| With the promotion of online and paperless process,there are various kinds of bills and application scenarios,such as medical bill settlement,court document record,insurance policy accounting,document filing and so on.Different from the uniform format of invoices in the past,these bills have many long lines with extreme aspect ratios and small single-word text,which are distributed in a dense form.Due to the limited receptive field of the network,the general text detection methods cannot make full use of the required information to accurately predict the spatial range of long text instances.Moreover,most of the spatial information of small text is lost under multiple convolution of feature extraction network.On the other hand,segmentation-based methods often incorrectly detect non-text pixels between dense text,resulting in text line conglutination.These three aspects will result in incomplete detection of long text,missing detection of small text and difficult separation of dense text lines.Aiming at these problems,this thesis introduces a feature fusion mechanism,proposes a detection algorithm based on character connection,improves the training mode of bill data,and designs a bill text detection and recognition system.Specific contents include:(1)To solve the problem of missing small text and difficult to separate dense text in bill text,a bill text detection method based on attentional feature fusion is proposed.This method makes use of the improved AFF(Attentional Feature Fusion)module to fuse the channel and spatial attention features between feature layers,so that the network pays more attention to the small text instances in the bills.Regional average pooling is used instead of global average pooling to make the module more suitable for those situations that the bill text pixels take up a smaller proportion and scattered in the image,and the intersection and union algorithm is designed to separate dense text lines according to the shrunken text kernel.In addition,a dataset of bill text synthesis is made.The general dataset assisted training method is adopted to improve the generalization of the network.Experiments show that this method achieves good results in both bill text and scene text.(2)To solve the problem of incomplete detection of long text line in bill text,a bill text detection method based on character connection is proposed.In this method,2d Gaussian kernel is used to label the character region,and weakly supervised learning is used to train the model.The network predicts the character region score and character gap score,and a character connection algorithm is designed to connect the character region according to the connection attributes between characters.Experimental results show that 2d Gaussian kernel can make the network better predict the text edge pixels,and the character connection method can completely detect the long Chinese text lines in the bill image.(3)Based on the bill text detection method proposed in this thesis,and combined with CRNN(Convolutional Recurrent Neural Network)text recognition algorithm,a bill text detection and recognition system is designed and implemented.The system adopts modular design,mainly realizes the function of bill text detection,recognition and visual display.The experiment shows that the system has perfect function,simple and easy to use interface,and can meet the demand of bill information extraction and organization in the market. |