A character defect detection method, device and computer storage medium

Two deep network models detect character defects in Chinese character font library from image and stroke dimensions, solving the problem of low manual quality inspection efficiency, realizing automated quality inspection, strong applicability, and improving the efficiency of font library issuance.

CN117877035BActive Publication Date: 2024-12-20BEIJING HANYI KEYIN INFORMATION TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410064083.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-17
Publication Date
2024-12-20
Estimated Expiration
2044-01-17

AI Technical Summary

Technical Problem

The font library characters generated by artificial intelligence methods in the prior art have defects, resulting in low quality inspection efficiency, and it is difficult for artificial quality inspection to distinguish character defects and font differences, and high-skilled personnel are required to participate.

Method used

Two deep network models are used to detect defects of characters to be detected, and the comparison is performed from the image and stroke dimensions are performed respectively. The detection results are fused to determine whether the characters have defects, including the encoding module and the decoding module, using ResNet50, LSTM, Linear, Attention and Softmax structure.

Benefits of technology

It improves the quality inspection efficiency of font library, reduces the artificial quality inspection and error correction process, is suitable for different Chinese character font libraries, and improves the efficiency of font library issuance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117877035B_ABST
    Figure CN117877035B_ABST
Patent Text Reader

Abstract

The present invention provides a method for detecting character defects, which is applied to character detection in a Chinese character library, and includes: step S1, obtaining images of n characters to be detected; step S2, obtaining a first discriminant model, inputting the ith character to be detected into the first discriminant model, and obtaining a first detection result of the ith character to be detected; step S3, obtaining a second discriminant model, inputting the ith character to be detected into the second discriminant model, and obtaining a second detection result of the ith character to be detected; step S4, fusing the first detection result and the second detection result of the ith character to be detected to determine whether the ith character has a defect; step S5, repeating steps S2-S4 until all characters in the character library to be detected are detected. The present invention also includes a corresponding character defect detection device and a computer storage medium. The scheme of the present invention can automatically inspect the characters in the character library, and improve the efficiency of character library issuance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence applications, and in particular relates to a character defect detection method, device and computer storage medium. Background Art

[0002] With the development of artificial intelligence algorithms such as neural networks, they have also been applied to the production of fonts, greatly improving the production efficiency of various fonts. However, the quality of font characters generated using artificial intelligence methods still has many defects, such as stroke adhesion, stroke intersection holes, code position errors, missing strokes or increased strokes, which leads to a decline in the quality of the fonts.

[0003] Therefore, fonts must pass the quality inspection and error correction process before they are released to ensure the overall quality of the fonts. In the past, there was no mature technology for the quality inspection and error correction process of fonts, which mainly relied on manual verification of characters one by one. Chinese fonts usually include 20,000 to 70,000 characters, and manual verification is inefficient, which seriously affects the speed of font release.

[0004] In addition, the same Chinese character in different fonts may vary greatly, but the defects of the characters are sometimes very subtle. During manual quality inspection, it is difficult for the naked eye to distinguish whether it is a defect or a difference between fonts. There are also subtle differences between different characters in the same font library. During manual quality inspection, it is also difficult to distinguish whether the character is a different correct character or a defect. There are many types of character defects but the number of character defect samples is relatively small. These situations lead to higher skill requirements for quality inspectors in the character quality inspection process.

[0005] Based on the above, this application provides a technical solution to solve the above technical problems. Summary of the invention

[0006] Aiming at the low efficiency of the quality inspection link of the character library produced by the artificial intelligence method in the prior art, the present invention provides a character defect detection method, which is applied to character detection in the Chinese character library, and comprises the following steps:

[0007] Step S1, obtaining images of n characters to be detected, where n is the number of characters in the character library to which the characters to be detected belong, and n is a positive integer;

[0008] Step S2, obtaining a first discriminant model, inputting the i-th character to be detected into the first discriminant model, and obtaining a first detection result of the i-th character to be detected, wherein i is a positive integer and i≤n;

[0009] Step S3, obtaining a second discriminant model, inputting the i-th character to be detected into the second discriminant model, and obtaining a second detection result of the i-th character to be detected;

[0010] Step S4, combining the first detection result and the second detection result of the i-th character to be detected to determine whether the i-th character has a defect;

[0011] Step S5, repeat steps S2-S4 for the i+1th character until all characters in the to-be-detected character library are detected.

[0012] In a specific embodiment of the present invention, the first discrimination model compares the image of the i-th character to be detected with the corresponding reference character image, determines whether the i-th character to be detected has defects based on the comparison result, and outputs a first detection result.

