Method for training pattern enhancement model and electronic device

By reading and reconstructing patterns, and combining pattern-enhancing model training, the reading difficulties caused by pattern defects are solved, and the recognition accuracy of the pattern reader in high defects is improved.

CN119538953APending Publication Date: 2025-02-28PEGATRON
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410808847.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-08-28
Filing Date
2024-06-21
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, when dealing with pattern defects, especially when the defect ratio exceeds 30%, it is difficult for the pattern reading device to accurately read pattern information.

Method used

The first pattern with defects is read through the pattern reader, and the reading is successful or not is determined. If successful, the pattern reconstruction is carried out, the second pattern is generated, and the first pattern and the second pattern are combined as training data to train the pattern to enhance the model to improve the accuracy of pattern reading.

Benefits of technology

By training the pattern to strengthen the model, it can effectively deal with severe defective patterns and improve the recognition accuracy of the pattern reader in the case of high defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538953A_ABST
    Figure CN119538953A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method for training a pattern enhancement model and an electronic device. The method comprises the following steps of: reading a first pattern with a flaw through a pattern reader, and judging whether the pattern reader successfully reads the first pattern; if the reading is successful, performing a pattern reconstruction operation based on pattern information of the read first pattern to obtain a second pattern; and training the pattern enhancement model based on the first pattern and the second pattern as a training data combination. Therefore, when the trained pattern enhancement model receives the to-be-identified pattern with the flaws, the to-be-identified pattern can be correspondingly enhanced so as to generate the to-be-identified pattern without the flaws. Therefore, the pattern information carried by the pattern to be identified can be read by the pattern reader.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a model training mechanism, and more particularly to a method and an electronic device for training a pattern enhancement model. Background Art

[0002] In the prior art, when a pattern such as a barcode is read by a pattern reading device, if the pattern itself has defects (such as dirt, blur, etc.), the information carried by the pattern can only be read by relying on the error tolerance of the pattern reading device during recognition.

[0003] Generally speaking, when the proportion of defects on the pattern is less than 30%, the pattern reading device can still read the information carried by the pattern. However, when the defects on the pattern are too serious (for example, more than 30%), the pattern reading device will not be able to smoothly read the information carried by the pattern. Summary of the invention

[0004] In view of this, the present disclosure provides a method for training a pattern enhancement model and an electronic device, which can be used to solve the above technical problems.

[0005] The disclosed embodiment provides a method for training a pattern enhancement model, which is suitable for an electronic device, comprising: reading a first pattern with a defect by a pattern reader, and determining whether the pattern reader has read successfully; if the reading is successful, performing a pattern reconstruction operation based on pattern information of the read first pattern to obtain a second pattern; and training the pattern enhancement model based on the first pattern and the second pattern as a training data combination.

[0006] According to one embodiment of the present disclosure, if the reading is successful, the proportion of the defect in the first pattern in the first pattern is lower than a threshold.

[0007] According to one embodiment of the present disclosure, the first pattern includes a barcode or a QR code.

[0008] According to one embodiment of the present disclosure, the method for training a pattern enhancement model further includes: if reading fails, feeding the first pattern into the pattern enhancement model to output an enhanced first pattern; and reading the enhanced first pattern by a pattern reader.

[0009] According to one embodiment of the present disclosure, the method for training a pattern enhancement model further includes: if the enhanced first pattern is successfully read, combining the first pattern and the enhanced first pattern as another training data and inputting the data into the pattern enhancement model to train the pattern enhancement model.

[0010] According to one embodiment of the present disclosure, the pattern enhancement model includes an autoencoder.

[0011] The disclosed embodiment provides an electronic device, including a storage circuit and a processor. The storage circuit stores a program code. The processor is coupled to the storage circuit and accesses the program code to execute: reading a first pattern with a defect through a pattern reader, and determining whether the pattern reader reads successfully; if the reading is successful, performing a pattern reconstruction operation based on pattern information of the read first pattern to obtain a second pattern; and training a pattern enhancement model based on the first pattern and the second pattern as a training data combination.

