Image recognition model training method and device and electronic equipment

The generator generates images similar to those of forged objects and trains them in combination with real images, which solves the problem of insufficient number of image samples of forged objects, improves the accuracy and robustness of the image recognition model, and reduces the risk of overfitting.

CN119723241APending Publication Date: 2025-03-28INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411792286.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Due to the insufficient number of images of forged objects, the image recognition model has poor training effect, low accuracy, and overfitting problems are prone to occur.

Method used

By obtaining images of forged objects and target objects, the generator of the neural network generates a large number of third-type images similar to those of forged objects, and trains them in combination with real images until the generator and judge enter a converging state to form an image recognition model.

Benefits of technology

The sample size of forged object images is significantly increased, the accuracy and robustness of the model is improved, the risk of overfitting is reduced, and the recognition ability of unseen forged object images is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723241A_ABST
    Figure CN119723241A_ABST
Patent Text Reader

Abstract

The invention discloses an image recognition model training method and device and electronic equipment, and relates to the field of artificial intelligence. The method comprises the following steps: acquiring a first type of images and a second type of images; performing multiple first operations on a generator of the neural network according to the first type of images until the generator enters a convergence state; the N third-class images, the N second-class images and the N first-class images are input into a judgment device of a neural network, iteration training is conducted on the judgment device multiple times till the judgment device enters a convergence state, and the judgment device in the convergence state can correctly recognize the image types of the input third-class images, the input second-class images and the input first-class images; and forming an image recognition model by the generator and the judger which enter the convergence state. According to the invention, the technical problems of poor training effect and low model accuracy of an image recognition model for a forged object caused by a small number of image samples for the forged object in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and more specifically, to a method, device and electronic device for training an image recognition model. Background Art

[0002] In the field of image recognition, especially forged object recognition, there is a common technical problem: it is quite difficult to obtain enough forged object image samples. Forged objects, such as counterfeit goods, counterfeit banknotes, forged documents, etc., are often difficult to collect actual samples on a large scale due to their illegal nature. As a result, when building image recognition models, the image datasets of forged objects often have a small number of samples. The lack of sample size seriously limits the training effect of the model, greatly reducing the recognition accuracy and robustness of the model when facing forged objects.

[0003] Existing image recognition models, whether based on traditional machine learning methods or deep learning methods, are highly dependent on large amounts of diverse training data. The size and diversity of the dataset directly affect the generalization ability and recognition performance of the model. When the number of forged object image samples in the dataset is small, the model may be biased when learning the features of the forged objects, resulting in poor recognition results. In addition, small sample sets may also cause overfitting problems, that is, the model performs well on the training data, but the accuracy drops significantly on unseen test data.

[0004] In order to overcome the above problems, some researchers have tried to increase the number of image samples of forged objects through data augmentation techniques, such as rotation, flipping, scaling, brightness adjustment, etc. Although these methods have increased the diversity of the data set to a certain extent, they are based on the transformation of existing image samples and cannot generate new images with different features, so they are limited in improving the accuracy of the model.

[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0006] The embodiments of the present application provide a method, device and electronic device for training an image recognition model to at least solve the technical problem in the prior art that the image recognition model training effect for forged objects is poor and the model accuracy is low due to the small number of image samples for forged objects.

[0007] According to one aspect of an embodiment of the present application, a training method for an image recognition model is provided, comprising: obtaining a first type of image and a second type of image, wherein the first type of image is a photographed image of a forged object, and the second type of image is a photographed image of a target object, and the forged object is an object that imitates the structure of the target object; performing a first operation on a generator of a neural network multiple times according to the first type of image until the generator enters a convergence state, wherein each first operation is used to generate N third type of images based on the first type of image; the third type of image generated by the generator in the convergence state based on the first type of image has a similarity with the first type of image greater than a first threshold; inputting the N third type of images, the second type of image, and the first type of image into a judge of the neural network, and performing multiple iterative training on the judge until the judge enters a convergence state, wherein the judge in the convergence state can correctly identify the image type of each third type of image, the second type of image, and the first type of image input; and forming an image recognition model with the generator and the judger that have entered a convergence state.

[0008] Optionally, each first operation includes the following steps: extracting image features of the first category image through the generator, and generating N third category images based on the first category image; detecting the similarity between each third category image generated by this first operation and the first category image; performing the next first operation when it is detected that the similarity between any third category image generated by this first operation and the first category image is less than or equal to a first threshold; determining that the generator has entered a convergence state and stopping training the generator when it is detected that the similarity between each third category image generated by this first operation and the first category image is greater than the first threshold.

[0009] Optionally, each first operation also includes the following steps: extracting image features of the first category image through the generator, and generating N third category images based on the first category image; detecting the similarity between each third category image generated by this first operation and the first category image; detecting the similarity between each third category image generated by this first operation and the second category image; performing the next first operation when it is detected that the similarity between any third category image generated by this first operation and the first category image is less than or equal to a first threshold, or when it is detected that the similarity between any third category image generated by this first operation and the second category image is less than or equal to a second threshold; determining that the generator has entered a convergence state and stopping training the generator when it is detected that the similarity between each third category image generated by this first operation and the first category image is greater than the first threshold, and when it is detected that the similarity between each third category image generated by this first operation and the second category image is greater than the second threshold and less than the third threshold.

[0010] Optionally, each iterative training of the judge includes the following steps: inputting N third-category images, second-category images, and first-category images into the judgement of the neural network, extracting image features of each input image through the judgement, and determining the image type of each input image based on the extracted image; detecting whether the judger correctly identifies each third-category image, second-category image, and first-category image input to the judger during this iterative training; executing the next iterative training when it is detected that the judger incorrectly identifies any image input to the judger; determining that the judger enters a convergence state and stopping training the judger when it is detected that the judger correctly identifies each third-category image, second-category image, and first-category image input to the judger.

[0011] Optionally, the training method of the image recognition model also includes: updating the weight parameters of the generator according to the similarity between the third category image generated by the i-th first operation and the first category image, and / or the similarity between the third category image generated by the i-th first operation and the second category image, where i is a positive integer and the i-th first operation is not the last first operation; and performing the i+1-th first operation based on the updated generator.

[0012] Optionally, the training method of the image recognition model also includes: updating the weight parameters of the judger according to the image types and the number of images incorrectly recognized by the judger during the j-th iterative training, where j is a positive integer and the j-th iterative training is not the last iterative training of the judger; and performing the j+1-th iterative training based on the updated judger.

