Picture recognition model construction method, picture recognition method and related device
Through the method of minimizing the difference and iteratively adjusting the model parameters, a target image recognition model is constructed, which solves the problem of low image recognition accuracy in the existing technology, and realizes efficient identification of new types of bad images.
Patent Information
- Application Number
- CN202411001816.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-11-12
AI Technical Summary
Existing picture recognition models are prone to identifying new types of bad pictures as normal pictures, resulting in low recognition accuracy. How to improve the accuracy of pictures is a key issue for technicians to pay attention to.
By obtaining the target image sample and the initial image sample for the difference minimization process, the fusion features are obtained, and the fusion features are predicted and recognized by the initial image recognition model, and the model parameters are iteratively adjusted until the preset fine-tuning conditions are met, and the target image recognition model is constructed. The initial model is fine-tuned using obfuscated transfer learning.
It reduces the training volume of the model and improves the training speed, improves the recognition accuracy of the picture, and can meet the recognition needs of the initial picture and target picture.
Smart Images

Figure CN118941865A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a method for constructing an image recognition model, an image recognition method and related devices. Background Art
[0002] With the rapid development of mobile Internet and multimedia technology, pictures have gradually become the main carrier for transmitting information between users, which can make users' lives more convenient, but also bring the risk of spreading bad pictures. Therefore, pictures need to be identified before uploading to the Internet to determine whether the pictures uploaded to the Internet are bad pictures that cannot be spread.
[0003] In the related technology, an image recognition model is usually constructed based on deep learning to perform image recognition according to the constructed image recognition model. However, with the boom of mobile Internet, the types of image display are endless. At this time, when identifying new types of bad images based on the image recognition model in the related technology, it is easy to identify them as normal images, resulting in a low image recognition accuracy.
[0004] Therefore, how to improve the recognition accuracy of images is a key issue that technicians in this field are concerned about. Summary of the invention
[0005] Based on the above problems, the present application provides a method for constructing an image recognition model, an image recognition method and related devices to improve the recognition accuracy of images.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] The first aspect of the present application provides a method for constructing an image recognition model. The method for constructing the image recognition model includes:
[0008] Obtaining a target image sample, an initial image sample, a first feature classification label, a second feature classification label set under the first feature classification label, and an initial image recognition model, wherein the initial image recognition model is constructed based on the initial image sample, and the target image sample and the initial image sample belong to the same image classification but have different image display types;
[0009] Performing difference minimization processing on the target image sample and the initial image sample to obtain a first image fusion feature;
[0010] Inputting the first picture fusion feature into the initial picture recognition model, using the initial picture recognition model to predict and recognize the first picture fusion feature, and obtaining a first prediction classification result corresponding to the first picture fusion feature and a second prediction classification result set under the first prediction classification result;
[0011] According to the difference between the first feature classification label and the first predicted classification result, and according to the difference between the second feature classification label set and the second predicted classification result set, the parameters of the initial image recognition model are iteratively adjusted until the adjusted model meets the preset fine-tuning cutoff condition, and the adjustment is ended to obtain the target image recognition model, wherein a classification label in the second feature classification label set corresponds to a classification result in the second predicted classification result set.
[0012] The second aspect of the present application provides a method for image recognition. The method for image recognition comprises:
[0013] Obtaining a picture to be identified, wherein the picture to be identified includes a picture uploaded by a user;
[0014] Inputting the image to be identified into a target image recognition model, identifying the image to be identified using the target image recognition model, obtaining a first classification result corresponding to the image to be identified, and a second classification result set under the first classification result, wherein the target image recognition model is a model trained according to the training method for an image recognition model according to any one of claims 1 to 8;
[0015] According to the first classification result and the second classification result set, it is determined that the image to be identified is a target image, wherein the target image is a bad image or a normal image.
[0016] The third aspect of the present application provides a device for constructing an image recognition model. The device for constructing an image recognition model includes:
[0017] a sample label acquisition unit, configured to acquire a target image sample, an initial image sample, a first feature classification label, a second feature classification label set under the first feature classification label, and an initial image recognition model, wherein the initial image recognition model is constructed based on the initial image sample, and the target image sample and the initial image sample belong to the same image classification but have different image display types;
[0018] A minimization processing unit, used for performing a difference minimization process on the target image sample and the initial image sample to obtain a first image fusion feature;
[0019] a feature prediction and recognition unit, configured to input the first picture fusion feature into the initial picture recognition model, use the initial picture recognition model to predict and recognize the first picture fusion feature, and obtain a first prediction and classification result corresponding to the first picture fusion feature and a second prediction and classification result set under the first prediction and classification result;
[0020] A recognition model generation unit is used to iteratively adjust the parameters of the initial image recognition model according to the difference between the first feature classification label and the first predicted classification result, and according to the difference between the second feature classification label set and the second predicted classification result set, until the adjusted model meets the preset fine-tuning cutoff condition, and end the adjustment to obtain the target image recognition model, wherein a classification label in the second feature classification label set corresponds to a classification result in the second predicted classification result set.
[0021] A fourth aspect of the present application provides an image recognition device. The image recognition device comprises:
[0022] A to-be-identified picture acquisition unit, used to acquire a to-be-identified picture, wherein the to-be-identified picture includes a picture uploaded by a user;
[0023] A picture recognition unit to be recognized, used for inputting the picture to be recognized into a target picture recognition model, using the target picture recognition model to recognize the picture to be recognized, and obtaining a first classification result corresponding to the picture to be recognized, and a second classification result set under the first classification result, wherein the target picture recognition model is a model trained according to the training method of the picture recognition model described in the first aspect;
[0024] A target picture determination unit is used to determine that the picture to be identified is a target picture according to the first classification result and the second classification result set, wherein the target picture is a bad picture or a normal picture.
[0025] A fifth aspect of the present application provides a computer device. The identification device comprises:
[0026] a memory having a computer program stored thereon;
[0027] A processor is used to execute the computer program in the memory to implement the steps of the method for constructing the image recognition model provided in the first aspect, or to implement the steps of the method for image recognition provided in the second aspect.
[0028] In a sixth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the method for constructing the image recognition model provided in the first aspect are implemented, or the steps of the method for image recognition provided in the second aspect are implemented.
[0029] Compared with the prior art, this application has the following beneficial effects:
[0030] In the present application, a target image sample, an initial image sample, a first feature classification label, a second feature classification label set under the first feature classification label, and an initial image recognition model are first obtained. After that, a difference minimization process is performed on the target image sample and the initial image sample to obtain a first image fusion feature. Finally, the first image fusion feature is input into the initial image recognition model, and the initial image recognition model is used to predict and recognize the first image fusion feature to obtain a first predicted classification result corresponding to the first image fusion feature and a second predicted classification result set under the first predicted classification result. According to the difference between the first feature classification label and the first predicted classification result, and according to the difference between the second feature classification label set and the second predicted classification result set, the parameters of the initial image recognition model are iteratively adjusted until the adjusted model meets the preset fine-tuning cutoff condition, and the adjustment is terminated to obtain the target image recognition model.
[0031] It should be noted that the initial image recognition model is constructed based on the initial image samples, the target image samples and the initial image samples belong to the same image category but have different image display types, and a classification label in the second feature classification label set corresponds to a classification result in the second predicted classification result set.
[0032] It can be seen that in this application, the target image sample and the initial image sample are first subjected to difference minimization processing, so as to use the first image fusion feature after the difference minimization processing to fine-tune the initial image recognition model and obtain the target image recognition model. In this way, this application fine-tunes the initial image recognition model by means of confusion transfer learning, which can reduce the amount of model training and increase the training speed of the model, and when the target image recognition model is subsequently applied, it can satisfy both the recognition of the initial image and the recognition of the target image, thereby improving the recognition accuracy of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0034] Figure 1 A flowchart of a method for constructing an image recognition model provided in an embodiment of the present application;
[0035] Figure 2 A processing flow chart for minimizing image differences in a method for constructing an image recognition model provided in an embodiment of the present application;
[0036] Figure 3A flowchart of feature prediction and recognition in a method for constructing an image recognition model provided in an embodiment of the present application;
[0037] Figure 4 A schematic diagram of a picture recognition model in a method for constructing a picture recognition model provided in an embodiment of the present application;
[0038] Figure 5 A flowchart of feature classification prediction in a method for constructing an image recognition model provided in an embodiment of the present application;
[0039] Figure 6 A flowchart of feature classification prediction in another method for constructing an image recognition model provided in an embodiment of the present application;
[0040] Figure 7 A full flow chart of feature classification prediction in a method for constructing an image recognition model provided in an embodiment of the present application;
[0041] Figure 8 A flowchart of a method for image recognition provided in an embodiment of the present application;
[0042] Fig. 9 A schematic diagram of the structure of a device for constructing an image recognition model provided in an embodiment of the present application;
[0043] Fig.10 A schematic diagram of the structure of an image recognition device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] Next, the technical terms that may appear in this application are explained.
[0045] Inappropriate pictures: The inappropriate pictures mentioned in this application can be understood as pictures that focus on showing private parts of the human body and are indecent.
[0046] Normal picture: The normal picture mentioned in this application can be understood as a picture that is the opposite of a bad picture, that is, a picture that is aesthetically pleasing.
[0047] As described above, with the rapid development of mobile Internet and multimedia technology, pictures have gradually become the main carrier for transmitting information between users, which can make users' lives more convenient, but also bring the risk of spreading bad pictures. Therefore, pictures need to be identified before uploading to the Internet to determine whether the pictures uploaded to the Internet are bad pictures that cannot be spread.
[0048] In some technologies, images are usually recognized based on human skin color and skin texture of private parts of the human body according to statistical and traditional machine learning methods. However, this image recognition method is prone to misjudgment when recognizing objects with similar skin color or close-up images of human faces, that is, it is easy to recognize normal images as bad images. Furthermore, in related technologies, it is proposed to build an image recognition model based on deep learning, and perform image recognition according to the built image recognition model, so as to avoid the situation where normal images are easily recognized as bad images.
[0049] However, with the boom of mobile Internet, the types of pictures displayed are endless. At this time, when identifying new bad pictures based on the picture recognition model in the relevant technology, it is easy to identify them as normal pictures. For example: the initial bad pictures are direct pictures of naked private parts of the human body. At this time, the picture recognition model can well identify and distinguish normal pictures from bad pictures. New bad pictures are pictures that do not expose private parts of the human body and are also bad pictures. At this time, the picture recognition model may identify the new bad pictures as normal pictures, which may lead to a low recognition accuracy of pictures. Therefore, how to improve the recognition accuracy of pictures is a key issue that technicians in this field are concerned about.
[0050] In view of the above problems, a solution is provided in the embodiment of the present application, and a method for constructing a picture recognition model, a picture recognition method and related devices are proposed, aiming to improve the recognition accuracy of pictures. In the technical solution of the present application, the target picture sample and the initial picture sample are subjected to difference minimization processing to obtain a first picture fusion feature, and then the first picture fusion feature is predicted and recognized using the initial picture recognition model to obtain a first prediction classification result corresponding to the first picture fusion feature, and a second prediction classification result set under the first prediction classification result, and finally, according to the first prediction classification result and the second prediction classification result set, the initial picture recognition model is fine-tuned to obtain a target picture recognition model. It can be seen that in the present application, the initial picture recognition model is fine-tuned by means of confusion transfer learning, which can reduce the training amount of the model and improve the training speed of the model, and when the target picture recognition model is subsequently applied, it can meet the recognition of both the initial picture and the target picture, thereby improving the recognition accuracy of the picture.
[0051] 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 are within the scope of protection of this application.
[0052] See also Figure 1 , which is a flow chart of a method for constructing an image recognition model provided in an embodiment of the present application. Figure 1 The method for constructing the picture recognition model shown includes:
[0053] S101: Obtain a target image sample, an initial image sample, a first feature classification label, a second feature classification label set under the first feature classification label, and an initial image recognition model.
[0054] In this step, the target image sample can be a new type of bad image or a new type of normal image, and the initial image sample can be an initial bad image or an initial normal image. The initial image sample is also used as a model construction sample of the initial image recognition model to construct the initial image recognition model. The target image sample can be obtained from the Internet by crawling or other methods.
[0055] It should be noted that the target image samples and the initial image samples in this application belong to the same image classification but have different image display types. For example, the image display type of the target image samples is a display type in which the private parts of the human body are not exposed, but the private parts of the human body can be highlighted through clothing or body movements, and the image display type of the initial image samples is a display type in which the private parts of the human body are not exposed, but the private parts of the human body are obviously highlighted. The corresponding image samples belong to the same image classification, that is, the image classification of inappropriate images.
[0056] And when the target image sample and the initial image sample belong to the same image classification, the present application can use the first feature classification label and the second feature classification label set under the first feature classification label as model labels for constructing the initial image recognition model and fine-tuning the initial image recognition model, so that the prediction and recognition of the target image sample and the initial image sample can be taken into account during the fine-tuning process of the initial image recognition model. Among them, the feature classification label can be understood as the classification of the image sample can be determined based on the image feature A in the image sample. At this time, according to the image feature A, it can be determined that the feature classification label can be 1, which is convenient for the subsequent calculation of the difference between the feature classification label and the predicted classification result.
[0057] It should also be noted that the present application recognizes images based on the hierarchical classification of images by training the model, and unifies and clarifies the classification boundaries for the model during the training process (that is, each classification has a corresponding classification label), such as the first feature classification label and the second feature classification label set under the first feature classification label in the present application, which can provide a good classification boundary for the model, thereby improving the recognition accuracy of the image. The first feature classification label can be understood as the main classification label for the image sample, and the second feature classification label can be understood as the sub-classification label under the main classification label for the image sample.
[0058] In some examples, the first feature classification label may be a classification label including a first bad picture element, a classification label including a second bad picture element, or a classification label including a normal picture element, wherein the badness of the first bad picture element is greater than the badness of the second bad picture element. It can be understood that the first bad picture element includes a picture element in which a private part of a human body is exposed, and the second bad picture element does not expose a private part of a human body, but obviously highlights or implies a picture element in which a private part of a human body is highlighted.
[0059] The second feature classification label set under the first feature classification label may be a classification label including multiple display types containing image elements, and due to the diversity of image display types, one image sample may correspond to the second feature classification label set at the same time. It is understandable that if the first feature classification label is a classification label including the first bad image element, then the second feature classification label set under the first feature classification label may be a classification label of multiple display types of image elements with exposed human private parts, such as a classification label of a display type with exposed private parts of the upper body of the human body, a classification label of a display type with exposed private parts of the lower body of the human body, a classification label of a display type with exposed private parts of the upper and lower body of the human body, etc.
[0060] Next, the construction process of the initial image recognition model is introduced. In this application, the initial image sample can first be input into the recognition model to be trained, so as to use the recognition model to be trained to extract features of the initial image sample, so as to obtain local features and global features corresponding to the initial image sample, and determine the fusion features of the initial image sample based on the local features and global features. After that, the fusion features of the initial image sample are predicted using the recognition model to be trained to obtain the first initial classification result for the fusion features of the initial image sample and the second initial classification result set under the first initial classification result. Finally, according to the difference between the first feature classification label and the first initial classification result, and according to the difference between the second initial classification result set and the second predicted classification result set, the parameters of the recognition model to be trained are iteratively adjusted until the adjusted model meets the preset cutoff condition, and the adjustment is terminated to obtain the initial image recognition model.
[0061] It can be seen that compared with the related art, the present application improves the accuracy of model recognition of images to a certain extent by constructing an initial image recognition model through the use of a full convolutional network (i.e., a method of extracting local and global features of images) and a hierarchical classification method.
[0062] Furthermore, the initial image recognition model in the present application can be constructed only for multiple initial image samples corresponding to the same image classification, or it can be constructed simultaneously for multiple initial image samples corresponding to different image classifications. No specific limitation is made here, and it can also be selected and constructed according to actual needs in actual applications.
[0063] In an achievable implementation, the present application may also preprocess the image samples before inputting them into the model to obtain an expanded image sample set, so as to improve the generalization ability of the model. Specifically, the preprocessing operation includes image augmentation processing, multi-scale scaling processing and standardization processing, wherein the image samples may first be subjected to image augmentation processing such as horizontal flipping, vertical flipping, cropping and rotation to obtain an augmented image sample set, after which the augmented image sample set may be standardized, i.e., the pixel values of the image samples in the expanded image sample set are scaled to between 0 and 1, and transformed into a distribution with a mean of 0 and a standard deviation of 1, to obtain a standardized image sample set, which may make the distribution of the image sample set more uniform.
[0064] Finally, the image samples in the standardized image sample set can be adaptively scaled to obtain an expanded image sample set. It can be understood that since the structure of the initial image recognition model in this application is a full convolutional network structure, the initial image recognition model can accept image samples of different sizes as model inputs. Compared with the models in the related art that can only accept image samples of fixed sizes as model inputs, the model in this application can be applied to images of different sizes, which improves the user experience to a certain extent.
[0065] It should also be noted that the present application can provide four types of image sizes (208×208, 312×312, 416×416, 520×520). After determining the size of the image sample, the image sample can be resized based on the size closest to the image sample among the above four types of image sizes. This avoids the problem of reduced model recognition accuracy caused by excessive scaling of the image size, and can also try to maintain the image resolution and image details before scaling to avoid the loss of key information.
[0066] S102: Perform difference minimization processing on the target image sample and the initial image sample to obtain a first image fusion feature.
[0067] like Figure 2 As shown, Figure 2A processing flow chart for minimizing image differences in a method for constructing an image recognition model provided in an embodiment of the present application. Specifically, in the present application, the target image sample and the initial image sample can first be subjected to feature extraction through a shared convolutional neural network to obtain image features corresponding to the target image sample and image features corresponding to the initial image sample. After that, the image features corresponding to the initial image sample can be input into the first fully connected layer to obtain the first image features, and the image features corresponding to the target image sample can be input into the second fully connected layer to obtain the second image features, wherein the first fully connected layer and the second fully connected layer are different fully connected layers, which are used to process the initial image sample and the target image sample, respectively.
[0068] Finally, the first image feature and the second image feature are input into the image confusion layer, so as to minimize the difference between the first image feature and the second image feature through the image confusion layer, so as to obtain the first image fusion feature. At this time, the first image fusion feature includes the features of the initial image sample and the features of the target image sample, so that in the subsequent fine-tuning process of the initial image recognition model, the fine-tuned initial image recognition model can learn both the features of the initial image sample and the features of the target image sample, thereby improving the recognition accuracy of the subsequent model to a certain extent.
[0069] S103: Input the first image fusion feature into the initial image recognition model, use the initial image recognition model to predict and recognize the first image fusion feature, and obtain a first prediction classification result corresponding to the first image fusion feature and a second prediction classification result set under the first prediction classification result.
[0070] In this step, the first image fusion feature is input into the initial image recognition model, so that the initial image recognition model can be fine-tuned based on the predicted classification result of the first image fusion feature. Figure 3 Introduce the process of predicting and identifying the first image fusion feature in this application, Figure 3 A flowchart of feature prediction and recognition in a method for constructing an image recognition model provided in an embodiment of the present application, Figure 3 The method comprises steps S1031 and S1032:
[0071] S1031: Perform feature processing on the first image fusion feature using the initial image recognition model to obtain a second image fusion feature.
[0072] It should be noted that the initial image recognition model in this application includes a local feature extraction layer, a global feature extraction layer and a feature fusion layer. The local feature extraction layer, the global feature extraction layer and the feature fusion layer can be understood as the DarkNet53 network in the full convolutional network, in which the global feature extraction layer mainly realizes feature extraction under the action of the shallow convolutional network and the DarkNet19 network. Next, combined with Figure 4 The process of obtaining the second image fusion feature is described. Figure 4 A schematic diagram of an image recognition model in a method for constructing an image recognition model provided in an embodiment of the present application.
[0073] Specifically, in the present application, the local feature extraction layer in the initial image recognition model can be used to first perform local feature extraction on the first image fusion feature to obtain the local feature corresponding to the first image fusion feature, and the global feature extraction layer in the initial image recognition model can be used to perform global feature extraction on the first image fusion feature to obtain the global feature corresponding to the first image fusion feature, and finally the feature fusion layer in the initial image recognition model can be used to perform feature fusion on the local features and the global features to obtain the second image fusion feature. In this way, in the present application, by extracting local features and global features from image samples, the feature parts involving bad elements in the image can be better captured, and background interference can be avoided, and the model's rapid image recognition can be achieved, and the recognition accuracy and robustness of the model can be improved.
[0074] It should also be noted that the local feature extraction layer in the present application includes a low-dimensional feature extraction layer, a high-dimensional feature extraction layer and a first fusion layer, wherein the low-dimensional feature extraction layer mainly performs feature extraction under the action of a shallow convolutional network, and the high-dimensional feature extraction layer mainly performs feature extraction under the action of a deep convolutional network. Specifically, the low-dimensional feature extraction layer in the local feature extraction layer can be used to extract low-dimensional features such as edges and colors in image samples, and the high-dimensional feature extraction layer in the local feature extraction layer can be used to extract high-dimensional features such as human body parts and limb movements in image samples, and finally, the low-dimensional features and the high-dimensional features are fused according to the first fusion layer in the local feature extraction layer to obtain the local features corresponding to the first image fusion features. And in the subsequent fine-tuning process of the initial image recognition model, the parameters of the low-dimensional feature extraction layer may not be adjusted to reduce the amount of model training.
[0075] In this way, the structure of the initial image recognition model in this application includes a fully convolutional network structure, which can not only meet the input of different sizes of images, but also achieve better feature extraction, have strong feature extraction capabilities, and enable subsequent models to perform predictive recognition based on the extracted features, thereby improving the model recognition performance to a certain extent.
[0076] S1032: Use the initial image recognition model to perform classification prediction on the second image fusion feature to obtain a first predicted classification result corresponding to the first image fusion feature and a second predicted classification result set under the first predicted classification result.
[0077] It should be noted that the initial image recognition model in the present application also includes a classification prediction layer. Specifically, the classification prediction layer in the initial image recognition model can be used to perform classification prediction on the second image fusion feature to obtain a first predicted classification result corresponding to the first image fusion feature and a second predicted classification result set under the first predicted classification result.
[0078] Furthermore, the classification prediction layer in the present application includes a first prediction sublayer and multiple second prediction sublayers, wherein the number of the multiple second prediction sublayers is the same as the number of the second feature classification label sets, and one second prediction sublayer is used to predict and obtain a second prediction classification result. It can be understood that since an image sample can only correspond to one first feature classification label, that is, an image sample can only have one main classification, and an image sample can correspond to multiple second feature classification labels, that is, an image sample can have multiple subclassifications under one main classification. Therefore, it is proposed in the present application to construct a prediction sublayer for each classification (including the main classification and the subclassification) for prediction and identification, so as to clarify the unification of the model classification boundaries.
[0079] Next, combine Figure 5 Introduce the process of classifying and predicting the fusion features of the second image in this application, Figure 5 A flowchart of feature classification prediction in a method for constructing an image recognition model provided in an embodiment of the present application. In the present application, the first prediction sublayer in the classification prediction layer in the initial image recognition model can be used to classify and predict the second image fusion feature to obtain a first prediction classification result corresponding to the first image fusion feature; and the multiple second prediction sublayers in the classification prediction layer in the initial image recognition model can be used to classify and predict the second image fusion feature to obtain a second prediction classification result set under the first prediction classification result corresponding to the first image fusion feature.
[0080] Understandably, Figure 5The multiple second prediction sublayers in the method include the second prediction sublayer 1 and the second prediction sublayer n, etc., and the second picture fusion feature can be classified and predicted according to the second prediction sublayer 1 to obtain the second prediction classification result 1 under the first prediction classification result corresponding to the first picture fusion feature, and the second picture fusion feature can be classified and predicted according to the second prediction sublayer n to obtain the second prediction classification result n under the first prediction classification result corresponding to the first picture fusion feature, and finally the second prediction classification result set can be obtained according to the second prediction classification result 1 and the second prediction classification result n, etc. In this way, in the present application, the classification prediction of features is realized by clarifying the classification boundaries, which can greatly improve the efficiency and accuracy of prediction recognition.
[0081] It should also be noted that the first prediction sublayer in the present application includes a convolution layer, a global average pooling layer and a classification output layer, wherein the second prediction sublayer in multiple second prediction sublayers also includes a convolution layer, a global average pooling layer and a classification output layer, and the parameters of the convolution layer, the global average pooling layer and the classification output layer in each prediction sublayer are different, which are used to predict and identify different classifications corresponding to image samples.
[0082] Next, combine Figure 6 Introduce the specific process of classifying and predicting the second image fusion features in this application, Figure 6 A flowchart of feature classification prediction in another method for constructing an image recognition model provided in an embodiment of the present application, wherein Figure 6 The first prediction sublayer is taken as an example for introduction. Correspondingly, the process of classifying and predicting the second image fusion features according to the second prediction sublayer is the same as that of the first prediction sublayer, and will not be described in detail here.
[0083] Specifically, in the present application, the convolution layer in the first prediction sublayer can be used to perform convolution processing on the second image fusion feature to obtain a convolution feature map, wherein the specification of the convolution layer is 1×1×1024, and the global average pooling layer in the first prediction sublayer can be used to perform gradient processing on the convolution feature map to obtain a prediction vector corresponding to the second image fusion feature, and the classification output layer in the first prediction sublayer can be used to perform probability conversion on the prediction vector to obtain the classification probability corresponding to the first image fusion feature, and the classification probability is used as the first prediction classification result corresponding to the first image fusion feature, wherein the classification output layer includes a softmax layer. In this way, the model recognition ability can be better improved.
[0084] It can be understood that after obtaining the prediction vector, the present application can normalize the prediction vector to between 0 and 1 through the classification output layer to obtain the classification probability, which is convenient for subsequent difference calculation with the feature classification label, where the closer the classification probability is to 1, the greater the possibility that the image sample belongs to the feature classification label.
[0085] In an achievable implementation, the classification probability can be obtained by formula (1) and formula (2), and formula (1) and formula (2) are specifically embodied as follows:
[0086]
[0087] in, represents the classification probability that the first image fusion feature belongs to the i-th main category (i.e., the first predicted classification result), represents the classification probability that the first image fusion feature belongs to the jth sub-category (i.e., the second predicted classification result), represents the probability distribution that the first image fusion feature belongs to the i-th main category, Represents the probability distribution that the first image fusion feature belongs to the jth sub-category, where m means predicting and identifying m image samples at the same time to obtain the classification probabilities of the main categories corresponding to the m image samples, and m is greater than or equal to 1; n means predicting and identifying n image samples at the same time to obtain the classification probabilities of the sub-categories corresponding to the n image samples, and n is greater than or equal to 1.
[0088] It should be further explained that the global average pooling layer in the present application includes a gradient activation mapping layer. In the present application, the gradient activation mapping layer in the global average pooling layer can first be used to perform gradient mapping on the convolution feature map to obtain a gradient heat map, wherein the gradient heat map is used to indicate the image classification direction for the initial image sample. It can be understood that the gradient heat map can focus on the part of the image that the model needs to pay attention to, which guides the model's prediction and recognition, and also makes a certain contribution to the model's recognition of the image classification.
[0089] After that, the gradient heat map can be used as a weight to multiply the convolution feature map to obtain an enhanced feature map. At this time, the enhanced feature map is gradient processed using the global average pooling layer in the first prediction sublayer to obtain the prediction vector corresponding to the fusion feature of the second image. In this way, the present application realizes feature prediction and recognition by using the gradient activation mapping layer to obtain the gradient heat map, which provides explainability for the prediction and recognition process of the model.
[0090] In an achievable implementation, the gradient heat map can be obtained by formula (3) and formula (4), and formula (3) and formula (4) are specifically embodied as follows:
[0091]
[0092] in, represents the gradient heat map for category C, Grad-CAM represents the gradient activation mapping layer, RELU represents the activation function, which is used to determine that only positive correlation areas are displayed in the generated gradient heat map, that is, the positive activation areas that contribute to the prediction and recognition are retained, α k Represents the convolution feature map A k The global average pooling, Z represents the convolution feature map A k The total number of pixels, Represents the convolution feature map A k The element at position p,q in y c Represents the convolution feature map A k The output result of classification C, represents the model gradient.
[0093] like Figure 7 As shown, Figure 7 A full flow chart of feature classification prediction in a method for constructing an image recognition model provided in an embodiment of the present application. Figure 7 First, the local feature extraction layer and the global feature extraction layer are used to extract features of the first image fusion feature respectively to obtain local features corresponding to the first image fusion feature and global features corresponding to the first image fusion feature, and the feature fusion layer is used to fuse the local features and the global features to obtain the second image fusion feature.
[0094] After that, the convolution layer in the first prediction sublayer in the classification prediction layer is used to perform convolution processing on the second image fusion feature to obtain a convolution feature map, and the gradient activation mapping layer in the first prediction sublayer in the classification prediction layer is used to perform gradient mapping on the convolution feature map to obtain a gradient heat map, and then the prediction vector corresponding to the second image fusion feature is obtained based on the gradient heat map; finally, the classification output layer in the first prediction sublayer is used to perform probability conversion on the prediction vector to obtain the first prediction classification result corresponding to the first image fusion feature. It should be noted that the prediction and recognition process of the second prediction sublayer 1 and the second prediction sublayer n is the same as that of the first prediction sublayer, and will not be repeated here.
[0095] S104: According to the difference between the first feature classification label and the first predicted classification result, and according to the difference between the second feature classification label set and the second predicted classification result set, iteratively adjust the parameters of the initial image recognition model until the adjusted model meets the preset fine-tuning cutoff condition, and end the adjustment to obtain the target image recognition model.
[0096] In this step, a classification label in the second feature classification label set corresponds to a classification result in the second predicted classification result set, that is, a classification label and a classification result can correspond to a difference. It should be noted that in this application, different features can be located in the second feature classification label set and the second predicted classification result set according to different agreements of the features. For example, the second feature classification label and the second predicted classification result corresponding to feature A are both located in the first position in the second feature classification label set and the second predicted classification result set, so as to facilitate the extraction of classification labels and classification results and ensure the accuracy of the data to a certain extent.
[0097] It should also be noted that the preset fine-tuning cutoff conditions in the present application include a first-level classification loss condition and a second-level classification loss condition set, wherein the first-level classification loss condition is used to iteratively adjust the parameters of the first prediction sublayer in the initial image recognition model according to the difference between the first feature classification label and the first predicted classification result; the second-level classification loss condition set is used to iteratively adjust the parameters of multiple second prediction sublayers in the initial image recognition model according to the difference between the second feature classification label set and the second predicted classification result set, and a second-level classification loss condition in the second-level classification loss condition set is used to adjust the parameters of a second prediction sublayer.
[0098] In an achievable implementation, the preset fine-tuning cutoff condition LOSS can be expressed by formula (5), which is specifically expressed as follows:
[0099]
[0100] in, represents the first feature classification label, Represents the classification label of the second feature, α represents the classification loss weight of the first image fusion feature belonging to the main classification, and β represents the classification loss weight of the first image fusion feature belonging to the sub-classification. It should be noted that the closer the classification label is to the predicted probability, the smaller the LOSS value is. In this application, the LOSS value can meet the preset LOSS value, or the model reaches the maximum iteration round, and it is considered that the model meets the preset fine-tuning cutoff condition, and the adjustment is ended to obtain the target image recognition model. It should also be noted that in the process of model fine-tuning, the classification loss weight α>β can be made in this application, so that the model can learn the features of the main classification first, improve the convergence of the model, and also help to improve the generalization performance of the sub-classification.
[0101] In summary, in this embodiment, the target image sample and the initial image sample are subjected to difference minimization processing to obtain the first image fusion feature, and then the first image fusion feature is predicted and recognized using the initial image recognition model to obtain the first predicted classification result corresponding to the first image fusion feature, and the second predicted classification result set under the first predicted classification result, and finally, the initial image recognition model is fine-tuned according to the first predicted classification result and the second predicted classification result set to obtain the target image recognition model. It can be seen that in this application, the initial image recognition model is fine-tuned by means of confusion transfer learning, which can reduce the amount of model training and increase the model training speed, as well as introduce the main classification loss and sub-classification loss at the same time, and by adjusting the loss weight between the two, a better recognition effect can be achieved.
[0102] See also Figure 8 , which is a flow chart of a method for image recognition provided by an embodiment of the present application. Figure 8 The picture recognition method shown includes the following steps, and the target picture recognition model used in the following steps is obtained according to the construction method of the above picture recognition model:
[0103] S801: Obtain a picture to be identified.
[0104] In this step, the pictures to be identified include pictures uploaded by users, that is, pictures that need to be identified before being uploaded to the network.
[0105] S802: Input the image to be identified into a target image recognition model, use the target image recognition model to identify the image to be identified, and obtain a first classification result corresponding to the image to be identified and a second classification result set under the first classification result.
[0106] It should be noted that the recognition process in this step is similar to the prediction recognition process mentioned in step S103 above, and will not be described in detail here. The target image recognition model has the same structure as the initial image recognition model, and the only difference is some parameters of the model.
[0107] S803: Determine, based on the first classification result and the second classification result set, that the image to be identified is a target image.
[0108] It should be noted that the target image in this step is a bad image or a normal image, and the target image is confirmed based on the first classification result and the second classification result set. And the target image recognition model can be a model that only recognizes images corresponding to the same classification (i.e., the same main classification and multiple sub-classifications under the same main classification), or a model that recognizes images corresponding to multiple classifications (i.e., different main classifications and multiple sub-classifications corresponding to different main classifications), which can be determined according to the actual model building process.
[0109] And if the target image recognition model is a model for recognizing images corresponding to multiple classifications, when recognizing image A, the target image recognition model can output multiple first classification results and multiple second classification results for image A, and respectively extract the highest classification result among the multiple first classification results and the highest classification result among the multiple second classification results, and determine the image classification of image A based on this, thereby determining whether image A is a bad image or a normal image. In summary, when applying the target image recognition model, the present application can satisfy both the recognition of the initial image and the recognition of the target image, thereby improving the recognition accuracy of the image.
[0110] Based on the method for constructing an image recognition model provided in the aforementioned embodiment, the present application also provides a device for constructing an image recognition model accordingly. Fig. 9 A schematic diagram of a device for constructing an image recognition model provided in an embodiment of the present application. Fig. 9 As shown, the construction device of the image recognition model includes:
[0111] A sample label acquisition unit 901 is used to acquire a target image sample, an initial image sample, a first feature classification label, a second feature classification label set under the first feature classification label, and an initial image recognition model, wherein the initial image recognition model is constructed based on the initial image sample, and the target image sample and the initial image sample belong to the same image classification but have different image display types;
[0112] A minimization processing unit 902 is used to perform a difference minimization process on the target image sample and the initial image sample to obtain a first image fusion feature;
[0113] A feature prediction and recognition unit 903 is used to input the first picture fusion feature into the initial picture recognition model, use the initial picture recognition model to predict and recognize the first picture fusion feature, and obtain a first prediction classification result corresponding to the first picture fusion feature and a second prediction classification result set under the first prediction classification result;
[0114] The recognition model generation unit 904 is used to iteratively adjust the parameters of the initial image recognition model according to the difference between the first feature classification label and the first predicted classification result, and according to the difference between the second feature classification label set and the second predicted classification result set, until the adjusted model meets the preset fine-tuning cutoff condition, and end the adjustment to obtain the target image recognition model, wherein a classification label in the second feature classification label set corresponds to a classification result in the second predicted classification result set.
[0115] In an achievable implementation, the feature prediction and recognition unit 903 includes:
[0116] a fusion feature processing unit, configured to perform feature processing on the first image fusion feature by using the initial image recognition model to obtain a second image fusion feature;
[0117] A feature classification prediction unit is used to use the initial image recognition model to perform classification prediction on the second image fusion feature to obtain a first predicted classification result corresponding to the first image fusion feature and a second predicted classification result set under the first predicted classification result.
[0118] In an achievable implementation, the fusion feature processing unit is specifically used to:
[0119] Using the local feature extraction layer in the initial image recognition model, perform local feature extraction on the first image fusion feature to obtain a local feature corresponding to the first image fusion feature;
[0120] Using the global feature extraction layer in the initial image recognition model, performing global feature extraction on the first image fusion feature to obtain a global feature corresponding to the first image fusion feature;
[0121] The feature fusion layer in the initial image recognition model is used to perform feature fusion on the local features and the global features to obtain a second image fusion feature.
[0122] In an achievable implementation, the feature classification prediction unit includes:
[0123] A first classification prediction unit, configured to perform classification prediction on the second image fusion feature by using the first prediction sublayer in the classification prediction layer in the initial image recognition model, and obtain a first prediction classification result corresponding to the first image fusion feature;
[0124] The second classification prediction unit is used to use multiple second prediction sub-layers in the classification prediction layer in the initial image recognition model to perform classification prediction on the second image fusion feature to obtain a second prediction classification result set under the first prediction classification result corresponding to the first image fusion feature.
[0125] In an achievable implementation, the first classification prediction unit includes:
[0126] A feature convolution processing unit, configured to perform convolution processing on the second image fusion feature using the convolution layer in the first prediction sublayer to obtain a convolution feature map;
[0127] a feature map gradient processing unit, configured to perform gradient processing on the convolution feature map using the global average pooling layer in the first prediction sublayer to obtain a prediction vector corresponding to the second image fusion feature;
[0128] A vector probability conversion unit is used to use the classification output layer in the first prediction sublayer to perform probability conversion on the prediction vector, obtain the classification probability corresponding to the first picture fusion feature, and use the classification probability as the first prediction classification result corresponding to the first picture fusion feature.
[0129] In an achievable implementation, the feature map gradient processing unit is specifically used to:
[0130] Performing gradient mapping on the convolution feature map using the gradient activation mapping layer in the global average pooling layer to obtain a gradient heat map, wherein the gradient heat map is used to indicate a picture classification direction for the initial picture sample;
[0131] Classify and predict the gradient heat map to obtain a prediction vector corresponding to the second image fusion feature.
[0132] In a feasible implementation, the first feature classification label is a classification label containing a first bad picture element, or a classification label containing a second bad picture element, or a classification label containing a normal picture element, wherein the badness of the first bad picture element is greater than the badness of the second bad picture element; the second feature classification label set under the first feature classification label includes a plurality of classification labels of display types containing picture elements.
[0133] In an achievable implementation, the preset fine-tuning cutoff condition includes a primary classification loss condition and a secondary classification loss condition set, wherein the primary classification loss condition is used to iteratively adjust the parameters of the first prediction sublayer in the initial image recognition model according to the difference between the first feature classification label and the first predicted classification result;
[0134] The secondary classification loss condition set is used to iteratively adjust the parameters of multiple second prediction sub-layers in the initial image recognition model according to the difference between the second feature classification label set and the second predicted classification result set, and a secondary classification loss condition in the secondary classification loss condition set is used to adjust the parameters of a second prediction sub-layer.
[0135] The device for constructing the image recognition model provided in the embodiment of the present application has the same beneficial effects as the method for constructing the image recognition model provided in the above embodiment, which will not be repeated here.
[0136] Based on the image recognition method provided in the aforementioned embodiment, the present application also provides an image recognition device accordingly. Fig.10 This is a schematic diagram of the structure of an image recognition device provided in an embodiment of the present application. Fig.10 As shown, the image recognition device includes:
[0137] The to-be-recognized picture acquisition unit 1001 is used to acquire the to-be-recognized picture, wherein the to-be-recognized picture includes a picture uploaded by a user;
[0138] The image to be identified unit 1002 is used to input the image to be identified into a target image recognition model, identify the image to be identified using the target image recognition model, and obtain a first classification result corresponding to the image to be identified and a second classification result set under the first classification result, wherein the target image recognition model is a model trained according to the training method of the image recognition model described in the first aspect;
[0139] The target picture determination unit 1003 is used to determine that the picture to be identified is a target picture according to the first classification result and the second classification result set, wherein the target picture is a bad picture or a normal picture.
[0140] The image recognition device provided in the embodiment of the present application has the same beneficial effects as the image recognition method provided in the above embodiment, which will not be repeated here.
[0141] The present application also provides a computer device. The identification device includes:
[0142] A memory having a computer program stored therein.
[0143] A processor is used to execute a computer program in a memory to implement some or all of the steps in the method for constructing an image recognition model described in the foregoing embodiments, or to implement some or all of the steps in the method for image recognition described in the foregoing embodiments.
[0144] The present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements some or all of the steps in the method for constructing the image recognition model described in the above embodiment, or implements some or all of the steps in the method for image recognition described in the above embodiment.
[0145] It should be noted that the "first" and "second" (if any) in the names such as "first" and "second" mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.
[0146] It should also be noted that the various embodiments in this specification are described in a progressive manner, and the same and similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and equipment embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0147] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for constructing an image recognition model, characterized in that: include: Obtaining a target image sample, an initial image sample, a first feature classification label, a second feature classification label set under the first feature classification label, and an initial image recognition model, wherein the initial image recognition model is constructed based on the initial image sample, and the target image sample and the initial image sample belong to the same image classification but have different image display types; Performing difference minimization processing on the target image sample and the initial image sample to obtain a first image fusion feature; Inputting the first picture fusion feature into the initial picture recognition model, using the initial picture recognition model to predict and recognize the first picture fusion feature, and obtaining a first prediction classification result corresponding to the first picture fusion feature and a second prediction classification result set under the first prediction classification result; According to the difference between the first feature classification label and the first predicted classification result, and according to the difference between the second feature classification label set and the second predicted classification result set, the parameters of the initial image recognition model are iteratively adjusted until the adjusted model meets the preset fine-tuning cutoff condition, and the adjustment is ended to obtain the target image recognition model, wherein a classification label in the second feature classification label set corresponds to a classification result in the second predicted classification result set.
2. The method according to claim 1, characterized in that The using the initial image recognition model to predict and recognize the first image fusion feature to obtain a first prediction classification result corresponding to the first image fusion feature and a second prediction classification result set under the first prediction classification result includes: Using the initial image recognition model to perform feature processing on the first image fusion feature to obtain a second image fusion feature; The initial image recognition model is used to perform classification prediction on the second image fusion feature to obtain a first predicted classification result corresponding to the first image fusion feature and a second predicted classification result set under the first predicted classification result.
3. The method according to claim 2, characterized in that The initial image recognition model includes a local feature extraction layer, a global feature extraction layer and a feature fusion layer. The using the initial image recognition model to perform feature processing on the first image fusion feature to obtain the second image fusion feature includes: Using the local feature extraction layer in the initial image recognition model, perform local feature extraction on the first image fusion feature to obtain a local feature corresponding to the first image fusion feature; Using the global feature extraction layer in the initial image recognition model, performing global feature extraction on the first image fusion feature to obtain a global feature corresponding to the first image fusion feature; The feature fusion layer in the initial image recognition model is used to perform feature fusion on the local features and the global features to obtain a second image fusion feature.
4. The method according to claim 3, characterized in that The initial image recognition model further includes a classification prediction layer, the classification prediction layer includes a first prediction sublayer and a plurality of second prediction sublayers, wherein the number of the plurality of second prediction sublayers is the same as the number of the second feature classification label sets, and one second prediction sublayer is used to predict and obtain a second prediction classification result; The using the initial image recognition model to perform classification prediction on the second image fusion feature to obtain a first prediction classification result corresponding to the first image fusion feature and a second prediction classification result set under the first prediction classification result includes: Using the first prediction sublayer in the classification prediction layer in the initial image recognition model, classify and predict the second image fusion feature to obtain a first prediction classification result corresponding to the first image fusion feature; The second image fusion feature is classified and predicted by using a plurality of second prediction sub-layers in the classification prediction layer in the initial image recognition model to obtain a second prediction classification result set under the first prediction classification result corresponding to the first image fusion feature.
5. The method according to claim 4, characterized in that The first prediction sublayer includes a convolution layer, a global average pooling layer, and a classification output layer. The first prediction sublayer in the classification prediction layer in the initial image recognition model is used to perform classification prediction on the second image fusion feature to obtain a first prediction classification result corresponding to the first image fusion feature, including: Using the convolution layer in the first prediction sublayer to perform convolution processing on the second image fusion feature to obtain a convolution feature map; Using the global average pooling layer in the first prediction sublayer to perform gradient processing on the convolution feature map, so as to obtain a prediction vector corresponding to the second image fusion feature; The prediction vector is probability-converted by using the classification output layer in the first prediction sublayer to obtain the classification probability corresponding to the first picture fusion feature, and the classification probability is used as the first prediction classification result corresponding to the first picture fusion feature.
6. The method according to claim 5, characterized in that The global average pooling layer includes a gradient activation mapping layer, and the global average pooling layer in the first prediction sublayer is used to perform gradient processing on the convolution feature map to obtain a prediction vector corresponding to the second image fusion feature, including: Performing gradient mapping on the convolution feature map using the gradient activation mapping layer in the global average pooling layer to obtain a gradient heat map, wherein the gradient heat map is used to indicate a picture classification direction for the initial picture sample; Classify and predict the gradient heat map to obtain a prediction vector corresponding to the second image fusion feature.
7. The method according to claim 1, characterized in that The first feature classification label is a classification label containing a first bad picture element, or a classification label containing a second bad picture element, or a classification label containing a normal picture element, wherein the badness of the first bad picture element is greater than the badness of the second bad picture element; the second feature classification label set under the first feature classification label includes a plurality of classification labels of display types containing picture elements.
8. The method according to claim 4, characterized in that The preset fine-tuning cutoff condition includes a primary classification loss condition and a secondary classification loss condition set, wherein the primary classification loss condition is used to iteratively adjust the parameters of the first prediction sublayer in the initial image recognition model according to the difference between the first feature classification label and the first predicted classification result; The secondary classification loss condition set is used to iteratively adjust the parameters of multiple second prediction sub-layers in the initial image recognition model according to the difference between the second feature classification label set and the second predicted classification result set, and a secondary classification loss condition in the secondary classification loss condition set is used to adjust the parameters of a second prediction sub-layer.
9. A method for image recognition, characterized in that: include: Obtaining a picture to be identified, wherein the picture to be identified includes a picture uploaded by a user; Inputting the image to be identified into a target image recognition model, identifying the image to be identified using the target image recognition model, obtaining a first classification result corresponding to the image to be identified, and a second classification result set under the first classification result, wherein the target image recognition model is a model trained according to the training method for an image recognition model according to any one of claims 1 to 8; According to the first classification result and the second classification result set, it is determined that the image to be identified is a target image, wherein the target image is a bad image or a normal image.
10. A device for constructing an image recognition model, characterized in that: include: a sample label acquisition unit, configured to acquire a target image sample, an initial image sample, a first feature classification label, a second feature classification label set under the first feature classification label, and an initial image recognition model, wherein the initial image recognition model is constructed based on the initial image sample, and the target image sample and the initial image sample belong to the same image classification but have different image display types; A minimization processing unit, used for performing a difference minimization process on the target image sample and the initial image sample to obtain a first image fusion feature; a feature prediction and recognition unit, configured to input the first picture fusion feature into the initial picture recognition model, use the initial picture recognition model to predict and recognize the first picture fusion feature, and obtain a first prediction and classification result corresponding to the first picture fusion feature and a second prediction and classification result set under the first prediction and classification result; A recognition model generation unit is used to iteratively adjust the parameters of the initial image recognition model according to the difference between the first feature classification label and the first predicted classification result, and according to the difference between the second feature classification label set and the second predicted classification result set, until the adjusted model meets the preset fine-tuning cutoff condition, and end the adjustment to obtain the target image recognition model, wherein a classification label in the second feature classification label set corresponds to a classification result in the second predicted classification result set.
11. A picture recognition device, characterized in that: include: A to-be-identified picture acquisition unit, used to acquire a to-be-identified picture, wherein the to-be-identified picture includes a picture uploaded by a user; A picture recognition unit to be recognized, used for inputting the picture to be recognized into a target picture recognition model, using the target picture recognition model to recognize the picture to be recognized, and obtaining a first classification result corresponding to the picture to be recognized, and a second classification result set under the first classification result, wherein the target picture recognition model is a model trained according to the training method of the picture recognition model according to any one of claims 1 to 8; A target picture determination unit is used to determine that the picture to be identified is a target picture according to the first classification result and the second classification result set, wherein the target picture is a bad picture or a normal picture.
12. A computer device, characterized in that: include: a memory having a computer program stored thereon; A processor, used to execute the computer program in the memory to implement the steps of the method for constructing the image recognition model described in claims 1-8, or to implement the steps of the image recognition method described in claim 9.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the steps of the method for constructing the image recognition model described in claims 1-8, or implements the steps of the image recognition method described in claim 9.
Citation Information
Patent Citations
Fungus image recognition method and device, electronic equipment and storage medium
CN111008670A
Image processing method and device, model training method and device, equipment and readable medium
CN111476309A
Knowledge distillation method and device for initial model
CN117237742A
Target detection method and system based on multi-level classification branch
CN118038133A
