Cable character detection method based on deep learning

Through deep learning cable character detection method, the pre-trained multiple character recognition models recognize characters on the cable, solving the problem of character shape deformation recognition caused by the curved surface of the cable, and improving the recognition accuracy and efficiency.

CN119229459APending Publication Date: 2024-12-31THE 41ST INST OF CHINA ELECTRONICS TECH GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411368840.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing deep learning-based OCR model has a high error detection rate when recognizing cable characters, especially because the cable surface is a curved surface, resulting in character shape deformation, resulting in low recognition accuracy.

Method used

Using deep learning-based cable character detection method, the character area images are acquired, preprocessed and segmented, and the pre-trained Chinese, English, numeric and symbol character recognition models are used for identification, and the model is recognized through multi-thread parallel recognition to improve the Identify efficiency and accuracy.

Benefits of technology

It significantly reduces the error detection rate of cable character recognition, improves recognition accuracy, and can effectively identify character types and sequences on the cable, ensuring the accuracy of quality inspection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119229459A_ABST
    Figure CN119229459A_ABST
Patent Text Reader

Abstract

The invention relates to a cable character detection method based on deep learning. The cable character detection method comprises the steps of S1, acquiring a character region image; s2, performing character segmentation on the character region image to obtain N character images; s3, classifying the N character images to obtain M types of character image sets; s4, recognizing different types of character images through a pre-trained neural network, and outputting recognized characters; and S5, comparing the identified characters to determine a cable quality inspection result. According to the method, firstly, a character recognition model is pre-trained through character image training sets of different types; according to the invention, the OCR model is decoupled into different types of character recognition models to recognize different types of characters, so that the accuracy of cable character detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a cable character detection method based on deep learning. Background Art

[0002] During the cable manufacturing process, information characters such as voltage, current, type, length, manufacturer, and related codes are usually printed on the cables to facilitate quick identification by relevant personnel and avoid improper use, thereby reducing the occurrence of related electrical accidents. At the same time, complete and accurate character information on the cables is also conducive to inventory management.

[0003] In actual production, when printing or stamping characters on cables, it is inevitable that character feature defects will occur, such as wrong printing, missing printing, blurred printing, skipped characters, etc. Therefore, it is necessary to conduct quality inspection on the cables after printing, and reprint the characters on the cables with character defects.

[0004] Using OCR (optical character recognition) technology for character recognition during cable character quality inspection can significantly improve the efficiency of quality inspection.

[0005] The existing OCR model has poor robustness. Defects in the character features of the cable or differences in the quality of the captured cable images will lead to a high false detection rate in the existing deep learning-based OCR algorithm, that is, cables with correct characters will be mistakenly detected as having incorrect characters.

[0006] Since the characters are printed along the circumference of the cable, the surface of the cable is a curved surface rather than a flat surface, which results in different shapes of cable characters and flat characters. On the cable, the top and bottom of the characters are compressed along the height direction of the characters, while the middle of the characters are expanded, similar to the flat unfolded map of the earth. The areas close to the poles appear larger on the unfolded map, while the areas close to the equator appear smaller on the unfolded map. Therefore, the OCR model has a high false positive rate when recognizing deformed characters.

[0007] In order to improve the recognition accuracy of the OCR model for cable characters, the present application provides a cable character detection method and system based on deep learning. Summary of the invention

[0008] In order to overcome the problems existing in the related art, the present application provides a cable character detection method based on deep learning, comprising:

[0009] S1, obtaining a character area image;

[0010] S2, performing character segmentation on the character region image to obtain N character images, where N is an integer greater than or equal to 0;

[0011] S3, classifying the N character images to obtain M types of character image sets; the types of the character image sets include: Chinese character image sets, English character image sets, digital character image sets and symbol character image sets; M is an integer greater than or equal to 1;

[0012] S4, respectively identifying different types of the character images through a pre-trained neural network, and outputting the recognized characters; the neural network includes M types of character recognition models, and the character recognition models are respectively pre-trained through different types of character image training sets;