[0013] Optionally, extracting image features of the first category of images through a generator includes: extracting features of each pixel of the first category of images; determining pixels in the first category of images that do not belong to forged objects based on the features of each pixel; deleting pixels in the first category of images that do not belong to forged objects to obtain an image to be processed; and extracting image features of the image to be processed through the generator as image features of the first category of images.

[0014] Optionally, the generator and judger that have entered a converged state form an image recognition model, including: obtaining a target image of unknown image type; inputting the target image into the judger of the image recognition model, and determining the image type of the target image based on prior knowledge learned by the judger in multiple iterative trainings.

[0015] According to another aspect of the present application, a training device for an image recognition model is also provided, including: an acquisition unit, used to acquire a first type of image and a second type of image, wherein the first type of image is a photographed image of a forged object, and the second type of image is a photographed image of a target object, and the forged object is an object constructed to imitate the target object; a first processing unit, used to perform multiple first operations on a generator of a neural network according to the first type of image until the generator enters a convergence state, wherein each first operation is used to generate N third type of images based on the first type of image; the third type of image generated by the generator in the convergence state based on the first type of image has a similarity with the first type of image greater than a first threshold; a second processing unit, used to input the N third type of images, the second type of image, and the first type of image into a judge of the neural network, and perform multiple iterative training on the judge until the judge enters a convergence state, wherein the judge in the convergence state can correctly identify the image type of each third type of image, second type of image, and first type of image input; a model determination unit, used to form an image recognition model with the generator and the judger that have entered a convergence state.

[0016] According to another aspect of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned image recognition model training method.

[0017] According to another aspect of the present application, an electronic device is provided, which includes: a memory storing an executable program; and a processor for running the program, wherein the above-mentioned image recognition model training method is executed when the program is running.

[0018] According to another aspect of the present application, a computer program product is also provided, including computer instructions, which implement the above-mentioned image recognition model training method when executed by a processor.

[0019] In the present application, firstly, a first type of image and a second type of image are obtained, wherein the first type of image is a photographed image of a forged object, the second type of image is a photographed image of a target object, and the forged object is an object constructed by imitating the target object. Then, the generator of the neural network is subjected to multiple first operations according to the first type of image until the generator enters a convergence state, wherein each first operation is used to generate N third type of images according to the first type of image; the third type of image generated by the generator in the convergence state according to the first type of image has a similarity with the first type of image greater than a first threshold. Subsequently, the N third type of images, the second type of image, and the first type of image are input into the judge of the neural network, and the judge is iteratively trained for multiple times until the judge enters a convergence state, wherein the judge in the convergence state can correctly identify the image type of each third type of image, the second type of image, and the first type of image input, and finally, the generator and the judge that have entered the convergence state form an image recognition model.

[0020] As can be seen from the above, in the present application, with the help of multiple operations of the generator, a large number of third-class images are generated based on the first-class images (photographed images of forged objects), and these images are highly similar to the first-class images, but they are different in details. The setting of the number of images N generated and the similarity threshold ensures the quality and diversity of the generated images, significantly increases the sample size of the image of the forged object, and overcomes the problem of data scarcity. Secondly, the generated third-class images and the real first-class images together constitute a richer and more diverse training data set. The judge of the neural network learns how to distinguish between true and false images through iterative training, so that the model can correctly identify the image type of each third-class image, second-class image and first-class image input in the convergent state. Compared with only using limited true and false images for training, the method of the present application significantly improves the accuracy and robustness of the model. Furthermore, by using the third-class images generated by the generator, the model learns the various features and changes that may exist in the forged object, which effectively enhances the recognition ability of the image recognition model for the unseen forged object images, that is, the generalization ability of the model. In practical applications, even if the forgery technology is improved or changed, the model can more stably identify forged objects. The generated third type of images are trained together with the real and fake images, which increases the diversity of image styles that the model is exposed to, helps reduce the risk of overfitting when the model is trained on a small sample set, and improves the stability of the model and its performance on new data.

[0021] In summary, the technical solution of the present application effectively solves the technical problems of poor image recognition model training effect and low model accuracy caused by insufficient number of forged object image samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0023] Figure 1 A hardware structure block diagram of a computer terminal for implementing a training method for an image recognition model is shown;

[0024] Figure 2 is a flowchart of an optional image recognition model training method according to an embodiment of the present application;

[0025] Figure 3 is a flowchart of an optional training process of an image recognition model according to an embodiment of the application;

[0026] Figure 4 is a schematic diagram of an optional image recognition model training device according to an embodiment of the present application;

[0027] Figure 5 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] It should also be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.

[0031] According to an embodiment of the present application, an embodiment of a method for training an image recognition model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0032] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a training method for an image recognition model. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0033] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuit may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As in the training method of the image recognition model involved in the embodiments of the present application, the data processing circuit serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0034] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the training method of the image recognition model in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the training method of the above-mentioned image recognition model. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0036] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0037] Under the above operating environment, this application provides Figure 2 The training method of the image recognition model shown. Figure 2 is a flowchart of an optional method for training an image recognition model according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0038] Step S201, obtaining a first type of image and a second type of image.

[0039] In step S201 , the first type of image is a photographed image of a forged object, and the second type of image is a photographed image of a target object. The forged object is an object that imitates the structure of the target object.

[0040] In an optional embodiment, an image recognition system can be used as the execution subject of the state determination method of the task executor of the embodiment of the present application. It is understandable that the training method of the image recognition model provided in the embodiment of the present application can also be performed by other systems or devices, and the embodiment of the present application does not specifically limit this.

[0041] Optionally, the target object may be a real banknote, commodity or the like, and correspondingly, the forged object may be a forged banknote or commodity. In order to facilitate the description of the technical solution of the present application, the target object is a banknote in the financial field as an example, and the forged object is a counterfeit banknote.

[0042] Optionally, regarding the collection of the first type of images, images of counterfeit banknotes produced by different counterfeiting techniques can be collected through formal channels (such as bank recycling), including images taken under different lighting, angles, and background conditions. Ensure that the first type of images covers a variety of styles and features of counterfeit banknotes so that the model can learn comprehensive information about counterfeit banknotes.

[0043] Optionally, images of real banknotes are collected as the second type of images, and they are also ensured to be taken under different environmental conditions, including currencies of different denominations and different countries, so as to increase the generalization ability of the model.

[0044] Optionally, the image recognition system can preprocess the collected first and second category images, including steps such as adjusting image size, graying, and denoising, to ensure that the images have a uniform format and quality before being input into the model to facilitate model recognition.