[0013] In a specific embodiment of the present invention, the second discrimination model compares the strokes of the i-th character to be detected with the strokes of the corresponding reference character, determines whether the i-th character to be detected has defects based on the comparison result, and outputs a second detection result.

[0014] In a specific embodiment of the present invention, the first discriminant model and the second discriminant model include an encoding module and a decoding module, the encoding module is used to extract the image features of the character to be detected and the image features of the reference character, and output the corresponding feature vector, and the decoding module is used to calculate the detection result and confidence of the character to be detected based on the feature vector.

[0015] In a specific embodiment of the present invention, the encoding module includes a ResNet50 structure, a MaxPool2d structure, and an LSTM structure;

[0016] The decoding module includes a Linear structure, an LSTM structure, an Attention structure, and a Softmax structure.

[0017] In a specific embodiment of the present invention, step S4 further includes:

[0018] When the first detection result and the second detection result of the i-th character to be detected show that the i-th character to be detected does not have defects, it is considered that the i-th character to be detected does not have defects;

[0019] When the first detection result and the second detection result of the i-th character to be detected indicate that the i-th character to be detected has a defect, the i-th character to be detected has a third-level defect;

[0020] When the first detection result of the i-th character to be detected is that there is a defect, and the second detection result is that there is no defect and the confidence level is greater than 0.8, then the i-th character to be detected is a secondary defect;

[0021] In other cases, the i-th character to be detected is a primary defect.

[0022] In a specific embodiment of the present invention, the training steps of the first discriminant model and the second discriminant model include:

[0023] Obtain n reference characters, wherein the n reference characters correspond one to one with the n characters to be detected;

[0024] Inputting the n reference characters into the first discriminant model and the second discriminant model respectively, and training the defect detection capabilities of the first discriminant model and the second discriminant model;

[0025] Among them, the first discriminant model and the second discriminant model are based on a deep network model.

[0026] In a specific embodiment of the present invention, the second discrimination model compares the strokes of the i-th character to be detected with the number of occurrences of the corresponding i-th character's reference character strokes to determine whether the i-th character to be detected has defects and outputs a second detection result.

[0027] The present invention also provides a character defect detection device, which is applied to character detection in a Chinese character library and includes the following modules:

[0028] An acquisition module is used to acquire images of n characters to be detected, where n is the number of characters in the character library to which the characters to be detected belong, and n is a positive integer;

[0029] A first discriminant model, inputting the i-th character to be detected into the first discriminant model to obtain a first detection result of the i-th character to be detected, wherein i is a positive integer and i≤n;

[0030] A second discriminant model, inputting the i-th character to be detected into the second discriminant model to obtain a second detection result of the i-th character to be detected;

[0031] A fusion module, used for fusing the first detection result and the second detection result of the i-th character to be detected, to determine whether the i-th character has a defect;

[0032] The determination module is circulated to input the i+1th character into the first discrimination model and the second discrimination model until all characters in the to-be-detected character library are detected.

[0033] The present invention also provides a computer storage medium, in which a computer program executable by a computer is stored. When the computer program is executed by a computer, the computer implements any of the aforementioned character defect detection methods.

[0034] The present invention can bring at least one of the following beneficial effects: the present invention performs defect detection on characters in an AI-generated character library through two deep network models. The two deep network models detect characters from different dimensions of the characters, and finally fuse the judgment results of the two deep network models to obtain the defect detection result of the current character, thereby eliminating the manual quality inspection and error correction link, and can be applied to different Chinese character character libraries, with strong applicability. The use of deep network models to detect character defects also greatly improves the quality inspection efficiency of the character library, and further improves the issuance efficiency of the character library. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The preferred implementation scheme will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and their implementation methods.

[0036] Figure 1 A schematic diagram of the steps of a character defect detection method proposed in Embodiment 1 of the present invention;

[0037] Figure 2 Schematic diagram of the structure of the encoding module in the discrimination model of the first embodiment of the present invention;

[0038] Figure 3 Schematic diagram of the structure of a decoding module in a discrimination model according to a first embodiment of the present invention;

[0039] Figure 4 Schematic diagram of stroke classification used by the second discrimination model in the first embodiment of the present invention when performing character defect detection;

[0040] Figure 5 This is a schematic diagram of the structure of a character defect detection device proposed in Embodiment 2 of the present invention. DETAILED DESCRIPTION

[0041] Various aspects of the present invention are described in further detail below.

