Spray code character content identification method based on OCR (Optical Character Recognition) technology
Through the OCR technology-based coded character recognition method, using PP-OCRv3 framework and multi-task learning technologies, the automatic recognition of cable coded characters is realized, which solves the problem that artificial quality inspection is difficult to accurately identify, and improves the recognition accuracy and Efficiency reduces production costs.
Patent Information
- Application Number
- CN202411269723.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-12-17
AI Technical Summary
In the prior art, the recognition of cable inkjet characters mainly relies on manual quality inspection, and it is difficult to accurately and promptly detect content errors in high-speed production, resulting in errors in cable length and model specifications, affecting product quality and customer satisfaction, and may even cause electrical accidents.
Using the coded character content recognition method based on OCR technology, the PP-OCRv3 framework combines SAST algorithm, multi-task learning, context attention module and feature pyramid network, improve the feature graph characterization capabilities through ResNet-50 and LK-PAN structures, and introduce the feature graph characterization capabilities. Learn the mutual distillation method DML to realize automatic recognition of cable ink-coded characters.
Improve the accuracy and completeness of ink-coded character recognition, reduce manual intervention, improve quality inspection efficiency, reduce incomplete character interference, enhance text readability, solve the traditional high error rate of manual judgment and quality inspection efficiency Low problem.
Smart Images