[0013] S5. Compare and identify the characters to determine the cable quality inspection result.

[0014] In one implementation, after acquiring the character region image, the method further includes: preprocessing the character region image.

[0015] In one embodiment, preprocessing the character region image specifically includes: performing binarization processing according to the pixel grayscale value of the character region image;

[0016] The discrete noise points of the character area image are eliminated.

[0017] In one embodiment, the character image is marked with character coordinates before image segmentation; and the comparison and recognition of the characters to determine the cable quality inspection result specifically includes:

[0018] Sort the characters according to the character coordinates and output a character detection sequence;

[0019] It is determined whether the character detection sequence is consistent with the characters of the preset character sequence. If so, it is determined that the current detection cable is qualified; if not, it is determined that the current detection cable is unqualified.

[0020] In one implementation, performing character segmentation on the character region image specifically includes:

[0021] Get cable printing data;

[0022] Determining a character interval length and a character sequence length according to the cable printing data;

[0023] The character image is obtained by segmentation and cropping according to the character interval length and the character sequence length.

[0024] In one embodiment, before the pre-trained neural network is used to respectively identify the character images of different types, the method further includes:

[0025] Constructing M character recognition models;

[0026] Obtain M types of character image training sets;

[0027] Different character recognition models are trained separately according to different types of character image training sets; the character recognition model is a Chinese recognition model, an English recognition model, a number recognition model or a character recognition model.

[0028] In one embodiment, the character recognition model is trained based on a PaddleOCR model.

[0029] In one implementation, a plurality of the character recognition models are installed on a cable detection device, and the cable detection device parallelizes the plurality of the character recognition models through multi-threading.

[0030] The technical solution provided by this application may have the following beneficial effects:

[0031] In the present application, the character recognition model is first pre-trained using different types of character image training sets. When quality inspecting the characters on the cable, the character area on the cable is photographed, and then the character area image is segmented character by character, and the character images are classified according to the character type and collected into different types of character image sets. Different types of character image sets are input into the corresponding character recognition model for character recognition. Finally, the recognized characters are compared to determine whether the quality inspection result is qualified or unqualified.

[0032] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The above and other objects, features and advantages of the present application will become more apparent through a more detailed description of exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.

[0034] Figure 1 A schematic diagram of the process of the cable character detection method shown in an embodiment of the present application;

[0035] Figure 2 The character region image before preprocessing shown in the embodiment of the present application;

[0036] Figure 3 The preprocessed character area image shown in the embodiment of the present application;

[0037] Figure 4 The segmented character image shown in the embodiment of the present application;

[0038] Figure 5 A schematic diagram of a character detection sequence shown in an embodiment of the present application;

[0039] Figure 6 This is a detection schematic diagram of a cable character detection system shown in an embodiment of the present application. DETAILED DESCRIPTION

[0040] The preferred embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0041] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0042] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0043] Embodiment 1

[0044] Since the characters are printed along the circumference of the cable, the surface of the cable is curved rather than flat, which results in different shapes of characters on the cable and on the flat surface. On the cable, the top and bottom of the characters are compressed along the height direction of the characters, while the middle of the characters are expanded, which ultimately leads to a high false positive rate in the existing OCR model when recognizing deformed characters.

[0045] In order to improve the recognition accuracy of the OCR model for cable characters, the present application embodiment provides a cable character detection method based on deep learning, such as Figure 1 As shown, the following steps are included:

[0046] S1, obtaining a character area image;

[0047] S2, performing character segmentation on the character region image to obtain N character images, where N is an integer greater than or equal to 0;

[0048] S3, classifying the N character images to obtain M Chinese character image sets, English character image sets, digital character image sets and symbol character image sets; M is an integer greater than or equal to 1;

[0049] S4, respectively identifying different types of character images through a pre-trained neural network, and outputting the recognized characters;

[0050] S5. Compare and identify the characters to determine the cable quality inspection result.

