Code recognition method and device based on Kuramoto model
By grouping and dimensionally improving the standard mode groups, and using the Kuramoto model to identify defect patterns, the problem of large identification errors in the prior art is solved, and code recognition with high stability and low error is achieved.
Patent Information
- Application Number
- CN202210740527.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-06-28
AI Technical Summary
When identifying binary modes that are blocked or noise-interferenced, the prior art has a large recognition error, making it difficult to accurately identify the standard mode corresponding to the defect mode.
The Kuramoto model is used to randomly group the standard mode groups in pairs, and each group is dimensionally improved to make the standard mode orthogonal. Then, the Kuramoto model is used to identify the defect mode, and the recognition error is reduced through the established model.
By establishing a Kuramoto model for orthogonal standard modes, the stability and accuracy of recognition are improved, the recognition error is reduced, and defect patterns under occlusion or noise interference can be effectively identified.
Smart Images

Figure CN115082407B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of code recognition, and in particular to a code recognition method and device based on a Kuramoto model. Background Art
[0002] A code represents a binary pattern, a vector whose components take values in the range {-1, 1}. In typical scenarios, it represents a binary color image. Given a set of standard binary patterns and a captured defect pattern, the defect pattern is derived by perturbing one of the standard binary patterns and represented as a vector with components in the closed interval [-1, 1]. The question is how to identify the defect pattern and determine which standard binary pattern the defect pattern was perturbed from.
[0003] Typically, binary pattern recognition often involves partial occlusion or noise interference. For example, a license plate number may be obscured by mud, or the image may be damaged, smeared, or blurred. These defective patterns require accurate identification of the corresponding standard patterns. Therefore, a code recognition method with minimal error is needed. Summary of the Invention
[0004] The embodiments of the present invention provide a code recognition method and device based on the Kuramoto model, which can reduce recognition errors.
[0005] In a first aspect, an embodiment of the present invention provides a code recognition method based on the Kuramoto model, comprising:
[0006] S1, obtaining a standard pattern group corresponding to a standard image and a defect pattern corresponding to an image to be identified;
[0007] S2. randomly divide the standard pattern groups into pairs;
[0008] S3. Determine whether the number of standard patterns involved in grouping is an even number. If so, each group includes two standard patterns, and S4 is executed for the group. If not, there is a group that includes one standard pattern. S4 is executed for the group that includes two standard patterns, and for the group that includes one standard pattern, the standard pattern in the group is output.
[0009] S4, performing dimensionality enhancement on the two standard patterns in the group so that the two standard patterns in the group are orthogonal after the dimensionality enhancement, and performing corresponding dimensionality enhancement on the defect pattern, and executing S5 on the group after the dimensionality enhancement;
[0010] S5. For each group, establish a corresponding Kuramoto model based on the two standard patterns in the group after dimensionality improvement;
[0011] S6. Using the established Kuramoto model to identify the defect pattern after the corresponding dimension is improved, so as to output the standard pattern that is closest to the corresponding defect pattern for each group;
[0012] S7. Summarize the standard patterns output in all groups and determine whether the number of the currently summarized standard patterns is one. If so, identify the defect pattern as the currently summarized standard pattern; otherwise, randomly group the currently summarized standard patterns into two groups as new standard pattern groups and execute S3.
[0013] In a possible implementation, in S4, for each group, the difference between the dimension-lifted portion of the defect pattern and the dimension-lifted portions of the two standard patterns in the group is the same.
[0014] In a possible implementation, the step of performing dimensionality enhancement on the two standard patterns in the group includes:
[0015] For the two standard patterns in this group { 1 , η 2}, and perform dimension enhancement according to the following formula:
[0016] ξ 1 =[η 1 , η 1 ]
[0017] ξ 2 =[η 2 , -η 2 ]
[0018] Among them, {ξ 1 ,ξ 2} are two standard patterns in this group after dimensionality enhancement.
[0019] In one possible implementation, the defect mode is dimensionally enhanced according to the following formula:
[0020]
[0021] Among them, ξ d is the defect mode after dimension enhancement, η d This is the defect mode before dimensionality improvement.
[0022] In a possible implementation, S6 includes:
[0023] For each group, the following steps are performed: determining the arc cosine of the defect pattern after the dimension of the group is lifted as the initial state of the Kuramoto model; and using the initial state and the Kuramoto model corresponding to the group to identify the defect pattern after the dimension is lifted.
[0024] In a second aspect, an embodiment of the present invention further provides a code recognition device based on the Kuramoto model, comprising:
[0025] A pattern acquisition unit, configured to acquire a standard pattern group corresponding to a standard image and a defect pattern corresponding to an image to be identified;
[0026] A grouping unit, configured to randomly group the standard pattern groups into pairs;
[0027] A determination unit is used to determine whether the number of standard patterns involved in grouping is an even number. If so, each group includes two standard patterns, and the dimension improvement unit is triggered to perform corresponding operations for the group; if not, there is a group that includes one standard pattern, and the dimension improvement unit is triggered to perform corresponding operations for the group including two standard patterns, and the standard pattern in the group including one standard pattern is output, and the summary processing unit is triggered to perform corresponding operations;
[0028] The dimension enhancement unit is used to enhance the dimensions of the two standard patterns in the group so that the two standard patterns in the group are orthogonal after the dimension enhancement, and to enhance the dimensions of the defect pattern accordingly, and to trigger the model building unit to perform corresponding operations on the group after the dimension enhancement;
[0029] The model building unit is used to build a corresponding Kuramoto model for each group according to the two standard patterns in the group after dimensionality improvement;
[0030] The recognition unit is used to use the established Kuramoto model to identify the defect pattern after the corresponding dimension is improved, so as to output the standard pattern closest to the corresponding defect pattern for each group and trigger the summary processing unit to perform corresponding operations;
[0031] The summary processing unit is used to summarize the standard patterns output by the identification unit for all groups, and determine whether the number of currently summarized standard patterns is one. If so, the defect pattern is identified as the currently summarized standard pattern; otherwise, the currently summarized standard pattern is randomly grouped in pairs as a new standard pattern group, and the determination unit, the dimensionality improvement unit, the model building unit, the identification unit, and the summary processing unit are triggered to repeat the corresponding operations.
[0032] In one possible implementation, for each group, the difference between the dimension-lifted portion of the defect pattern and the dimension-lifted portions of the two standard patterns in the group is the same.
[0033] In one possible implementation, the model building unit is specifically used to perform the following operations for each group: determining the arc cosine of the defect pattern after the dimension of the group is increased as the initial state of the Kuramoto model, and using the initial state and the Kuramoto model corresponding to the group to identify the defect pattern after the dimension is increased.
[0034] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in any embodiment of this specification is implemented.
[0035] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method described in any embodiment of this specification.
[0036] An embodiment of the present invention provides a code recognition method and device based on the Kuramoto model. By performing dimensionality enhancement on the standard pattern in a group so that the two standard patterns of the group are orthogonal after the dimensionality enhancement, and performing corresponding dimensionality enhancement on the defect pattern, a recognition algorithm can be given for the two orthogonal standard patterns. By establishing a corresponding Kuramoto model for the orthogonal standard pattern, when the Kuramoto model is used to identify the defect pattern, the equilibrium state of the standard pattern has a high stability, so as to avoid identifying non-standard binary patterns as much as possible, thereby reducing recognition errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 This is a flow chart of a code recognition method based on the Kuramoto model provided by one embodiment of the present invention;
[0039] Figure 2 is a set of standard mode schematic diagrams provided by an embodiment of the present invention;
[0040] Figure 3 This is a defect mode schematic diagram provided by an embodiment of the present invention;
[0041] Figure 4 This is a schematic diagram of an improved grouping standard mode provided by an embodiment of the present invention;
[0042] Figure 5 An embodiment of the present invention provides Figure 4 Schematic diagram of the defect mode after the standard mode is improved;
[0043] Figure 6 This is an identification comparison diagram provided by an embodiment of the present invention;
[0044] Figure 7 This is a hardware architecture diagram of a code recognition device based on the Kuramoto model provided by one embodiment of the present invention;
[0045] Figure 8 This is a structural diagram of a code recognition device based on the Kuramoto model provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0047] Please refer to Figure 1 , an embodiment of the present invention provides a code recognition method based on the Kuramoto model, comprising:
[0048] S1, obtaining a standard pattern group corresponding to a standard image and a defect pattern corresponding to an image to be identified;
[0049] S2. randomly divide the standard pattern groups into pairs;
[0050] S3. Determine whether the number of standard patterns involved in grouping is an even number. If so, each group includes two standard patterns, and S4 is executed for the group. If not, there is a group that includes one standard pattern. S4 is executed for the group that includes two standard patterns, and for the group that includes one standard pattern, the standard pattern in the group is output.
[0051] S4, performing dimensionality enhancement on the two standard patterns in the group so that the two standard patterns in the group are orthogonal after the dimensionality enhancement, and performing corresponding dimensionality enhancement on the defect pattern, and executing S5 on the group after the dimensionality enhancement;
[0052] S5. For each group, establish a corresponding Kuramoto model based on the two standard patterns in the group after dimensionality improvement;
[0053] S6. Using the established Kuramoto model to identify the defect pattern after the corresponding dimension is improved, so as to output the standard pattern that is closest to the corresponding defect pattern for each group;
[0054] S7. Summarize the standard patterns output in all groups and determine whether the number of the currently summarized standard patterns is one. If so, identify the defect pattern as the currently summarized standard pattern; otherwise, randomly group the currently summarized standard patterns into two groups as new standard pattern groups and execute S3.
[0055] In an embodiment of the present invention, the dimensionality of the standard pattern in the group is increased so that the two standard patterns of the group are orthogonal after the dimensionality increase, and the defect pattern is correspondingly increased in dimensionality, so that a recognition algorithm can be given for the two orthogonal standard patterns. By establishing a corresponding Kuramoto model for the orthogonal standard pattern, when the Kuramoto model is used to identify the defect pattern, the equilibrium state of the standard pattern has a higher stability, so as to avoid identifying non-standard binary patterns as much as possible, thereby reducing the recognition error.
[0056] Described below Figure 1 How to perform the steps shown.
[0057] First, S1, S2, and S3 are described.
[0058] In the embodiment of the present invention, the standard image refers to an unobstructed image, and the image to be recognized is an image after a certain standard image is obstructed. The standard mode group includes at least two standard modes.
[0059] For example, if the standard pattern group includes the numbers 0 through 9, then the defect pattern is an obscured digit. Another example is if the standard pattern group includes the letters A through Z, then the defect pattern is an obscured letter. Therefore, identifying which standard pattern perturbs the defect pattern can enable the recognition of muddy license plates, damaged images, and even human faces.
[0060] In S2 and S3, when the standard pattern groups are randomly grouped in pairs, if the number M (M is an integer not less than 2) of standard patterns in the standard pattern group is even, M / 2 groups are obtained. If the number M of standard patterns in the standard pattern group is odd, (M+1) / 2 groups are obtained. Since the Kuramoto model does not need to be used for groups containing one standard pattern, the standard pattern in the group is directly output as the standard pattern closest to the defect pattern.
[0061] Then, the following description is given for S4, S5 and S6.
[0062] Before explaining S4, S5, and S6, the following analysis is performed:
[0063] For a set of standard modes and defect modes, if the Kuramoto model is constructed using all the standard modes as memory modes, it is easy to find examples that show that the correct standard mode cannot be accurately identified. If the two standard modes used to construct the Kuramoto model are mutually orthogonal, the correct standard mode can be accurately identified for the defect mode; in this case, the memory mode is ε-independent and asymptotically stable, that is, the equilibrium state corresponding to the memory mode is asymptotically stable for any ε>0.
[0064] Furthermore, the ε-independent asymptotic stability of binary modes can be characterized from two different perspectives. First, it is equivalent to the sum of the squares of the inner products of the binary mode and each memory mode being equal to the square of the number of phases; second, it is equivalent to the binary mode being linearly represented by the memory mode. These two descriptions are comprehensive and can greatly reduce the computational complexity of stability. Memory modes are necessarily ε-independent asymptotically stable; and for binary modes that are not ε-independent asymptotically stable, a readily computable lower bound on the critical coupling strength that causes them to become unstable can be provided. Furthermore, when M ≤ 3, that is, when the system contains no more than three mutually orthogonal memory modes, only the memory modes are ε-independent asymptotically stable binary modes. When M > 3, in addition to the memory modes, the system can have other ε-independent asymptotically stable binary modes. The drawbacks of the above theories include the inability to provide an identification algorithm for non-orthogonal standard modes. Even when the memory modes are pairwise orthogonal, the presence of other ε-independent stable modes may make it impossible to accurately identify the standard modes.
[0065] Based on the above analysis, it can be seen that it is necessary to perform orthogonal improvement on each group, so as to provide a binary pattern recognition algorithm that effectively improves the error-free recognition capability.
[0066] In addition, since the defect pattern needs to be identified using the two standard patterns after dimensionality enhancement, it is also necessary to perform corresponding dimensionality enhancement on the defect pattern for each group according to the dimensionality enhancement method of the group. The degree of difference between the dimensionality enhancement part of the defect pattern and the dimensionality enhancement part of the two standard patterns in the group is the same.
[0067] There are at least several ways to improve the two standard modes and defect modes:
[0068] Method 1
[0069] For the two standard patterns in this group { 1 , η 2}, and perform dimension enhancement according to the following formula:
[0070] ξ 1 =[η 1 , η 1 ]
[0071] ξ 2 =[η 2 , -η 2 ]
[0072] Among them, {ξ 1 ,ξ 2} are two standard patterns in this group after dimensionality enhancement.
[0073] The two standard modes after the dimension enhancement in the group are used to compare the defect mode η d Before identification, the defect mode η d Dimensionality is increased according to the following formula:
[0074]
[0075] Among them, ξ d It is the defect mode after dimensionality improvement.
[0076] It is understandable that the dimension improvement part of the defect mode The dimension improvement part η of the two standard modes in this group 1 and -η 2 The degree of difference is the same.
[0077] Method 2:
[0078] For the two standard patterns in this group { 1 , η 2}, and perform dimension enhancement according to the following formula:
[0079]
[0080]
[0081] Among them, {ξ 1 ,ξ 2} are two standard patterns in this group after dimensionality enhancement.
[0082] The two standard modes after the dimension enhancement in the group are used to compare the defect mode η d Before identification, the defect mode η d Dimensionality is increased according to the following formula:
[0083]
[0084] Among them, ξ d It is the defect mode after dimensionality improvement.
[0085] Method 3:
[0086] For the two standard patterns in this group { 1 , η 2}, and perform dimension enhancement according to the following formula:
[0087] ξ 1 =[η 1 , η 2 , η 1 , η 2 ]
[0088] ξ 2 =[η 2 , η 1 , -η 2 , -η 1 ]
[0089] Among them, {ξ 1 ,ξ 2} are two standard patterns in this group after dimensionality enhancement.
[0090] The two standard modes after the dimension enhancement in the group are used to compare the defect mode η d Before identification, the defect mode η d Dimensionality is increased according to the following formula:
[0091]
[0092] Among them, ξ d It is the defect mode after dimensionality improvement.
[0093] When there are a large number of standard patterns, the computational complexity of dimensionality enhancement using method 2 is large, and the dimensionality enhancement using method 3 requires a larger number of dimensions to be expanded, which will cause greater interference to the recognition process. Therefore, it is preferred to use method 1 for dimensionality enhancement, which not only has a small computational complexity but also has less interference to the subsequent recognition process.
[0094] When establishing the Kuramoto (coupled oscillator) model in S5, the standard modes in each group are mutually orthogonal. Therefore, in the embodiment of the present invention, the following Kuramoto model can be established:
[0095]
[0096] Among them, θ i =θ i (t) represents the value of the i-th phase at time t, θ j =θ j (t) represents the value of the j-th phase at time t, is the time derivative of the ith phase, N (N is a positive integer) represents the number of phases, ε>0 represents the strength of the second-order Fourier term, C ij is the connection coefficient between the i-th phase and the j-th phase.
[0097] Assume there is a set of standard patterns {ξ 1 ,ξ 2 ,...,ξ M}, where M is an integer not less than 2. These standard modes are all N-dimensional vectors with components in {-1, 1}. 1 ,ξ 2 ,...,ξ M As a memory pattern, the connection topology between the phases of the Kuramoto model is designed according to the Hebbian rule, that is,
[0098]
[0099] Every standard pattern ξ∈{-1, 1} N The equilibrium state θ of the Kuramoto model * (ξ) corresponds to θ * (ξ) is uniquely characterized by the following relation:
[0100]
[0101]
[0102] In S5, when building the Kuramoto model for the group after dimensionality improvement, the network parameters are Equivalent to {ξ 1 ,ξ 2} as a memory pattern to establish the Kuramoto model. 1 ,ξ 2} is the ε-independent asymptotically stable binary mode of the system. In the Kuramoto model, a small value of ε is selected to ensure that the remaining binary modes are unstable.
[0103] In S6, for each group, the following steps are performed: the arc cosine of the defect pattern after the dimension of the group is lifted is determined as the initial state of the Kuramoto model, and the defect pattern after the dimension is lifted is identified using the initial state and the Kuramoto model corresponding to the group. d 2N-dimensional vector ξ after dimensionality enhancement d Usually it is not a binary mode, so let θ(0) = arccos(ξ d) is used as the initial state to be input into the Kuramoto model for calculation. The solution θ(t) will converge to a standard mode ξ in this group. k , that is, m(ξ k ,θ(t))→1, the standard mode to which it converges will be output.
[0104] Finally, S7 and S8 are explained.
[0105] After executing S4-S6 for each group containing two standard patterns, each group will output a standard pattern, and after aggregation, (M+1) / 2 or M / 2 standard patterns will be obtained. If the number of standard patterns output after aggregation is not 1, it indicates that the final result has not been identified. The output standard patterns are then aggregated and regarded as a new standard pattern group, and S3-S7 are continued until the output standard pattern is one. At this point, the defect pattern is identified as the output standard pattern.
[0106] It should be noted that when identifying the group after dimensionality improvement, the standard pattern ξk after improvement is compared with the standard pattern η before improvement. k Correspondingly, that is: if m(ξ 1 ,θ(t))→1, then it is considered that the output η 1 ;If m(ξ 2 ,θ(t))→1, then the output η 2 . The output η 1 or η 2 The next round of grouping and identification process is performed as a standard mode.
[0107] The above identification method is described below with a specific example.
[0108] Please refer to Figure 2 It is a set of standard modes, including 10 standard modes; Figure 3 is the defect mode (taking image damage as an example), denoted as η d .
[0109] Step 1: Randomly group the standard patterns into pairs, for example: {0,1}, {2,3}, {4,5}, {6,7}, {8,9}.
[0110] Step 2: Perform defect pattern recognition on each group.
[0111] The first group {0,1} is taken as an example for detailed description.
[0112] Step 1: According to the above method, a pair of standard pattern {0,1} and defect pattern η d To improve, get Figure 4 and Figure 5 The improvement results are shown.
[0113] Step 2: Set the network parameters in the Kuramoto model to That is {ξ 1 ,ξ 2} as a memory pattern to construct the Kuramoto model. At this time, only {ξ 1 ,ξ 2} is the ε-independent asymptotically stable binary mode of the Kuramoto model. Choosing a small value of ε in the Kuramoto model ensures that the remaining binary modes are unstable.
[0114] Step 3: Due to ξ d It is not a binary model. The initial value θ(0)=arccos(ξ d ) is calculated, and the corresponding solution θ(t) is as follows: Figure 6 As shown, due to m(ξ 2 ,θ(t))→1, indicating that in the group {ξ 1 ,ξ 2} d Recognize the pattern 2 , that is, the defect mode η in the number {0,1} d Pattern 1 is identified. Recognition of the first group {0,1} is completed.
[0115] Similar operations are performed on other groups. For group 2 {2,3}, the defect mode η d Mode 3 will be identified; for the third group {4,5}, the defect mode η d Mode 5 will be identified; for the fourth group {6,7}, the defect mode η d Mode 6 will be identified; for the fifth group {8,9}, the defect mode η d Pattern 9 will be recognized.
[0116] Step 3: Summarize the standard patterns identified in step 2 to obtain {1, 3, 5, 6, 9}, and select it as a new standard pattern group. Repeat the two-by-two grouping in step 1 (for example, {1, 3}, {5, 6}, {9}) and the group identification process in step 2. Defect pattern η d Recognize 3 in the first group {1,3} and 6 in the second group {5,6} respectively. The single pattern {9} in the third group does not need to be recognized, and pattern 9 can be directly output.
[0117] Step 4: Summarize the patterns {3, 6, 9} identified in step 3 and select them as a new standard pattern group. Repeat the grouping (e.g., {3, 6}, {9}) and recognition process. If pattern 3 is identified in the first group {3, 6}, the second group {9} can be directly output.
[0118] Step 5: Summarize the numbers {3,9} identified in step 4 as a new standard pattern group and output pattern 3. At this point, there is only one standard pattern after summarization, which indicates that the defect pattern η d Finally, pattern 3 is identified and the recognition is completed.
[0119] like Figure 7 、 Figure 8 As shown, the embodiment of the present invention provides a code recognition device based on the Kuramoto model. The device embodiment can be implemented by software, hardware, or a combination of software and hardware. From the hardware level, Figure 7 As shown in FIG. 1 , a hardware architecture diagram of an electronic device in which a code recognition device based on a Kuramoto model is provided in an embodiment of the present invention is provided. Figure 7 In addition to the processor, memory, network interface, and non-volatile memory shown, the electronic device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, Figure 8 As shown, as a device in a logical sense, the CPU of the electronic device in which it is located reads the corresponding computer program in the non-volatile memory into the internal memory and runs it. This embodiment provides a code recognition device based on the Kuramoto model, including:
[0120] The pattern acquisition unit 801 is used to acquire a standard pattern group corresponding to a standard image and a defect pattern corresponding to an image to be identified;
[0121] A grouping unit 802 is configured to randomly group the standard pattern groups into pairs;
[0122] The determination unit 803 is used to determine whether the number of standard patterns involved in the grouping is an even number. If so, each group includes two standard patterns, and the dimension improvement unit is triggered to perform a corresponding operation for the group; if not, there is a group that includes one standard pattern, and the dimension improvement unit is triggered to perform a corresponding operation for the group including two standard patterns. For the group including one standard pattern, the standard pattern in the group is output, and the summary processing unit is triggered to perform a corresponding operation;
[0123] The dimension enhancement unit 804 is configured to enhance the dimensions of the two standard patterns in the group so that the two standard patterns in the group are orthogonal after the dimension enhancement, and to enhance the dimensions of the defect pattern accordingly, and trigger the model building unit to perform corresponding operations on the group after the dimension enhancement;
[0124] The model building unit 805 is used to build a corresponding Kuramoto model for each group according to the two standard patterns in the group after dimensionality improvement;
[0125] The identification unit 806 is used to identify the defect pattern after the corresponding dimension is improved by using the established Kuramoto model, so as to output the standard pattern that is closest to the corresponding defect pattern for each group, and trigger the summary processing unit to perform corresponding operations;
[0126] The summary processing unit 807 is used to summarize the standard patterns output by the identification unit for all groups, and determine whether the number of currently summarized standard patterns is one. If so, the defect pattern is identified as the currently summarized standard pattern; otherwise, the currently summarized standard pattern is randomly grouped in pairs as a new standard pattern group, and the determination unit, the dimensionality improvement unit, the model building unit, the identification unit, and the summary processing unit are triggered to repeat the corresponding operations.
[0127] In one embodiment of the present invention, for each group, the difference between the dimension-lifted portion of the defect pattern and the dimension-lifted portions of the two standard patterns in the group is the same.
[0128] In one embodiment of the present invention, when performing dimensionality enhancement on the two standard patterns in the group, the dimensionality enhancement unit is specifically configured to:
[0129] For the two standard patterns in this group { 1 , η 2}, and perform dimension enhancement according to the following formula:
[0130] ξ 1 =[η 1 , η 1 ]
[0131] ξ 2 =[η 2 , -η 2 ]
[0132] Among them, {ξ 1 ,ξ 2} are two standard patterns in this group after dimensionality enhancement.
[0133] In one embodiment of the present invention, the dimension enhancement unit is specifically configured to enhance the dimension of the defect pattern accordingly according to the following formula:
[0134]
[0135] Among them, ξ d is the defect mode after dimension enhancement, η d This is the defect mode before dimensionality improvement.
[0136] In one embodiment of the present invention, the model building unit is specifically used to perform the following operations for each group: determining the arc cosine of the defect pattern after the dimension corresponding to the group is increased as the initial state of the Kuramoto model, and using the initial state and the Kuramoto model corresponding to the group to identify the defect pattern after the dimension is increased.
[0137] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on a code recognition device based on the Kuramoto model. In other embodiments of the present invention, a code recognition device based on the Kuramoto model may include more or fewer components than shown in the figure, or may combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0138] The information interaction, execution process, etc. between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For specific contents, please refer to the description in the embodiment of the method of the present invention and will not be repeated here.
[0139] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, a code recognition method based on the Kuramoto model in any embodiment of the present invention is implemented.
[0140] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor executes a code recognition method based on a Kuramoto model in any embodiment of the present invention.
[0141] Specifically, a system or device equipped with a storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program codes stored in the storage medium.
[0142] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute part of the present invention.
[0143] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code can be downloaded from a server computer via a communication network.
[0144] In addition, it should be clear that the functions of any of the above embodiments can be achieved not only by executing the program code read by the computer, but also by enabling the operating system operating on the computer to complete part or all of the actual operations based on the instructions of the program code.
[0145] In addition, it can be understood that the program code read from the storage medium is written into a memory provided in an expansion board inserted into the computer or into a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above embodiments.
[0146] It should be noted that, in this article, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical factors in the process, method, article or device comprising the elements.
[0147] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk, etc. Various media that can store program codes.
[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A code recognition method based on the Kuramoto model, characterized in that: include: S1, obtaining a standard pattern group corresponding to a standard image and a defect pattern corresponding to an image to be identified; The number of standard modes in the standard mode group is M, M≥3; S2. randomly divide the standard pattern groups into pairs; S3. Determine whether the number of standard patterns involved in grouping is an even number. If so, each group includes two standard patterns, and S4 is executed for the group. If not, there is a group that includes one standard pattern. S4 is executed for the group that includes two standard patterns, and for the group that includes one standard pattern, the standard pattern in the group is output. S4, performing dimensionality enhancement on the two standard patterns in the group so that the two standard patterns in the group are orthogonal after the dimensionality enhancement, and performing corresponding dimensionality enhancement on the defect pattern, and executing S5 on the group after the dimensionality enhancement; S5. For each group, establish a corresponding Kuramoto model based on the two standard patterns in the group after dimensionality improvement; S6. Using the established Kuramoto model to identify the defect pattern after the corresponding dimension is increased, so as to output a standard pattern that is closest to the corresponding defect pattern for each group; S6 includes: for each group, executing: determining the arc cosine of the defect pattern after the dimension is increased for the group as the initial state of the Kuramoto model, and using the initial state and the Kuramoto model corresponding to the group to identify the defect pattern after the dimension is increased; the output standard pattern is the standard pattern before the dimension is increased; S7, summarizing the standard patterns output in all groups, and determining whether the number of the currently summarized standard patterns is one, and if so, identifying the defect pattern as the currently summarized standard pattern; Otherwise, the currently summarized standard patterns are randomly grouped into two groups as new standard pattern groups, and S3 is executed.
2. The method according to claim 1, characterized in that In S4, for each group, the dimension-lifted portion of the defect pattern is the same as the dimension-lifted portions of the two standard patterns in the group.
3. The method according to claim 2, characterized in that The dimensionality enhancement of the two standard modes in the group includes: For the two standard patterns in this group { 1 , η 2 }, and perform dimension enhancement according to the following formula: x 1 =[the 1 ,or 1 ] x 2 =[the 2 ,-or 2 ] Among them, {ξ 1 ,ξ 2 } are two standard patterns in this group after dimensionality enhancement.
4. The method according to claim 3, characterized in that According to the following formula, the defect mode is dimensionally improved accordingly: Among them, ξ d is the defect mode after dimension enhancement, η d This is the defect mode before dimensionality improvement.
5. A code recognition device based on the Kuramoto model, characterized in that: include: A pattern acquisition unit, configured to acquire a standard pattern group corresponding to a standard image and a defect pattern corresponding to an image to be identified; The number of standard modes in the standard mode group is M, M≥3; a grouping unit, configured to randomly group the standard pattern groups into pairs; A determination unit is used to determine whether the number of standard patterns involved in grouping is an even number. If so, each group includes two standard patterns, and the dimension improvement unit is triggered to perform corresponding operations for the group; if not, there is a group that includes one standard pattern, and the dimension improvement unit is triggered to perform corresponding operations for the group including two standard patterns, and the standard pattern in the group including one standard pattern is output, and the summary processing unit is triggered to perform corresponding operations; The dimension enhancement unit is used to enhance the dimensions of the two standard patterns in the group so that the two standard patterns in the group are orthogonal after the dimension enhancement, and to enhance the dimensions of the defect pattern accordingly, and to trigger the model building unit to perform corresponding operations on the group after the dimension enhancement; The model building unit is used to build a corresponding Kuramoto model for each group according to the two standard patterns in the group after dimensionality improvement; The identification unit is used to use the established Kuramoto model to identify the defect pattern after the corresponding dimension is enhanced, so as to output the standard pattern closest to the corresponding defect pattern for each group, and trigger the summary processing unit to perform corresponding operations; the model establishment unit is specifically used to perform the following operations for each group: determine the arc cosine of the defect pattern after the dimension enhancement of the group as the initial state of the Kuramoto model, and use the initial state and the Kuramoto model corresponding to the group to identify the defect pattern after the dimension enhancement; the output standard pattern is the standard pattern before the dimension enhancement; The summary processing unit is used to summarize the standard patterns output by the identification unit for all groups, and determine whether the number of currently summarized standard patterns is one. If so, the defect pattern is identified as the currently summarized standard pattern; otherwise, the currently summarized standard pattern is randomly grouped in pairs as a new standard pattern group, and the determination unit, the dimensionality improvement unit, the model building unit, the identification unit, and the summary processing unit are triggered to repeat the corresponding operations.
6. The code recognition device based on the Kuramoto model according to claim 5, characterized in that: For each group, the dimension-lifted portion of the defective pattern differs to the same degree from the dimension-lifted portions of the two standard patterns in that group.
7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 4.