Picture identification method and device

By combining labeled and label-free image samples in the picture recognition model for training, the problem of inefficient image verification in the prior art is solved, and efficient identification and verification of risk images is achieved.

CN119479084APending Publication Date: 2025-02-18ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411231742.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-02-25
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The prior art is difficult to effectively identify and verify the authenticity of pictures uploaded by users, especially when facing illegal means such as remakes of images, which leads to inefficient image verification.

Method used

By entering the image to be identified into the pre-trained picture recognition model, the model is obtained based on the labeled picture samples and the labeled picture samples that meet the preset rules, and then determine whether the image to be identified is a risky picture.

Benefits of technology

It improves the recognition efficiency of risky images, reduces the difficulty of the image verification process, and enhances the detection ability of illegal means such as remakes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119479084A_ABST
    Figure CN119479084A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a picture recognition method and system, and the method comprises the steps: inputting a to-be-recognized picture into a pre-trained picture recognition model, and enabling the picture recognition model to be obtained based on the training of a labeled picture sample and a non-labeled picture sample meeting a preset rule; and obtaining a recognition result of the picture recognition model on the to-be-recognized picture, and determining whether the to-be-recognized picture is a risk picture based on the recognition result. According to the method, whether the input to-be-recognized picture is the risk picture or not is recognized through the picture recognition model obtained through training based on the labeled picture sample and the unlabeled picture sample meeting the preset rule, so that the recognition efficiency of the risk picture is improved, and the difficulty of the picture verification process is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application with application number 202210181146.5, application date February 25, 2022, and invention name “Image recognition method and device”. Technical Field

[0002] The embodiments of the present specification relate to the field of computer technology, and in particular to a method for image recognition. Background Art

[0003] With the continuous development of computer technology, more and more application scenarios (such as those involving finance, insurance or public welfare) require verification of the authenticity of pictures uploaded by users. However, with the improvement of data photography technology, many criminals have come up with endless means to obtain illegal profits by reshooting images, making the picture verification process more and more difficult to verify, resulting in low efficiency of picture verification. Summary of the invention

[0004] In view of this, the present specification provides an image recognition method. One or more embodiments of the present specification also relate to an image recognition device, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a method for image recognition is provided, including:

[0006] Inputting the image to be recognized into a pre-trained image recognition model, wherein the image recognition model is trained based on labeled image samples and unlabeled image samples that meet preset rules;

[0007] Obtain a recognition result of the image recognition model on the image to be recognized, and determine whether the image to be recognized is a risky image based on the recognition result.

[0008] According to a second aspect of the embodiments of this specification, there is provided an image recognition device, including:

[0009] An input module is configured to input the image to be recognized into a pre-trained image recognition model, wherein the image recognition model is trained based on labeled image samples and unlabeled image samples that meet preset rules;

[0010] The determination module is configured to obtain a recognition result of the image recognition model on the image to be recognized, and determine whether the image to be recognized is a risky image based on the recognition result.

[0011] According to a third aspect of an embodiment of this specification, a computing device is provided, including:

[0012] Memory and processor;

[0013] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the image recognition method are implemented.

[0014] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the image recognition method are implemented.

[0015] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the image recognition method.

[0016] The image recognition method provided in this specification includes: inputting a picture to be recognized into a pre-trained picture recognition model, wherein the picture recognition model is trained based on labeled picture samples and unlabeled picture samples that meet preset rules; obtaining the recognition result of the picture recognition model on the picture to be recognized, and determining whether the picture to be recognized is a risky picture based on the recognition result.

[0017] Specifically, the method obtains an image recognition model through training based on labeled image samples and unlabeled image samples that meet preset rules to identify whether the input image to be identified is a risky image, thereby improving the recognition efficiency of risky images and reducing the difficulty of the image verification process. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flow chart of a picture recognition method provided by an embodiment of this specification;

[0019] Figure 2 It is a schematic diagram of a process of model training in a picture recognition method provided by an embodiment of this specification;

[0020] Figure 3 It is a structural schematic diagram of an image recognition device provided by an embodiment of this specification;

[0021] Figure 4 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0022] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0023] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0024] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0025] First, the terms involved in one or more embodiments of this specification are explained.

[0026] Semi-supervised learning: Use a large amount of unlabeled data and labeled data at the same time to perform pattern recognition.

[0027] Hard examples: Examples with the highest loss during model training.

[0028] Data augmentation: refers to the method used to increase the training data set. Through data augmentation, the data set can be made as diverse as possible, making the trained model have stronger generalization capabilities.

[0029] With the continuous development of computer technology, more and more application scenarios (such as those involving finance, insurance or public welfare) require verification of the authenticity of pictures uploaded by users. However, with the improvement of data photography technology, many criminals have come up with new means to obtain illegal profits by reshooting images, making the picture verification process more and more difficult to verify.

[0030] For example, in public welfare scenarios, in order to respond to the call for low-carbon emission reduction, many organizations will launch various low-carbon emission reduction projects to address the serious problem of vehicle exhaust emissions pollution. For example, when a user's weekly vehicle mileage is low, the user will be given a certain reward, and the user needs to upload a picture of the vehicle dashboard taken with a mobile phone to determine the user's vehicle mileage.

[0031] However, during this process, some users will take pictures on their mobile phones or computers to impersonate real dashboard pictures, which is also called "re-shooting". Therefore, when many institutions receive dashboard pictures taken by mobile phones uploaded by users, they need to determine whether the dashboard pictures are re-shot pictures, so as to determine whether the user has cheated.

[0032] Alternatively, in a financial scenario, financial institutions need to verify user identities through methods such as ID image recognition and facial image recognition, so as to prevent criminals from engaging in illegal financial activities by disguising their identities.

[0033] Based on this, in this specification, a picture recognition method is provided. This specification also involves a picture recognition device, a computing device, a computer-readable storage medium and a computer program, which are described in detail one by one in the following embodiments.

[0034] Figure 1 A flowchart of a method for image recognition provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0035] Step 102: Input the image to be recognized into a pre-trained image recognition model, wherein the image recognition model is trained based on labeled image samples and unlabeled image samples that meet preset rules.