[0051] Specifically, the neural network includes M types of character recognition models, and the character recognition models are pre-trained by using different types of character image training sets.

[0052] In the embodiment of the present application, in order to reduce the shape deformation of characters causing the model to recognize incorrect characters.

[0053] Therefore, the embodiment of the present application trains multiple character detection models according to the character type to detect different types of characters separately.

[0054] In the embodiment of the present application, the character recognition model is first pre-trained using different types of character image training sets. When quality inspecting the characters on the cable, the character area on the cable is photographed, and then the character area image is segmented character by character, and the character images are classified according to the character type and collected into different types of character image sets. Different types of character image sets are respectively input into the corresponding character recognition model for character recognition. Finally, the recognized characters are compared to determine whether the quality inspection result is qualified or unqualified.

[0055] Embodiment 2

[0056] Based on the cable character detection method of the first embodiment, before recognizing characters, it is necessary to perform steps such as preprocessing of the character area image and training of the character recognition model. In order to clearly and completely illustrate the cable detection method of the present application, the embodiment of the present application also provides a cable character detection method based on deep learning, including:

[0057] S1, obtaining a character area image;

[0058] S2, performing character segmentation on the character region image to obtain N character images;

[0059] S3, classifying the N character images to obtain a character image set of M types;

[0060] S4, respectively identifying different types of character images through a pre-trained neural network, and outputting the recognized characters;

[0061] S5. Compare and identify the characters to determine the cable quality inspection result.

[0062] After step S1, the method further includes: preprocessing the character area image.

[0063] Specifically, firstly, binarization processing is performed according to the pixel grayscale value of the character area image, and then the discrete noise points of the character area image are eliminated to obtain the following Figure 3 The character area image shown. Figure 2 It is the character area image before binarization.

[0064] Furthermore, step S2 specifically includes:

[0065] S201, obtaining cable printing data;

[0066] S202, determining a character interval length and a character sequence length according to the cable printing data;

[0067] S203: Segment and crop the character image according to the character interval length and the character sequence length.

[0068] Specifically, the cable printing data includes the cable moving speed, the paint spraying speed, and the number of words of the sprayed text during cable printing.

[0069] In actual production, the characters on the cable are spray-printed by an inkjet printer, and the cable moves along the spray port of the inkjet printer during spraying.

[0070] Therefore, the characters after spraying are as follows Figure 2 or Figure 3 As shown in the figure, the sprayed characters are deformed and distorted.

[0071] Therefore, in the embodiment of the present application, character segmentation of the character area image needs to determine the size of the area to be segmented based on the cable printing data to prevent a single character from being cut into pieces.

[0072] After executing step S3, the character image set is as follows Figure 4 As shown, it is divided into 4 types according to Chinese, English, numbers and special symbols.

[0073] In the embodiment of the present application, the character image is marked with the character coordinates before image segmentation.

[0074] Furthermore, step S5 specifically includes:

[0075] S501, sorting the characters according to the character coordinates, and outputting a character detection sequence;

[0076] S502: Determine whether the characters in the character detection sequence are consistent with the characters in the preset character sequence.

[0077] If yes, it is determined that the current detection cable is qualified; if no, it is determined that the current detection cable is unqualified.

[0078] Therefore, in the embodiment of the present application, the character detection sequence is as follows: Figure 5 shown.

[0079] In an embodiment of the present application, before the pre-trained neural network model is used to respectively recognize different types of character images, a character recognition model is further trained, including the following steps:

[0080] S301, constructing M character recognition models;

[0081] S302, obtaining M types of character image training sets;

[0082] S303, training different character recognition models separately according to different types of character image training sets.

[0083] Specifically, the character image training set annotates each character image data of the cable, and uses an automatic processing method to automatically classify and store the various types of character image data that are located and segmented in a ratio of 8:2 between the training set and the validation set, and automatically classify and store the data set required for training and its annotated text, which are provided for model training.