[0045] Step S202, performing a first operation on a generator of a neural network multiple times according to the first category of images until the generator enters a convergence state, wherein each first operation is used to generate N third category images based on the first category of images; the third category images generated by the generator in the convergence state based on the first category of images have a similarity with the first category images that is greater than a first threshold.

[0046] Optionally, first, a series of counterfeit banknotes (first type of images) are collected to ensure that these counterfeit banknotes cover a variety of counterfeiting techniques and styles to improve the diversity of generated images. At the same time, real banknotes (second type of images) are prepared as comparison samples in model training. Secondly, a generator model is built, which is mainly composed of a mapping network and a synthesis network. The mapping network is used to map random noise to a latent space, while the synthesis network is used to generate a specific image. In this embodiment, the synthesis network is optimized to generate an image that is highly similar to the counterfeit banknote. Then, the counterfeit banknote image is input into the generator, and the generator is trained by multiple first operations. Each first operation generates N third-type images based on the counterfeit banknote image, and the value of N is determined according to computing resources and data requirements, and is usually set to a larger value to increase the diversity of generated images. After each generation operation, an image similarity evaluation algorithm, such as a structural similarity index (SSIM), a peak signal-to-noise ratio (PSNR) or a perceptual hashing algorithm (PHASH), is used to verify whether the similarity between the generated third-type image and the first-type image exceeds a preset first threshold. The setting of the first threshold needs to ensure that the generated image is almost indistinguishable from the counterfeit image visually, but contains certain changes to increase the diversity of the data set. It should be noted that the training goal of the generator is for the generator to enter a convergence state. The criterion for the convergence state is that the generated third-category image can stably maintain a level of similarity with the first-category image that is greater than the first threshold, indicating that the generator has successfully generated sufficiently realistic and diverse counterfeit images.

[0047] Step S203, input N third-category images, second-category images, and first-category images into the judger of the neural network, and perform multiple iterative training on the judger until the judger enters a convergence state, wherein the judger in the convergence state can correctly identify the image type of each input third-category image, second-category image, and first-category image.

[0048] Optionally, integrate the first class of images (counterfeit banknotes), the second class of images (real banknotes), and the generated N third class of images (synthesized counterfeit banknotes). Make sure that the image set contains enough samples to train a high-precision judge. First, assign a label to each image in the dataset, for example, the first class of images (0, counterfeit banknotes) and the third class of images (1, synthetic counterfeit banknotes), and the second class of images are assigned a real banknote label (such as 2).

[0049] Optionally, a neural network judge is constructed, usually using a deep convolutional neural network (DCNN) architecture. The goal of the judge is to learn how to distinguish between genuine and counterfeit banknote images and give the correct image type label. First, set the training parameters, including learning rate, number of iterations (number of training rounds), batch size, etc. Select a suitable loss function, such as a cross entropy loss function, to guide the optimization direction of the model. Then the first class image, the second class image, and the third class image are input into the judge for multiple iterations of training. In each iteration, the judge classifies the input image and adjusts the model parameters according to the difference between the classification result and the true label through the back propagation algorithm. The training process continues until the judge reaches a convergence state. The judgment criterion of the convergence state is that the classification accuracy of the judge for each input image (first class, second class, and third class) reaches a preset high level, and in multiple consecutive iterations, the loss function value of the model no longer decreases significantly, indicating that the model has learned effective features for distinguishing genuine and counterfeit banknotes. After preliminary training to a convergence state, an independent validation data set is used to evaluate the performance of the judge. Based on the validation results, it may be necessary to further adjust the model parameters or optimize the model structure to improve the recognition and generalization capabilities of specific types of counterfeit banknotes.

[0050] Step S204, the generator and the judger that have entered the convergence state form an image recognition model.

[0051] Finally, the judger that has entered the convergence state is combined with the previous generator to form a complete counterfeit banknote recognition system. Such a system can first generate high-quality counterfeit banknote images, and then use the judger to quickly and accurately identify genuine and counterfeit banknotes.

[0052] Through the above technical embodiments, an efficient and accurate judge can be trained, which can not only identify existing counterfeit banknotes and genuine banknote samples, but also improve the recognition ability of newly emerging counterfeit banknote types through learning generated counterfeit banknote images. This not only solves the technical problems of the size and diversity of counterfeit banknote image data sets, but also provides high-performance model support for counterfeit banknote recognition applications, especially in real-time recognition scenarios on mobile devices, which can significantly improve the user experience and the accuracy of counterfeit banknote recognition.

[0053] Based on the contents of the above steps S201 to S204, it can be known that in the present application, with the help of multiple operations of the generator, a large number of third-class images are generated based on the first-class images (photographed images of forged objects), and these images are highly similar to the first-class images, but differ in details. The setting of the number of images N generated and the similarity threshold ensures the quality and diversity of the generated images, significantly increases the image sample size of the forged objects, and overcomes the problem of data scarcity. Secondly, the generated third-class images and the real first-class images together constitute a richer and more diverse training data set. The judge of the neural network learns how to distinguish between true and false images through iterative training, so that the model can correctly identify the image type of each third-class image, second-class image and first-class image input in the convergent state. Compared with only using limited true and false images for training, the method of the present application significantly improves the accuracy and robustness of the model. Furthermore, by using the third-class images generated by the generator, the model learns the various features and changes that may exist in the forged objects, which effectively enhances the recognition ability of the image recognition model for the unseen forged object images, that is, the generalization ability of the model. In practical applications, even if the forgery technology is improved or changed, the model can more stably identify forged objects. The generated third type of images are trained together with the real and fake images, which increases the diversity of image styles that the model is exposed to, helps reduce the risk of overfitting when the model is trained on a small sample set, and improves the stability of the model and its performance on new data.

[0054] In summary, the technical solution of the present application effectively solves the technical problems of poor image recognition model training effect and low model accuracy caused by insufficient number of forged object image samples.

[0055] In an optional embodiment, each first operation includes the following steps: extracting image features of the first category image through a generator, and generating N third category images based on the first category image; detecting the similarity between each third category image generated by this first operation and the first category image; executing the next first operation when it is detected that the similarity between any third category image generated by this first operation and the first category image is less than or equal to a first threshold; determining that the generator has entered a convergence state and stopping training the generator when it is detected that the similarity between each third category image generated by this first operation and the first category image is greater than the first threshold.

