Training method and device for two-dimensional code front-end recognition model

By training the QR code front-end recognition model for training samples, the problem of the non-interoperability of front-end recognition technologies of each code system is solved, and the common QR code front-end recognition is realized, which reduces development costs and improves the recognition effect.

CN120298822APending Publication Date: 2025-07-11GUANGDONG LEAPFIVE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510347521.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

In the prior art, the front-end identification technology of each code system is not interoperable, resulting in high development costs.

Method used

By obtaining training samples, including basic QR code generated by non-QR code encoding algorithms and intelligent QR code generated by QR code encoding algorithms, the QR code front-end recognition model is trained to enable it to identify QR codes of various code systems.

Benefits of technology

A general QR code front-end recognition model is implemented, which reduces development costs and improves recognition effect and applicability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120298822A_ABST
    Figure CN120298822A_ABST
Patent Text Reader

Abstract

The invention provides a two-dimensional code front-end recognition model training method and device, and the method comprises the steps: obtaining a training sample which comprises a first sample, and the first sample is a basic two-dimensional code generated through a non-two-dimensional code coding algorithm; and training the two-dimensional code front-end recognition model by using the training sample to obtain a trained two-dimensional code front-end recognition model. According to the method, the two-dimensional codes are represented as black and white square modules which are alternately gathered, the basic two-dimensional codes generated through a non-two-dimensional code coding algorithm can contain the two-dimensional codes which have representation meanings and conform to the code system, and the irregular basic two-dimensional codes are used for training the two-dimensional code front-end recognition model; in the training process, the two-dimensional code front-end recognition model recognizes two-dimensional codes of various code systems, a universal two-dimensional code front-end recognition model is obtained, and the cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and particularly relates to a method and device for training a front-end recognition model of two-dimensional codes. Background Art

[0002] Currently, there are multiple mainstream two-dimensional code encoding and decoding algorithms. Generally, two-dimensional codes of different code systems can only be recognized through corresponding front-end recognition technologies, and the front-end recognition of each code system is not interoperable. This results in the non-universality of the front-end recognition technologies of each two-dimensional code, increasing the development cost of the front-end recognition technology of two-dimensional codes. Summary of the Invention

[0003] Embodiments of this application provide a method, device, electronic device, readable storage medium, and computer program product for training a front-end recognition model of two-dimensional codes, which can solve the problem of high development cost of front-end recognition technology for two-dimensional codes.

[0004] In a first aspect, embodiments of this application provide a method for training a front-end recognition model of two-dimensional codes, including:

[0005] Obtaining training samples, where the training samples include first samples, and the first samples are basic two-dimensional codes generated by a non-two-dimensional code encoding algorithm;

[0006] Using the training samples to train a front-end recognition model of two-dimensional codes to obtain a trained front-end recognition model of two-dimensional codes.

[0007] In an embodiment, the training samples further include second samples, and the second samples are intelligent two-dimensional codes generated by a two-dimensional code encoding algorithm.

[0008] In an embodiment, the basic two-dimensional code is generated by a binary stream matrix including 1 and 0, and the distribution probability of 1 is greater than a preset probability.

[0009] In an embodiment, the obtaining of the training samples includes:

[0010] Collecting the basic two-dimensional codes in each scenario to obtain first image samples;

[0011] Performing sample enhancement processing on some of the first image samples to obtain second image samples, and the first samples include the first image samples and the second image samples.

[0012] Collecting the intelligent two-dimensional codes in each scenario to obtain third image samples.

[0013] Performing sample enhancement processing on some of the third image samples to obtain fourth image samples, and the second samples include the third image samples and the fourth image samples.

[0014] In one embodiment, part of the first image samples and part of the third image samples contain physical noise.

[0015] In one embodiment, the method of training the front-end QR code recognition model using the training samples to obtain the trained front-end QR code recognition model includes:

[0016] Input the training samples into the front-end QR code recognition model to obtain a first prediction result output by the front-end QR code recognition model, and the format of the first prediction result is binary stream data;

[0017] Use a preset loss function to determine the loss value of the front-end QR code recognition model according to the first prediction result and the label;