[0084] Furthermore, the pre-trained recognition model of Paddle OCR is used to train the deep neural network model according to Chinese characters, English letters, numbers, special symbols, etc. and output various types of character recognition models. In the embodiment of the present application, the character recognition model is a Chinese recognition model, an English recognition model, a number recognition model or a character recognition model.

[0085] Wherein, a plurality of character recognition models are installed on the cable detection device, and the cable detection device parallelizes the plurality of character recognition models through multi-threading.

[0086] Specifically, the detection diagram of the cable detection equipment is as follows: Figure 6 shown.

[0087] When training the character recognition model, it is divided into 4 different types of training sets, and the Chinese character recognition model, English character recognition model, digital character recognition model and special character recognition model are trained respectively. When recognizing characters on the cable, the cable detection equipment runs multiple models simultaneously through multi-threading for character recognition, which can speed up the recognition speed. Moreover, since it is divided into multiple different types of models, the number of parameters of the character recognition model is small, and the character recognition model can be decoupled. When the recognition accuracy of one of the models is low, one of the character recognition models can be updated separately.

[0088] The scheme of the present application has been described in detail above with reference to the accompanying drawings. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. Those skilled in the art should also be aware that the actions and modules involved in the description are not necessarily required for the present application.

[0089] In addition, it can be understood that the steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the modules in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs.

[0090] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.

[0091] Alternatively, the present application can also be implemented as a non-temporary machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or electronic device, server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.

[0092] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the application herein may be implemented as electronic hardware, computer software, or a combination of both.

[0093] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system and method according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, a program segment or a code, and the part of the module, the program segment or the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or the flow chart, and the combination of the square boxes in the block diagram and / or the flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0094] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A cable character detection method based on deep learning, characterized in that: include: S1, obtaining a character area image; S2, performing character segmentation on the character region image to obtain N character images; N is an integer greater than or equal to 0; S3, classifying the N character images to obtain a character image set of M types; The types of the character image set include: Chinese character image set, English character image set, digital character image set and symbol character image set; M is an integer greater than or equal to 1; S4, respectively identifying different types of the character images through a pre-trained neural network, and outputting the recognized characters; the neural network includes M types of character recognition models, and the character recognition models are respectively pre-trained through different types of character image training sets; S5. Compare and identify the characters to determine the cable quality inspection result.

2. The cable character detection method based on deep learning according to claim 1, characterized in that: After acquiring the character area image, the method further includes: The character area image is preprocessed.

3. The cable character detection method based on deep learning according to claim 2, characterized in that: Preprocessing the character area image specifically includes: Performing binarization processing according to the pixel grayscale value of the character area image; The discrete noise points of the character area image are eliminated.

4. The cable character detection method based on deep learning according to claim 1, characterized in that: The character image is marked with the character coordinates before image segmentation; The comparison and recognition of the characters to determine the cable quality inspection result specifically includes: Sort the characters according to the character coordinates and output a character detection sequence; It is determined whether the character detection sequence is consistent with the characters of the preset character sequence. If so, it is determined that the current detection cable is qualified; if not, it is determined that the current detection cable is unqualified.

5. The cable character detection method based on deep learning according to claim 1, characterized in that: Performing character segmentation on the character area image specifically includes: Get cable printing data; Determining a character interval length and a character sequence length according to the cable printing data; The character image is obtained by segmentation and cropping according to the character interval length and the character sequence length.

6. The cable character detection method based on deep learning according to claim 1, characterized in that: Before respectively identifying different types of character images through the pre-trained neural network, the method further includes: Constructing M character recognition models; Obtain M types of character image training sets; Different character recognition models are trained separately according to different types of character image training sets; the character recognition model is a Chinese recognition model, an English recognition model, a number recognition model or a character recognition model.

7. The cable character detection method based on deep learning according to claim 6, characterized in that: The character recognition model is trained based on the PaddleOCR model.

8. The cable character detection method based on deep learning according to claim 1, characterized in that: A plurality of the character recognition models are installed on the cable detection device, and the cable detection device runs the plurality of the character recognition models in parallel through multi-threading.