[0056] Optionally, when training the generator, first configure the training parameters: set the generator's learning rate, number of iterations, batch size and other training parameters to ensure that the generator can effectively learn and generate images. Then, the counterfeit banknote image (first category image) is input into the generator, and the generator extracts the image features of the counterfeit banknote through multi-layer convolution operations, including pattern, texture, color and other information. Subsequently, based on the extracted counterfeit banknote image features, the generator generates N third category images (synthetic counterfeit banknotes). The value of N can be adjusted according to actual needs and computing resources, and is usually set to a larger value to increase the diversity of images. The similarity between each generated third category image and the first category image is calculated, and image similarity evaluation indicators such as structural similarity index (SSIM), peak signal-to-noise ratio (PSNR), feature vector comparison, etc. can be used to quantify the similarity between images.

[0057] Optionally, a first threshold value can be set as a similarity judgment standard. If it is detected that the similarity between any third-category image and the first-category image is less than or equal to the first threshold value, it is considered that the quality of the image generated this time is not enough and the generator needs to be further optimized. If it is detected that the similarity between each third-category image generated by the first operation and the first-category image is greater than the first threshold value, it can be considered that the generator can generate high-quality counterfeit banknote images and enter a convergence state. At this time, stop training the generator; on the contrary, if there is a situation where the similarity does not meet the standard, continue to perform the next first operation, that is, generate a new third-category image through the generator again, and perform a similarity test. The criterion for the generator to enter a convergence state is that it can stably generate a third-category image whose similarity with the first-category image exceeds the first threshold value, which indicates that the generator has learned the key features of counterfeit banknotes and can generate images that are highly similar to them. Finally, when the generator reaches a convergence state, save the current model parameters, including the weights, biases and other information of the generator, for subsequent training of the counterfeit banknote recognition model.

[0058] Through the above embodiment, it is possible to ensure that the generated third type of image has sufficient similarity with the first type of image, and at the same time, through iterative control and convergence state judgment, the performance of the generator is optimized, and high-quality synthetic counterfeit banknote images are generated, which provides a large amount of diverse training data for the subsequent training of the counterfeit banknote recognition model, and effectively improves the recognition accuracy and generalization ability of the model. In addition, the generated images have a certain degree of variability, which can help the model better learn the complex features of counterfeit banknotes and improve its robustness when facing new counterfeiting technologies.

[0059] In an optional embodiment, each first operation includes the following steps: extracting image features of the first category image through a generator, and generating N third category images based on the first category image; detecting the similarity between each third category image generated by this first operation and the first category image; detecting the similarity between each third category image generated by this first operation and the second category image; performing the next first operation when it is detected that the similarity between any third category image generated by this first operation and the first category image is less than or equal to a first threshold, or when it is detected that the similarity between any third category image generated by this first operation and the second category image is less than or equal to a second threshold; determining that the generator has entered a convergence state and stopping training the generator when it is detected that the similarity between each third category image generated by this first operation and the first category image is greater than the first threshold, and when it is detected that the similarity between each third category image generated by this first operation and the second category image is greater than the second threshold and less than the third threshold.

[0060] Optionally, first construct the generator and discriminator structures, including multi-layer convolutional networks, mapping networks, and upsampling layers, etc., to ensure that the model can generate high-resolution synthetic counterfeit banknote images from low-resolution random noise and counterfeit banknote features. Secondly, initialize the model parameters, set the training hyperparameters, such as learning rate, optimization algorithm (such as Adam), batch size, etc., and similarity thresholds: the first threshold is used to control the similarity between the third category image and the first category image, the second threshold is used to control the similarity between the third category image and the second category image, and the third threshold is used to further distinguish the difference between the third category image and the second category image. Then, the first category image (counterfeit banknote) and the second category image (real banknote) are input into the generator, and the features of the images are extracted through the convolution and mapping networks. Based on the extracted features, the generator generates N third category images (synthetic counterfeit banknotes). The value of N is determined according to the computing resources and the required data set size.

[0061] Optionally, for each third-category image generated, its similarity with the first-category image is calculated respectively to ensure that the generated counterfeit banknote image can highly imitate the original counterfeit banknote, and the similarity must be greater than the first threshold. At the same time, the similarity of each third-category image with the second-category image is calculated to ensure that the synthetic counterfeit banknote image is different from the real banknote image, and the similarity should be greater than the second threshold and less than the third threshold. This can avoid the generated image being too close to the real banknote, affecting the performance of the discriminator. If it is detected that the similarity of any third-category image with the first-category image is less than or equal to the first threshold, or the similarity with the second-category image is less than or equal to the second threshold, it indicates that the generator has not fully grasped the difference between counterfeit banknotes and real banknotes, and needs to continue to perform the next first operation, that is, generate the image again and perform similarity detection.

[0062] Finally, when the similarity of all the generated third-category images with the first-category images is greater than the first threshold, and the similarity with the second-category images is greater than the second threshold and less than the third threshold, the generator is considered to have entered a convergence state. At this point, the generator can stably generate synthetic counterfeit banknote images that are highly similar to counterfeit banknotes and have a certain difference from real banknotes. When the generator is detected to have entered a convergence state, the training of the generator is stopped. The weights and parameters of the generator are saved for subsequent training and use of the counterfeit banknote recognition algorithm model.

[0063] Through the above technical embodiments, it is possible to ensure that the generator can not only generate synthetic counterfeit banknote images that are highly similar to counterfeit banknotes, but also maintain a certain difference from the real banknote images to avoid model overfitting. This helps to improve the accuracy and robustness of the counterfeit banknote recognition algorithm, especially when dealing with complex counterfeit banknote styles and subtle differences between real and counterfeit banknotes. The generated third type of images can provide more comprehensive training data for the model and improve recognition performance. In addition, by introducing similarity detection of the second type of images, the difficulty and complexity of model training are increased, prompting the model to learn more accurate counterfeit banknote features and improve recognition effects in practical applications.

[0064] In an optional embodiment, each iterative training of the judge includes the following steps: inputting N third-category images, second-category images, and first-category images into the judgement of the neural network, extracting image features of each input image through the judgement, and determining the image type of each input image based on the extracted image; detecting whether the judgement correctly identifies each third-category image, second-category image, and first-category image input to the judgement during this iterative training; executing the next iterative training when it is detected that the judgement incorrectly identifies any image input to the judgement; determining that the judgement enters a convergence state and stopping the training of the judgement when it is detected that the judgement correctly identifies each third-category image, second-category image, and first-category image input to the judgement.

[0065] Optionally, first, the first category of images, the second category of images, and the third category of images are input into the judge. These images may need to be preprocessed, such as scaling and normalization, to adapt to the input requirements of the network. The judge extracts features from each input image through its network structure. For example, the convolution layer is responsible for learning the local features of the image, and the fully connected layer is used to integrate these features to form an abstract representation of the image type judgment. Based on the extracted image features, the judge gives the type judgment result of each image through the output layer, that is, the category label of counterfeit banknotes, real banknotes, or synthetic counterfeit banknotes. The predicted results of the judge are compared with the actual labels of each image, and the loss function (such as cross entropy loss) is calculated. The loss function is used to quantify the difference between the predicted results of the judge and the actual labels, and is the optimization target in the training process.