[0018] When the loss value is less than the preset loss value, obtain the trained front-end QR code recognition model.

[0019] In one embodiment, after obtaining the trained front-end QR code recognition model, it further includes:

[0020] Obtain the QR code to be recognized;

[0021] Input the QR code to be recognized into the trained front-end QR code recognition model to obtain a second prediction result output by the trained front-end QR code recognition model, and the format of the second prediction result is binary stream data;

[0022] Use each QR code decoding algorithm to decode the second prediction result;

[0023] If the decoding is successful, obtain the decoding result of the second prediction result.

[0024] In a second aspect, an embodiment of the present application provides a training device for a front-end QR code recognition model, including:

[0025] An acquisition module, configured to acquire training samples, where the training samples include a first sample, and the first sample is a basic QR code generated by a non-QR code encoding algorithm;

[0026] A training module, configured to use the training samples to train a front-end QR code recognition model to obtain a trained front-end QR code recognition model.

[0027] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, it implements the method according to any one of the above first aspects.

[0028] Fourthly, an embodiment of the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the method described in any one of the above first aspects is implemented.

[0029] Fifthly, an embodiment of the present application provides a computer program product, and when the computer program product runs on an electronic device, the electronic device is enabled to execute the method described in any one of the above first aspects.

[0030] The beneficial effects of the embodiments of the present application compared with the prior art are as follows:

[0031] In the embodiments of the present application, by obtaining training samples, the training samples include first samples, and the first samples are basic two-dimensional codes generated by a non-two-dimensional code encoding algorithm; using the training samples to train a two-dimensional code front-end recognition model to obtain a trained two-dimensional code front-end recognition model; based on the fact that two-dimensional codes are all represented in the form of an aggregation of alternating black and white square modules, the basic two-dimensional codes generated by the non-two-dimensional code encoding algorithm can include two-dimensional codes representing meanings and conforming to code systems. Training the two-dimensional code front-end recognition model with the irregular basic two-dimensional codes enables the two-dimensional code front-end recognition model to recognize two-dimensional codes of various code systems during the training process, obtaining a general two-dimensional code front-end recognition model and reducing costs.

[0032] It can be understood that the beneficial effects of the above second to fifth aspects can be referred to the relevant descriptions in the above first aspect, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0034] Figure 1 FIG. 21 is a first flowchart of a method for training a two-dimensional code front-end recognition model provided by an embodiment of the present application;

[0035] Figure 2 FIG. 25 is a second flowchart of a method for training a two-dimensional code front-end recognition model provided by an embodiment of the present application;

[0036] Figure 3 FIG. 29 is a structural diagram of a device for training a two-dimensional code front-end recognition model provided by an embodiment of the present application;

[0037] Figure 4 FIG. 33 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0038] In the following description, specific details such as specific system architectures, technologies, etc. are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.

[0039] It should be understood that when used in the specification and appended claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0040] It should also be understood that the term "and / or" used in the specification and appended claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0041] As used in the specification and appended claims of the present application, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]" depending on the context.

[0042] In addition, in the description of the specification and appended claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0043] Reference to "one embodiment" or "some embodiments" or the like described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0044] At present, there are various mainstream QR code encoding and decoding algorithms. Generally, the QR codes of each existing code system can only be recognized through the corresponding front-end recognition technology, and the front-end recognition technologies of each code system are not interoperable, which results in the non-universality of the front-end recognition technologies of each QR code and increases the cost of the front-end recognition technology of QR codes.

[0045] Among them, the mainstream front-end recognition process of QR codes can be roughly divided into steps such as detection and positioning, deformation correction, and module sampling. The detection and positioning of QR codes of different code systems rely on different positioning patterns. For example, the DF417 two-dimensional barcode relies on specific ratios at the beginning and end to achieve positioning; the DM code (Data Matrix code) relies on the L-shaped border to achieve positioning; the GM code (GridMatrix Code) relies on the grid-shaped pattern to achieve positioning; the QR code (Quick Response code) relies on three square-shaped positioning corner blocks to achieve positioning; other code systems use the positioning pattern to perform simple deformation correction to achieve positioning, etc., which makes the front-end recognition technologies of QR codes of different code systems not universal.