[0012] According to one embodiment of the present disclosure, if the reading is successful, the proportion of the defects in the first pattern in the first pattern is lower than a threshold.

[0013] According to one embodiment of the present disclosure, the first pattern includes a barcode or a QR code.

[0014] According to one embodiment of the present disclosure, the processor further executes: if the reading fails, feeding the first pattern into the pattern enhancement model to output an enhanced first pattern; and reading the enhanced first pattern through the pattern reader.

[0015] According to one embodiment of the present disclosure, the processor further executes: if the enhanced first pattern is successfully read, the first pattern and the enhanced first pattern are combined as another training data and input into the pattern enhancement model to train the pattern enhancement model.

[0016] According to one embodiment of the present disclosure, the pattern enhancement model includes an autoencoder. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a schematic diagram of an electronic device according to an embodiment of the present disclosure.

[0018] Figure 2 FIG. 4 is a flow chart of a method for training a pattern enhancement model according to an embodiment of the present disclosure.

[0019] Figure 3 is a schematic diagram of a training pattern enhancement model according to an embodiment of the present disclosure.

[0020] Figure 4 FIG. 4 is a schematic diagram showing strengthening by using a pattern strengthening model according to an embodiment of the present disclosure.

[0021] Description of reference numerals:

[0022] 100: Electronic devices

[0023] 102: Storage Circuit

[0024] 104: Processor

[0025] 310: Training Data Combination

[0026] 311,411: First pattern

[0027] 311a,411a: Defects

[0028] 312: Second Pattern

[0029] 412: The Third Pattern

[0030] 399: Pattern Reader

[0031] P: Pattern information

[0032] M: Pattern Enhancement Model

[0033] S210~S260: Steps DETAILED DESCRIPTION

[0034] Please refer to Figure 1 , which is a schematic diagram of an electronic device according to an embodiment of the present disclosure. In different embodiments, the electronic device 100 can be implemented as various smart devices and / or computer devices, but is not limited thereto. In one embodiment, the electronic device 100 can also be provided with an image reader (such as a barcode reader). In other embodiments, the image reader can also be externally connected to the electronic device 100, but is not limited thereto.

[0035] exist Figure 1 In the embodiment, the electronic device 100 includes a storage circuit 102 and a processor 104 .

[0036] The storage circuit 102 is, for example, any form of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory, hard disk or other similar devices or a combination of these devices, and can be used to record multiple program codes or modules.

[0037] The processor 104 is coupled to the memory circuit 102 and may be a general purpose processor, a special purpose processor, a conventional processor, a digital signal processor, a plurality of microprocessors, one or more microprocessors combined with a digital signal processor core, a controller, a microcontroller, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), any other type of integrated circuit, a state machine, an Advanced RISC Machine (ARM) based processor, and the like.

[0038] In the embodiment of the present disclosure, the processor 104 can access the modules and program codes recorded in the storage circuit 102 to implement the method of training the pattern enhancement model proposed in the present disclosure, the details of which are described as follows.

[0039] Please refer to Figure 2 , which is a flow chart of a method for training a pattern reinforcement model according to an embodiment of the present disclosure. The method of this embodiment can be Figure 1 The electronic device 100 is executed as follows: Figure 1 Description of components shown Figure 2 In addition, in order to make the disclosed concept easier to understand, the following will be supplemented with Figure 3 The situation is described, Figure 3 is a schematic diagram of a training pattern enhancement model according to an embodiment of the present disclosure.

[0040] In step S210 , the processor 104 reads the first pattern 311 with the defect 311 a (eg, dirt or wear) through the pattern reader 399 , and determines whether the pattern reader 399 has read successfully.

[0041] In different embodiments, the first pattern 311 is, for example, a barcode, a QR code, or other identifiable patterns that can carry specific information, but is not limited thereto.