[0066] Subsequently, the back propagation algorithm can be used to adjust the network parameters of the judge according to the calculated loss function value to minimize the loss and improve the accuracy of the judge in identifying the image type. Perform multiple iterations of training, each of which includes steps such as input image, feature extraction, type judgment and loss calculation. During the iterative training process, the performance of the judge is continuously monitored, including the recognition accuracy and the change trend of the loss function. After each iteration of training, it is detected whether the judge correctly recognizes all input images. If the judge misidentifies any input image (first, second or third category image) in the current iteration, it is considered that the judge has not reached the convergence state, and the next iteration training is required to continue to optimize the model parameters. When it is detected that the judge correctly recognizes all input images in a complete training round, that is, the judge's recognition accuracy for counterfeit banknotes, real banknotes and synthetic counterfeit banknotes reaches the set high level, and the loss function value of multiple consecutive iterations is stable in a small range, it indicates that the judge has entered the convergence state and can stably and accurately judge the image type. After confirming that the judge has entered the convergence state, stop training the judge, save its optimal parameters, and use it for the subsequent application of the counterfeit banknote recognition algorithm.

[0067] Through the above technical embodiments, it can be ensured that the judge can accurately identify counterfeit banknotes, real banknotes and synthetic counterfeit banknote images generated by the generator after sufficient training. This iterative training method based on deep learning can enable the judge to learn complex and subtle image features, improve its recognition performance in practical applications, reduce misjudgments and missed judgments, and is particularly suitable for processing counterfeit banknote recognition tasks with high similarity and complex changes.

[0068] In an optional embodiment, the training method of the image recognition model also includes: updating the weight parameters of the generator based on the similarity between the third category image generated by the i-th first operation and the first category image, and / or the similarity between the third category image generated by the i-th first operation and the second category image, wherein i is a positive integer and the i-th first operation is not the last first operation; and performing the i+1-th first operation based on the updated generator.

[0069] Optionally, when performing the i-th first operation, it includes:

[0070] Step 1: Input the first type of image (counterfeit banknote image) into the generator to generate N third type of images (synthetic counterfeit banknote images).

[0071] Step 2: Calculate the similarity between each generated third-category image and the first-category image. A variety of image similarity evaluation methods can be used, such as structural similarity index (SSIM), peak signal-to-noise ratio (PSNR), or Euclidean distance of feature vectors.

[0072] Step three, calculate the similarity between each generated third-category image and the second-category image to ensure that the generated image maintains a certain difference from the real banknote image to avoid overfitting.

[0073] Step 4: Update the weight parameters of the generator through the back propagation algorithm based on the similarity results and the loss function (usually an adversarial loss function, which may be combined with other losses such as reconstruction loss). The purpose of the update is to make the generated third-category images closer to the first-category images while maintaining a certain distance from the second-category images. Detect whether the generator has entered a convergence state, that is, whether the similarity between the generated third-category images and the first-category images is stable at a high level, while the similarity with the second-category images is stable at an acceptable low level, indicating that the generator can stably generate high-quality counterfeit banknote images.

[0074] If the generator has not yet entered the convergence state, use the updated generator to perform the i+1th first operation, that is, generate N third-category images again, and repeat steps 2 to 4 to continuously iterate and optimize the performance of the generator.

[0075] When it is detected that the generator has entered a convergence state, that is, in multiple consecutive first operations, the similarity between the generated third-category images and the first-category images is always greater than the first threshold, and the similarity with the second-category images is always greater than the second threshold and less than the third threshold, it indicates that the generator has been able to stably generate high-quality counterfeit banknote images, and the training of the generator can be stopped at this time.

[0076] Through the above technical embodiments, it is possible to ensure that the generator continuously adjusts its weight parameters during the iterative training process according to the similarity feedback between the generated image and the counterfeit banknote and the real banknote image, and finally generates a synthetic counterfeit banknote image that is highly similar to the counterfeit banknote and has a certain difference from the real banknote. This iterative optimization mechanism based on similarity feedback helps to improve the generation quality of the generator and the robustness of the model, and provides a higher quality and more diverse counterfeit banknote image dataset for the subsequent training of the counterfeit banknote recognition model.

[0077] In actual operation, the weight update of the generator may involve complex gradient calculations and optimization algorithms (such as Adam, SGD, etc.), and hyperparameters such as learning rate and momentum need to be adjusted according to actual conditions to accelerate the convergence process and avoid training instability. In addition, in order to ensure the quality of the generated images, it may be necessary to add additional loss functions, such as regularization loss, to control the complexity of the generated images and prevent the generator from learning invalid or overly complex image features. By comprehensively considering these factors, the training process of the generator can be further optimized to improve its ability and efficiency in generating counterfeit banknote images.

[0078] In an optional embodiment, the training method of the image recognition model also includes: updating the weight parameters of the judger according to the image types and the number of images incorrectly recognized by the judger during the j-th iterative training, where j is a positive integer and the j-th iterative training is not the last iterative training of the judger; and performing the j+1-th iterative training based on the updated judger.

[0079] Optionally, when performing the j-th iteration training, including:

[0080] Step 1: Input the first type of image (counterfeit banknote), the second type of image (genuine banknote) and the third type of image (synthesized counterfeit banknote) into the judge to predict the image type. The difference between the judge's prediction result and the actual image type is recorded, that is, the case of misidentification.

[0081] Step 2: Calculate the loss function (such as cross entropy loss) based on the type and number of images that the discriminator misidentified in the jth iteration training. The value of the loss function reflects the gap between the discriminator's prediction results and the actual image labels, and is the goal to be optimized during the training process.

[0082] Step 3: Use the back propagation algorithm and optimizer (such as Adam, SGD) to update the weight parameters of the judge. The optimizer adjusts the weight parameters according to the calculated gradient of the loss function to reduce errors in future predictions and improve the accuracy of identifying counterfeit, real and synthetic banknotes.

[0083] Step 4: Check whether the performance of the judge has reached the preset convergence conditions, which usually include the error recognition rate being reduced to a certain level, the loss function value being stable within a small range, and the recognition accuracy not being significantly improved in multiple consecutive iterations of training.

[0084] If the judge has not yet entered the convergence state, the updated weight parameters are used for the j+1th iteration training, and the model is continuously optimized until the performance of the judge is stable and reaches the preset convergence condition.

