Editing raster text is a promising but challenging task. We propose to apply text vectorization for the task of raster text editing in display media, such as posters, web pages, or advertisements. In our approach, instead of applying image transformation or generation in the raster domain, we learn a text vectorization model to parse all the rendering parameters including text, location, size, font, style, effects, and hidden background, then utilize those parameters for reconstruction and any editing task. Our text vectorization takes advantage of differentiable text rendering to accurately reproduce the input raster text in a resolution-free parametric format. We show in the experiments that our approach can successfully parse text, styling, and background information in the unified model, and produces artifact-free text editing compared to a raster baseline.READ FULL TEXT VIEW PDF
Typography is the art of visually arranging letters and text. Typography greatly affects how people perceive textual content in graphic design. Graphic designers carefully arrange and stylize text to convey their message in display media, such as posters, web pages, or advertisements. In computer vision, letters and texts have been predominantly the subject of optical character recognition (OCR), where the goal is to identify characters in the given image. This includes both OCR in printed documents or automatic scene text recognition for navigation. However, often, typographic information of text, such as font, outline, or shadow, is ignored in text recognition because the OCR does not target at reproducing typography in the output.
In this paper, we consider raster text editing as a text vectorization problem. There have been a few attempts at editing raster text mainly in scene images [32, 43, 45]. Previous work frames text editing as a style transfer problem in the pixel domain, where the goal is to apply the original style and effect in the input image to the target characters in the destination. However, the major limitation of the style transfer approach is that 1) it is hard to avoid artifacts in the resulting image, and 2) a pixel-based model is resolution-dependent. Our main target is display media. Compared to scene text images [32, 43, 45] that often involve external noise due to lighting condition, we often observe noise-free texts in display media which is prone to small artifacts on reconstruction. Editing in the vector format has a clear advantage in display media, as rendering results in consistent and sharp drawing at any resolution. Our approach is equivalent to viewing text recognition as a de-rendering problem , where the goal is to predict rendering parameters. Figure 1 illustrates our approach to the task of raster text editing.
Text vectorization can be an ill-posed problem. For editing raster text in the vector format, we need to first parse characters, text styling information such as font and effects, and hidden background pixels. Once those rendering parameters are recovered from the input image, we can edit and render the target text using a rasterizer. Our approach hence has to solve three sub-problems: 1) OCR, 2) background inpainting, and 3) styling attribute recognition. OCR has a long history of research that dates back to the 1870s . In parallel, inpainting has been studied in numerous literature [25, 50, 31, 24]
. It might look straightforward to add styling attribute recognition to those two problems for our task. However, parsing various stylistic attributes is not trivial, as the presence of multiple rendering effects can easily lead to an ill-posed decomposition problem. For example, it is impossible to decompose the border and fill colors if two colors are the same. For solving such an ill-posed problem, we train neural networks to predict statistically plausible parameters.
Our model parses text, background, and styling attributes in two steps; we obtain the initial rendering parameters from feedforward inference, then refine the parameters by feedback inference. Our feedback refinement incorporates differentiable rendering to reproduce the given raster text, and fit the parameters to the raster input using reconstruction loss. Following SynthText , we train our feedforward model on text images we generate using a rendering engine. In the experiments, we show that our vectorization model accurately parses the text information. Further, we demonstrate that we can successfully edit texts by an off-the-shelf rendering engine using the parsed rendering parameters.
We summarize our contributions below.
We formulate raster text editing as a de-rendering problem, where the task is to parse potentially ill-posed rendering parameters from the given image.
We propose a vectorization model to parse detailed text information, using forward and backward inference procedure that takes advantage of differentiable rendering.
We empirically show that our model achieves high quality parsing of rendering parameters. We also demonstrate that the parsed information can be successfully utilized in a 2D graphics engine for downstream edit tasks. We release the codes at Github111available at https://github.com/CyberAgentAILab/derendering-text.
OCR has a long history of research. The earliest ideas of OCR are conceived in the 1870s in Fournier d’Albe’s Optophone and Tauschek’s reading machine . In the past, OCR models could not deal with font variations, but recent methods developed for scene texts can detect and recognize any fonts. Among many literature, EAST  and CRAFT  are well-known recent detection approaches. FOTS  and CharNet 
report an end-to-end detection and recognition pipelines. FOTS incorporates a detection model and CRNN after ROI rotation, whereas CharNet utilizes a pixel-wise character classifier for assigning a character label to detect bounding boxes. In this paper, we adopt the CharNet model for the OCR module, but our model is not restricted to a specific OCR model.
Compared to OCR, there has been little work for font recognition. Among a few literature, DeepFont 
reports a deep learning approach to categorize fonts. The major challenge in font recognition is that fonts can be arbitrarily created by font designers, and it is often impossible to define a finite set of font categories. For this reason, some work instead resorts to font similarity evaluation[10, 5]. In this paper, we only use a fixed set of fonts to avoid the handling of infinite fonts.
Image vectorization aims at recognizing drawing entities such as lines or shape primitives from an image, and a classic example is line detection by Hough transform. Image vectorization has been actively studied and is still an open problem [13, 29, 7, 4, 18, 36, 1, 21, 33, 14]. Jia  propose an approach to preserve an object arrangement and positional relationship using a depth map. Favreau propose a method for vector clip-arts . They decompose the input image into a small number of semi-transparent layers by color gradients. Liu  report a method to convert a rasterized floor-plan into a vector format. Kim  turn Chinese character images into vector formats by converting segmentation to overlapping strokes. Our approach shares image vectorization approaches in that text effects can be seen as image layers, but the target recognition entity is characters and rendering parameters rather than low-level shape primitives.
There has been a few recent work on raster text editing based on generative models in the pixel domain. STEFANN  proposes a model that generates a character mask for swapping and transferring color from the source character to the target, then paste the transferred character onto the background. SRNet  takes a raster text image and a target text in pixels, encodes them into a feature space, and generates a stylized target text as a decoding process. Yang  further improve SRNet by manipulating geometric control points of characters to move text locations. Our work does not rely on pixel-domain generative models for text and styles but instead predicts parametric representation necessary for reproducing the raster text image.
Apart from editing text, some recent work solely focuses on erasing text by inpainting [30, 38, 52, 51, 23]. Nakamura  are one of the first attempts that applies an inpainting approach to erase scene text. Zdeneck consider text erasing under a weakly supervised setting . The background inpainting module in our model considers the same problem, yet our model further considers foreground text in terms of rendering.
Font style transfer is yet another line of relevant work. Most of the work is based on generative networks except for Awesome Typography , where Yang propose to transfer text effects by a patch matching algorithm. Azadi et al.  train the GAN-based model for character style transfer. TETGAN  is another GAN-based character style transfer method that preserves various effects. Yang stylize text with arbitrary texture [48, 49]. Wenjing propose to transfer style for decorative elements . Men transfer video motion to text style .
Our work does not consider a highly-complex textured text image. Instead, we model basic text effects by parameters in the rendering engine including font, fill, border, and shadow, so that we can interpret and easily control the effect for editing. Although it is our future work to expand the effect kinds, typical typography in display media do not exhibit complex combination of effects.
In this paper, we consider raster text editing as a text vectorization problem, where we solve three sub-problems: 1) OCR, 2) background inpainting, and 3) text attribute recognition. We approach this task by two-stage inference model consisting of a feedforward parser and a feedback refiner. We illustrate our model architecture in Fig 2.
Our feedforward parser builds upon an OCR model that detects and recognizes characters in the image. We utilize an image-level feature map and box-level feature maps from the OCR model to further parse background colors, alpha maps of effects, and text attributes at each bounding box.
Formally, our model takes a raster image and first detects a set of bounding boxes , where and are boundig boxes for texts and characters. For the detection task, we train an encoder to obtain a global feature map , where are the channels, height, width of the feature map. We use the hourglass-like network  to obtain the feature map. 222We show the detailed architecture in the supplementary. The detector localizes the location of characters in the image. We follow the approach of CharNet  and generate a foreground segmentation and a geometry map that predicts distance to the center of the region to obtain localized bounding boxes . After localizing text and character regions, we apply a character decoder to predict a sequence of characters. Internally, our model combines the foreground segmentation, the geometry map, and a character class map to parse the text in the given region. Note that we use CharNet  to implement our model, but can be any other model as long as characters can be localized.
Similarly to text, we predict font categories of the given region using the local feature maps at the given bounding box and , which is a subset of the global feature map at the bounding box and
. We apply pooling followed by a multi-layer perceptron to classify fonts.
The purpose of the background inpainting is to erase foreground raster text so that afterwards we can render manipulated text on the occluded background region. We can apply any image inpainting approach, but the challenge here is that we need to erase not only text but also composited text effects. Since inpainting is a pixel-domain problem, we adopt a pixel-based generator. Our background inpainter takes a raster text image and predicts background RGB pixels. Note that we utilize OCR (Sec 3.1) and pixel-level alpha (Sec 3.1) to specify the region to inpaint. In our experiment, we adopt either an off-the-shelf inpainting method  or we learn the inpainting model of MEDFE .
Text effects involves a complex compositing process. We briefly describe the compositing process in the following. Formally, let us denote an alpha map of the -th effect layer by , where is an effect function that generates an alpha map given the source shape and is the effect parameter. In our setting, is a text rasterizer that generates a mask pixel at location . For a plain source-over blending on an opaque background333Generic blending further considers different color blend modes, but we leave out for simplicity. See https://www.w3.org/TR/compositing-1/ for further details., a rendering engine composites the -th effect layer to the background image in the following equation:
where is the color of the composited image, is the background color, and is the effect color. When there are multiple effects, a rendering engine repeats the above compositing operation by substituting at each effect .
In this paper, we restrict the available effects to three basic but commonly-used kinds: fill, border, and shadow. We also assume the ordering of the effects is fixed to (shadow, fill, border). In our setting, all effects have color . Shadow and border effects have visibility parameter that indicates whether the effect is enabled. Border has a width parameter: and shadow has three additional parameters that control the effect generation: . For each effect , we learn effect decoders from the feature maps:
For decoding color , we first decode the alpha map for the entire canvas, and sequentially decomposite the color following the inverse of eq 1 and averaging the color in the bounding box region:
where the decompositing order is (border, fill, shadow), and if , we skip decompositing of the effect . For the initial border decompositing, we set from the result of the inpainting in Sec 3.1, and otherwise use the color of the previously decomposited effect.
While the feedforward parsing produces plausible rendering parameters, usually there are still inaccuracy in exactly reproducing the appearance of the input image. In our feedback refinement stage, we fill the appearance gap between the input and the vector reconstruction by minimizing the error in the rasterized image. The goal is to minimize the error between the input image and the raster reconstruction with all the rendering parameters :
The raster reconstruction function produces the final reconstruction using compositing equation (eq 1). As long as the compositing process is differentiable, we can apply back propagation to efficiently optimize parameters . We propose to reconstruct a raster image using pre-rendered alpha maps so that the rendering process becomes differentiable. Note, while there exist recent approaches on differentiable rendering of strokes or shape primitives [19, 6, 17], we are not aware of any existing work on direct vectorization of text styling.
In the compositing process (eq 1), the glyph shape function and the effect function is usually not differentiable with respect parameters like font category and character class. We circumvent this issue by replacing the actual effect function by pre-rendering. The key idea is to rasterize non-differentiable glyphs and effects beforehand so that we can approximate rendering process as a linear combination of pre-rendered shapes. Let us denote the non-differentiable rendering parameters by . We approximate the non-differentiable shape function by:
is the joint probability (or so-called attention map) of parameter, and is the pre-rendered alpha maps for the corresponding parameter set . Since is defined over a finite set, we can pre-render for all possible combination of . is differentiable with respect to , and consequently eq 8 becomes also differentiable. Similarly, we approximate the borderline effect function in the same pre-rendering approach to make differentiable approximation. An alpha map constructed from eq 8 visually looks blurred because the shape is a linear combination of different font glyphs. However, the purpose of this alpha construction is to compute gradients over and not to produce the final raster reconstruction.
In this work, we use 100 fonts for the pre-rendered alpha maps randomly picked from Google Fonts444https://github.com/google/fonts. Note that the pre-rendered alpha maps require large memory footprint if the parameter space is huge; e.g., if there are 100 fonts for 100 characters, we have to pre-render and keep alpha maps, and also computing shape becomes expensive. In practice, we compute sparse attention map for only the top 20 fonts and zero-out the rest to save computation. We choose resolution for alpha maps considering the balance between the reconstruction quality and the memory footprint.
Although the OCR model gives the initial prediction of character bounding boxes, those locations do not perfectly align with the actual position of each character in the given input image. We introduce image warping to adjust the location of each character during feedback refinement. We prepare affine transformation parameters for each character and also for the word-level bounding box, and solve for the best adjustment during the optimization (eq 7). We set initial warping parameters to identity transformation at the beginning.
We use pre-rendered alpha for fill and border effects, but shadow has differentiable effect such as blur or offset. We directly implement those differentiable operators for shadow effect .
To reconstruct an image, we composite alpha maps by eq 1 and image warping in character adjustment. The visibility flag controls whether to enable the effect compositing. All the operators are differentiable with respect to parameters . We binalize the effect visibility
with differentiable binarization and multiply to the foreground alpha. Note that our differentiable reconstruction is only for refinement purpose. The final output of our model is the refined rendering parameters .
We show in Fig 3 the intermediate results during feedback refinement. Our refinement process starts from the rough initialization by feedforward parser, and gradually fits the parameters to reproduce the given raster image.
We do not optimize location and background during refinement, because bounding box generation in our OCR model is not differentiable. Background pixels are differentiable, but we observe unstable behavior during optimization, perhaps due to ill-posed decompositing setup. We also do not optimize character probability maps of OCR because of unstable behavior. We refine parameters using Adam optimizer with 200 iterations. In our implementation, optimization requires about 1 minute for one word.
Parsed rendering parameters can be directly used in external 2D graphics rendering engine, though we need to adjust the scale of each parameter for the external format. Most of the parameters can be exported to the rendering engine with simple normalization, but we need to take care of computing geometric information such as font size or offset that our parser does not predict. Although our OCR model produces bounding boxes, it is not trivial to convert to those geometric information.
We convert these information in the following post-processing. We first transform character bounding boxes using affine parameters we obtain in letter adjustment. Next, we obtain a word-level bounding box by taking the minimum and maximum coordinates from the OCR bounding box and the set of character bounding boxes. Once we obtain both the character- and word-level bounding boxes, we use them to as guidance and conduct a grid search over configuration, starting from the parameters of best-fit character in the refinement.
For training our model, we minimize the following loss function, where each term corresponds to training of each decoder module in our model:
The loss functions for text recognition and background inpainting are identical to those defined in CharNet  and MDEDF . is the categorical softmax cross entropy for font categories. is the mean squared error of pixel-wise difference of the effect alpha map. is the binary cross entropy of the effect visibility. is the total of mean squared error for effect parameters. In the experiment, we apply weighting to each term for better convergence. and
are the hyperparameters for balancing. We empirically set the hyperparameter values toand .
We follow the approach of SynthText  to generate text images for training. In addition to the scene background images from SynthText, we collect background images from single-color background data, book cover dataset , BAM dataset  and FMD dataset . For the book cover dataset and BAM dataset, we erase text regions by text detection and inpainting, then generate candidate locations from a saliency map. We take the vocabulary set from SynthText. We implement our data generator using the Skia graphics library555https://skia.org/, which can handle both font and effects in a purely resolution-free manner.
We pre-train the OCR model for 5 epochs with 80,000 SynthText images. The condition is the same as the pre-training of CharNet. The resolution of the input image is , and the feature map is with the channel size to be . We train our model with the SGD optimizer. We set the learning rate to to the pre-trained encoder and to all the other decoders, with batch size 4. We decrease the learning rate with cosine warm up .
We independently train the inpainting model on the generated text data666We also attempted joint training in the experiment but did not observe a clear advantage.. In the training phase, we make holes for text regions with a mask generated by thresholding alpha values in each effect, and train to fill the holes. At test time, we make holes for text regions with predicted alpha maps, then fill the holes using the inpainting model. The resolution of the inpainting output  is . We resize the inpainted image to the target image size. This upsampling often causes undesired artifacts. To alleviate the quality issue, we replace text regions with text erased images and blend using predicted alpha.
In this experiments, we evaluate 1) how accurately our model parse text information in vectorized representation, and 2) how well our model can perform raster text editing through vectorized information. For experiments, we use two datasets, the book cover dataset  and the advertising image dataset .
We show in Fig 4 input images, initial reconstructions after feedforward parsing, reconstructions after feedback refinement, and final vectorization results using a 2D graphics engine from the book cover dataset. We observe that our approach successfully parses text information in various situations, including stylized texts with effects. In Fig 4, the first and second rows show examples of simple texts, and the third to fourth rows show examples of stylized texts with thin borderline and small shadow. The results demonstrate that our model can parse detailed effects parameters such as the weight of borderline and shadow orientation. The last two rows show challenging examples; the fifth row is an example of non-aligned text, and the last row is an example of unusual font. Our model parses non-aligned texts, but the vector reconstruction fails to render with the same style. When there is an unusual font, even though our reconstruction is inaccurate, our feedback refinement tries hard to adjust the choice of font and affine warping parameters to visually match the result.
We show reconstruction and text editing examples in advertisement datasets in Fig 5. Compared to book covers, advertisement images have various aspect ratios. Our approach successfully reconstructs complex text layouts in vector format with correct styling.
We compare the quality of our editing approach with a state-of-the-art raster editing method SRNet . SRNet takes a source style image and a target text mask to render the stylized target, where SRNet converts the text mask into a skeleton appearance and generates an image by transferring style from the reference style source. We use the alpha mask generated by the external rendering engine for the target text. Fig 6 shows qualitative comparisons between SRNet and our vectorization approach. We observe that SRNet often fails to draw a straight line and prone to be small artifacts, while our approach completely separates text shape from text effects in the parametric representation and does not suffer from artifacts. Note that our result has an additional benefit of easy and reproducible editing in the rendering parameters.
We quantitatively evaluate our model in terms of the reconstruction quality. We set up the following benchmark conditions.
Book cover We randomly pick 1,000 images from the book cover dataset, and apply an off-the-shelf OCR model  to extract title text region of the image for evaluation. In the book cover dataset, we use Telea’s inpainting method  in our feedforward parser, because we find the off-the-shelf method already works well for book cover images.
Advertisement We randomly pick 508 images from the ad dataset and evaluate reconstruction performance on all text regions. We use the learned inpainting model .
To measure the reconstruction performance, we use the average L1 loss and peak signal-to-noise ratio (PSNR) between the input image and the reconstructed image. We compare the quality of 1) the differentiable reconstruction after feedforward parsing, 2) after feedback refinement, and 3) the final reconstruction in the external graphic engine.
We summarize the evaluation results in Table 1. We find that our two-stage vectorization approach effectively improves the reconstruction quality, as the refinement consistently improves both L1 and PSNR compared to the feedforward parser only. The final reconstruction using the external rasterizer does not necessarily gives the identical result to our differentiable reconstruction. Our refinement process includes approximation and also the exporting process (Sec 3.3) can introduce errors. Nevertheless, we find the reconstruction quality reasonably well, and PSNR is consistently better than the initial feedforward reconstruction. Filling the gap between the differentiable reconstruction and the exported result is our future work.
We show in Table 2 how PSNR changes as we skip feedback refinement in rendering parameters in the book cover dataset. We skip color, font, shadow, and border effects in this ablation study. As the result suggest, effect components that has larger area in the resulting appearance have more performance influence on the reconstruction quality; incorrect color most negatively affect the resulting visual quality, while other effects occupy smaller regions and therefore quantitatively have less minor impact on PSNR.
One drawback of our approach is that we cannot handle arbitrary styles that are not defined in our basic effect models or unusual glyph shapes. We also do not consider detailed rendering parameters such as kerning or geometric transformation. It is our future work to extend the available fonts or effects, where we have to address efficient differentiable rendering for a large combination of non-differentiable operations (Sec 3.2). However, we note that our basic effects already cover the majority of real-world typography in display media.
We present a vectorization approach to edit raster text images. Our approach inpaints the background and accurately parses foreground text information for reconstruction in an external rendering engine. We show in the experiments our model successfully reproduces the given raster text in vector graphic format. Our vectorization approach has a clear advantage in resolution-free editing, especially for display media. One limitation of our approach is that effects must be pre-defined by the rendering engine. We wish to expand the available effects and blending operations in the future.
SGDR: stochastic gradient descent with warm restarts. In ICLR, Cited by: §4.3.
In the experiment, we assumed the most common three text effects: fill, border, and shadow. Fig 7 illustrates an example of those effects. We also assume the ordering of the effects is fixed to shadow fill border.
We illustrate the process of alpha generation based on pre-rendered alpha maps in Fig 8.
As shown in Fig.6, the proposed model can use the text style of another text on the rendering step. Here, we show more detailed examples of text style transfer, as Fig.7. Five different styles are transferred to a text (e.g., “FREE” and “BACON”) in an input image. Note again that the proposed model can transfer not just font style but also effect style.
We use a text image generator, which is modified from SynthText, and record the exact rendering parameter used in the text image generator to supervise the training of our model. Here, we introduce our text image generator details, in terms of the type of the background images, text placement rule, and sampling rule of the rendering parameter.
The background images originally used in SynthText are insufficient for the robust performance on the display media; we therefore add background images from single-color background data, Book cover dataset, BAM dataset, and FMD dataset. For those five types of background images, we render texts and place texts in background images.
The rule of the text placement procedure is different in the type of the background images, respectively. For the background images from SynthText, the text placement procedure follows SynthText; we apply over-segmentation to generate candidate regions to place a text. Note that we disable text rotation for the function of SynthText. For BAM and Book cover data, we utilize a saliency map to generate candidate locations. For Book cover data, we also generate candidate locations by applying the existing OCR model. Unlike other background images, BAM and Book cover images often include texts, then we apply text inpainting to erase texts in advance. We randomly generate text locations for single-color flat backgrounds and FMD images. On FMD, we crop material regions and use those regions as backgrounds. We generate 10,000 text rendered images for the background images, respectively. Then we exclude images that have too-small candidate regions for locating texts, and finally obtained a total of 42,285 images.
After generating candidate regions, we set rendering parameters. Font categories are randomly sampled from predefined categories. The effect parameters and colors are randomly sampled from a predefined range. Unlike SynthText, we implement our data generator using the Skia graphics library777https://skia.org/, which can handle both font and effects without raster artifacts.
We show the detailed configurations for the parser models in Table 3. Our encoder model, i.e. backbone model, is based on an hour-glass model. We add some convolution layers to the outputs’ head to enlarge the receptive fields because texts tend to be large in the display media. There are branches for predicting text rendering parameters: the OCR branch, the alpha branch, the font branch, the effect visibility brach, and the effect parameter branch. The OCR branch is further split into the word detector, the character detector, and the character classifier. For extracting text colors, we predict pixel-wise alpha maps to decompose an image. We obtain font information for each text by a classification model. To parse text effects, we predict both effects visibility and effects parameters. We consider visibility prediction as a binary classification problem and shadow parameter estimation as a regression problem. We predict discretized parameters by a classification model for border effects because we use pre-rendered alpha maps for them. We quantize the border parameter into five bins in our experiments.
, the third “kernel and stride” column indicate the kernel size and the stride in the convolution layer if the layer has those configurations. The three numerical values in both columns of input size and output size represent tensors’ size for channel, height, and width. We represent the intermediate representation in inputs and outputs by B1-B5 for the backbone model, W1-W3 for the word detector, C1-C3 for the character detector, R1-R3 for the character classifier, A1-A6 for the alpha model, F1 for the font model, V1 for the effects visibility model, and P1 for the effects parameter model.
|Model||Layers||Kernel, Stride||Input||Input size||Output||Output Size|
|Backbone||Hour Glass Net||-||B1|
CONV + BN + RELU
|(3 3), (2 2)||B1||B2|
|CONV + BN + RELU||(3 3), (2 2)||B2||B3|
|CONV + BN + RELU||(3 3), (2 2)||B3||B4|
|CONV + BN + RELU||(3 3), (1 1)||B1 and B5|
|Word detector||CONV + BN + RELU||(3 3), (1 1)||W1|
|CONV + BN + RELU||(3 3), (1 1)||W1||W2|
|CONV + BN + RELU||(3 3), (1 1)||W1||W3|
|CONV||(1 1), (1 1)||W2||Text foreground map|
|CONV + RELU||(1 1), (1 1)||W3||Text geometry map|
|Char detector||CONV + BN + RELU||(3 3), (1 1)||C1|
|CONV + BN + RELU||(3 3), (1 1)||C1||C2|
|CONV + BN + RELU||(3 3), (1 1)||C1||C3|
|CONV||(1 1), (1 1)||C2||Char foreground map|
|CONV + RELU||(1 1), (1 1)||C3||Char geometry map|
|Char recognizer||CONV + BN + RELU||(3 3), (1 1)||R1|
|CONV + BN + RELU||(3 3), (1 1)||R1||R2|
|CONV + BN + RELU||(3 3), (1 1)||R2||R3|
|CONV||(1 1), (1 1)||R3||Char recognition map|
|Alpha||CONV + BN + RELU||(3 3), (1 1)||A1|
|CONV + BN + RELU||(3 3), (1 1)||A1||A2|
|CONV + BN + RELU||(3 3), (1 1)||A4|
|CONV + BN + RELU||(3 3), (1 1)||A3 and A4||A5|
|CONV + BN + RELU||(3 3), (1 1)||A5||A6|
|CONV + Sigmoid||(3 3), (1 1)||A6||Alpha for decomposition|
|Font||CONV + BN + RELU||(3 3), (1 1)||F1|
|CONV||(1 1), (1 1)||F1||Font categories|
|Effects visiblity||CONV + BN + RELU||(3 3), (1 1)||V1|
|CONV||(1 1), (1 1)||V1||Shadow visibility|
|CONV||(1 1), (1 1)||V1||Border visibility|
|Effects params||CONV + BN + RELU||(3 3), (1 1)||P1|
|CONV + Tanh||(1 1), (1 1)||P1||Shadow offset|
|CONV + Sigmoid||(1 1), (1 1)||P1||Shadow blur|
|CONV||(1 1), (1 1)||P1||Border weights|