[0036] The image to be identified may be understood as an image that needs to be identified as to whether it is risky; for example, a user's face image, a user's ID image, a user's vehicle dashboard image, and the like.

[0037] The image recognition model can be understood as a model that can identify whether the image is risky; in practical applications, the image recognition model can be understood as any model that can identify or detect an image, and this specification does not impose specific restrictions on this. For example, the image recognition model can be a MobileNet V2 (a lightweight convolutional neural network), a CNN (convolutional neural network) model, etc. Correspondingly, the labeled image sample can be understood as a sample that is used to train the image recognition model and has a sample label. The unlabeled image sample can be understood as a sample that is used to train the image recognition model but does not have a sample label.

[0038] In actual applications, the image recognition method provided in this specification is applied in different scenarios, and the image to be recognized is also different; for example, in the case of a financial scenario in which the image recognition method is applied, the image to be recognized can be a user's ID image, a user's paper document image, etc.; accordingly, the image recognition model can be understood as a model that can detect the authenticity of an ID image or a paper document image, that is, a model that detects whether an ID image or a paper document image is a copied image.

[0039] Alternatively, in the case of a security scenario where the image recognition method is applied, the image to be identified may be a user's ID picture, a user's face image, etc.; accordingly, the image recognition model can be understood as a model that can detect the authenticity of an ID picture or a face image, that is, a model that detects whether the ID picture or the face image is a copied picture.

[0040] Alternatively, in the case of a low-carbon emission reduction project scenario where the image recognition method is applied, the image to be identified may be a dashboard image of a user's vehicle, etc.; accordingly, the image recognition model can be understood as a model that can detect the authenticity of the dashboard image, that is, a model that detects whether the dashboard image is a copied image.

[0041] Correspondingly, in the case of different image recognition models, the labeled image samples and unlabeled image samples for training the image recognition models are also different. For example, the labeled image samples may be ID image samples with sample labels, face image samples with sample labels, or dashboard image samples with sample labels. The labeled image samples may be samples containing ID images without sample labels, samples containing face images without sample labels, or samples containing dashboard images without sample labels.

[0042] Specifically, the image recognition method provided in this specification can input the to-be-recognized images that require risk identification into an image recognition model obtained by training with labeled image samples and unlabeled image samples that meet preset rules.

[0043] In practical applications, the preset rules can be set according to the actual application scenario, and this specification does not impose specific restrictions on this. For example, the preset rules can be to mine difficult examples in pseudo-label samples through a semi-supervised method, and determine more valuable samples based on the difficult examples. Thereby, the more valuable samples are added to the training of the image recognition model to improve the performance and training efficiency of the image recognition model.

[0044] The following is a further explanation of the image recognition method provided in this specification for inputting the image to be recognized into a pre-trained image recognition model in the scenario of detecting whether a dashboard image is a copied image, wherein the image to be recognized is a dashboard image of the user's vehicle, and the image recognition model can be understood as an image recognition model that can recognize whether the dashboard image is a copied image. Based on this, the image recognition method provided in this specification can input the dashboard image of the user's vehicle into the image recognition model that can recognize whether the dashboard image is a copied image.

[0045] In one embodiment provided in this specification, before the image to be identified is input into the image recognition model, the image recognition model needs to be trained. Therefore, two solutions for the image recognition model are provided in this specification. The first solution is to train a convolutional neural network by manually annotating limited sample data, so as to realize the recognition of reproduced images. However, this solution has two disadvantages. The first is that the amount of sample data is very large, resulting in very high manual annotation costs and a long annotation time; and it also causes low model iteration efficiency. The second aspect is that the number of labeled resources is small under limited manpower, resulting in poor generalization of the model.

[0046] The second solution is to perform multiple data augmentations through semi-supervised learning, and then add pseudo-labels to the sample data by taking the mean, and then add the pseudo-labeled samples to the training of the model. However, this solution also has two disadvantages. The first is that there may be abnormally small values ​​in the mean, which will cause many useful samples to be unable to be added to the training, further reducing the performance gain brought by semi-supervised learning. The second is that the semi-supervised method is not used to mine difficult examples, and more valuable samples are not added to the training.

[0047] Based on the defects of the above two solutions, in the image recognition method provided in this specification, first, after the unlabeled images are subjected to multiple data augmentation in the pseudo-label stage, the samples with the maximum scores are used as samples added to the training, thereby improving the utilization rate of the unlabeled samples. In addition, by introducing the similarity comparison method to mine difficult examples in the training method of semi-supervised learning, more valuable unlabeled samples are added to the training, which also greatly improves the utilization rate of the unlabeled samples. Based on this, in the image recognition method provided in this specification, the training steps of the image recognition model include steps one to four.

[0048] Step 1: Obtain an initial image recognition model based on the labeled image sample training.

[0049] The initial image recognition model can be understood as a model obtained by training with labeled image samples.

[0050] Specifically, the image recognition method provided in this specification can train an untrained image recognition model based on labeled image samples, thereby obtaining a trained initial image recognition model. The operation of obtaining the initial image recognition model based on labeled image samples can be implemented by any method of training the model based on labeled image samples, and this specification does not impose any specific restrictions on this.

[0051] Continuing with the above example, the labeled image sample can be a dashboard image sample containing a sample label. Based on this, the image recognition method provided in this specification can determine the dashboard image sample containing the sample label, input the dashboard image sample into the image recognition model to be trained, obtain the recognition result of the dashboard image sample, determine the loss value based on the recognition result and the sample label of the dashboard image sample, and adjust the parameters of the image recognition model to be trained based on the loss value so that the image recognition model converges, thereby obtaining the trained initial image recognition model.

[0052] Step 2: Based on the initial image recognition model, determine a first pseudo-label sample and a second pseudo-label sample from the unlabeled image samples.

[0053] Among them, the first pseudo-label sample can be understood as the image sample with a pseudo-label in the unlabeled image sample, that is, the pseudo-label image sample; the second pseudo-label sample is understood as the image sample without a pseudo-label in the unlabeled image sample, that is, the image sample in the unlabeled image sample except the pseudo-label image sample.