[0046] To solve the above problems, the embodiment of the present application provides a training method for a front-end recognition model of a QR code, and uses the first sample to train the front-end recognition model of the QR code, so that the trained front-end recognition model of the QR code can recognize QR codes of various code systems.

[0047] In one embodiment, Figure 1 is the first process schematic diagram of the training method for the front-end recognition model of the QR code provided by an embodiment of the present application. As Figure 1 shown, the method includes:

[0048] S11: Obtain training samples.

[0049] Among them, the training samples include the first sample, and the first sample is a basic QR code generated by a non-QR code encoding algorithm.

[0050] In application, the basic QR code is generated according to the binary stream string after using the non-QR code encoding algorithm to generate the binary stream string. The basic QR code does not represent meaning and does not contain a positioning pattern. In a possible implementation manner, the binary stream string is a binary stream matrix.

[0051] In a possible implementation manner, the basic QR code is generated by a binary stream matrix including 1 and 0, and the distribution probability of 1 is greater than the preset probability.

[0052] Specifically, a binary stream matrix including 1 and 0, and the distribution probability of 1 is greater than the preset probability, is generated by a non-QR code encoding algorithm such as a mathematical method, and a QR code is generated according to the binary stream matrix to obtain the basic QR code.

[0053] Among them, the mathematical method can be a pseudo-random number generator, the Mersenne Twister algorithm, etc. The preset probability can be set according to specific circumstances so that 1 is approximately evenly distributed within the matrix.

[0054] In a possible implementation, the training sample further includes a second sample, and the second sample is an intelligent two-dimensional code generated by a two-dimensional code encoding algorithm.

[0055] In applications, the two-dimensional code encoding algorithm is a two-dimensional code encoding algorithm such as QR code, DM code, etc. The intelligent two-dimensional code is generated based on the binary stream string after using the two-dimensional code encoding algorithm to generate the binary stream string. The intelligent two-dimensional code can represent meaning and conform to the two-dimensional code encoding algorithm. Using the second sample to train the two-dimensional code front-end recognition model enables the two-dimensional code front-end recognition model to better recognize mainstream two-dimensional codes and improve the recognition effect of two-dimensional codes generated by code systems related to mainstream code systems. Reusing two-dimensional code samples of existing code systems improves versatility and reduces training difficulty and cost.

[0056] In a possible implementation, in order to improve the recognition effect of the front-end recognition model, two-dimensional codes in various real-world usage scenarios are obtained.

[0057] Specifically, step S11 includes:

[0058] S111: Collect the basic two-dimensional codes in each scenario to obtain the first image sample.

[0059] S112: Perform sample enhancement processing on some of the first image samples to obtain the second image sample.

[0060] Among them, the first sample includes the first image sample and the second image sample.

[0061] S113: Collect the intelligent two-dimensional codes in each scenario to obtain the third image sample.

[0062] S114: Perform sample enhancement processing on some of the third image samples to obtain the fourth image sample.

[0063] Among them, the second sample includes the third image sample and the fourth image sample.

[0064] In applications, after the basic two-dimensional code is set in each scenario, it is photographed and saved as an image to obtain the first image sample, and after the intelligent two-dimensional code is set in each scenario, it is photographed and saved as an image to obtain the third image sample. For example: being set in each scenario includes being set on materials such as paper, plastic, and screen.

[0065] Then, perform sample enhancement processing such as horizontal flipping, rotation, and Gaussian noise on some of the first image samples and some of the third image samples to add noise to the first image samples and the third image samples for expansion, and obtain the second image samples and the fourth image samples respectively. Use the second image samples and the fourth image samples to train the QR code front-end recognition model to learn QR codes in various situations, and further improve the recognition effect.

[0066] In a possible implementation, some of the first image samples and some of the third image samples contain physical noise. Specifically, add various physical interferences such as defacement and deformation to some of the first image samples and some of the third image samples, so that these image samples contain physical noise, more comprehensively simulate QR codes in various scenarios, enable the trained model to have better generalization performance, and further improve the recognition effect.

