This repository provides train＆test code, dataset, det.&rec. annotation, evaluation script, annotation tool, and ranking.
Traditional text detection methods mostly focus on quadrangle text. In this study we propose a novel method named sliding line point regression (SLPR) in order to detect arbitrary-shape text in natural scene. SLPR regresses multiple points on the edge of text line and then utilizes these points to sketch the outlines of the text. The proposed SLPR can be adapted to many object detection architectures such as Faster R-CNN and R-FCN. Specifically, we first generate the smallest rectangular box including the text with region proposal network (RPN), then isometrically regress the points on the edge of text by using the vertically and horizontally sliding lines. To make full use of information and reduce redundancy, we calculate x-coordinate or y-coordinate of target point by the rectangular box position, and just regress the remaining y-coordinate or x-coordinate. Accordingly we can not only reduce the parameters of system, but also restrain the points which will generate more regular polygon. Our approach achieved competitive results on traditional ICDAR2015 Incidental Scene Text benchmark and curve text detection dataset CTW1500.READ FULL TEXT VIEW PDF
In this paper, we propose a novel method called Rotational Region CNN (R...
Existing object detection-based text detectors mainly concentrate on
In this paper, we propose a refined scene text detector with a novel
The detection of oriented objects is frequently appeared in the field of...
This paper introduces a novel rotation-based framework for arbitrary-ori...
Curve text or arbitrary shape text is very common in real-world scenario...
Numerous scene text detection methods have been proposed in recent years...
This repository provides train＆test code, dataset, det.&rec. annotation, evaluation script, annotation tool, and ranking.
Text detection is important in our daily life as it can be applied in many areas, such as digitization of text, text translation, etc. In this study, we focus on scene text detection. Some of the previous methods   have obtained good results on many horizontal scene texts dataset based on Faster R-CNN  or SSD . Some methods        also tried to solve arbitrary-oriented text detection problem.  and  regressed first a horizontal rectangle and then a quadrilateral.  aimed to generate an irregular polygon after regressing a rectangle. The methods mentioned above mostly treated a text line as a quadrilateral which can be completely represented by four points. However, besides the quadrilateral shape, there are many other various shapes of text line in natural scene. Therefore, recent research   have begun to explore curve text line detection. In this paper we explore both arbitrary-oriented and curve text detection. Our method named sliding line point regression (SLPR) is based on 2-step object detection methods using Faster R-CNN or R-FCN. Firstly we propose some interesting rectangular regions with region proposal network (RPN), then regress the points on the edge of text. We generate some rules to determine which points should be regressed so that there will be relevance between points. Different from  which directly regressed both x-coordinate and y-coordinate of fixed annotated points and employed RNN [15, 16] to learn their relevance, we introduce some rules to vertically and horizontally slide lines along text and then regress the intersection points of sliding lines and text lines as illustrated in Fig. 1. In this way, we can only regress x-coordinate or y-coordinate of these points, then calculate other coordinates with the position of rectangle, yielding reduction of unnecessary computation and improvement of performance.
The contributions of this paper are as follows:
1. We explore regressing multiple points on the border of text line, try to handle arbitrary-oriented and curve text detection based on Faster R-CNN and R-FCN.
2. We introduce a sliding line method to determine the ground truth points for the regression, and we make full use of the relevance of these points to generate more regular polygon.
In recent years, scene text detection and recognition has drawn more and more attention. But scene text detection remains a difficult problem due to its complicated orientation and background. All the methods can be divided into three categories: character based methods, word based methods and segmentation based methods. Character based methods often need synthetic datasets because labeling characters in text lines requires additional efforts. However, the generated data is greatly deviated from the real data, which can not make the trained model to achieve the state-of-the-art results on real dataset such as the popular ICDAR2015 Incidental Scene Text benchmark. In order to solve this problem,  used semi-supervised method to finetune model on real data and obtained good results.
The segmentation based methods have also been used in text detection recently.  trained a fully convolutional network (FCN) [19, 20] to predict the salient map of text regions, then traced the text line by combining the salient map and character components.  added the border class to separate text from their neighbor.  and generated text maps and regress the size and angle of the corresponding quadrilateral, or coordinates of four vertexes at the same time. Compared with the traditional segmentation methods, they made a huge breakthrough on ICDAR2015 Incidental Scene Text benchmark.
Many methods of object detection can be applied to text detection, e.g., Faster R-CNN , SSD , R-FCN  and YOLO .  used irregular convolutional filters instead of the standard convolutional filters to make the network more suitable for long text detection.  used the attention map to remove background noise. Recently more and more researchers proposed 2-step methods based on Faster R-CNN or R-FCN.  firstly generated axis-aligned bounding boxes and then regressed the text quadrangle. They used multi-scale pool operations on the roipool layer.  tried to segment and detect text simultaneously. Considering the particularity of text line,  appended different angle anchors which are suitable for arbitrary-oriented text line. More recently,  considered the polygon case and labeled a new dataset of curve text.  also constructed a curve text dataset named CTW1500, and they proposed a new structure named curve text detector (CTD) to solve curve text detection problem.
Our model can be applied to any 2-step object detection framework such as Faster R-CNN and R-FCN. Our system simultaneously regresses the minimum rectangle including text line and the coordinates of some specific points on the boundary of text line. More specifically, take Faster R-CNN as an example, we first get some interesting regions using the RPN, then we not only regress the position of the rectangle, but also regress the coordinates of the points on the edge of the text line, finally we can get arbitrary shape text area.
Obviously, how to determine the point set for restoring the polygon is quite important. We believe the simpler the rules, the easier the neural net learns. We do not regress the fixed points such as vertexes on the polygon because there are a large variety of shapes and angles in natural scene and it is difficult to define the order of fixed feature points for all shapes. Although for quadrilateral, we can perfectly restore it by regressing the corresponding four vertices, the determination of the order of four vertices requires a complicated rule which is difficult for the neural net to learn. Alternatively, as shown in Fig. 2, we introduce some rules to vertically and horizontally slide the lines (we use equidistant sliding in our experiment) on text line and then regress the intersection of sliding lines and text line border. On the other hand, the correlation exists among the coordinates of different intersection points due to the constraints of the sliding lines. It is not necessary to regress both x-coordinate and y-coordinate of all points simultaneously. If it is horizontal sliding, the x-coordinate of the point on the text boundary can be calculated by the coordinates of the rectangle, so we only need to regress the y-coordinate of these points. Similarly, if it is vertical sliding, we only need to regress the x-coordinate of these points. This method not only reduces the computational complexity of the network, but also adds restraints to the regressed points as the prior knowledge which can prevent generating polygons with weird shapes and further improve the accuracy. As for the number of sliding lines, we observe that this parameter is not sensitive to quadrangle text line. But in order to restore other shape text line well, after balancing the performance and network complexity, seven sliding lines are used for we decided to for vertical and horizontal directions, respectively. Accordingly a total of 14 lines with 28 intersection points are generated.
To optimize the neural network parameters, as illustrated in Fig.2
, we adopt the multi-task learning to define the loss functionas:
where is the region proposal loss, is region proposal classification loss, is box regression loss. is the loss for the second step after RPN. Similarly, the first two items and are respectively classification loss and box regression loss. , and are the related weighting factors, which are all set to 1 in this study. is the proposed new loss item for SLPR:
is the smooth L1 loss for the box regression task:
|NMS||Restoration||Precision (%)||Recall (%)||Hmean (%)|
In Eq. (4), represents the number of sliding lines in one direction and we set in our experiments. In general, each line has two intersection points with the text line border. If there are more than two intersection points, we take the smallest and the largest coordinates. is x-coordinate of the intersection point of vertically sliding lines and text line border while is y-coordinate of the intersection point of horizontally sliding lines and text line border. and
are the corresponding estimated points from neural net outputs. For horizontally sliding lines, we only regress the y-coordinate of its intersection point. For vertically sliding lines, we only regress the x-coordinate of its intersection point. The other coordinates can be restored through the coordinates of the rectangle:
and represent the minimum x-coordinate and y-coordinate of the rectangular border while and represent the maximum x-coordinate and y-coordinate of the rectangular border. is the floor function. In a word, in order to regress the coordinates of polygon, 32 parameters should be considered including 4 parameters for the rectangle and 28 parameters to represent x and y coordinates of intersection points on text line border.
Through the above SLPR method, we can obtain multiple points from the output of neural nets. To restore the final quadrilateral or polygon, the following two approaches are adopted and compared:
The text line always extends to the long side, and the lines that slide along the long side can better reflect the shape of the text. In fact we can restore the polygon by only scanning the long side, as shown in Fig. 3. Specifically, we firstly judge whether the text line is horizontal or vertical through the regressed rectangle, and then restore the polygon through points in the corresponding direction. Taking the vertical direction as an example in Fig. 3, since we do not regress the intersection point on the rectangular border, we firstly extend the four lines near the border to find four intersection points with the rectangle, then we connect four new points and other intersection points to generate polygon.
In fact, if we use both horizontal and vertical points to restore polygon, we can calculate a polygon or quadrangle that passes through these points roughly as shown in Fig.4 by using the method in . In this way we can obtain dense enough points in both horizontal and vertical direction and we do not need to calculate the intersection with the rectangle as in PLS method. However, we observe BHVP is not as effective as PLS for the polygon case. So we use this method only on the quadrilateral dataset (ICDAR2015 Incidental Scene Text).
Non-maximum suppression (NMS) is a basic method commonly used in the object detection, and its purpose is to remove duplicate boxes. The traditional NMS method is based on rectangular boxes, which is not the best choice for other shapes. In recent years, other NMS approaches were investigated, e.g., locality-aware NMS , inclined NMS , Mask-NMS  and polygonal NMS (PNMS) . As we consider the polygon in this study, both NMS and PNMS are compared in our experiment.
|Methods||Precision (%)||Recall (%)||Hmean (%)|
|Zhang et al. ||70.8||43.1||53.6|
|Deep direct regression ||82.0||80.0||81.0|
ICDAR2015 Incidental Scene Text dataset  is commonly used benchmark for detecting arbitrary-angle quadrangular text lines. It contains 1000 images for training, 500 images for testing. Some words which are too short, or unclear is annotated as don’t cared samples.
Curve text dataset (CTW1500) is constructed by Yuliang et al. . Different from traditional text datasets, a text line is labelled by a polygon with 14 points.
Since our proposed SLPR can be applied to any 2-step object detection framework. We adopted Faster R-CNN in ICDAR2015 Incidental Scene Text. And because  also proposed a 2-step framework based on R-FCN while presenting the CTW1500 dataset, to perform a fair comparison, we directly used the network in  from https://github.com/Yuliang-Liu/Curve-Text-Detector
. All experiments were implemented in Caffe by using the NVIDIA GTX 1080Ti GPU.
For Faster R-CNN structure, we used an additional anchor and replaced RoIPool with RoIAlign  because the text line is smaller than other objects. We set anchor scales as  and set ratios as [0.5, 1, 2]. The base network is VGG16 . Learning rates started from , decays to one-tenth every iterations. We set weight decay as , and momentum as . We used 1000 training incidental images in ICDAR2015 Incidental Scene Text  and the 229 training images from ICDAR 2013 to train our network. In order to prevent over-fitting we employed data augmentation. Specifically, we randomly resized the images to where the numbers represent the length of the short side, and randomly rotated the images among .
We used the curve text detector (CTD) network which is based R-FCN from .  also added LSTM units named transverse and longitudinal offset connection (TLOC) to learn the correlation of points. But we removed it. As we only used PLS to restore polygon, Eq. (4) was modified as:
equals to when is true, otherwise . and are the height and width of the rectangle. Because most of the texts in this dataset are horizontal text line, to solve the imbalance between horizontal and vertical samples, we added to balance the losses between them. And when is close to , the text line may be judged as horizontal or vertical, so we set as . The base network is ResNet-50 , which is initialized by the pre-trained model on ImageNet database. The max iteration was . The learning rate in this experiment was always . We set weight decay as , and momentum as . To conduct a fair comparison, we only used the training set in CTW1500 to train our network and did not use data augmentation.
Table I shows the results of SLPR system with different settings. First, for the restoration of the quadrangle for the text region, BHVP using all the points can achieve better results than PLS using only the long-side points. Second, even we aim to detect the quadrangle in this dataset, PNMS still outperforms NMS. Finally, the use of multi-scale is one way to improve detection performance on different target sizes. We also test the multi-scale results of our system at (850, 1000), which yields about 1% absolute improvement of Hmean measure. Fig. 5 lists several challenging examples of detection results on ICDAR2015 Incidental Scene Text dataset. Table II gives the comparison of SLPR with state-of-the-art results on ICDAR2015 Incidental Scene Text. We can observe that our method achieved the competitive results on this dataset.
|NMS Method||Precision (%)||Recall (%)||Hmean (%)|
|Method||Precision (%)||Recall (%)||Hmean (%)|
Table III shows the results of our method with different NMS settings. Different from the observation in ICDAR2015 Incidental Scene Text, our method achieved the best result on NMS0.3, namely the traditional NMS method with the threshold 0.3 for calculating the IoU (Intersection-over-Union). Table IV lists the results of our method compared with CTD and CTD+TLOC. We removed TLOC from  as our base network which is the same as CTD. Clearly, the Hmean performance of our SLPR method could be increased by over the CTD method, demonstrating the effectiveness of our simple rules to set the regression points. Even compared with the CTD+TLOC method with an additional LSTM network, SLPR still achieved improvement of Hmean performance. Fig. 6 gives several examples of the detection results of CTD, CTD+TLOC and our SLPR. We can observe that our method generated smoother regions and better detection results compared with CTD, which implied that the proposed SLPR can better handle the arbitrary-oriented case due to the novel design of the horizontally and vertically symmetrical scanning using sliding lines.
In this study, we propose a novel SLPR method for the text detection in arbitrary-shape case. Compared with the curve text detection method CTD+TLOC , SLPR is more concise without using LSTM and obtains better performance. In the traditional quadrangle dataset (ICDAR2015 Incidental Scene Text), SLPR also achieves the state-of-the-art performance.
This work was supported in part by the National Key R&D Program of China under contract No. 2017YFB1002202, in part by the National Natural Science Foundation of China under Grants 61671422 and U1613211, in part by the MOE-Microsoft Key Laboratory of USTC.
A. Graves, A.-r. Mohamed, and G. Hinton, “Speech recognition with deep recurrent neural networks,” inAcoustics, speech and signal processing (icassp), 2013 ieee international conference on. IEEE, 2013, pp. 6645–6649.