[0054] Specifically, after an initial image recognition model is obtained based on labeled image samples training, a first pseudo-label sample and a second labeled sample can be determined from the unlabeled image samples based on the initial recognition model.

[0055] Continuing with the above example, the unlabeled dashboard image sample is input into the initial image recognition model obtained through training, and the unlabeled dashboard image sample is recognized based on the initial image recognition model to obtain a recognition result of the unlabeled dashboard image sample, wherein the recognition result may be a prediction score indicating whether the unlabeled dashboard image sample is a retaken image, such as any value in the interval [0,1].

[0056] After determining the recognition result of the unlabeled dashboard picture sample, determine whether the recognition result of the unlabeled dashboard picture sample is greater than or equal to the preset score threshold. If so, it is determined that the unlabeled dashboard picture may be a reshot picture, so the unlabeled dashboard picture sample is marked with a sample pseudo-label of "reshot dashboard picture". If not, it is determined that the unlabeled dashboard picture may be a real unlabeled dashboard picture, not a reshot picture, so the unlabeled dashboard picture sample is not labeled. For example, the predicted score of picture sample A in the unlabeled dashboard picture sample is 0.3, and the predicted score of picture sample B is 0.6, and the preset score threshold is 0.5 points. Based on this, the picture sample A will not be marked with a pseudo-label, and the picture sample B will be marked with a pseudo-label. Among them, the preset score threshold can be set according to the actual application scenario, and this manual does not make specific restrictions on this.

[0057] In the embodiment provided in this specification, in the process of determining the first pseudo-label sample and the second pseudo-label sample from the unlabeled picture sample, data augmentation can also be performed on the unlabeled picture sample, and the first pseudo-label sample and the second pseudo-label sample are determined based on the picture sample and the unlabeled picture sample obtained after the data augmentation, thereby improving the accuracy of the first pseudo-label sample and the second pseudo-label sample. Based on this, the method of determining the first pseudo-label sample and the second pseudo-label sample from the unlabeled picture sample based on the initial picture recognition model includes:

[0058] Determine, based on the unlabeled picture sample, a to-be-processed picture sample associated with the unlabeled picture sample;

[0059] Inputting the unlabeled image sample and the associated to-be-processed image sample into the initial image recognition model to obtain a first recognition result of the unlabeled image sample and a second recognition result of the to-be-processed image sample;

[0060] Based on the first recognition result and the second recognition result, a first pseudo-label sample and a second pseudo-label sample are determined from the unlabeled image samples.

[0061] Among them, the image sample to be processed can be understood as the image sample obtained after data augmentation of the unlabeled sample. The first recognition result of the unlabeled image sample can be understood as the prediction score output by the initial image recognition model after recognizing the unlabeled image sample, such as any value in the interval [0,1]. Correspondingly, the second recognition result of the image sample to be processed can be understood as the prediction score output by the initial image recognition model after recognizing the image sample to be processed, such as any value in the interval [0,1].

[0062] The unlabeled image sample can be multiple, and the corresponding to-be-processed image sample associated with the unlabeled image sample can be understood as the to-be-processed image sample corresponding to each unlabeled image sample. Further, the to-be-processed image sample corresponding to each unlabeled image sample can also be multiple, that is, each unlabeled image sample can correspond to multiple to-be-processed image samples.

[0063] Specifically, after obtaining an initial image recognition model based on labeled image sample training, it is possible to determine an unlabeled image sample for training the initial image recognition model. And by performing data augmentation processing on the unlabeled image sample, a to-be-processed image sample associated with the unlabeled image sample is obtained. And the unlabeled image sample and the to-be-processed image sample associated with the unlabeled image sample are input into the initial image recognition model, thereby obtaining a first recognition result of the unlabeled image sample and a second recognition result of the to-be-processed image sample. And based on the first recognition result and the second recognition result, a first pseudo-label sample and a second pseudo-label sample are determined from the unlabeled image sample.

[0064] Continuing with the above example, after the initial image recognition model is obtained based on the labeled dashboard image sample training, the unlabeled dashboard image sample A (referred to as image sample A) and the unlabeled dashboard image sample B (referred to as image sample B) for training the initial image recognition model can be determined, and data augmentation processing is performed on image sample A and image sample B to obtain augmented image sample A1 and augmented image sample A2 related to image sample A, and augmented image sample B1 and augmented image sample B2 related to image sample B.

[0065] The picture sample A, augmented picture sample A1 and augmented picture sample A2, as well as picture sample B, augmented picture sample B1 and augmented picture sample B2 are input into the initial picture recognition model to obtain the prediction score of each picture sample, for example, picture sample A is 0.1 point, augmented picture sample A1 is 0.2 point, augmented picture sample A2 is 0.3 point, picture sample B is 0.4 point, augmented picture sample B1 is 0.5 point, and augmented picture sample B2 is 0.6 point.

[0066] Based on the prediction score of each unlabeled dashboard image sample and the prediction score of each augmented image sample, dashboard image samples with pseudo labels and dashboard image samples without pseudo labels are determined from the unlabeled dashboard image samples.

[0067] It should be noted that in the embodiments of this specification, only the number of unlabeled image samples is two, and the number of to-be-processed image samples corresponding to each unlabeled image sample is two for illustration. The number of unlabeled image samples and the number of to-be-processed image samples can be set according to the actual application scenario, and this specification does not make any specific limitations on this.

[0068] Furthermore, the determining a first pseudo-label sample and a second pseudo-label sample from the unlabeled image sample based on the first recognition result and the second recognition result includes:

[0069] Determine a target recognition result corresponding to the unlabeled image sample based on the first recognition result of the unlabeled image sample and the second recognition result of the to-be-processed image sample associated with the unlabeled image sample;

[0070] Determine whether the target recognition result corresponding to the unlabeled image sample is greater than or equal to a preset result threshold,

[0071] If yes, the unlabeled image sample is determined as the first pseudo-labeled sample.

[0072] If not, the unlabeled image sample is determined as a second pseudo-labeled sample.

[0073] The preset result threshold can be set according to the actual application scenario, and this specification does not specifically limit this. For example, the preset result threshold can be 0.5 points.