[0085] When the judge enters the convergence state, that is, in multiple consecutive iterative training, the type and number of incorrectly identified images stabilize at a low level, and the loss function value reaches the minimum and remains stable, it indicates that the judge can stably and accurately identify counterfeit banknotes, real banknotes and synthetic counterfeit banknotes. At this time, the training of the judge can be stopped.

[0086] Through the above technical embodiments, it is possible to ensure that the judgement device, in the iterative training process, continuously updates its weight parameters according to the image type and quantity feedback of its wrong recognition, so as to improve the recognition accuracy of counterfeit banknotes, real banknotes and synthetic counterfeit banknotes. This training mechanism based on feedback helps to improve the recognition ability and robustness of the judgement device, so that it can make more accurate judgments when facing complex images and rich image types. In actual operation, it may be necessary to regularly adjust hyperparameters such as learning rate to avoid early stopping or training instability during training. In addition, in order to prevent overfitting, it may also be necessary to add regularization mechanisms, such as weight decay, Dropout, etc., to control model complexity and improve the generalization ability of the judgement device on unseen data. By taking these factors into consideration, the training process of the judgement device can be further optimized to improve its performance in the counterfeit banknote recognition task.

[0087] In an optional embodiment, in order to extract the image features of the first type of image through the generator, the image recognition system can extract the features of each pixel of the first type of image, and then determine the pixels in the first type of image that do not belong to the forged object according to the features of each pixel, delete the pixels in the first type of image that do not belong to the forged object, and obtain the image to be processed. Finally, the image features of the image to be processed are extracted by the generator as the image features of the first type of image.

[0088] Optionally, when using the first type of image training generator, the training generator can be subjected to image preprocessing operations, including: inputting the first type of image (counterfeit banknote image) into the image recognition system. Before input, the image is grayed, scaled, normalized, and the like to ensure that the input of the image recognition system meets the requirements. The image recognition system also extracts features from each pixel of the counterfeit banknote image, which usually involves multi-layer convolution operations to learn features such as color, texture, and shape of the pixel. Using the results of feature extraction, the image recognition system determines whether each pixel in the counterfeit banknote image belongs to a counterfeit object (counterfeit banknote). This can be achieved by setting a threshold or using a specific algorithm (such as conditional random field CRF, full convolution network FCN) to distinguish between the counterfeit banknote area and the background area. Subsequently, the image recognition system deletes the pixels in the counterfeit banknote image that do not belong to the counterfeit object, that is, removes the background information, and only retains the pixel information of the counterfeit banknote area to obtain the image to be processed. This process can improve the generator's ability to capture counterfeit banknote features and reduce the impact of background noise on generator training.

[0089] Through the above technical embodiments, we can ensure that the image recognition system can accurately extract the pixel features of the counterfeit banknote image, identify and retain the pixel information of the counterfeit object, and obtain the image to be processed. The generation of the image to be processed is conducive to reducing the impact of background noise on the generator training and improving the learning efficiency of the generator for counterfeit banknote features. Finally, by extracting the features of the image to be processed by the generator for training, more realistic and high-quality counterfeit banknote images can be generated, providing a more accurate and rich data set for the subsequent training of the counterfeit banknote recognition algorithm, thereby improving the accuracy and robustness of the recognition algorithm.

[0090] It should be noted that, when training the judger, the above-mentioned image preprocessing operation may also be performed on the training image input to the judger, and this application will not make unnecessary repetitions for this.

[0091] Optionally, after the generator and judger that have entered the convergence state are combined into an image recognition model, the image recognition system can obtain a target image of unknown image type, and then input the target image into the judger of the image recognition model to determine the image type of the target image based on the prior knowledge learned by the judger in multiple iterative trainings.

[0092] Figure 3 is a flowchart of an optional image recognition model training process according to an embodiment of the application, such as Figure 3 As shown, the present application aims to provide a lightweight counterfeit banknote recognition algorithm, which is optimized for mobile devices to achieve efficient and accurate counterfeit banknote identification. The algorithm is divided into three core stages: data set enhancement, model design and training, and algorithm optimization, and each stage adopts advanced and targeted technical solutions. First, a generative adversarial network (GAN) algorithm is used to expand the counterfeit banknote data set to significantly increase the diversity and quality of the data. The generative adversarial network (GAN) algorithm can create synthetic images similar in style to the original counterfeit banknote images by interpolating and transforming in the latent space. These images have high resolution and realism and are difficult to distinguish from real counterfeit banknotes. Through this method, the coverage of the data set is significantly improved, and the generalization ability and robustness of the model are enhanced, especially when faced with complex and changeable counterfeit banknote styles, which can effectively improve the recognition accuracy.

[0093] Then, the expanded counterfeit banknote dataset and the real banknote dataset are integrated, and each image is labeled with the image type to build a comprehensive dataset. On this basis, a lightweight neural network architecture can be selected for model training. The lightweight neural network architecture has the characteristics of efficient computing and low resource consumption, which is very suitable for the computing environment of mobile devices. Through a large amount of training and verification, and optimizing model parameters, we can obtain a powerful counterfeit banknote recognition algorithm model suitable for mobile devices.

[0094] In the process of algorithm optimization, in order to further improve the accuracy and efficiency of the recognition algorithm in practical applications, the background pixel recognition algorithm can be used to process image segmentation and background removal. For example, the image of banknotes can be accurately extracted from complex images taken by mobile phones, and interfering background information can be removed, thereby significantly improving the accuracy of counterfeit banknote recognition. The optimized image is then input into the lightweight counterfeit banknote recognition model to ensure the accuracy and reliability of the final recognition result.

[0095] According to another aspect of the embodiment of the present application, a training device for an image recognition model is also provided, wherein: Figure 4 is a schematic diagram of an optional image recognition model training device according to an embodiment of the present application, such as Figure 4 As shown, the training device of the image recognition model includes: an acquisition unit 401, a first processing unit 402, a second processing unit 403, and a model determination unit 404.

[0096] Optionally, an acquisition unit 401 is used to acquire a first type of image and a second type of image, wherein the first type of image is a photographed image of a forged object, and the second type of image is a photographed image of a target object, and the forged object is an object that imitates the structure of the target object; a first processing unit 402 is used to perform multiple first operations on a generator of a neural network according to the first type of image until the generator enters a convergence state, wherein each first operation is used to generate N third type of images based on the first type of image; the third type of image generated by the generator in the convergence state based on the first type of image has a similarity with the first type of image greater than a first threshold; a second processing unit 403 is used to input the N third type of images, the second type of image, and the first type of image into a judge of the neural network, and perform multiple iterative training on the judge until the judge enters a convergence state, wherein the judge in the convergence state can correctly identify the image type of each third type of image, second type of image, and first type of image input; a model determination unit 404 is used to form an image recognition model by the generator and the judger that have entered a convergence state.