[0067] It should be noted that the image samples for adding physical interference and performing sample enhancement processing can be the same or different.

[0068] S12: Use the training samples to train the QR code front-end recognition model to obtain the trained QR code front-end recognition model.

[0069] In a possible implementation, step S12 includes:

[0070] S121: Input the training samples into the QR code front-end recognition model to obtain the first prediction result output by the QR code front-end recognition model.

[0071] Among them, the format of the first prediction result is binary stream data.

[0072] In a possible implementation, the binary stream data is a binary stream matrix.

[0073] S122: Use a preset loss function to determine the loss value of the QR code front-end recognition model according to the first prediction result and the label.

[0074] Among them, the label is the correct binary expression of each sample.

[0075] S123: When the loss value is less than the preset loss value, obtain the trained QR code front-end recognition model.

[0076] In an application, training samples can be divided into a training set, a validation set, and a test set, which do not overlap with each other. The samples in the training set are used to train the QR code front-end recognition model. When the loss value is greater than the preset loss value, the model's own parameters are adjusted according to the loss value and training continues to gradually reduce and converge the training loss value. During the training process, the samples in the validation set are used to train the QR code front-end recognition model. When the loss value is greater than the preset loss value, the model hyperparameters are adjusted according to the loss value and the model performance is evaluated to select the optimal model structure, hyperparameter combination, etc., and to prevent the model from overfitting on the training set and improve the generalization ability of the model. And the samples in the test set are used to evaluate the performance of the model in a real scenario. When the loss value is less than the preset loss value, the trained QR code front-end recognition model is obtained.

[0077] In this embodiment, by obtaining training samples, the training samples include first samples, and the first samples are basic QR codes generated by a non-QR code encoding algorithm; using the training samples to train the QR code front-end recognition model to obtain the trained QR code front-end recognition model; based on the fact that QR codes are all represented in the form of an aggregation of alternating black and white square modules, the basic QR codes generated by the non-QR code encoding algorithm can include QR codes with representational meanings and conforming to the code system. Using the irregular basic QR codes to train the QR code front-end recognition model enables the QR code front-end recognition model to recognize QR codes of various code systems during the training process, obtaining a general QR code front-end recognition model and reducing costs.

[0078] It can be understood that QR codes are all represented in the form of an aggregation of alternating black and white square modules, and the QR code front-end recognition model is trained with the first samples. During the training process, the QR code front-end recognition model learns the features, patterns, and rules of various QR codes. The first samples enable the QR code front-end recognition model to have the ability of analogy and transfer learning, be able to recognize QR codes of all code systems, and have generality. That is, the trained QR code front-end recognition model can be compatible with existing code systems and new code systems, and is applicable to any QR code with alternating black and white square modules, without the need to develop a separate front-end recognition technology for each code system QR code, reducing the difficulty of developing the front-end recognition technology and reducing costs.

[0079] And the general QR code front-end recognition model can solve the fragmentation of the front-end recognition technologies for various code systems. Fragmentation means that when developing the front-end recognition technology, the training samples of QR codes of other code systems cannot be used, and only a corresponding set of front-end recognition technologies can be developed. For example: when developing the front-end recognition model for the DM code, the training sample diagram of the QR code cannot be used, nor can the characteristics of the QR code's back-to-back shape be used for detection and positioning, and only a corresponding set of front-end recognition technologies can be developed.

[0080] When the trained front-end QR code recognition model can be compatible with existing code systems and new code systems, and is applicable to any QR code with alternating black and white square modules, it also makes the front-end recognition not limited to the positioning pattern, which can simplify the subsequent development of new code systems. Developers can focus on the encoding and back-end decoding parts without paying attention to the front-end recognition part, reducing the difficulty and workload of developing new code systems, and increasing the possibility of more expressions. For example, the content related to the positioning pattern in the QR code can be removed, and by fusing the image into the QR code of a certain code system, a QR code with strong visual effects and recognizable by the trained front-end QR code recognition model can be obtained, realizing more expression possibilities.

[0081] In one embodiment, Figure 2 is the second process schematic diagram of the training method of the front-end QR code recognition model provided by an embodiment of the present application. As Figure 2 shown, after obtaining the trained front-end QR code recognition model, it further includes:

[0082] S13: Obtain the QR code to be recognized.

[0083] In an application, the QR code to be recognized can be a basic QR code or an intelligent QR code.

[0084] S14: Input the QR code to be recognized into the trained front-end QR code recognition model to obtain the second prediction result output by the trained front-end QR code recognition model.

[0085] Among them, the format of the second prediction result is binary stream data.

[0086] In a possible implementation, the binary stream data is a binary stream matrix.

[0087] S15: Use each QR code decoding algorithm to decode the second prediction result.

[0088] In an application, the QR code decoding algorithm can be polled to decode the second prediction result.

[0089] S16: If the decoding is successful, obtain the decoding result of the second prediction result.

[0090] In an application, when the QR code to be recognized represents a meaning, obtain the corresponding decoding result. When the QR code to be recognized does not represent a meaning or has heavy physical noise and cannot be decoded successfully, the decoding result of the second prediction result cannot be obtained.

[0091] In this embodiment, by inputting the QR code to be recognized into the trained front-end QR code recognition model to obtain the second prediction result output by the trained front-end QR code recognition model, QR codes of various code systems can be recognized; and by using each QR code decoding algorithm to decode the second prediction result; if the decoding is successful, obtain the decoding result of the second prediction result, ensuring the acquisition of the decoding results of QR codes of various code systems.

[0092] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the sequence of execution. The execution sequence of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. And the data collection in the above embodiments is compliant, and its use or implementation does not involve harming the public interest.

[0093] Corresponding to the method described in the above embodiments, for the convenience of description, only the parts related to the embodiments of the present application are shown.

[0094] In one embodiment, Figure 3 is a schematic structural diagram of a training device for a two-dimensional code front-end recognition model provided by an embodiment of the present application. As Figure 3 shown, the device includes:

[0095] An acquisition module 10, configured to acquire training samples, where the training samples include first samples, and the first samples are basic two-dimensional codes generated by a non-two-dimensional code encoding algorithm.

[0096] A training module 11, configured to use the training samples to train a two-dimensional code front-end recognition model to obtain a trained two-dimensional code front-end recognition model.

[0097] In one embodiment, the device further includes a decoding module;

[0098] The acquisition module is further configured to acquire a two-dimensional code to be recognized;

[0099] The decoding module is configured to input the two-dimensional code to be recognized into the trained two-dimensional code front-end recognition model to obtain a second prediction result output by the trained two-dimensional code front-end recognition model, and the format of the second prediction result is binary stream data;

[0100] It is further configured to decode the second prediction result by using each two-dimensional code decoding algorithm;

[0101] It is further configured to obtain the decoding result of the second prediction result if the decoding is successful.

[0102] In one embodiment, the acquisition module is specifically configured to collect basic two-dimensional codes in each scenario to obtain a first image sample; perform sample enhancement processing on part of the first image samples to obtain a second image sample, and the first samples include the first image sample and the second image sample; collect intelligent two-dimensional codes in each scenario to obtain a third image sample; perform sample enhancement processing on part of the third image samples to obtain a fourth image sample, and the second samples include the third image sample and the fourth image sample.

[0103] In one embodiment, the training module is specifically configured to input training samples into the front-end QR code recognition model to obtain a first prediction result output by the front-end QR code recognition model, where the format of the first prediction result is binary stream data; use a preset loss function to determine the loss value of the front-end QR code recognition model according to the first prediction result and the label; when the loss value is less than the preset loss value, obtain the trained front-end QR code recognition model.

[0104] Figure 4 FIG. is a schematic structural diagram of an electronic device provided in an embodiment of the present application. As Figure 4 shown, the electronic device 2 of this embodiment includes: at least one processor 20 ( Figure 4 only one is shown in the figure), a memory 21, and a computer program 22 stored in the memory 21 and executable on the at least one processor 20. When the processor 20 executes the computer program 22, the steps in any of the above method embodiments are implemented.