[0074] Specifically, after determining the first recognition result of the unlabeled image sample and the second recognition result of the image sample to be processed associated with the unlabeled image sample, the maximum recognition result can be determined from the first recognition result and the second recognition result, and the maximum recognition result is used as the target recognition result corresponding to the unlabeled image sample. Afterwards, it is determined whether the target recognition result corresponding to the unlabeled image sample is greater than or equal to a preset result threshold. If so, the unlabeled image sample is determined as a first pseudo-label sample, and if not, the unlabeled image sample is determined as a second pseudo-label sample.

[0075] Continuing with the above example, the preset result threshold can be 0.5 points. Based on this, after determining the prediction score of each unlabeled dashboard image sample and the prediction score of each augmented image sample, the maximum prediction score can be determined from the prediction score of each unlabeled dashboard image sample and the prediction score of the augmented image sample corresponding to each unlabeled dashboard image sample, and the maximum prediction score is used as the target prediction score of the unlabeled dashboard image sample. For example, image sample A is 0.1 points, the augmented image sample A1 corresponding to the image sample A is 0.2 points, and the augmented image sample A2 is 0.3 points. Therefore, the maximum prediction score of 0.3 points is used as the target prediction score of image sample A; image sample B is 0.4 points, the augmented image sample B1 corresponding to the image sample B is 0.5 points, and the augmented image sample B2 is 0.6 points. Therefore, the maximum prediction score of 0.6 points is used as the target prediction score of image sample B.

[0076] Then, it is determined whether the target prediction scores of the image sample A and the image sample B are greater than or equal to 0.5 points. If so, the unlabeled dashboard image sample is pseudo-labeled, and thus the image sample B is pseudo-labeled to obtain the pseudo-labeled dashboard image sample. If not, the unlabeled dashboard image sample is not pseudo-labeled, and thus the image sample A is not pseudo-labeled, and it is determined that the image sample A is an unlabeled dashboard image sample.

[0077] In the embodiments of the present specification, after multiple sample data augmentation of unlabeled image samples in the pseudo-label stage, the sample data with the maximum score in the sample data is used as the sample added to the training (pseudo-label sample), thereby improving the utilization rate of the unlabeled samples.

[0078] Step three: determining a third pseudo-label sample from the first pseudo-label samples based on a preset determination rule, and determining a fourth pseudo-label sample from the second pseudo-label samples based on the third pseudo-label sample.

[0079] Among them, the preset determination rule can be set according to the actual application scenario, and this specification does not make specific settings for this. For example, the preset determination rule can be to determine a specific number of first pseudo-label samples whose recognition results are closest to the preset result threshold as the third pseudo-label samples.

[0080] The third pseudo-label sample can be understood as a difficult sample in the first pseudo-label sample. Correspondingly, the fourth pseudo-label sample can be understood as a difficult sample in the second pseudo-label sample.

[0081] Specifically, the image recognition method provided in this specification can determine a third pseudo-label sample from the first pseudo-label sample based on the preset determination rule, and determine a fourth pseudo-label sample from the second pseudo-label sample based on the third pseudo-label sample.

[0082] In an embodiment provided in this specification, the determining the third pseudo-label sample from the first pseudo-label sample based on a preset determination rule includes:

[0083] Determine a target recognition result corresponding to the first pseudo-label sample;

[0084] Sort the first pseudo-label samples in ascending order based on the target recognition result to obtain a sample sorting result of the first pseudo-label samples;

[0085] A first preset number of first pseudo-label samples are obtained from the sample sorting results of the first pseudo-label samples from top to bottom, and the first preset number of first pseudo-label samples are used as third pseudo-label samples.

[0086] Among them, the first preset number can be set according to the actual application scenario, and this manual does not make specific settings for this. For example, the first preset number can be 100 or 1000.

[0087] Specifically, after determining the first pseudo-label sample from the unlabeled image sample, the target recognition result corresponding to the first pseudo-label sample can be determined, and the first pseudo-label sample is sorted in ascending order based on the target recognition result to obtain a sample sorting result of the first pseudo-label sample, and then a first preset number of first pseudo-label samples are obtained from the sample sorting result in a top-down manner, and the first preset number of first pseudo-label samples are used as the third pseudo-label samples.

[0088] Continuing with the above example, the first preset number can be 100. Based on this, after the pseudo-label dashboard image samples are determined from the unlabeled dashboard image samples, the target prediction score corresponding to each pseudo-label dashboard image sample can be determined, and the pseudo-label dashboard image samples can be sorted in ascending order based on the target prediction score to obtain the sample sorting result of the pseudo-label dashboard image samples, and the top 100 pseudo-label dashboard image samples are selected from the sample sorting results in a top-down manner, and the top 100 pseudo-label dashboard image samples are used as difficult examples in the pseudo-label dashboard image samples.

[0089] In addition, in an embodiment provided in this specification, the third pseudo-label sample can also be determined from labeled image samples, and the specific implementation method is as follows.

[0090] After the initial image recognition model is obtained through training based on labeled image samples, the method further includes:

[0091] Determine a sample recognition result corresponding to the labeled image sample, wherein the sample recognition result is a recognition result determined in a process of obtaining the initial image recognition model based on the labeled image sample training;

[0092] Sort the labeled image samples in ascending order based on the sample recognition result to obtain a sample sorting result of the labeled image samples;

[0093] Obtain a second preset number of labeled image samples from the sample sorting results of the labeled image samples from top to bottom, and use the second preset number of labeled image samples as third pseudo-label samples.

[0094] Among them, the sample recognition result corresponding to the labeled image sample can be understood as the prediction score determined by the image recognition model for the labeled image sample in the process of obtaining the initial image recognition model through training with the labeled image sample. In practical applications, the labeled image sample can be divided into training labeled image samples and testing labeled image samples. Therefore, the sample recognition result corresponding to the labeled image sample can be understood as the prediction score corresponding to the training labeled image sample and / or the prediction score corresponding to the testing labeled image sample.

[0095] The second preset number can be set according to the actual application scenario, and this specification does not make specific settings for this. For example, the second preset number can be 100 or 1000.