[0042] exist Figure 3 In the scenario, the processor 104 may determine whether the pattern reader 399 has read the first pattern 311 successfully after the pattern reader 399 has read the first pattern 311. For example, the processor 104 may determine whether the pattern reader 399 has read the pattern information P carried by the first pattern 311 successfully.

[0043] In one embodiment, the proportion of the defect 311a in the first pattern 311 may be lower than a threshold value. In different embodiments, the threshold value is, for example, an upper limit value at which the pattern reader 399 can still successfully read the pattern information P carried by the first pattern 311 .

[0044] For example, assuming that the pattern reader 399 can successfully read the pattern information carried by the acquired pattern when the defect area is less than 30%, the above threshold value may be 30%, but is not limited thereto. In other words, when the threshold value is 30%, even if there are defects such as dirt in the acquired pattern, as long as the area of ​​the defect does not exceed 30% of the pattern, the pattern reader 399 can still successfully read the pattern information carried by the pattern, but is not limited thereto.

[0045] Therefore, after the image reader 399 successfully reads the first image 311 , the image reader 399 can obtain the image information P (such as information about a product, a website, etc.) carried by the first image 311 .

[0046] In step S220, the processor 104 may perform a pattern reconstruction operation based on the read pattern information P of the first pattern 311 to obtain the second pattern 312. Figure 3 In the scenario, since the first pattern 311 is, for example, a two-dimensional code, when the processor 104 performs the pattern reconstruction operation, the processor 104 may, for example, feed the obtained pattern information P into an application and / or webpage originally used to generate the first pattern 311, so that the application and / or webpage generates a complete first pattern 311 (i.e., a first pattern 311 without the defect 311a) according to the pattern information P. Afterwards, the processor 104 may, for example, use the complete first pattern 311 (i.e., a first pattern 311 without the defect 311a) as the second pattern 312, but is not limited thereto.

[0047] In step S230 , the processor 104 uses the first pattern 311 and the second pattern 312 as the training data combination 310 to train the pattern enhancement model M. In this way, the pattern enhancement model M can be learned accordingly.

[0048] In different embodiments, the pattern enhancement model M may be implemented as various models based on a convolutional neural network (CNN), such as an autoencoder, CycleGAN, etc., but is not limited thereto.

[0049] After the pattern enhancement model M is trained as described above, the corresponding relationship between the first pattern 311 with the defect 311 a and the complete first pattern 311 (eg, the second pattern 312 ) can be learned.

[0050] After the pattern enhancement model M is trained, the pattern enhancement model M can enhance the pattern to be identified accordingly when receiving a pattern to be identified with defects. In this case, the pattern to be identified with defects can be enhanced (or restored) to a state without defects or with fewer defects. This can increase the possibility that the pattern to be identified can be correctly identified later.

[0051] Please refer to Figure 4 , which is a schematic diagram showing strengthening with a pattern strengthening model according to an embodiment of the present disclosure.

[0052] exist Figure 4 In the example, it is assumed that the processor 104 reads the first pattern 411 including the defect 411a through the pattern reader 399. In this case, the processor 104 can determine whether the pattern reader 399 reads successfully (step S210). For example, the processor 104 can determine whether the pattern reader 399 successfully obtains the pattern information carried by the first pattern 411.

[0053] If yes, it means that the defect 411a does not affect the processor 104 to read the pattern information carried by the first pattern 411. In this case, the processor 104 can perform steps S220 and S230 accordingly, and the details can be referred to the previous description, which will not be repeated here.

[0054] On the other hand, if the processor 104 determines that the pattern reader 399 fails to read successfully (for example, the pattern information carried by the first pattern 411 cannot be read), this means that the severity of the defect 411a has made it impossible for the processor 104 to successfully read the pattern information carried by the first pattern 411. In this case, the processor 104 can execute step S240 accordingly to feed the first pattern 411 into the pattern enhancement model M, so that the pattern enhancement model M outputs the enhanced first pattern 411.