[0097] Optionally, the first processing unit 402 includes: a first processing subunit, a second processing subunit, a third processing subunit and a fourth processing subunit. The first processing subunit is used to extract the image features of the first type of image through the generator, and generate N third type of images according to the first type of image; the second processing subunit is used to detect the similarity between each third type of image generated by the first operation and the first type of image; the third processing subunit is used to perform the next first operation when it is detected that the similarity between any third type of image generated by the first operation and the first type of image is less than or equal to the first threshold; the fourth processing subunit is used to determine that the generator has entered a convergence state and stop training the generator when it is detected that the similarity between each third type of image generated by the first operation and the first type of image is greater than the first threshold.

[0098] Optionally, the first processing unit 402 includes: a fifth processing subunit, a sixth processing subunit, a seventh processing subunit, and an eighth processing subunit. The fifth processing subunit is used to extract image features of the first type of image through the generator, and generate N third type of images according to the first type of image; the sixth processing subunit is used to detect the similarity between each third type of image generated by the first operation and the first type of image; and detect the similarity between each third type of image generated by the first operation and the second type of image; the seventh processing subunit is used to perform the next first operation when it is detected that the similarity between any third type of image generated by the first operation and the first type of image is less than or equal to the first threshold, or when it is detected that the similarity between any third type of image generated by the first operation and the second type of image is less than or equal to the second threshold; and the eighth processing subunit is used to determine that the generator enters a convergence state and stops training the generator when it is detected that the similarity between each third type of image generated by the first operation and the first type of image is greater than the first threshold, and when it is detected that the similarity between each third type of image generated by the first operation and the second type of image is greater than the second threshold and less than the third threshold.

[0099] Optionally, the second processing unit 403 includes: a ninth processing subunit, a tenth processing subunit, an eleventh processing subunit and a twelfth processing subunit. The ninth processing subunit is used to input N third-category images, second-category images and first-category images into the judge of the neural network, extract the image features of each input image through the judge, and determine the image type of each input image according to the extracted image; the tenth processing subunit is used to detect whether the judge correctly identifies each third-category image, second-category image and first-category image input to the judge during this iterative training; the eleventh processing subunit is used to perform the next iterative training when it is detected that the judge incorrectly identifies any image input to the judge; the twelfth processing subunit is used to determine that the judge enters a convergence state and stops training the judge when it is detected that the judge correctly identifies each third-category image, second-category image and first-category image input to the judge.

[0100] Optionally, the training device of the image recognition model also includes: a first updating unit, used to update the weight parameters of the generator according to the similarity between the third category image generated by the i-th first operation and the first category image, and / or the similarity between the third category image generated by the i-th first operation and the second category image, wherein i is a positive integer and the i-th first operation is not the last first operation; and perform the i+1-th first operation based on the updated generator.

[0101] Optionally, the training device of the image recognition model also includes: a second updating unit, used to update the weight parameters of the judger according to the type of images incorrectly recognized and the number of images incorrectly recognized by the judger during the j-th iterative training, wherein j is a positive integer and the j-th iterative training is not the last iterative training of the judger; and perform the j+1-th iterative training based on the updated judge.

[0102] Optionally, the training device of the image recognition model also includes: a pixel processing unit, used to extract features of each pixel point of the first category of images; determine the pixels in the first category of images that do not belong to the forged objects based on the features of each pixel point; delete the pixels in the first category of images that do not belong to the forged objects to obtain the image to be processed; and extract the image features of the image to be processed through the generator as the image features of the first category of images.

[0103] Optionally, the training device of the image recognition model also includes: a model application unit, used to obtain a target image of an unknown image type; input the target image into a judge of the image recognition model, and determine the image type of the target image based on prior knowledge learned by the judge in multiple iterative trainings.

[0104] An embodiment of the present application may also provide an electronic device, Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5 Only one is shown) a processor, a memory, a storage controller, and a peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display.

[0105] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the training method of the above-mentioned image recognition model. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0106] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain a first type of image and a second type of image, wherein the first type of image is a photographed image of a forged object, and the second type of image is a photographed image of a target object, and the forged object is an object that imitates the structure of the target object; perform multiple first operations on the generator of the neural network according to the first type of image until the generator enters a convergence state, wherein each first operation is used to generate N third type of images based on the first type of image; the third type of image generated by the generator in the convergence state based on the first type of image has a similarity with the first type of image greater than a first threshold; input the N third type of images, the second type of image and the first type of image into the judgement of the neural network, and perform multiple iterative training on the judgement until the judgement enters a convergence state, wherein the judgement in the convergence state can correctly identify the image type of each third type of image, the second type of image and the first type of image input; the generator and the judgement that have entered the convergence state form an image recognition model.

[0107] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: extract the image features of the first category of images through the generator, and generate N third category images based on the first category of images; detect the similarity between each third category image generated by this first operation and the first category image; when it is detected that the similarity between any third category image generated by this first operation and the first category image is less than or equal to the first threshold, perform the next first operation; when it is detected that the similarity between each third category image generated by this first operation and the first category image is greater than the first threshold, determine that the generator has entered a convergence state and stop training the generator.

[0108] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: extract the image features of the first category image through the generator, and generate N third category images according to the first category image; detect the similarity between each third category image generated by this first operation and the first category image; detect the similarity between each third category image generated by this first operation and the second category image; when it is detected that the similarity between any third category image generated by this first operation and the first category image is less than or equal to the first threshold, or when it is detected that the similarity between any third category image generated by this first operation and the second category image is less than or equal to the second threshold, perform the next first operation; when it is detected that the similarity between each third category image generated by this first operation and the first category image is greater than the first threshold, and when it is detected that the similarity between each third category image generated by this first operation and the second category image is greater than the second threshold and less than the third threshold, determine that the generator has entered a convergence state and stop training the generator.

[0109] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: input N third-category images, second-category images and first-category images into the judgement of the neural network, extract the image features of each input image through the judgement, and determine the image type of each input image based on the extracted image; detect whether the judgement correctly identifies each third-category image, second-category image and first-category image input to the judgement during this iterative training; if it is detected that the judgement incorrectly identifies any image of the input value judgement, perform the next iterative training; if it is detected that the judgement correctly identifies each third-category image, second-category image and first-category image input to the judgement, determine that the judgement enters a convergence state and stop training the judgement.