[0096] Specifically, after training to obtain the initial image recognition model, the sample recognition result corresponding to the labeled image sample can be determined, and the labeled image sample is sorted in ascending order based on the sample recognition result to obtain the sample sorting result corresponding to the labeled image sample; and from the sample sorting results of the labeled image sample from top to bottom, a second preset number of labeled image samples is obtained, for example, the second preset number is 100, and the 100 labeled image samples are used as the third pseudo-label samples.

[0097] In an embodiment provided in this specification, the determining a fourth pseudo-label sample from the second pseudo-label sample based on the third pseudo-label sample includes:

[0098] Determining sample features of the third pseudo-label sample and sample features of the second pseudo-label sample based on the initial image recognition model;

[0099] Determining the similarity between the sample feature of the third pseudo-label sample and the sample feature of the second pseudo-label sample;

[0100] A fourth pseudo-label sample is determined from the second pseudo-label samples based on the similarity.

[0101] The similarity can be understood as a value representing the similarity between the sample features of the third pseudo-label sample and the sample features of the second pseudo-label sample, for example, any value in the interval [0,10].

[0102] Specifically, after determining the third pseudo-label sample, the third pseudo-label sample can be input into the initial image recognition model to determine the sample characteristics of the third pseudo-label sample based on the initial image recognition model, and the second pseudo-label sample can be input into the initial image recognition model to determine the sample characteristics of the second pseudo-label sample based on the initial image recognition model.

[0103] Then, the similarity between the sample feature of each third pseudo-label sample and the sample feature of the second pseudo-label sample is determined, and the fourth pseudo-label sample is determined from the second pseudo-label sample based on the similarity. The operation of determining the similarity between the sample feature of the third pseudo-label sample and the sample feature of the second pseudo-label sample can be implemented by any method of calculating the similarity between sample features, and this specification does not make specific restrictions here. For example, the similarity can be determined by a similarity determination algorithm, or by a computer program.

[0104] In one embodiment provided in this specification, in the process of determining sample features through the initial image recognition model, the operation of determining sample features of the third pseudo-label sample and sample features of the second pseudo-label sample can be implemented through the module for feature extraction in the initial image recognition model. The specific implementation method is as follows.

[0105] The determining, based on the initial image recognition model, the sample features of the third pseudo-label sample and the sample features of the second pseudo-label sample comprises:

[0106] Inputting the third pseudo-label sample into the initial image recognition model, and determining a sample feature of the third pseudo-label sample based on a feature extraction module in the initial image recognition model;

[0107] The second pseudo-label sample is input into the initial image recognition model, and the sample feature of the second pseudo-label sample is determined based on a feature extraction module in the initial image recognition model.

[0108] Among them, the feature extraction module can be understood as a module used for feature extraction in the initial image recognition model, for example, a network layer in the model used for image feature extraction.

[0109] Continuing with the above example, the feature extraction module is a feature extraction layer used for feature extraction in the initial image recognition model. Based on this, the sample difficult example in the pseudo-labeled dashboard image sample is input into the initial image recognition model, and the sample difficult example is subjected to feature extraction processing based on the feature extraction layer in the initial image recognition model, thereby obtaining the sample features of the sample difficult example. In addition, the dashboard image sample that is not pseudo-labeled in the unlabeled dashboard image sample is input into the initial image recognition model, and the dashboard image sample that is not pseudo-labeled is subjected to feature extraction processing based on the feature extraction layer in the initial image recognition model, thereby obtaining the sample features corresponding to the dashboard image sample that is not pseudo-labeled.

[0110] Then, the similarity between the sample features of each difficult sample and the sample features corresponding to the dashboard image sample that is not pseudo-labeled is determined, and based on the similarity, the difficult sample is determined from the dashboard image sample that is not pseudo-labeled.

[0111] Further, the determining a fourth pseudo-label sample from the second pseudo-label sample based on the similarity includes:

[0112] Sort the second pseudo-label samples in descending order based on the similarity to obtain a sample sorting result of the second pseudo-label samples;

[0113] A third preset number of second pseudo-label samples are obtained from the sample sorting results of the second pseudo-label samples from top to bottom, and the third preset number of second pseudo-label samples are used as fourth pseudo-label samples.

[0114] Among them, the third preset number can be set according to the actual application scenario, and this specification does not make specific settings for this. For example, the third preset number can be 10.

[0115] Specifically, after determining the similarity between the sample features of each third pseudo-label sample and the sample features of the second pseudo-label sample, the second pseudo-label samples are sorted in descending order based on the similarity to obtain a plurality of descending sample sorting results corresponding to the second pseudo-label sample, wherein each sample feature of the third pseudo-label sample corresponds to a descending sample sorting result, and then a third preset number of second pseudo-label samples are obtained from the sample sorting results of each second pseudo-label sample from top to bottom. For example, the third preset number may be 10, then 10 second pseudo-label samples are obtained from the sample sorting results of each second pseudo-label sample from top to bottom, and the obtained second pseudo-label samples are used as fourth pseudo-label samples.

[0116] In the embodiments provided in this specification, by introducing a similarity comparison method into the semi-supervised learning training method to perform difficult example mining, more valuable unlabeled samples are added to the training, which also greatly improves the utilization rate of unlabeled samples.

[0117] Step 4: Based on the first pseudo-label sample, the fourth pseudo-label sample and the labeled image sample, the initial image recognition model is trained to obtain a trained image recognition model.

[0118] Specifically, in the image recognition method provided in this specification, after determining the first pseudo-label sample and the fourth pseudo-label sample, the initial image recognition model can be trained based on the first pseudo-label sample, the fourth pseudo-label sample and the labeled image sample, so as to obtain a trained image recognition model. Among them, the operation of obtaining the initial image recognition model based on the first pseudo-label sample, the fourth pseudo-label sample and the labeled image sample can be implemented by any method of training the model based on the pseudo-label sample and the labeled image sample, and this specification does not make specific restrictions on this. For example, the first pseudo-label sample, the fourth pseudo-label sample and the labeled image sample are input into the initial image recognition model to obtain the prediction scores corresponding to the first pseudo-label sample, the fourth pseudo-label sample and the labeled image sample, determine the sample labels corresponding to the first pseudo-label sample, the fourth pseudo-label sample and the labeled image sample, determine the loss value based on the sample label and the prediction score, and adjust the parameters of the initial image recognition model based on the loss value so that the initial image recognition model converges, thereby obtaining a trained image recognition model.