Figure CN119152516A_ABST
Abstract
Description
Technical Field
[0001] The invention discloses a method for identifying the content of inkjet characters based on OCR technology, and relates to the technical field of computer vision. Background Art
[0002] Cable coding is a crucial link in cable production. Cable coding refers to the coding of cable sheaths to mark cable models, specifications, uses, manufacturers and other information. Its main function is to identify basic cable information, ensure cable quality and quality traceability, and is a necessary procedure for cable production and sales. Cable coding errors can lead to inaccurate cable length and meter count, resulting in insufficient length during use, seriously affecting product quality and customer satisfaction. In addition, it may also lead to errors in cable model specifications, causing construction workers to misuse during installation, and even causing electrical accidents.
[0003] At present, many domestic cable manufacturers mainly use manual quality inspection methods, which makes it difficult to accurately and timely detect content errors in inkjet coding characters during high-speed production. Summary of the invention
[0004] In view of the problems of the prior art, the present invention provides a method for identifying the content of inkjet character based on OCR technology, which uses machine vision to replace manual visual quality inspection, can reduce the manual burden, improve the efficiency and accuracy of inkjet character content quality inspection, improve product quality, and reduce production costs.
[0005] The specific scheme proposed by the present invention is:
[0006] The present invention provides a method for identifying the content of inkjet characters based on OCR technology, comprising:
[0007] Based on the PP-OCRv3 framework, the inkjet character content is recognized:
[0008] Cable coded character images are collected to form a training data set and a validation set. The PP-OCRv3 framework is used to train a recognition model based on the training data set. The recognition model is used to identify the coded character content. The detection module of the PP-OCRv3 framework uses the SAST algorithm to detect and process text of any shape in the image. Multi-task learning and context attention modules are introduced to capture the long-range correlation between pixels. The multi-task learning framework is used to output multiple feature maps related to text detection. The feature pyramid network is used to perform multi-level feature map fusion. The SVTR algorithm is used based on the fused features to identify the coded character content of the cable character text.
[0009] Furthermore, the method for identifying the content of inkjet characters based on OCR technology is based on the PP-OCRv3 framework, uses ResNet-50 as the Backbone, introduces the RES-FPN structure into the residual structure and the channel attention structure, and replaces the convolutional layer in the FPN with the RSEConv layer of the channel attention structure to enhance the representation capability of the feature map and detect texts of different sizes.
[0010] Furthermore, the method for identifying the content of inkjet characters based on OCR technology is based on the PP-OCRv3 framework. In view of the characteristics of cable characters that are long and flat and have a relatively large length and width, the LK-PAN structure is used for feature extraction. The convolution kernel of the path enhancement part of the PAN structure is changed from 3*3 to 9*9, the convolution kernel is enlarged, and the receptive field covered by each position of the feature map is improved, so that the recognition model can capture a wider range of contextual information and locate the text area.
[0011] Furthermore, the inkjet character content recognition method based on OCR technology is based on the PP-OCRv3 framework, and introduces the mutual learning distillation method DML, so that recognition models with the same structure can learn from each other, so that each recognition model can learn useful information from the output or features of other recognition models during the training process.
[0012] The present invention also provides a coding character content recognition device based on OCR technology, based on the PP-OCRv3 framework, including a collection module, a management module, a detection module, a multi-task learning and context attention module and a recognition module.
[0013] The collection module collects cable coded character images to form a training data set and a verification set. The management module uses the PP-OCRv3 framework to train the recognition model according to the training data set. The recognition module uses the recognition model to identify the coded character content. The detection module of the PP-OCRv3 framework uses the SAST algorithm to detect and process text of any shape in the image. Multi-task learning and context attention modules are introduced to capture the long-range correlation between pixels. The management module uses a multi-task learning framework to output multiple feature maps related to text detection. The management module uses the feature pyramid network to perform multi-level feature map fusion. The recognition module uses the SVTR algorithm to identify the coded character content of the cable character text based on the fused features.
[0014] Furthermore, the management module of the inkjet character content recognition device based on OCR technology is based on the PP-OCRv3 framework, adopts ResNet-50 as the Backbone, introduces the RES-FPN structure into the residual structure and the channel attention structure, and replaces the convolution layer in the FPN with the RSEConv layer of the channel attention structure to improve the representation ability of the feature map and detect character texts of different sizes.
[0015] Furthermore, the management module of the inkjet character content recognition device based on OCR technology is based on the PP-OCRv3 framework. Aiming at the characteristics of cable characters that are long and flat and have a relatively large length and width, the LK-PAN structure is used for feature extraction. The convolution kernel of the path enhancement part of the PAN structure is changed from 3*3 to 9*9, the convolution kernel is enlarged, and the receptive field covered by each position of the feature map is improved, so that the recognition model can capture a wider range of contextual information and locate the text area.
[0016] Furthermore, the management module of the inkjet character content recognition device based on OCR technology is based on the PP-OCRv3 framework, and introduces the mutual learning distillation method DML, so that recognition models with the same structure can learn from each other, so that each recognition model can learn useful information from the output or features of other recognition models during the training process.
[0017] The benefits of the present invention are:
[0018] 1. The method of the present invention detects errors in the content of the coding characters in a fully automatic environment, thereby improving the accuracy and integrity of the cable coding characters, reducing dependence on external resources, and also meeting the national requirements for information security.
[0019] 2. The method of the present invention optimizes the PP-OCRv3 text detection and recognition model. The detection module uses the SAST algorithm. By using the LK-PAN structure with a large receptive field, the ResNet-50 network and the DML strategy to optimize the model, the cable inkjet character morphology can be better detected and recognized, and the accuracy and generalization of inkjet character recognition can be improved.
[0020] 3. The method of the present invention filters out incomplete characters by designing algorithm post-processing, retains complete character information, reduces the interference of incomplete characters, and improves the accuracy of inkjet character content recognition; by merging adjacent characters for output, the readability of the text is enhanced.
[0021] 4. The method of the present invention can solve the problems of high error rate, low quality inspection efficiency and high quality inspection difficulty in traditional manual judgment of the content of inkjet characters. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a schematic flow chart of the method of the present invention.
[0023] Figure 2 It is a schematic diagram of the LK-PAN structure involved in the present invention. DETAILED DESCRIPTION
[0024] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0025] Example 1
[0026] The present invention provides a method for identifying the content of inkjet characters based on OCR technology, comprising:
[0027] Based on the PP-OCRv3 framework, the inkjet character content is recognized:
[0028] Cable coding character images are collected to form training data sets and verification sets. In order to improve the generalization ability of the coding character recognition model, data enhancement technology is used to increase the amount and diversity of data, meet the algorithm's ability to recognize multiple languages, and improve the generalization ability of the character recognition model. In the data annotation process, single-character annotation data is used to improve the accuracy of character detection and recognition.
[0029] The characters used in character generalization include 3500 commonly used Chinese characters, Arabic numerals and uppercase and lowercase English. A font similar to the inkjet characters is used, and image processing operations are performed through the program to generate text images with a color similar to the inkjet characters and a transparent background. The OpenCV function is used to adjust the character size, exposure, rotation and scaling, and the processed text images are randomly generated into the real cable background images to obtain a large amount of diversified character data, so as to achieve the purpose of increasing data volume and diversity.
[0030] The PP-OCRv3 framework is used to train the recognition model based on the training data set, in which the detection module of the PP-OCRv3 framework uses the SAST algorithm to detect and process text of any shape in the image, such as multi-directional, multi-language, and curved text.
[0031] Multi-task learning and contextual attention modules are introduced to capture the long-range correlation between pixels. A multi-task learning framework is used to output multiple feature maps related to text detection, such as text centerline TCL, text boundary offset TBO, text center offset TCO and text vertex offset TVO.
[0032] The feature pyramid network is used to fuse multi-level feature maps, so that the network can include more information about objects of different sizes and improve the detection ability of small text areas.
[0033] ResNet-50 is used as the Backbone, the RES-FPN structure is introduced into the residual structure and channel attention structure, and the convolution layer in the FPN is replaced with the RSEConv layer of the channel attention structure to improve the representation ability of the feature map and detect texts of different sizes. This can further improve the representation ability of the feature map and better detect texts of different sizes.
[0034] In view of the fact that cable characters have long and flat shapes and large aspect ratios, the LK-PAN structure is used for feature extraction. The convolution kernel of the path enhancement part of the PAN structure is changed from 3*3 to 9*9, the convolution kernel is enlarged, and the receptive field covered by each position of the feature map is improved, so that the recognition model can capture a wider range of context information and locate text areas, especially texts that are large or have extreme aspect ratios such as inkjet characters. At the same time, it maintains lightweight characteristics and does not significantly increase the computational complexity, which can better meet the needs of a large number of cable inkjet character content recognition.
[0035] The mutual learning distillation method DML (Deep Mutual Learning) is introduced to enable recognition models with the same structure to learn from each other, so that each recognition model can learn useful information from the output or features of other recognition models during the training process. This helps to improve the generalization ability and robustness of the model and improve the accuracy of text detection.
[0036] Based on the fused features, the SVTR algorithm is used to identify the inkjet character content of the cable character text.
[0037] In addition, when the cable character data is collected during the cable movement, the edge fonts may be incomplete. In order to eliminate the interference of incomplete characters, through algorithm post-processing, based on the PP-OCRv3 framework, coordinate edge filtering is used to set the filter distance range threshold, and the single characters closest to the edge of the image on both sides are filtered within the filter distance range to ensure that the incomplete characters close to the edge are excluded, retaining the complete characters, and improving the accuracy of character content recognition. According to the coordinate distance relationship of the single character detection frame, the relevant threshold can also be set to merge the detected adjacent characters that meet the threshold conditions into a complete sentence to improve the readability of the text. Finally, compare with the preset inkjet character template to determine whether the inkjet content is correct, whether there are problems such as wrong inkjet, missed inkjet, and multiple inkjet characters.
[0038] Example 2
[0039] The present invention also provides a coding character content recognition device based on OCR technology, based on the PP-OCRv3 framework, including a collection module, a management module, a detection module, a multi-task learning and context attention module and a recognition module.
[0040] The collection module collects cable coded character images to form a training data set and a verification set. The management module uses the PP-OCRv3 framework to train the recognition model according to the training data set. The detection module of the PP-OCRv3 framework uses the SAST algorithm to detect and process text of any shape in the image. Multi-task learning and context attention modules are introduced to capture the long-range correlation between pixels. The management module uses a multi-task learning framework to output multiple feature maps related to text detection. The management module uses a feature pyramid network to perform multi-level feature map fusion. The recognition module uses the SVTR algorithm to identify the coded character content of the cable character text based on the fused features.
[0041] As the information interaction and execution process between the modules of the above-mentioned device are based on the same concept as the embodiment of the method of the present invention, the specific contents can be found in the description of the embodiment of the method of the present invention and will not be repeated here.
[0042] Likewise, the beneficial effects of the device of the present invention are:
[0043] 1. Detect errors in the coding character content in a fully automatic environment, thereby improving the accuracy and integrity of the cable coding characters, reducing dependence on external resources, and also meeting the country's requirements for information security.
[0044] 2. By optimizing the PP-OCRv3 text detection and recognition model, the detection module uses the SAST algorithm. By optimizing the model using the LK-PAN structure with a large receptive field, the ResNet-50 network and the DML strategy, it can better detect and recognize the cable inkjet character morphology and improve the accuracy and generalization of inkjet character recognition.
[0045] 3. By designing algorithm post-processing, incomplete characters are filtered out, and complete character information is retained, reducing the interference of incomplete characters and improving the accuracy of inkjet character content recognition; by merging adjacent characters into output, the readability of the text is enhanced.
[0046] 4. It can solve the problems of high error rate, low quality inspection efficiency and high difficulty in traditional manual judgment of inkjet character content.
[0047] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.
[0048] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A method for identifying the content of inkjet characters based on OCR technology, characterized in that include: Based on the PP-OCRv3 framework, the inkjet character content is recognized: Cable coded character images are collected to form a training data set and a validation set. The PP-OCRv3 framework is used to train a recognition model based on the training data set. The recognition model is used to identify the coded character content. The detection module of the PP-OCRv3 framework uses the SAST algorithm to detect and process text of any shape in the image. Multi-task learning and context attention modules are introduced to capture the long-range correlation between pixels. The multi-task learning framework is used to output multiple feature maps related to text detection. The feature pyramid network is used to perform multi-level feature map fusion. The SVTR algorithm is used based on the fused features to identify the coded character content of the cable character text.
2. The method for identifying the content of inkjet characters based on OCR technology according to claim 1, characterized in that Based on the PP-OCRv3 framework, ResNet-50 is used as the Backbone, the RES-FPN structure is introduced into the residual structure and channel attention structure, and the convolution layer in FPN is replaced with the RSEConv layer of the channel attention structure to improve the representation ability of the feature map and detect texts of different sizes.
3. The method for identifying the content of inkjet characters based on OCR technology according to claim 1, characterized in that Based on the PP-OCRv3 framework, the LK-PAN structure is used for feature extraction to address the characteristics of cable characters that are long and flat and have a large aspect ratio. The convolution kernel of the path enhancement part of the PAN structure is changed from 3*3 to 9*9, and the convolution kernel is enlarged. The receptive field covered by each position of the feature map is improved, so that the recognition model can capture a wider range of contextual information and locate the text area.
4. The method for identifying the content of inkjet characters based on OCR technology according to claim 1, characterized in that Based on the PP-OCRv3 framework, the mutual learning distillation method DML is introduced to enable recognition models with the same structure to learn from each other, so that each recognition model can learn useful information from the output or features of other recognition models during the training process.
5. A device for identifying the content of inkjet characters based on OCR technology, characterized in that Based on the PP-OCRv3 framework, including collection module, management module, detection module, multi-task learning and contextual attention module and recognition module, The collection module collects cable coded character images to form a training data set and a verification set. The management module uses the PP-OCRv3 framework to train the recognition model according to the training data set. The recognition module uses the recognition model to identify the coded character content. The detection module of the PP-OCRv3 framework uses the SAST algorithm to detect and process text of any shape in the image. Multi-task learning and context attention modules are introduced to capture the long-range correlation between pixels. The management module uses a multi-task learning framework to output multiple feature maps related to text detection. The management module uses the feature pyramid network to perform multi-level feature map fusion. The recognition module uses the SVTR algorithm to identify the coded character content of the cable character text based on the fused features.
6. The OCR-based inkjet character content recognition device according to claim 5, characterized in that The management module is based on the PP-OCRv3 framework, uses ResNet-50 as the Backbone, introduces the RES-FPN structure into the residual structure and channel attention structure, and replaces the convolutional layer in the FPN with the RSEConv layer of the channel attention structure to improve the representation ability of the feature map and detect texts of different sizes.
7. The device for identifying the content of inkjet characters based on OCR technology according to claim 5 is characterized in that The management module is based on the PP-OCRv3 framework. In view of the fact that cable characters are long and flat and have a large length-to-width ratio, the LK-PAN structure is used for feature extraction. The convolution kernel of the path enhancement part of the PAN structure is changed from 3*3 to 9*9, and the convolution kernel is enlarged. The receptive field covered by each position of the feature map is improved, so that the recognition model can capture a wider range of contextual information and locate the text area.
8. The device for identifying the content of inkjet characters based on OCR technology according to claim 5, characterized in that The management module is based on the PP-OCRv3 framework and introduces the mutual learning distillation method DML, which enables recognition models with the same structure to learn from each other, so that each recognition model can learn useful information from the output or features of other recognition models during the training process.
Citation Information
Patent Citations
High-temperature slab ID character recognition method and system based on deep learning
CN117173716A
Cited By
Character recognition method and device based on PP-OCRv3 transfer learning
CN119625738A