[0110] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: update the weight parameters of the generator based on the similarity between the third category image generated by the i-th first operation and the first category image, and / or the similarity between the third category image generated by the i-th first operation and the second category image, where i is a positive integer and the i-th first operation is not the last first operation; and perform the i+1-th first operation based on the updated generator.

[0111] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: update the weight parameters of the judgement according to the image type and the number of images incorrectly recognized by the judgement during the j-th iterative training, where j is a positive integer and the j-th iterative training is not the last iterative training of the judgement; and perform the j+1-th iterative training based on the updated judgement.

[0112] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 5 The structure of the electronic device is not limited. Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations are shown.

[0113] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0114] According to another aspect of the present application, a computer program product is also provided, comprising computer instructions, characterized in that when the computer instructions are executed by a processor, the steps of the above-mentioned image recognition model training method are implemented.

[0115] According to another aspect of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned image recognition model training method.

[0116] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0117] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0118] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0120] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0121] If 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, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0122] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A training method for an image recognition model, characterized in that: include: Acquire a first type of image and a second type of image, wherein the first type of image is a photographed image of a forged object, and the second type of image is a photographed image of a target object, and the forged object is an object that imitates the structure of the target object; Performing a first operation on a generator of a neural network multiple times according to the first type of image until the generator enters a convergence state, wherein each first operation is used to generate N third type of images according to the first type of image; the third type of image generated by the generator in the convergence state according to the first type of image has a similarity with the first type of image greater than a first threshold; Inputting the N third-category images, the second-category images, and the first-category images into the judger of the neural network, and performing multiple iterations of training on the judger until the judger enters a convergence state, wherein the judger in the convergence state can correctly identify the image type of each input third-category image, second-category image, and first-category image; The generator and the judger that enter the convergence state form an image recognition model.

2. The method for training an image recognition model according to claim 1, characterized in that: Each first operation comprises the following steps: Extracting image features of the first category of images by the generator, and generating N third category images according to the first category of images; Detecting the similarity between each third-category image generated by the first operation and the first-category image; When it is detected that the similarity between any third-category image generated by the current first operation and the first-category image is less than or equal to the first threshold, performing the next first operation; When it is detected that the similarity between each third-category image generated by the first operation and the first-category image is greater than the first threshold, it is determined that the generator enters a convergence state, and the training of the generator is stopped.

3. The training method of the image recognition model according to claim 1, characterized in that: Each first operation comprises the following steps: Extracting image features of the first category of images by the generator, and generating N third category images according to the first category of images; Detecting the similarity between each third-category image generated by the first operation and the first-category image; detecting the similarity between each third-category image generated by the first operation and the second-category image; When it is detected that the similarity between any one of the third-category images generated by the first operation and the first-category images is less than or equal to the first threshold, or when it is detected that the similarity between any one of the third-category images generated by the first operation and the second-category images is less than or equal to the second threshold, performing the first operation next time; When it is detected that the similarity between each third-category image generated by this first operation and the first-category image is greater than the first threshold, and when it is detected that the similarity between each third-category image generated by this first operation and the second-category image is greater than the second threshold and less than the third threshold, it is determined that the generator has entered a convergence state and the training of the generator is stopped.

4. The method for training an image recognition model according to claim 1, characterized in that: Each iteration of training the judge includes the following steps: Inputting the N third-category images, the second-category images, and the first-category images into a judgement device of the neural network, extracting image features of each input image through the judgement device, and determining the image type of each input image according to the extracted image; During the iterative training, the judger correctly identifies each third-category image, second-category image, and first-category image input to the judger; In case it is detected that the judger mistakenly identifies an image of any input value of the judger, performing the next iterative training; When it is detected that the judger correctly identifies each third-category image, second-category image, and first-category image input to the judger, it is determined that the judger enters a convergence state, and the training of the judger is stopped.

5. The method for training an image recognition model according to claim 1, characterized in that: The training method of the image recognition model also includes: updating the weight parameter of the generator according to the similarity between the third type image generated by the i-th first operation and the first type image, and / or the similarity between the third type image generated by the i-th first operation and the second type image, wherein i is a positive integer and the i-th first operation is not the last first operation; Perform the (i+1)th first operation based on the updated generator.

6. The method for training an image recognition model according to claim 1, characterized in that: The training method of the image recognition model also includes: updating the weight parameters of the judger according to the image types and the number of images incorrectly recognized by the judger during the j-th iterative training, wherein j is a positive integer and the j-th iterative training is not the last iterative training of the judger; Perform the j+1th iterative training based on the updated discriminator.

7. The method for training an image recognition model according to any one of claims 2 or 3, characterized in that: Extracting image features of the first type of images by the generator includes: Extracting features of each pixel of the first type of image; Determining pixels in the first type of image that do not belong to the forged object according to the features of each pixel point; Deleting pixels that do not belong to the forged object in the first type of image to obtain an image to be processed; The generator extracts image features of the image to be processed as image features of the first category of images.

8. The method for training an image recognition model according to claim 1, characterized in that: After the generator and the judger that have entered the converged state form an image recognition model, the training method of the image recognition model further includes: Get a target image of unknown image type; The target image is input into the judgement device of the image recognition model, and the image type of the target image is determined according to the prior knowledge learned by the judgement device in multiple iterations of training.

9. A training device for an image recognition model, characterized in that: include: an acquisition unit, configured to acquire a first type of image and a second type of image, wherein the first type of image is a photographed image of a forged object, and the second type of image is a photographed image of a target object, and the forged object is an object that imitates the structure of the target object; A first processing unit is used to perform a plurality of first operations on a generator of a neural network according to the first type of image until the generator enters a convergence state, wherein each first operation is used to generate N third type of images according to the first type of image; and a similarity between the third type of image generated by the generator in the convergence state according to the first type of image and the first type of image is greater than a first threshold; a second processing unit, configured to input the N third-category images, the second-category images, and the first-category images into a judge of the neural network, and perform multiple iterations of training on the judge until the judge enters a convergence state, wherein the judge in the convergence state can correctly identify the image type of each input third-category image, second-category image, and first-category image; The model determination unit is used to form an image recognition model by combining the generator and the judger that have entered the convergence state.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the training method of the image recognition model described in any one of claims 1 to 8.

11. An electronic device, characterized in that: include: A memory storing an executable program; A processor, used to run the program, wherein the program, when running, executes the training method of the image recognition model described in any one of claims 1 to 8.

12. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the image recognition model training method described in any one of claims 1 to 8 are implemented.