[0119] In the embodiments provided in this specification, a semi-supervised learning method is used to mine difficult examples, and the maximum value of unlabeled images is taken as a pseudo-label and added to the training, thereby improving the performance of the image recognition model, facilitating the subsequent identification of reproduced images based on the image recognition model, and further achieving the purpose of automated image review.

[0120] Step 104: Obtain a recognition result of the image recognition model on the image to be recognized, and determine whether the image to be recognized is a risky image based on the recognition result.

[0121] Among them, the recognition result of the image to be identified can be understood as a predicted score for determining whether the image to be identified is a risky image, such as any value in the interval [0,1]; accordingly, a risky image can be understood as a risky image, such as a fake image, a copied image, etc.

[0122] Specifically, after the image to be identified is input into a trained image recognition model, a recognition result of the image recognition model on the image to be identified can be obtained, and based on the recognition result, it is determined whether the image to be identified is a risky image.

[0123] Continuing with the above example, after the dashboard image is input into the image recognition model, the dashboard image is recognized based on the image recognition model to obtain a prediction score output by the image recognition model. Based on the prediction score, it can be determined whether the dashboard image is a re-shot image.

[0124] Further, determining whether the image to be identified is a risky image based on the identification result includes:

[0125] It is determined whether the recognition result is greater than or equal to a preset risk threshold. If so, it is determined that the image to be recognized is a risk image. If not, it is determined that the image to be recognized is a non-risk image.

[0126] The non-risky picture is a picture without risk, such as a real picture, a non-reproduced picture, etc. The preset risk threshold can be set according to the actual application scenario, and this specification does not make a specific limitation on this; for example, 0.5 points.

[0127] Continuing with the above example, after determining the predicted score of the dashboard image based on the image recognition model, determine whether the predicted score is greater than or equal to 0.5 points. If so, determine that the dashboard image is a re-shot image. If not, determine that the dashboard image is not a re-shot image.

[0128] The image recognition method provided in this specification includes: inputting a picture to be recognized into a pre-trained picture recognition model, wherein the picture recognition model is trained based on labeled picture samples and unlabeled picture samples that meet preset rules; obtaining the recognition result of the picture recognition model on the picture to be recognized, and determining whether the picture to be recognized is a risky picture based on the recognition result.

[0129] The following combination Figure 2 Taking the application of the image recognition method provided in this specification in the scene of identifying whether a dashboard image is a re-photographed image as an example, the image recognition method is further described. Figure 2 A schematic diagram of the model training process in an image recognition method provided by an embodiment of the present specification is shown. In the scenario of identifying whether a dashboard picture is a re-shot picture, the image recognition method provided by the present specification can input a dashboard picture of a user's vehicle into a picture recognition model that can identify whether a dashboard picture is a re-shot picture, and identify the dashboard picture based on the picture recognition model, thereby obtaining a prediction score output by the picture recognition model, and based on the prediction score, it can be determined whether the dashboard picture is a re-shot picture. Among them, before inputting the dashboard picture of the user's vehicle into the picture recognition model for recognition processing, it is also necessary to train the picture recognition model with labeled picture samples and unlabeled picture samples, thereby obtaining a trained picture recognition model. Based on this, the training steps for the picture recognition model can be referred to. Figure 2 ,like Figure 2 As shown, the image recognition method provided in this specification can be divided into four stages in the steps of training the image recognition model, including training stage 1, pseudo label stage 1, pseudo label stage 2, and training stage 2.

[0130] The first training phase refers to training model A through manually annotated labeled image samples, thereby training an initial image recognition model A;

[0131] Among them, pseudo label stage 1 refers to performing multiple data augmentations on the unlabeled image sample, so as to obtain multiple image samples corresponding to each unlabeled image sample through different data augmentation methods. The unlabeled image sample and the image sample obtained by data augmentation are input into the initial image recognition model A, and the prediction score of the image sample obtained by data augmentation and the prediction score of the unlabeled image sample are taken together as the prediction score of the unlabeled image sample, that is, Figure 2 ; then, taking the maximum value from the prediction scores of the unlabeled image samples to obtain the maximum prediction score; judging whether the prediction score is higher than a preset threshold, if so, the unlabeled image sample can be labeled, that is, a pseudo-label is added to obtain a pseudo-labeled sample image sample.

[0132] It should be noted that the image samples obtained by data augmentation can be understood as the image samples to be processed in the above embodiment. The preset threshold can be understood as the preset result threshold in the above embodiment.

[0133] Among them, the pseudo-label stage two refers to determining difficult samples from the labeled image samples. The labeled image samples can be labeled image samples manually annotated in the training stage one, and / or pseudo-label image samples obtained in the pseudo-label stage one.

[0134] The difficult examples in the labeled image samples are sent to model A to obtain corresponding features, and then a large number of unlabeled image samples are also sent to the model to obtain corresponding features; the large number of unlabeled image samples can be the unlabeled image samples except those that are not labeled in the pseudo-label stage 1, that is, the unlabeled image samples whose prediction scores are less than or equal to the preset threshold.

[0135] The similarity between the features of the labeled image samples and the features of each unlabeled image sample is calculated to obtain the similarity between the features of the labeled image samples and the features of each unlabeled image sample, and each unlabeled image sample is sorted based on the similarity, and the top 10 unlabeled image samples with the highest sorting are pseudo-labeled, so as to obtain a certain number of pseudo-labeled image samples again, and the pseudo-labeled image samples are added to the subsequent training.

[0136] Among them, the training stage 2 refers to adding the pseudo-label image samples obtained in the pseudo-label stage 1 and the pseudo-label stage 2, and the labeled image samples manually annotated in the training stage 1, to the training of the initial image recognition model A, so as to obtain the trained target image recognition model A. The target image recognition model A can be understood as the pre-trained image recognition model in the above embodiment.