[0042] Unless otherwise defined or indicated, all professional and scientific terms used herein have the same meanings as those familiar to those skilled in the art. In addition, any methods and materials similar or equivalent to those described herein can be applied to the present invention.

[0043] The following is an explanation of the terms.

[0044] Unless otherwise clearly specified and limited, the "or" mentioned in the present invention includes the relationship of "and". The "and" is equivalent to the Boolean logic operator "AND", the "or" is equivalent to the Boolean logic operator "OR", and "AND" is a subset of "OR".

[0045] It is to be understood that although the terms "first", "second", etc. may be used herein to describe different elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. Therefore, the first element may be referred to as the second element without departing from the teachings of the present invention.

[0046] In the present invention, the terms "comprising", "including" or "comprising" indicate that various components can be applied together in the mixture or composition of the present invention. Therefore, the term "consisting mainly of..." is included in the terms "comprising", "including" or "comprising".

[0047] Unless otherwise clearly specified and limited, the terms "connected", "connected" and "connection" in the present invention should be understood in a broad sense, for example, it can be a fixed connection, or it can be connected through an intermediary medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0048] For example, if an element (or component) is referred to as being on, coupled to, or connected to another element, the element may be directly formed on, coupled to, or connected to the other element, or there may be one or more intervening elements between them. In contrast, if the expressions "directly on," "directly coupled to," and "directly connected to" are used herein, then no intervening elements are indicated. Other words used to describe the relationship between elements should be similarly interpreted, such as "between" and "directly between," "attached" and "directly attached," "adjacent" and "directly adjacent," and the like.

[0049] It should also be noted that the words "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to directions in the drawings. The words "inner" and "outer" used refer to directions toward or away from the geometric center of a particular component, respectively. It can be understood that these terms are used here to describe the relationship of one element, layer or region relative to another element, layer or region as shown in the drawings. In addition to the orientations described in the drawings, these terms should also include other orientations of the device.

[0050] Other aspects of the present invention will be apparent to those skilled in the art in view of the disclosure herein.

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.

[0052] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. The drawings only show the components related to the present application and are not drawn according to the number, shape and size of the components in actual implementation. The type, quantity and proportion of each component in actual implementation may be changed arbitrarily, and the component layout may also be more complicated. For example, the thickness of the components in the drawings may be exaggerated for the sake of clarity.

[0053] Embodiment 1

[0054] Regarding the difficulty of quality inspection of fonts produced by artificial intelligence methods in the prior art, see the attached Figure 1 As shown, the present invention provides a character defect detection method, which is applied to character detection in a Chinese character library, and comprises the following steps:

[0055] Step S1, obtaining images of n characters to be detected, where n is the number of characters in the character library to which the characters to be detected belong, and n is a positive integer;

[0056] Step S2, obtaining a first discriminant model, inputting the i-th character to be detected into the first discriminant model, and obtaining a first detection result of the i-th character to be detected, wherein i is a positive integer and i≤n;

[0057] Step S3, obtaining a second discriminant model, inputting the i-th character to be detected into the second discriminant model, and obtaining a second detection result of the i-th character to be detected;

[0058] Step S4, combining the first detection result and the second detection result of the i-th character to be detected to determine whether the i-th character has a defect;

[0059] Step S5, repeat steps S2-S4 for the i+1th character until all characters in the to-be-detected character library are detected.

[0060] Specifically, the n characters to be detected are derived from a Chinese character library produced by an artificial intelligence method, and each Chinese character library may correspond to a different Chinese font.

[0061] In a preferred embodiment of the present invention, the first discrimination model compares the image of the i-th character to be detected with the corresponding reference character image, determines whether the i-th character to be detected has defects based on the comparison result, and outputs a first detection result.

[0062] In a preferred embodiment of the present invention, the second discrimination model compares the strokes of the i-th character to be detected with the strokes of the corresponding reference character, determines whether the i-th character to be detected has defects based on the comparison result, and outputs a second detection result.

[0063] Specifically, the second discrimination model compares the number of occurrences of the strokes of the i-th character to be detected with the number of occurrences of the corresponding reference character strokes of the i-th character to determine whether the i-th character to be detected has defects and outputs a second detection result.

[0064] Preferably, the first discriminant model and the second discriminant model both include an encoding module and a decoding module, the encoding module is used to extract image features of the character to be detected and the image features of the reference character, and output corresponding feature vectors, and the decoding module is used to calculate the detection results and confidence levels of the character to be detected based on the feature vectors.