[0055] In this embodiment, the enhanced first pattern 411 is, for example, the third pattern 412 , that is, the first pattern 411 without defects or with fewer defects, but is not limited thereto.

[0056] In step S250, the processor 104 may read the enhanced first pattern 411 (e.g., the third pattern 412) through the pattern reader 399. Since the defects in the third pattern 412 are significantly reduced compared to the first pattern 411, the pattern reader 399 should be able to read the pattern information carried by the third pattern 412 more smoothly, but the present invention is not limited thereto.

[0057] In step S260, if the pattern reader 399 successfully reads the enhanced first pattern 411 (e.g., the third pattern 412), the processor 104 uses the first pattern 411 and the enhanced first pattern 411 (e.g., the third pattern 412) as another training data combination and inputs them into the pattern enhancement model M to train the pattern enhancement model M. In this way, the pattern enhancement model M can learn the corresponding relationship between the first pattern 411 with the defect 411a and the enhanced first pattern 411 (e.g., the third pattern 412).

[0058] In summary, the method proposed in the present disclosure can combine the defective and non-defective versions of a pattern as a training data to train the pattern enhancement model. In this way, the pattern enhancement model can learn the correspondence between the above two versions. Afterwards, when the trained pattern enhancement model receives a pattern to be identified with defects, the pattern to be identified can be enhanced accordingly to generate a pattern to be identified without defects (or with fewer defects). In this way, it can help the pattern reader read the pattern information carried by the pattern to be identified.

[0059] Although the present disclosure has been disclosed as above with the embodiments, it is not intended to limit the present disclosure. Any technician in the relevant technical field can make some changes and modifications without departing from the concept and scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on what is defined in the claims.

Claims

1. A method for training a pattern enhancement model, suitable for an electronic device, characterized in that: include: Reading a first pattern with a defect by a pattern reader, and determining whether the pattern reader reads successfully; If the reading is successful, performing a pattern reconstruction operation based on a pattern information of the read first pattern to obtain a second pattern; as well as The first pattern and the second pattern are used as a training data combination to train the pattern enhancement model.

2. The method according to claim 1, characterized in that If the reading is successful, a proportion of the defect in the first pattern in the first pattern is lower than a threshold.

3. The method according to claim 1, characterized in that The first pattern includes a barcode or a QR code.

4. The method according to claim 1, characterized in that Also includes: If the reading fails, feeding the first pattern into the pattern enhancement model to output the enhanced first pattern; as well as The enhanced first pattern is read by the pattern reader.

5. The method according to claim 4, characterized in that Also includes: If the enhanced first pattern is read successfully, the first pattern and the enhanced first pattern are combined as another training data and input into the pattern enhancement model to train the pattern enhancement model.

6. The method according to claim 1, characterized in that The pattern enhancement model includes an autoencoder.

7. An electronic device, characterized in that: include: a storage circuit storing a program code; A processor coupled to the storage circuit and accessing the program code to execute: Reading a first pattern with a defect by a pattern reader, and determining whether the pattern reader reads successfully; If the reading is successful, performing a pattern reconstruction operation based on a pattern information of the read first pattern to obtain a second pattern; as well as The pattern enhancement model is trained based on the first pattern and the second pattern as a training data combination.

8. The electronic device as claimed in claim 7, characterized in that: If the reading is successful, a proportion of the defect in the first pattern in the first pattern is lower than a threshold.

9. The electronic device as claimed in claim 7, characterized in that: The first pattern includes a barcode or a QR code.

10. The electronic device as claimed in claim 7, wherein: The processor also performs: If the reading fails, feeding the first pattern into the pattern enhancement model to output the enhanced first pattern; and The enhanced first pattern is read by the pattern reader.

11. The electronic device according to claim 10, wherein: The processor also performs: If the enhanced first pattern is read successfully, the first pattern and the enhanced first pattern are combined as another training data and input into the pattern enhancement model to train the pattern enhancement model.

12. The electronic device according to claim 7, wherein: The pattern enhancement model includes an autoencoder.