[0137] The image recognition method provided in this specification improves the utilization rate of unlabeled samples by augmenting the unlabeled image samples with multiple data in the pseudo-label stage and taking the sample with the maximum score as the sample to be added to the training. In addition, by introducing the similarity comparison method to perform difficult example mining in the semi-supervised learning training method, more valuable unlabeled samples are added to the training, which also greatly improves the utilization rate of unlabeled samples.

[0138] Corresponding to the above method embodiment, this specification also provides an image recognition device embodiment, Figure 3 FIG. 1 is a schematic diagram showing the structure of an image recognition device provided by an embodiment of the present specification. Figure 3 As shown, the device comprises:

[0139] An input module 302 is configured to input a to-be-recognized picture into a pre-trained picture recognition model, wherein the picture recognition model is trained based on labeled picture samples and unlabeled picture samples that meet preset rules;

[0140] The determination module 304 is configured to obtain a recognition result of the image recognition model on the image to be recognized, and determine whether the image to be recognized is a risky image based on the recognition result.

[0141] Optionally, the image recognition device further includes a model training module configured to:

[0142] Obtaining an initial image recognition model based on the labeled image sample training;

[0143] Based on the initial image recognition model, determining a first pseudo-label sample and a second pseudo-label sample from the unlabeled image sample;

[0144] Determine a third pseudo-label sample from the first pseudo-label samples based on a preset determination rule, and determine a fourth pseudo-label sample from the second pseudo-label samples based on the third pseudo-label sample;

[0145] Based on the first pseudo-label sample, the fourth pseudo-label sample and the labeled image sample, the initial image recognition model is trained to obtain a trained image recognition model.

[0146] Optionally, the model training module is further configured to:

[0147] Determine, based on the unlabeled picture sample, a to-be-processed picture sample associated with the unlabeled picture sample;

[0148] Inputting the unlabeled image sample and the associated to-be-processed image sample into the initial image recognition model to obtain a first recognition result of the unlabeled image sample and a second recognition result of the to-be-processed image sample;

[0149] Based on the first recognition result and the second recognition result, a first pseudo-label sample and a second pseudo-label sample are determined from the unlabeled image samples.

[0150] Optionally, the model training module is further configured to:

[0151] Determine a target recognition result corresponding to the unlabeled image sample based on the first recognition result of the unlabeled image sample and the second recognition result of the to-be-processed image sample associated with the unlabeled image sample;

[0152] Determine whether the target recognition result corresponding to the unlabeled image sample is greater than or equal to a preset result threshold,

[0153] If yes, the unlabeled image sample is determined as the first pseudo-labeled sample.

[0154] If not, the unlabeled image sample is determined as a second pseudo-labeled sample.

[0155] Optionally, the model training module is further configured to:

[0156] Determine a target recognition result corresponding to the first pseudo-label sample;

[0157] Sort the first pseudo-label samples in ascending order based on the target recognition result to obtain a sample sorting result of the first pseudo-label samples;

[0158] A first preset number of first pseudo-label samples are obtained from the sample sorting results of the first pseudo-label samples from top to bottom, and the first preset number of first pseudo-label samples are used as third pseudo-label samples.

[0159] Optionally, the model training module is further configured to:

[0160] Determine a sample recognition result corresponding to the labeled image sample, wherein the sample recognition result is a recognition result determined in a process of obtaining the initial image recognition model based on the labeled image sample training;

[0161] Sort the labeled image samples in ascending order based on the sample recognition result to obtain a sample sorting result of the labeled image samples;

[0162] Obtain a second preset number of labeled image samples from the sample sorting results of the labeled image samples from top to bottom, and use the second preset number of labeled image samples as third pseudo-label samples.

[0163] Optionally, the model training module is further configured to:

[0164] Determining sample features of the third pseudo-label sample and sample features of the second pseudo-label sample based on the initial image recognition model;

[0165] Determining the similarity between the sample feature of the third pseudo-label sample and the sample feature of the second pseudo-label sample;

[0166] A fourth pseudo-label sample is determined from the second pseudo-label samples based on the similarity.

[0167] Optionally, the model training module is further configured to:

[0168] Inputting the third pseudo-label sample into the initial image recognition model, and determining a sample feature of the third pseudo-label sample based on a feature extraction module in the initial image recognition model;

[0169] The second pseudo-label sample is input into the initial image recognition model, and the sample feature of the second pseudo-label sample is determined based on a feature extraction module in the initial image recognition model.

[0170] Optionally, the model training module is further configured to:

[0171] Sort the second pseudo-label samples in descending order based on the similarity to obtain a sample sorting result of the second pseudo-label samples;

[0172] A third preset number of second pseudo-label samples are obtained from the sample sorting results of the second pseudo-label samples from top to bottom, and the third preset number of second pseudo-label samples are used as fourth pseudo-label samples.

[0173] Optionally, the determining module 304 is further configured to:

[0174] It is determined whether the recognition result is greater than or equal to a preset risk threshold. If so, it is determined that the image to be recognized is a risk image. If not, it is determined that the image to be recognized is a non-risk image.

[0175] The image recognition device provided in this specification identifies whether an input image to be identified is a risky image through an image recognition model obtained by training based on labeled image samples and unlabeled image samples that meet preset rules, thereby improving the recognition efficiency of risky images and reducing the difficulty of the image verification process.

[0176] The above is a schematic scheme of an image recognition device of this embodiment. It should be noted that the technical scheme of the image recognition device and the technical scheme of the above-mentioned image recognition method belong to the same concept, and the details not described in detail in the technical scheme of the image recognition device can be referred to the description of the technical scheme of the above-mentioned image recognition method.

[0177] Figure 4 The block diagram of a computing device 400 according to an embodiment of the present specification is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.

[0178] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0179] In one embodiment of the present specification, the above components of the computing device 400 and Figure 4 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0180] Computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 400 may also be a mobile or stationary server.

[0181] The processor 420 is used to execute the following computer executable instructions, which, when executed by the processor 420, implement the steps of the above-mentioned image recognition method.

[0182] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned image recognition method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned image recognition method.

[0183] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned image recognition method.

[0184] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned image recognition method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned image recognition method.

[0185] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned image recognition method.

[0186] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above-mentioned image recognition method belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be referred to the description of the technical scheme of the above-mentioned image recognition method.