[0065] Preferably, with Figure 2 It is a structural diagram of the encoding module, which includes a ResNet50 structure, a MaxPool2d structure, and a LSTM structure.

[0066] The decoding module includes a Linear structure, an LSTM structure, an Attention structure, and a Softmax structure.

[0067] More specifically, Figure 3 This is a structural diagram of the decoding module. The decoding module includes multiple Linear structures and LSTM structures. The structure of the encoding module and the decoding module can achieve better local focusing, making the character defect results more accurate.

[0068] In a specific embodiment of the present invention, the training steps of the first discriminant model and the second discriminant model include:

[0069] Obtain n reference characters, wherein the n reference characters correspond one to one with the n characters to be detected;

[0070] Inputting the n reference characters into the first discriminant model and the second discriminant model respectively, and training the defect detection capabilities of the first discriminant model and the second discriminant model;

[0071] Among them, the first discriminant model and the second discriminant model are based on a deep network model.

[0072] Specifically, the reference characters may be different fonts that have formed a fixed morphological style, and the above-mentioned character defect detection method can be applied to Chinese characters in all fonts except for particularly sloppy handwriting or calligraphy.

[0073] In a specific embodiment of the present invention, step S4 further includes:

[0074] When the first detection result and the second detection result of the i-th character to be detected show that the i-th character to be detected does not have defects, it is considered that the i-th character to be detected does not have defects;

[0075] When the first detection result and the second detection result of the i-th character to be detected indicate that the i-th character to be detected has a defect, the i-th character to be detected has a third-level defect;

[0076] When the first detection result of the i-th character to be detected is that there is a defect, and the second detection result is that there is no defect and the confidence level is greater than 0.8, then the i-th character to be detected is a secondary defect;

[0077] In other cases, the i-th character to be detected is a primary defect.

[0078] By detecting the image of the character to be detected by the first discriminant model and the character to be detected by the second discriminant model, and fusing the detection results of the first discriminant model and the second discriminant model through the above-mentioned grading method, the character to be detected can be detected from different dimensions of a character at the same time, with better detection effect and stronger robustness, and is suitable for character detection of different fonts.

[0079] In a preferred embodiment of the present invention, the second discriminant model uses additional Figure 4 44 stroke categories are shown.

[0080] The present invention performs defect detection on characters in the AI-generated character library through two deep network models. The two deep network models detect characters from different dimensions of the characters, and finally fuse the discrimination results of the two deep network models to obtain the defect detection result of the current character, thereby eliminating the manual quality inspection and error correction link. The present invention can be applied to different Chinese character character libraries and has strong applicability. The use of deep network models to detect character defects also greatly improves the quality inspection efficiency of the character library and further improves the issuance efficiency of the character library.

[0081] Embodiment 2

[0082] See also Figure 4 , is a structural schematic diagram of a character defect detection device according to another specific embodiment of the present invention, wherein the character defect detection device is applied to character detection in a Chinese character library, and comprises the following modules:

[0083] An acquisition module is used to acquire images of n characters to be detected, where n is the number of characters in the character library to be detected and n is a positive integer;

[0084] A first discriminant model, inputting the i-th character to be detected into the first discriminant model to obtain a first detection result of the i-th character to be detected, wherein i is a positive integer and i≤n;

[0085] A second discriminant model, inputting the i-th character to be detected into the second discriminant model to obtain a second detection result of the i-th character to be detected;

[0086] A fusion module, used for fusing the first detection result and the second detection result of the i-th character to be detected, to determine whether the i-th character has a defect;

[0087] The determination module is circulated to input the i+1th character into the first discrimination model and the second discrimination model until all characters in the to-be-detected character library are detected.

[0088] Embodiment 3

[0089] The present invention also provides a computer storage medium, in which a computer program executable by a computer is stored. When the computer program is executed by a computer, the computer implements the character defect detection method described in the first embodiment.

[0090] In summary, the present invention has achieved the following effects:

[0091] The present invention performs defect detection on characters in the AI-generated character library through two deep network models. The two deep network models detect characters from different dimensions of the characters, and finally fuse the discrimination results of the two deep network models to obtain the defect detection result of the current character, thereby eliminating the manual quality inspection and error correction link. The present invention can be applied to different Chinese character character libraries and has strong applicability. The use of deep network models to detect character defects also greatly improves the quality inspection efficiency of the character library and further improves the issuance efficiency of the character library.

[0092] Based on this application, it should be understood by those skilled in the art that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number and aspect described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.

[0093] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.