[0105] The electronic device 2 may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The electronic device 2 may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art can understand that Figure 4 merely examples of the electronic device 2, which do not constitute a limitation on the electronic device 2, and may include more or fewer components than shown in the figure, or combine some components, or different components. For example, it may also include input / output devices, network access devices, etc.

[0106] The processor 20 may be a central processing unit (CPU), and the processor 20 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0107] The memory 21 may be an internal storage unit of the electronic device 2 in some embodiments, such as the hard disk or memory of the electronic device 2. The memory 21 may also be an external storage device of the electronic device 2 in other embodiments, such as a plug-in hard disk equipped on the electronic device 2, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 21 may also include both the internal storage unit and the external storage device of the electronic device 2. The memory 21 is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of the computer program. The memory 21 may also be used to temporarily store data that has been output or will be output.

[0108] It should be noted that for the content such as information interaction and execution process between the above-mentioned device / units, since it is based on the same concept as the method embodiments of the present application, for its specific functions and the technical effects brought, reference may be specifically made to the method embodiments section, and details will not be elaborated here.

[0109] Those skilled in the art can clearly understand that for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments, and details will not be elaborated here.

[0110] The embodiments of the present application also provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments can be implemented.

[0111] The embodiments of the present application provide a computer program product, and when the computer program product runs on an electronic device, the electronic device can implement the steps in the above method embodiments when executed.

[0112] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-mentioned embodiment methods of this application, a computer program can be used to instruct the relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some cases, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.

[0113] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0114] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0115] In the embodiments provided in this application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.

[0116] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A training method for a front-end recognition model of two-dimensional codes, characterized in that, Including: Obtain training samples, where the training samples include first samples, and the first samples are basic two-dimensional codes generated by a non-two-dimensional code encoding algorithm; Utilize the training samples to train a two-dimensional code front-end recognition model to obtain a trained two-dimensional code front-end recognition model.

2. The method according to claim 1, wherein The training samples further include second samples, and the second samples are intelligent two-dimensional codes generated by a two-dimensional code encoding algorithm.

3. The method according to claim 1, characterized in that: The basic two-dimensional code is generated from a binary stream matrix containing 1s and 0s, and the distribution probability of 1s is greater than a preset probability.

4. The method according to claim 2, wherein The obtaining of the training samples includes: Collect the basic two-dimensional codes of each scenario to obtain first image samples; Perform sample enhancement processing on some of the first image samples to obtain second image samples, and the first samples include the first image samples and the second image samples; Collect the intelligent two-dimensional codes of each scenario to obtain third image samples; Perform sample enhancement processing on some of the third image samples to obtain fourth image samples, and the second samples include the third image samples and the fourth image samples.

5. The method according to claim 3, wherein Some of the first image samples and some of the third image samples contain physical noise.

6. The method according to any one of claims 1 to 5, characterized in that The utilizing of the training samples to train a two-dimensional code front-end recognition model to obtain a trained two-dimensional code front-end recognition model includes: Input the training samples into the two-dimensional code front-end recognition model to obtain a first prediction result output by the two-dimensional code front-end recognition model, and the format of the first prediction result is binary stream data; Utilize a preset loss function to determine the loss value of the two-dimensional code front-end recognition model according to the first prediction result and the label; When the loss value is less than a preset loss value, obtain the trained two-dimensional code front-end recognition model.

7. The method according to claim 6, characterized in that, After obtaining the trained two-dimensional code front-end recognition model, it further includes: Obtain a two-dimensional code to be recognized; Input the two-dimensional code to be recognized into the trained two-dimensional code front-end recognition model to obtain a second prediction result output by the trained two-dimensional code front-end recognition model, and the format of the second prediction result is binary stream data; Utilize various two-dimensional code decoding algorithms to decode the second prediction result; If the decoding is successful, obtain the decoding result of the second prediction result.

8. A training device for a front-end recognition model of two-dimensional codes, characterized in that, Including: An obtaining module for obtaining training samples, where the training samples include first samples, and the first samples are basic two-dimensional codes generated by a non-two-dimensional code encoding algorithm; A training module for utilizing the training samples to train a two-dimensional code front-end recognition model to obtain a trained two-dimensional code front-end recognition model.

9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method according to any one of claims 1 to 7.