[0187] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0188] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0189] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0190] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0191] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A method for image recognition, comprising: Input the image to be identified into a pre-trained image recognition model, wherein the image recognition model is trained based on labeled image samples and unlabeled image samples that meet preset rules, wherein the preset rules are to mine difficult examples in pseudo-labeled samples by a semi-supervised method, and the pseudo-labeled samples are obtained by adding pseudo-labels to unlabeled image samples after multiple data augmentations are performed on them by a semi-supervised learning method and averaging them; Obtain a recognition result of the image recognition model on the image to be recognized, and determine whether the image to be recognized is a risky image based on the recognition result.

2. According to the image recognition method of claim 1, the step of training the image recognition model comprises: Obtaining an initial image recognition model based on the labeled image sample training; Based on the initial image recognition model, determining a first pseudo-label sample and a second pseudo-label sample from the unlabeled image sample; Determine a third pseudo-label sample from the first pseudo-label sample based on a preset determination rule, and determine a fourth pseudo-label sample from the second pseudo-label sample based on the third pseudo-label sample, wherein the fourth pseudo-label sample is determined from the second pseudo-label sample based on a similarity between the third pseudo-label sample and the second pseudo-label sample; Based on the first pseudo-label sample, the fourth pseudo-label sample and the labeled image sample, the initial image recognition model is trained to obtain a trained image recognition model.

3. The image recognition method according to claim 2, wherein the step of determining the first pseudo-label sample and the second pseudo-label sample from the unlabeled image sample based on the initial image recognition model comprises: Determine, based on the unlabeled picture sample, a to-be-processed picture sample associated with the unlabeled picture sample; Inputting the unlabeled image sample and the associated to-be-processed image sample into the initial image recognition model to obtain a first recognition result of the unlabeled image sample and a second recognition result of the to-be-processed image sample; Based on the first recognition result and the second recognition result, a first pseudo-label sample and a second pseudo-label sample are determined from the unlabeled image samples.

4. The image recognition method according to claim 3, wherein the determining a first pseudo-label sample and a second pseudo-label sample from the unlabeled image sample based on the first recognition result and the second recognition result comprises: Determine a target recognition result corresponding to the unlabeled image sample based on the first recognition result of the unlabeled image sample and the second recognition result of the to-be-processed image sample associated with the unlabeled image sample; Determine whether the target recognition result corresponding to the unlabeled image sample is greater than or equal to a preset result threshold, If yes, the unlabeled image sample is determined as the first pseudo-labeled sample. If not, the unlabeled image sample is determined as a second pseudo-labeled sample.

5. The image recognition method according to claim 4, wherein the step of determining the third pseudo-label sample from the first pseudo-label sample based on a preset determination rule comprises: Determine a target recognition result corresponding to the first pseudo-label sample; Sort the first pseudo-label samples in ascending order based on the target recognition result to obtain a sample sorting result of the first pseudo-label samples; A first preset number of first pseudo-label samples are obtained from the sample sorting results of the first pseudo-label samples from top to bottom, and the first preset number of first pseudo-label samples are used as third pseudo-label samples.

6. The image recognition method according to claim 2, after obtaining the initial image recognition model based on the labeled image sample training, further comprising: Determine a sample recognition result corresponding to the labeled image sample, wherein the sample recognition result is a recognition result determined in a process of obtaining the initial image recognition model based on the labeled image sample training; Sort the labeled image samples in ascending order based on the sample recognition result to obtain a sample sorting result of the labeled image samples; Obtain a second preset number of labeled image samples from the sample sorting results of the labeled image samples from top to bottom, and use the second preset number of labeled image samples as third pseudo-label samples.

7. The image recognition method according to claim 2, wherein determining a fourth pseudo-label sample from the second pseudo-label sample based on the third pseudo-label sample comprises: Determining sample features of the third pseudo-label sample and sample features of the second pseudo-label sample based on the initial image recognition model; Determining the similarity between the sample feature of the third pseudo-label sample and the sample feature of the second pseudo-label sample; A fourth pseudo-label sample is determined from the second pseudo-label samples based on the similarity.

8. The image recognition method according to claim 7, wherein determining the sample features of the third pseudo-label sample and the sample features of the second pseudo-label sample based on the initial image recognition model comprises: Inputting the third pseudo-label sample into the initial image recognition model, and determining a sample feature of the third pseudo-label sample based on a feature extraction module in the initial image recognition model; The second pseudo-label sample is input into the initial image recognition model, and the sample feature of the second pseudo-label sample is determined based on a feature extraction module in the initial image recognition model.

9. The image recognition method according to claim 7, wherein determining a fourth pseudo-label sample from the second pseudo-label sample based on the similarity comprises: Sort the second pseudo-label samples in descending order based on the similarity to obtain a sample sorting result of the second pseudo-label samples; A third preset number of second pseudo-label samples are obtained from the sample sorting results of the second pseudo-label samples from top to bottom, and the third preset number of second pseudo-label samples are used as fourth pseudo-label samples.

10. The image recognition method according to claim 1, wherein determining whether the image to be recognized is a risky image based on the recognition result comprises: It is determined whether the recognition result is greater than or equal to a preset risk threshold. If so, it is determined that the image to be recognized is a risk image. If not, it is determined that the image to be recognized is a non-risk image.

11. A picture recognition device, comprising: An input module is configured to input the image to be recognized into a pre-trained image recognition model, wherein the image recognition model is trained based on labeled image samples and unlabeled image samples that meet preset rules, wherein the preset rules are to mine difficult examples in pseudo-labeled samples by a semi-supervised method, and the pseudo-labeled samples are obtained by performing multiple data augmentations on unlabeled image samples by a semi-supervised learning method and then adding pseudo-labels to the unlabeled image samples by taking the average; The determination module is configured to obtain a recognition result of the image recognition model on the image to be recognized, and determine whether the image to be recognized is a risky image based on the recognition result.

12. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the image recognition method according to any one of claims 1 to 10 are implemented.

13. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the image recognition method according to any one of claims 1 to 10.

Citation Information

Cited By

  • Anti-counterfeiting identification method and device

    CN121148026A