[0094] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.

[0095] All documents mentioned in the present invention are cited as references in this application, just as each document is cited as reference separately. In addition, it should be understood that after reading the above content of the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms also fall within the scope defined by the claims attached to this application.

Claims

1. A character defect detection method, which is applied to character detection in a Chinese character library, characterized in that: The following steps are involved: Step S1, obtaining images of n characters to be detected, where n is the number of characters in the character library to which the characters to be detected belong, and n is a positive integer; Step S2, obtaining a first discriminant model, inputting the i-th character to be detected into the first discriminant model, and obtaining a first detection result of the i-th character to be detected, wherein i is a positive integer and i≤n; Step S3, obtaining a second discriminant model, inputting the i-th character to be detected into the second discriminant model, and obtaining a second detection result of the i-th character to be detected; Step S4, combining the first detection result and the second detection result of the i-th character to be detected to determine whether the i-th character has a defect; Step S5, repeating steps S2-S4 for the i+1th character until all characters in the character library to be detected are detected; The first discriminant model compares the image of the i-th character to be detected with the corresponding reference character image, determines whether the i-th character to be detected has a defect according to the comparison result, and outputs a first detection result; The second discrimination model compares the strokes of the i-th character to be detected with the strokes of the corresponding reference character, determines whether the i-th character to be detected has defects based on the comparison result, and outputs a second detection result.

2. The character defect detection method according to claim 1, characterized in that: The first discriminant model and the second discriminant model include an encoding module and a decoding module. The encoding module is used to extract the image features of the character to be detected and the image features of the reference character, and output the corresponding feature vector. The decoding module is used to calculate the detection result and confidence of the character to be detected based on the feature vector.

3. The character defect detection method according to claim 2, characterized in that: The encoding module includes ResNet50 structure, MaxPool2d structure and LSTM structure; The decoding module includes a Linear structure, an LSTM structure, an Attention structure, and a Softmax structure.

4. The character defect detection method according to claim 2, characterized in that: Step S4 also includes: When the first detection result and the second detection result of the i-th character to be detected show that the i-th character to be detected does not have defects, it is considered that the i-th character to be detected does not have defects; When the first detection result and the second detection result of the i-th character to be detected indicate that the i-th character to be detected has a defect, the i-th character to be detected has a third-level defect; When the first detection result of the i-th character to be detected is that there is a defect, and the second detection result is that there is no defect and the confidence level is greater than 0.8, then the i-th character to be detected is a secondary defect; In other cases, the i-th character to be detected is a primary defect.

5. The character defect detection method according to claim 1, characterized in that: The training steps of the first discriminant model and the second discriminant model include: Obtain n reference characters, wherein the n reference characters correspond one to one with the n characters to be detected; Inputting the n reference characters into the first discriminant model and the second discriminant model respectively, and training the defect detection capabilities of the first discriminant model and the second discriminant model; Among them, the first discriminant model and the second discriminant model are based on a deep network model.

6. The character defect detection method according to claim 1, characterized in that: The second discrimination model compares the strokes of the i-th character to be detected with the number of occurrences of the corresponding reference character strokes of the i-th character to determine whether the i-th character to be detected has defects and outputs a second detection result.

7. A character defect detection device, which is applied to character detection in a Chinese character library, characterized in that: Includes the following modules: An acquisition module is used to acquire images of n characters to be detected, where n is the number of characters in the character library to which the characters to be detected belong, and n is a positive integer; A first discriminant model, inputting the i-th character to be detected into the first discriminant model to obtain a first detection result of the i-th character to be detected, wherein i is a positive integer and i≤n; A second discriminant model, inputting the i-th character to be detected into the second discriminant model to obtain a second detection result of the i-th character to be detected; A fusion module, used for fusing the first detection result and the second detection result of the i-th character to be detected, to determine whether the i-th character has a defect; The determination module is circulated, and the i+1th character is input into the first discrimination model and the second discrimination model until all characters in the character library to be detected are detected; The first discriminant model compares the image of the i-th character to be detected with the corresponding reference character image, determines whether the i-th character to be detected has a defect according to the comparison result, and outputs a first detection result; The second discrimination model compares the strokes of the i-th character to be detected with the strokes of the corresponding reference character, determines whether the i-th character to be detected has defects based on the comparison result, and outputs a second detection result.

8. A computer storage medium, characterized in that: The computer storage medium stores a computer program executable by a computer. When the computer program is executed by a computer, the computer implements the method according to any one of claims 1 to 6.