Image processing method, device, computer equipment and readable storage medium

Through memory unit-assisted training and self-supervised learning, the problem of low data utilization and model optimization limitations in image scene recognition is solved, and the accuracy of image recognition and the expression of advanced semantic information are improved.

CN113705597BActive Publication Date: 2024-08-27TENCENT TECH (BEIJING) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110246521.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-05
Publication Date
2024-08-27
Estimated Expiration
2041-03-05

AI Technical Summary

Technical Problem

Existing technologies have problems with low data utilization, limited model optimization, and low recognition accuracy in image scene recognition, especially when dealing with high-level semantic recognition and confusing samples.

Method used

The memory unit is used to assist in training the image recognition model, and the classification loss value is determined by storing the judgment information of the scene category, and the model parameters are adjusted to achieve self-supervised learning and model optimization, and improve the accuracy of image recognition.

Benefits of technology

It effectively reduces the deviation of image data, improves the accuracy of image scene recognition, optimizes the model's expression of advanced semantic information, and improves data utilization efficiency and recognition effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113705597B
    Figure CN113705597B
Patent Text Reader

Abstract

The embodiment of the present application discloses an image processing method, device, computer equipment and readable storage medium. The image processing method is based on artificial intelligence technology and includes: obtaining an image to be identified; processing the image to be identified using an image recognition model to obtain a scene category corresponding to the content in the image to be identified; wherein the image recognition model is obtained by using a memory unit to assist in training; in the process of training the image recognition model using sample data, based on the scene category determination information of multiple scene categories stored in the memory unit, determining the classification loss value corresponding to the sample data, and adjusting the model parameters of the initial image recognition model based on the classification loss value to obtain a trained image recognition model. Through the embodiment of the present application, the deviation of image data processing can be effectively reduced and the scene recognition accuracy of the image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to an image processing method, apparatus, computer device, and readable storage medium. Background Art

[0002] With the rapid development of deep learning, its application in the field of image recognition has achieved great success. At present, high-level semantic recognition such as the scene of an image is more challenging than general object recognition. This is because the similarity between scenes and the existence of confused images as ambiguous samples (or noise samples) will have a certain impact on model training. In this case, the model is generally trained with clean samples first, and then the ambiguous samples are used for fine-tuning offline learning.

[0003] However, this method has some problems, such as low data utilization and certain limitations in model optimization, which lead to low accuracy in image scene recognition. Therefore, how to improve the accuracy of the model's data prediction is a problem worthy of attention. Summary of the invention

[0004] The embodiments of the present application provide an image processing method, apparatus, computer device, and readable storage medium, which can effectively reduce the deviation of processed image data and improve the scene recognition accuracy of images.

[0005] An embodiment of the present application provides an image processing method, including:

[0006] Obtain an image to be recognized;

[0007] Processing the image to be identified using an image recognition model to obtain a scene category corresponding to the content in the image to be identified;

[0008] In which, the image recognition model is obtained by using a memory unit to assist in training; in the process of training the image recognition model using sample data, the classification loss value corresponding to the sample data is determined based on the scene category judgment information of multiple scene categories stored in the memory unit, and the model parameters of the initial image recognition model are adjusted based on the classification loss value to obtain the trained image recognition model.

[0009] An embodiment of the present application provides an image processing device, including:

[0010] An acquisition module, used for acquiring an image to be recognized;

[0011] A processing module, used to process the image to be identified by using an image recognition model to obtain a scene category corresponding to the content in the image to be identified;

[0012] In which, the image recognition model is obtained by using a memory unit to assist in training; in the process of training the image recognition model using sample data, the classification loss value corresponding to the sample data is determined based on the scene category judgment information of multiple scene categories stored in the memory unit, and the model parameters of the initial image recognition model are adjusted based on the classification loss value to obtain the trained image recognition model.

[0013] An embodiment of the present application provides a computer device, including: a processor and a memory;

[0014] The memory stores a computer program, and when the computer program is executed by the processor, the processor executes the image processing method in the embodiment of the present application.

[0015] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the image processing method in the embodiment of the present application is executed.

[0016] Accordingly, the embodiment of the present application provides a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the image processing method provided in one aspect of the embodiment of the present application.

[0017] In the embodiment of the present application, the memory unit is used to assist the training of the image recognition model, specifically, the scene category determination information stored in the memory unit is used to determine the category of the sample data, and then the classification loss value is determined, and then the classification loss value is used to adjust the relevant parameters of the image recognition model to improve the overall accuracy of the image recognition model and effectively perform classification learning. By processing the image to be recognized with the image recognition model obtained after training, the accuracy of expressing high-level semantic information in the image can be optimized, thereby improving the accuracy of scene recognition of the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] 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 work.

[0019] Figure 1 It is a structural diagram of an image recognition model training phase provided in an embodiment of the present application;

[0020] Figure 2 It is a flowchart of an image processing method provided in an embodiment of the present application;

[0021] Figure 3 It is a schematic diagram of a flow chart of processing an image to be recognized by using an image recognition model provided in an embodiment of the present application;

[0022] Figure 4 is a flowchart of another image processing method provided in an embodiment of the present application;

[0023] Figure 5 It is a structural diagram of a residual learning unit for a deep network provided in an embodiment of the present application;

[0024] Figure 6 is a structural schematic diagram of an update memory unit provided in an embodiment of the present application;

[0025] Figure 7 It is a flowchart of a self-supervised generalizable scene learning framework based on memory units provided in an embodiment of the present application;

[0026] Figure 8 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;

[0027] Fig. 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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.

[0029] The following is an explanation of the definitions of key terms involved in this application.

[0030] ImageNet: A large-scale open-source dataset for general object recognition.

[0031] Image recognition: Category-level recognition, which does not consider specific instances of objects, but only considers the category of objects (such as people, dogs, cats, birds, etc.) to identify and give the category to which the object belongs. A typical example is the recognition task in ImageNet, a large-scale general object recognition open source dataset, which identifies an object as one of 1,000 categories.

[0032] Image multi-label recognition: Use computers to identify whether an image has a combination of specified attribute labels. An image may have multiple attributes, and the multi-label recognition task is to determine the preset attribute labels of a certain image.

[0033] Noisy recognition: Object recognition tasks performed using noisy samples. Noisy samples include incorrect category labeling caused by labeling errors, unclear concepts causing images and corresponding category labels to be inconsistent. (For example, the concepts of two categories partially overlap, resulting in a picture having two category attributes, but only being labeled as one category).

[0034] ImageNet pre-trained model: A deep learning network model is trained based on ImageNet, and the parameter weights of the model are obtained as the ImageNet pre-trained model.

[0035] Clean samples: samples that do not contain noise (manually confirmed).

[0036] Noisy samples: The samples contain noise data to a certain extent, but not all samples are noise.

[0037] Full samples: the union of clean samples and noisy samples.

[0038] Verification samples: samples that have been verified with artificial noise (i.e., images and their 0 or 1 labels indicating whether they are noisy).

[0039] Scene recognition tasks belong to high-level semantic recognition, which is more difficult than general object recognition. One of the major recognition problems is that there is serious confusion between scenes. For example, coffee shops and libraries are both collections of tables and chairs, and there are easily confused images in the samples. If such confused samples are regarded as noise samples, noise samples (i.e. ambiguous samples) are prone to overfitting (making opposite judgments on two similar images in the recognition results). How to identify and deal with such confused samples is a major problem.

[0040] Curriculum Net and Clean Net are both based on deep learning from noisy samples to train high-performance deep learning models. Curriculum Net is based on the idea of ​​CurriculumLearning. It uses data sets of different difficulty levels for different stages of learning, making model learning from simple to complex. It can effectively handle a large number of noise labels and data imbalance problems and complete the comprehensive training of the model. The main idea is to first learn a first-stage model on a given clean sample or full sample, then learn the noise (divide the noise sample into two-stage and three-stage data by density and give different sample weights respectively), then use the fine-tuning method to perform two-stage learning, and use the secondary fine-tuning method to perform three-stage learning as the result. Clean Net first learns a first-stage model given a full sample, then gives a verification sample and trains a noise judgment model based on the sample, then the noise judgment model predicts the noise of the full sample, and its prediction result is used as the sample weight, and finally the sample weight is applied to the two-stage model learning as the sample weight. However, the two deep learning models have common problems in the process of learning noisy samples: first, whether initializing the model with clean samples or collecting more verification samples to achieve better results, there will be more manual input due to the additional need for manual labeling. Secondly, in the fine-tuning stage or other training processes, the direct suppression of predicted noise samples will cause the loss of information that may belong to other categories, and the data utilization rate is not high. Moreover, there are cases where some samples are misclassified as noise, that is, a certain amount of difficult samples that are difficult to identify are misclassified as noise samples, which leads to overfitting of samples. Finally, due to offline learning, the model structure parameters will no longer change after they are determined. In this way, there is a deviation in the noise in the first learning, which will cause inaccurate learning and cause the subsequent model optimization to get into trouble.

[0041] Regarding how to perform deep learning tasks in scene recognition with ambiguous samples, the embodiment of the present application provides a self-supervised learning solution based on a memory bank, which learns scene categories online, builds a model, and automatically corrects the task by the model, updates the category expression batch by batch through model iteration, automatically corrects the category label of the sample, and uses a generalizable loss calculation for the confused sample, thereby realizing the model's separate self-supervised learning of different samples and improving the overall accuracy. This self-supervised learning solution is applied to the field of image recognition and involves artificial intelligence technology. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes several major directions, such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0042] Furthermore, the solution provided in the embodiment of the present application is computer vision technology (Computer Vision, CV) and machine learning (Machine Learning, ML) under the field of artificial intelligence.

[0043] Computer Vision (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to the use of cameras and computers to replace human eyes to identify, track and measure targets, and further perform graphics processing so that the computer processes the images into images that are more suitable for human observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and mapping, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

[0044] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0045] It is understandable that the methods provided in the following embodiments of the present application can be executed by computer devices, including but not limited to user terminals or servers. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0046] See also Figure 1 , is a structural diagram of an image recognition model training stage provided in an embodiment of the present application, including an image feature extraction model 101, a classifier 102, a memory unit 103 and a loss calculation unit 104.

[0047] In one embodiment, the image feature extraction model 101 can be a convolutional neural network (CNN) or other deep convolutional neural networks VGG, etc. This model is mainly used to extract feature vectors from the input image, and is combined with the classifier 102, the memory unit 103 and the loss calculation unit 104 for adjustment and training to achieve accurate high-level semantic expression of the image content. Optionally, a pre-trained model trained with an open source dataset can be used as an image feature extraction model to perform forward training on the input image to obtain a feature vector.

[0048] The classifier 102 is used to process the feature vector obtained after the image feature extraction model 101 processes the input image to obtain the predicted classification result of the input image. The classifier can be regarded as a mapping function, which maps the input image to each category according to the feature vector, that is, the predicted value of the input image belonging to each category. Specifically, the classifier 102 is a multi-classifier, such as Softmax, SVM multi-classifier, which predicts the scene category to which the input image belongs. For example, if the scene category of image A is library, after the image feature extraction model and the classifier, the probability values ​​of the scene categories in the predicted classification results are library, classroom, cafe, playground and exhibition hall, and finally the scene category with the highest probability value is selected as the scene to which image A belongs.

[0049] The memory unit 103 (memory bank) is used to store the feature vectors corresponding to the sample images when training the model, as well as information related to each scene category, such as the scene category and its expression, threshold, etc. Since the samples used in the training process include ambiguous and non-ambiguous samples, self-supervised learning is performed on different samples through this information, and noise samples (i.e., ambiguous samples) are identified, and the scene category expression is corrected according to the feature vectors of these samples, so that the scene category tends to be more accurately expressed, thereby assisting the image feature extraction model in training and adjusting parameters to optimize the model to the best.

[0050] The loss calculation unit 104 is used to calculate the loss value according to different loss functions, and transmit the loss value back to the image feature extraction model to adjust the network parameters of the model, such as convolution template parameters and bias parameters. After multiple rounds of training, when the loss value changes within an acceptable range and reaches a convergence state, the training of the model is stopped. Among them, the loss function includes a generalizable loss function and a classification prediction loss function, which are used to calculate the loss value of ambiguous samples and the loss value of unambiguous samples respectively. Therefore, in the process of calculating the loss value according to the loss function, it is necessary to determine whether the sample is an ambiguous or unambiguous sample based on the scene category label recommended by the memory unit for the sample image and the actual scene category label of the sample, and use different loss functions for different samples to calculate and obtain the loss value.

[0051] The above-mentioned image recognition system uses memory units to assist in the training of image feature extraction models, wherein the self-supervised learning of the memory units does not require prior knowledge of whether the sample image is a confused sample (i.e., an ambiguous sample). In the model iteration, the expression of the category center by the memory unit is used to infer the confused sample, and the corresponding loss function is used for processing to achieve the optimization of the model. In this process, by continuously adjusting the category center, the expression of the category is getting closer and closer to the correctness, and the correction in the sample learning process is also better. Different loss functions are used for calculation according to the contribution of ambiguous and non-ambiguous samples to the model, thereby achieving effective classification learning.

[0052] For further understanding, please see Figure 2 , Figure 2 This embodiment of the application is based on Figure 1 A flowchart of an image processing method is provided. The method can be executed by a user terminal or by a user terminal and a server. For ease of understanding, this embodiment takes the method executed by a server as an example for explanation. The image processing method can at least include the following steps S201-S202:

[0053] S201, obtaining an image to be recognized.

[0054] In a possible embodiment, the image to be identified can be a simple single object, such as a dog or a cat, or it can be an image including multiple objects, such as an image of a library including tables, chairs, books and other background environments. Images of some specific scenes, such as concert halls, cafes, classrooms, etc., can all be used as images to be identified. Usually, in the process of image recognition, images to be identified can be obtained from a database storing images to be identified. These images to be identified can be image data uploaded by users in certain applications, or they can be image data of various scenes collected by related equipment, such as cameras. It should be noted that the specific content of the images to be identified and the method of obtaining them are not limited in the embodiments of the present application.

[0055] S202: Process the image to be recognized by using an image recognition model to obtain a scene category corresponding to the content in the image to be recognized.

[0056] In a possible embodiment, the image recognition model corresponds to the above Figure 1 The image feature extraction model 101 and the classifier 102 are combined, and the image recognition model is a memory unit (such as Figure 1In the process of training the image recognition model using sample data, the classification loss value corresponding to the sample data can be determined based on the scene category determination information of multiple scene categories stored in the memory unit, and the model parameters of the initial image recognition model can be adjusted based on the classification loss value to obtain the trained image recognition model.

[0057] Among them, the sample data is the full amount of data including clean samples and ambiguous samples. Using data with ambiguous samples to train the image recognition model is noisy training. During the training process, there is no need to distinguish between clean samples or verification samples, so there is no need for pre-labeling, which greatly reduces the cost of manual input and also improves the efficiency of model learning under large-scale data. Different loss functions can be determined according to the scene category judgment information, which belongs to self-supervised learning. The loss function includes a generalizable loss function for processing ambiguous samples and a classification loss function for processing other samples. The classification loss value is determined according to different loss functions, and the classification loss value is fed back to the image recognition model. The relevant parameters of the model are adjusted according to the classification loss value, which can improve the generalization ability of the model to the actual category. The self-supervised learning process of the memory unit is simply as follows: in each batch learning process, the class center of the memory unit is updated by extracting the category, and a sample correction suggestion is given. According to the sample correction suggestion, the loss value is calculated by selecting a generalized or non-generalized method.

[0058] By processing the image to be identified using the trained image recognition model, the corresponding scene category can be obtained. The scene category here can be one of the scenes with certain functions such as gymnasiums, conference rooms, restaurants, or scenes in other forms of expression. There is no restriction on the scene category. In the specific processing of the image to be identified, the image feature extraction model included in the image recognition model, such as a convolutional neural network, is used to extract the feature vector of the image to be identified. This feature vector is a relatively accurate high-level semantic expression of the image to be identified. The feature vector is then sent to the classifier for processing to obtain the predicted value of the image to be identified belonging to each scene category, such as the predicted probability. The scene category with the largest predicted value can be selected as the scene category corresponding to the content in the image to be identified. The content in the image to be identified refers to the conceptual part of the image, such as the tables and chairs in a cafe, the paintings in a gallery, etc. As an extended example, if the image to be identified includes multiple scene categories, for example, two scene categories of a playground and an indoor gymnasium are in one image to be identified, then the content included in the image to be identified may include the lawn, runway, and people corresponding to the playground and the ping-pong table, people, basketball stand, etc. corresponding to the indoor gymnasium, and the scene categories to which the image to be identified belongs may include a playground and an indoor gymnasium.

[0059] The implementation logic and processing flow of processing the image to be recognized according to the above trained image recognition model can be as follows Figure 3 As shown, specifically: front end A receives data (such as pictures input by users), uploads it to the back end, such as a cloud server, and then the back end uses the trained image recognition model included therein to identify and classify it, and then outputs it to front end B. Front end A and front end B here can be the same front end or different front ends, and the output result is the scene category to which the received data belongs. The image recognition model obtained by the above-mentioned noisy training can be installed in a cloud server to provide object recognition services.

[0060] In summary, this application has at least the following advantages:

[0061] The memory unit is used to assist the training of the image recognition model. Specifically, the scene category determination information stored in the memory unit is used to determine the loss function, and then the classification loss value is determined. The real-time learning of the memory unit and the update of the scene category determination information, as well as the feedback and self-update of the image recognition model, can avoid the problem of deviation caused by one-time learning noise, so that the model can be continuously optimized to ensure more accurate learning. The image to be recognized is processed using an accurate image recognition model, and the obtained feature vector expresses the image content more accurately, which can effectively improve the recognition accuracy and recognition effect of the scene category to which the image to be recognized belongs.

[0062] See also Figure 4 , Figure 4 This embodiment of the application is based on Figure 1 A flowchart of another image processing method is provided. For ease of understanding, this embodiment takes the method executed by a server as an example for explanation. The image processing method may at least include the following steps S401-S405:

[0063] S401, obtaining a sample data set.

[0064] In a possible embodiment, the sample data set includes multiple groups of sample data, each group of sample data includes a sample image and an annotated scene category label corresponding to the sample image, where the annotated scene category label is the real scene category label corresponding to the sample image, that is, the original scene category label. The sample data set includes some easily confused sample images, such as a coffee shop and a library with a collection of tables and chairs. Such samples are called ambiguous samples or noise samples. In this embodiment, the collection of the sample data set is simple and does not require too much manpower annotation investment, that is, it does not require a large amount of manpower to annotate clean samples, which is time-consuming. Only the model needs to learn the sample data set, thereby improving the speed and quickly providing a learned target recognition model. There is no restriction on the specific method of obtaining the sample data set.

[0065] S402, inputting the sample data set into an initial image recognition model for processing, extracting feature vectors of the sample images, and determining matching values ​​between the sample images and each predicted scene category label according to the feature vectors.

[0066] In a possible embodiment, the initial image recognition model can be an ImageNet pre-trained model, i.e., a deep convolutional neural network model trained using the ImageNet data set. It should be noted that the above-mentioned initial image recognition model can also use other different network structures and different pre-trained model weights as a basic model, which is not limited here. For the ImageNet pre-trained model in the embodiment of the present application, it is mainly that the convolutional layers Conv1-Conv5 use the parameters of the ResNet-101 pre-trained on the ImageNet data set, ResNet-101 is a deep residual network of 101 layers, and each module (block) is a residual learning unit. The relevant parameters of the feature module structure of ResNet-101 are shown in Table 1 below, and the classification module can be constructed using ResNet-101 as shown in Table 2 below. Wherein, the newly added layer such as the fully connected layer (FullConnection, FC) is initialized using a Gaussian distribution with a variance of 0.01 and a mean of 0.

[0067] In convolutional neural networks, the deeper the network, the more abstract the features extracted and the more semantic information it contains. Based on the increase in the number of original network layers, the accuracy on the sample training set will reach saturation or even decrease, and degradation problems will occur. The residual network learns a residual function F(x) = H(x)-x, where H(x) is the feature learned by the model when the input is x. Since the value corresponding to the residual function is relatively small, it is easier to fit the model residual and easier to optimize, and the accuracy can be improved by increasing the depth. In this way, the use of residual networks can solve the degradation problem caused by increased depth, and simply increasing the network depth can improve network performance. Similarly, the deep residual network ResNet-101 can make the semantic information of the feature vector of the extracted sample image richer and more accurate, so that the matching value between the sample image and each predicted scene category label obtained by processing the feature vector using the classification module is more reliable. The predicted scene category refers to all scene categories included in the sample data. Correspondingly, each predicted scene category label is a different annotated scene category label. The matching value refers to the predicted value of the sample image belonging to the predicted scene category label. For example, assuming that the annotated scene category labels have categories 1 to 100, the matching value obtained after processing the sample image A can be the probability that the sample image A belongs to category 1 to category 100, similar to [m1,m2,...,m 100 ] in this format.

[0068] In one embodiment, the sample data set is divided into multiple batches and input into the initial image recognition model for training. Each batch contains multiple sample data. For the feature vectors corresponding to the sample images in each batch, not only can the prediction value of each sample image belonging to each scene category be obtained, but it can also be stored in a temporary storage unit for subsequent use.

[0069] Using sample data sets to train the model is the process of model learning. Deep neural networks can be trained using the recognition model training method. Assuming that the recognition task is N-category image recognition, the specific process includes parameter initialization, training, and generalization loss of self-supervised ambiguous samples based on memory units. Parameter initialization is involved in this step.

[0070] Table 1. Feature module structure of ResNet-101

[0071]

[0072] The feature module of the above ResNet-101 is composed of multiple residual learning units connected together, see Figure 5 , Figure 5 It is a structural diagram of the residual learning unit for deep networks, such as Figure 5 As shown in the figure, the short-circuit mechanism is added to the residual unit. When the input and output dimensions are consistent, they are directly added. When the dimensions are inconsistent, there are two ways to short-circuit the connection. The dimension can be increased by using pooling with stride=2 without increasing parameters, or a new mapping can be used, but this generally increases the parameters and the amount of calculation.

[0073] Table 2 Classification module structure based on ResNet-101

[0074] Layer Name Output size layer Pool_cr 1x2048 Max Pooling Layer Fc_cr 1xN Fully connected layer

[0075] Where N is the number of categories to be learned. The pooling layer sandwiched between continuous convolutional layers can reduce the dimensionality of image features, retain important information, and reduce overfitting by compressing the amount of data and parameters. Max pooling can achieve better results by selecting the largest element from the window and downsampling the data (data compression). The fully connected layer is at the tail of the convolutional neural network, and the feature vector of the sample image is sent to the fully connected layer and classified in conjunction with the output layer. In the embodiment of the present application, the specific process is the classification process of the scene category, and the corresponding matching value is obtained by the fully connected layer in conjunction with the output layer.

[0076] S403, acquiring scene category determination information stored in the memory unit, and determining a reference scene category label of the sample image according to the feature vector and the scene category determination information.

[0077] In a possible embodiment, the scene category determination information of each scene category includes a reference category vector and a reference similarity threshold. The reference category vector here can be regarded as the category center, which is an expression of each scene category. The category centers of different scene categories are different. The reference similarity threshold is also an expression of another dimension belonging to each scene category. Its main function is to serve as a comparison standard for reference of sample images that may belong to a certain scene category. The initialization of the memory unit (memory bank) is to extract the feature vector (embedding) of the sample image in the first batch (batch), and use the embedding center of each category as the memory bank. The threshold is recorded for each category, and the initial value is 0.5. The embedding center here is the aforementioned reference category vector, and the threshold is the reference similarity threshold. In the continuous processing of batch sample data, the scene category determination information will be automatically updated to make the determined reference scene category label more accurate, wherein the reference category label is the relevant category label assigned to the sample image by the memory unit according to certain rules.

[0078] Furthermore, the process of determining the reference scene category label of the sample image may specifically include: first determining the target similarity between the feature vector and the target reference category vector, where the target reference category vector is a reference category vector of any scene category stored in the memory unit.

[0079] In the memory unit, the stored scene categories include the reference category vectors of the scene categories included in all batches of sample data processed before the current batch of sample data. Therefore, the target reference category vector is limited to the category center in the memory unit. For example, the memory unit stores reference category vectors of categories 1 to 50, and the target reference category vector is any one of them. Optionally, corresponding to the initialization of the first batch of the above-mentioned memory unit, the feature vector here is the feature vector of the sample in the second batch. The target similarity can be the cosine similarity between the feature vector and the target reference category vector, or other methods of measuring the similarity between the feature vector and the target reference category vector, which are not limited here. Cosine similarity evaluates their similarity by calculating the cosine value of the angle between the two vectors. For the specific formula, see the following formula (1). When the similarity is closer to 1, the higher the similarity between the two vectors, and correspondingly, the closer the feature vector and the target reference category vector are to each other, the more likely the scene category of the sample image is the scene category corresponding to the target reference category vector.

[0080]

[0081] Among them, M is the feature vector and N is the target reference category vector.

[0082] Then, the target similarity is compared with the reference similarity threshold corresponding to the target reference category vector. If the comparison result indicates that the target similarity is greater than or equal to the reference similarity threshold corresponding to the target reference category vector, the scene category label corresponding to the target reference category vector is used as the reference scene category label of the sample image. It should be noted that the target similarity here is not compared with a standard close to 1, but is compared with a given reference similarity threshold. For example, when the memory unit is initialized, the reference similarity threshold is uniformly set to 0.5, so the target similarity can be compared with the value 0.5. If it is greater than 0.5, the memory unit gives all scene category labels as the relevant category labels of the sample image. Since the reference similarity threshold is continuously updated, the threshold of each scene category will change. When the scene category label of the sample image corresponding to the feature vector is related to the scene category label corresponding to the target reference category vector, that is, when the target similarity is greater than the reference similarity threshold, this scene category label is given to the sample image. For example, if the feature vector of sample image A and the reference category vectors corresponding to the 100 scene categories stored in the memory unit are calculated separately, the corresponding 100 target similarities can be obtained, and then compared with the corresponding 100 reference similarity thresholds stored in the memory unit, 50 of which have target similarities greater than the reference similarity threshold, then these 50 scene category labels are used as the reference scene category labels of sample image A.

[0083] S404: Determine a target classification loss value according to the annotated scene category label, the reference scene category label, and a matching value between the sample image and each predicted scene category label.

[0084] In a possible embodiment, a specific method for determining the target classification loss value includes the following steps: first, compare the reference scene category label with the annotated scene category label. When the reference scene category label matches the annotated scene category label, that is, the sample image has only one reference scene category label, which is consistent with the annotated scene category label corresponding to the sample image, that is, the scene category label given by the memory unit is the same as the original scene category label, and the classification prediction loss function L is used. class Calculate the corresponding target classification loss value, that is, compare the classification prediction result with the true category label to calculate the loss value of the model. The calculation expression is as follows (2):

[0085]

[0086] Among them, y takes the value of 1, is the probability value when the predicted scene category label is the original scene category label.

[0087] When the reference scene category label does not match the annotated scene category label, the matching value between the sample image and each reference scene category label is determined according to the matching value between the sample image and each predicted scene category label, and the weight parameter corresponding to each reference scene category label is determined, and the target classification loss value is determined according to the matching value between the sample image and each reference scene category label and the weight parameter corresponding to each reference scene category label. At this time, there are three mismatch situations: one is that there is only one reference scene category label and it is different from the annotated scene category label; the second is that there are two or more reference scene category labels and one of them is the same as the annotated scene category label; the third is that there are two or more reference scene category labels and none of them is the same as the annotated scene category label. The relevant category label given by the memory unit is different from the original category label, which means that the sample image is an ambiguous sample. For the above situations, the generalizable loss function is used to calculate the target classification loss value, that is, the predicted value is calculated according to all the recommended categories of the memory bank and the original annotated categories, and the loss of all labels is averaged. The specific calculation formula (3) is as follows:

[0088]

[0089] Among them, w1,...,w n is the weight coefficient, the specific value is 1 / n, n is the number of reference scene category labels, class is the original label (i.e. the annotated scene category label), L class is the loss value corresponding to the labeled scene category label, class2,...,class n is the predicted label (i.e., the reference scene category label), is the matching value between the sample image and the reference scene category label i, and y takes the value 0 or 1.

[0090] For example, if the annotated scene category label of sample image A is category 1, and the reference scene category labels are category 2, category 3, and category 4, the matching value between sample image A and the predicted scene category label includes the probability values ​​of category 1 to category 50. Since the reference scene category label does not include the annotated scene category label, that is, the reference scene category label and the annotated scene category label do not match, the generalizable loss function is used to calculate the target classification loss value, that is:

[0091]

[0092]

[0093] Among them, when calculating the loss value corresponding to each scene category, The sample image A and the probability values ​​of the predicted scene category labels of category 2, category 3, and category 4 are respectively selected for calculation. At this time, since the reference scene category labels are not the real scene category labels, that is, the annotated scene category labels, the y values ​​are all 0.

[0094] In the above, the loss value corresponding to each sample data is used as the target classification loss value. Optionally, the target classification loss value can also be calculated according to batch sample data, that is, after calculating the classification loss values ​​corresponding to all sample data in a batch, the target classification loss value is directly obtained by summing them up, or the target classification loss value is obtained by summing and averaging them.

[0095] S405, adjusting the model parameters of the initial image recognition model based on the target classification loss value to obtain a trained image recognition model.

[0096] In a possible embodiment, since the target classification loss value can be calculated by averaging a batch of sample data, the period of adjusting the model parameters of the initial image recognition model can correspond to the adjustment after each batch loss value is transmitted back, and there is no restriction on the timing of adjusting the model parameters. In the process of adjusting the image recognition model according to the target classification loss value, the knowledge learned by the image recognition model is used for self-supervision to make generalization corrections to ambiguous samples, which can avoid poor recognition performance caused by overfitting of ambiguous samples.

[0097] In each iteration, that is, each time a new batch of sample data is input into the model, the classification prediction loss or the generalization loss is calculated for each sample based on the existing scene category judgment information in the memory bank, and back-propagated to the convolutional neural network model (i.e., the initial image recognition model), and the gradient is calculated and the network weight parameters (i.e., model parameters) of the convolutional neural network model are updated through the stochastic gradient descent method (SGD). The specific process is: all parameters of the model are set to the state that needs to be learned, and during training, the neural network performs forward calculations on an input image to obtain the prediction result, and the target classification loss value obtained based on the classification prediction loss or the generalization loss is passed back to the convolutional neural network model, and the network weight parameters are updated through the stochastic gradient descent method, such as adjusting the convolution template parameter w and the bias parameter b, thereby achieving a weight optimization. After training with multiple batches of sample data, when the loss value converges, the training is stopped. Otherwise, the training is continued until the training of the full data is completed, that is, one round of learning. After that, it is determined whether a new round of training is needed. In general, the necessity of continuing model training and the degree of model optimization can be determined based on the loss value. The image recognition model obtained by the above-mentioned noisy training can also be installed in the cloud server to provide object recognition services.

[0098] In a possible embodiment, after the target classification loss value corresponding to each batch of sample data is determined, the memory bank needs to be updated while adjusting the model parameters, more specifically, the scene category determination information stored in the memory bank needs to be updated. Figure 6 , is a schematic diagram of updating the memory unit. Since the sample data is divided into multiple batches for processing, the update of the relevant information in the memory unit is also updated on a batch basis, that is, the model automatically updates the memory bank at the end of each batch. Among them, the current batch of sample data is used as the basis for updating and will be temporarily stored in the new information unit. Specifically, the feature vector corresponding to the sample image is stored. Then, the feature vector of the current batch of sample data and the relevant information stored in the memory unit are calculated and compared, and the scene category judgment information in the memory unit is automatically updated, including the reference category vector and the reference similarity threshold. Each memory unit update affects the calculation of the target classification loss value of the next batch of sample data. For example, if the memory unit stores scene category determination information corresponding to the sample data in the first batch and the second batch, when the sample data of the third batch is input into the image recognition model, the corresponding feature vector is obtained, which is first temporarily stored in the new information unit, and then calculated and compared with the scene category determination information corresponding to the sample data of the first batch and the second batch stored in the memory unit to determine the target classification loss value, and then transmitted back to the image recognition model. At this time, the original scene category determination information in the memory unit will be updated according to the sample data of the third batch, for example, new scene category determination information is added, or the original scene category determination information is replaced. After the scene category determination information is updated and the model parameters are also updated according to the returned target classification loss value, the fourth batch of sample data is processed. At this time, the memory unit stores the scene category determination information corresponding to the sample data of the first batch, the second batch and the third batch. The above operation is repeated until a sample data set training is completed. By directly learning all sample data and generalizing ambiguous samples, the efficiency of data utilization can be improved. It can avoid the situation where some noise samples with other category information cannot be effectively utilized due to noise suppression in direct noise learning, thereby improving the model's generalization ability for actual categories.

[0099] It should be noted that the memory bank is an online learning model, which means that there is no need to provide a complete training data set at the beginning. Instead, as more real-time data arrives, the model will continuously update relevant parameters during operation. By using the memory bank to record the samples seen during the model learning process and to characterize the categories, the model's self-perception ability for ambiguous samples can be improved.

[0100] Specifically, the update method corresponding to the reference category vector included in the scene category determination information may include: first, for the target scene category, obtaining the feature vector of one or more target sample images belonging to the target scene category label, wherein the target scene category label is any one of the multiple annotated scene category labels included in the sample data set. The feature vector of the target sample image is obtained from the feature vector corresponding to the current batch of sample data, specifically the feature vector of all sample data of the batch stored in the new information unit. Since the multiple annotated scene category labels in each batch of sample data can be classified into at least one scene category, each scene category corresponds to one or more sample images, therefore, the target scene category label can also be any one of the multiple annotated scene category labels included in the batch of sample data, and each target scene category label is a different scene category. For example, the batch of sample data includes 1024 groups of sample data, including 1024 sample images and corresponding 1024 annotated scene category labels, and the scene categories corresponding to the 1024 annotated scene category labels are 50 in total, therefore, there are also 50 target scene category labels, traversing each scene category.

[0101] Then, the updated reference category vector of the corresponding scene category is determined based on the feature vector of one or more target sample images. Specifically, the feature vectors of the target sample images of the same scene category in the batch sample data are averaged to obtain the average feature vector of each scene category, and the average feature vector is used as the updated reference category vector. According to the above example, if there are 50 scene categories, there are 50 corresponding updated reference category vectors, and the reference category vector of the corresponding scene category stored in the memory unit is updated based on the updated reference category vector. Given that each reference category vector is an expression of the scene category, that is, an update of the category expression in the memory unit, and for the categories that are not sampled in this batch (that is, the scene categories not included in this batch), the corresponding category expression is not updated. The specific update expression is as follows (4):

[0102] C mem =a1C mem +a2C embedding (4)

[0103] Among them, a1 and a2 are preset parameters, C memis the reference category vector stored in the memory unit, C embedding To update the reference category vector.

[0104] The preset parameters a1 and a2 are artificial experience values. Since the feature vectors corresponding to the ambiguous samples and the unambiguous samples in the target scene category are uniformly calculated when determining the updated reference category vector, the preset parameters can be adjusted according to the contribution of the ambiguous samples or the unambiguous samples to the update of the reference category vector. For example, when the feature vectors corresponding to the ambiguous samples in the updated reference category vector account for a large proportion, the updated reference category vector will be inaccurate. At this time, a2 needs to be adjusted to a smaller value and a1 needs to be adjusted to a larger value, so that the original reference category vector in the memory unit changes less and the error in the update process is reduced. Optionally, when calculating the average feature vector of each scene category, it can be calculated based on the unambiguous samples, and the feature vectors corresponding to the ambiguous samples can be excluded. That is, in the selection of the target sample image, the sample image whose reference scene category label matches the annotated scene category label is selected, so that the updated reference category vector obtained will be more accurate.

[0105] The update method corresponding to the reference similarity threshold included in the scene category determination information may include: first, for the target scene category, determine the number of target sample images belonging to the target scene category label. The target scene category label is the same as the definition when updating the reference category vector mentioned above. Each target scene category in the batch sample data includes at least one target sample image, and correspondingly, the matching value between each target sample image and the target scene category label determined by the initial image recognition model is obtained, that is, the predicted probability that the target sample image belongs to the target scene category label, and then the new reference similarity threshold of the target scene category is determined based on the matching value and the number of target sample images, and then the reference similarity threshold included in the scene category determination information of the target scene category stored in the memory unit is updated based on the new reference similarity threshold. According to the predicted probability of each sample image in the current batch in the category to which it belongs, the mean is calculated, and the specific expression is as follows (5):

[0106]

[0107] Among them, C i represents the sample set of category i in the current batch, P ji It represents the predicted probability of sample j for category i, and the maximum value of i is the number of scene categories in the current batch.

[0108] It should be noted that if the scene categories in the current batch include category 1 and category 2, and the memory unit includes category 1, then the reference similarity thresholds for category 1 and category 2 will be updated. As an extended embodiment, the update calculation of the category threshold (i.e., the reference similarity threshold) can also replace all samples belonging to the category in the current batch with those samples whose categories recommended by the memory unit in the category are the same as the original category, that is, in the update of the sample threshold, the relevant data of the ambiguous sample is not included. In addition, for the update method of the category threshold, the new category threshold can replace the original category threshold in the memory unit, or the new category threshold and the original category threshold can be stored together in the memory unit, and the best category threshold is selected to give the relevant category label (i.e., the reference scene category label) during comparison, and it can also be similar to updating the category center, selecting preset parameters, assigning different update weights according to the importance of the original category threshold and the new category threshold, and weighted calculation to obtain a value as the new category threshold. The settings of parameters such as weights and category thresholds in the embodiment of the present application can also be modified according to data needs, and are not limited here.

[0109] In a possible embodiment, the specific learning framework corresponding to the image processing method of steps S401-S405 can be found in Figure 7 , is a flowchart of a self-supervised generalizable scene learning framework based on memory units, which involves a self-supervised training method based on memory bank category expression and sample granularity generalizable loss design. The training framework in which memory bank and model learning are performed synchronously and alternately adds unsupervised fast and effective noise discrimination (i.e., the relevant category labels recommended by the memory unit to the sample image) and task correction module (i.e., the update of the memory unit) to the overall learning task, and directly applies the task correction results to the next round of learning (no need for staged data fine-tuning), so as to achieve the effect that the learning efficiency is not affected even if new label learning is performed multiple times.

[0110] The learning process includes the basic model feature CNN extracting the feature vector of the image (CNN-embedding), memory bank initialization (or updating each round), label prediction and loss decision based on memory bank, and finally loss calculation and model update. When entering the memory bank stage, first selectively update the category expression in the memory bank, then infer the possible label of the sample based on the memory bank, decide whether to use the generalizable loss for this sample data, calculate the loss based on the judgment of each sample in this batch, and then update the model to complete the training of the full data once, and decide whether to continue training after this round of learning. Specifically, the sample images in the sample data are input into the CNN model to obtain the corresponding feature vector, and the original scene category label is given to the loss function decision module. The feature vector is automatically updated to the memory unit model (class memory bank modeling). For the first batch, the scene category determination information is initialized, and the predicted value of the sample image belonging to each scene category is obtained through the classifier. Correction opinions are given according to the scene category determination information in the memory unit, which can be understood as the relevant category label given to the sample image by the memory unit. According to the relevant category label and the original scene category label, it is determined whether the loss function uses a generalizable loss or a classification prediction loss. In this way, the training model does not need to know any image noise information in advance, so that the data can be maximized, and the category information is automatically represented according to the model, and the corrected category is gradually inferred according to the category information representation. Through gradual iteration and feedback, the category representation and loss correction are mutually promoted, avoiding the model from falling into the local optimum, and ensuring that the model learning is carried out in the direction of better recognition effect.

[0111] In summary, the embodiments of the present application have at least the following advantages:

[0112] In the process of using sample data to train the initial image recognition model, all sample data are directly learned. There is no need to invest additional manpower to label clean samples or ambiguous samples. Instead, the memory unit is used to assist the initial image recognition model training, automatically distinguish and correct ambiguous samples. Specifically, the target classification loss value is determined based on the scene category judgment information and sample data stored in it, and the scene category judgment information is continuously iterated, so that the scene category judgment information and the target classification loss value promote each other, ensure the best effect of model learning, reduce the deviation in the learning process, and improve the model's self-perception ability of ambiguous samples. Among them, the generalizable loss function calculated for ambiguous samples improves the model's processing ability for ambiguous samples, improves the efficiency of data utilization, realizes the model's self-perception of scene categories and iterative learning of self-supervised verification data, and avoids the model falling into local optimality caused by single deviations caused by offline learning noise weights or updating labels. The overall model training efficiently uses all sample data for weakly supervised learning, combines the sample's labeled scene category labels with memory unit self-supervised learning, and improves the image recognition effect.

[0113] See also Figure 8 , is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application. The image processing device may be a computer program (including program code) running in a computer device, for example, the image processing device is an application software; the image processing device is used to execute the corresponding steps in the method provided in an embodiment of the present application. The image processing device 80 includes: an acquisition module 801 and a processing module 802, wherein:

[0114] An acquisition module 801 is used to acquire an image to be recognized;

[0115] The processing module 802 is used to process the image to be recognized by using an image recognition model to obtain a scene category corresponding to the content in the image to be recognized; wherein the image recognition model is obtained by using a memory unit to assist in training; in the process of training the image recognition model by using sample data, based on the scene category judgment information of multiple scene categories stored in the memory unit, the classification loss value corresponding to the sample data is determined, and based on the classification loss value, the model parameters of the initial image recognition model are adjusted to obtain a trained image recognition model.

[0116] In one embodiment, the image processing device 80 further includes a determination module 803 and an adjustment module 804, wherein:

[0117] The acquisition module 801 is further used to acquire a sample data set, wherein the sample data set includes multiple groups of sample data, each group of sample data includes a sample image and an annotated scene category label corresponding to the sample image;

[0118] The processing module 802 is further used to input the sample data set into the initial image recognition model for processing, extract the feature vector of the sample image, and determine the matching value between the sample image and each predicted scene category label according to the feature vector;

[0119] A determination module 803 is used to obtain the scene category determination information stored in the memory unit, and determine a reference scene category label of the sample image according to the feature vector and the scene category determination information;

[0120] The determination module 803 is further used to determine a target classification loss value according to the annotated scene category label, the reference scene category label, and a matching value between the sample image and each predicted scene category label;

[0121] The adjustment module 804 is used to adjust the model parameters of the initial image recognition model based on the target classification loss value to obtain a trained image recognition model.

[0122] In one embodiment, the determination module 803 is specifically used to: when the reference scene category label does not match the annotated scene category label, determine the matching value between the sample image and each reference scene category label according to the matching value between the sample image and each predicted scene category label; determine the weight parameters corresponding to each reference scene category label, and determine the target classification loss value according to the matching value between the sample image and each reference scene category label and the weight parameters corresponding to each reference scene category label.

[0123] In one embodiment, the determination module 803 is specifically used to: determine the target similarity between the feature vector and the target reference category vector, where the target reference category vector is a reference category vector of any scene category stored in the memory unit; compare the target similarity with a reference similarity threshold corresponding to the target reference category vector; if the comparison result indicates that the target similarity is greater than or equal to the reference similarity threshold corresponding to the target reference category vector, then use the scene category label corresponding to the target reference category vector as the reference scene category label of the sample image.

[0124] In one embodiment, the image processing device 80 further includes an updating module 805, wherein:

[0125] The acquisition module 801 is further used to acquire, for a target scene category, a feature vector of one or more target sample images belonging to a target scene category label, wherein the target scene category label is any one of a plurality of annotated scene category labels included in the sample data set;

[0126] The determination module 803 is further configured to determine an updated reference category vector of a corresponding scene category according to the feature vectors of the one or more target sample images;

[0127] The updating module 805 is configured to update the reference category vector of the corresponding scene category stored in the memory unit according to the updated reference category vector.

[0128] In one embodiment, the determination module 803 is further used to determine, for a target scene category, the number of target sample images belonging to a target scene category label, where the target scene category label is any one of a plurality of annotated scene category labels included in the sample data set;

[0129] The acquisition module 801 is further used to obtain the matching value between each target sample image determined by the initial image recognition model and the target scene category label;

[0130] The determination module 803 is further used to determine a new reference similarity threshold of the target scene category according to a matching value between the target sample image determined by the initial image recognition model and the target scene category label and the number of the target sample images;

[0131] The updating module 805 is further configured to update the reference similarity threshold included in the scene category determination information of the target scene category stored in the memory unit according to the new reference similarity threshold.

[0132] It is understandable that the functions of the functional modules of the image processing device described in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment, and the specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated here.

[0133] See also Fig. 9 , is a schematic diagram of the structure of a computer device provided in an embodiment of the present application, the computer device 90 may include a processor 901, a memory 902, a network interface 903 and at least one communication bus 904. Among them, the processor 901 is used to schedule computer programs, and may include a central processing unit, a controller, and a microprocessor; the memory 902 is used to store computer programs, and may include a high-speed random access memory, a non-volatile memory, such as a disk storage device, a flash memory device; the network interface 903 provides a data communication function, and the communication bus 904 is responsible for connecting various communication elements.

[0134] The processor 901 may be used to call a computer program in the memory to perform the following operations:

[0135] Obtain an image to be recognized;

[0136] The image to be recognized is processed by an image recognition model to obtain a scene category corresponding to the content in the image to be recognized; wherein the image recognition model is obtained by training with the assistance of a memory unit; in the process of training the image recognition model by using sample data, based on the scene category judgment information of multiple scene categories stored in the memory unit, a classification loss value corresponding to the sample data is determined, and based on the classification loss value, the model parameters of the initial image recognition model are adjusted to obtain a trained image recognition model.

[0137] In one embodiment, the processor 901 is also used to: obtain a sample data set, the sample data set including multiple groups of sample data, each group of sample data including a sample image and an annotated scene category label corresponding to the sample image; input the sample data set into an initial image recognition model for processing, extract a feature vector of the sample image, and determine a matching value between the sample image and each predicted scene category label based on the feature vector; obtain scene category determination information stored in the memory unit, and determine a reference scene category label of the sample image based on the feature vector and the scene category determination information; determine a target classification loss value based on the annotated scene category label, the reference scene category label, and the matching value between the sample image and each predicted scene category label; and adjust the model parameters of the initial image recognition model based on the target classification loss value to obtain a trained image recognition model.

[0138] In one embodiment, the processor 901 is specifically used to: when the reference scene category label does not match the annotated scene category label, determine the matching value between the sample image and each reference scene category label according to the matching value between the sample image and each predicted scene category label; determine the weight parameters corresponding to each reference scene category label, and determine the target classification loss value according to the matching value between the sample image and each reference scene category label and the weight parameters corresponding to each reference scene category label.

[0139] In one embodiment, the processor 901 is specifically used to: determine the target similarity between the feature vector and the target reference category vector, where the target reference category vector is a reference category vector of any scene category stored in the memory unit; compare the target similarity with a reference similarity threshold corresponding to the target reference category vector; if the comparison result indicates that the target similarity is greater than or equal to the reference similarity threshold corresponding to the target reference category vector, then use the scene category label corresponding to the target reference category vector as the reference scene category label of the sample image.

[0140] In one embodiment, the processor 901 is further used to: for a target scene category, obtain a feature vector of one or more target sample images belonging to a target scene category label, wherein the target scene category label is any one of a plurality of annotated scene category labels included in the sample data set; determine an updated reference category vector of the corresponding scene category based on the feature vectors of the one or more target sample images; and update the reference category vector of the corresponding scene category stored in the memory unit based on the updated reference category vector.

[0141] In one embodiment, the processor 901 is also used to: determine, for a target scene category, the number of target sample images belonging to a target scene category label, wherein the target scene category label is any one of a plurality of annotated scene category labels included in the sample data set; obtain a matching value between each target sample image determined by the initial image recognition model and the target scene category label; determine a new reference similarity threshold for the target scene category based on the matching value between the target sample image determined by the initial image recognition model and the target scene category label and the number of target sample images; and update the reference similarity threshold included in the scene category determination information of the target scene category stored in the memory unit based on the new reference similarity threshold.

[0142] It should be understood that the computer device described in the embodiments of the present application can implement the description of the data processing method in the embodiments, and can also execute the description of the data processing device in the corresponding embodiments, which will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here.

[0143] In addition, it should be noted that the embodiment of the present application also provides a storage medium, in which a computer program of the aforementioned data processing method is stored, and the computer program includes program instructions. When one or more processors load and execute the program instructions, the description of the data processing method in the embodiment can be implemented, which will not be repeated here, and the description of the beneficial effects of using the same method will not be repeated here. It is understandable that the program instructions can be deployed and executed on one or more computer devices that can communicate with each other.

[0144] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the steps performed in the embodiments of the above-mentioned methods.

[0145] Finally, it should be noted that the terms in the specification and claims of the present application and the above-mentioned drawings, such as first and second, etc., are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0146] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. An image processing method, characterized in that: The method comprises: Obtain an image to be recognized; Processing the image to be identified using an image recognition model to obtain a scene category corresponding to the content in the image to be identified; The image recognition model is obtained by using a memory unit to assist in training; in the process of using sample data to train the image recognition model, based on the scene category determination information of multiple scene categories stored in the memory unit, the classification loss value corresponding to the sample data is determined, and the model parameters of the initial image recognition model are adjusted based on the classification loss value to obtain the trained image recognition model, including: A sample data set is obtained, wherein the sample data set includes multiple groups of sample data, each group of sample data includes a sample image and an annotated scene category label corresponding to the sample image; the sample data set is input into an initial image recognition model for processing, a feature vector of the sample image is extracted, and a matching value between the sample image and each predicted scene category label is determined according to the feature vector; the scene category determination information stored in the memory unit is obtained, and a reference scene category label of the sample image is determined according to the feature vector and the scene category determination information; a target classification loss value is determined according to the annotated scene category label, the reference scene category label, and the matching value between the sample image and each predicted scene category label; and a model parameter of the initial image recognition model is adjusted based on the target classification loss value to obtain a trained image recognition model.

2. The method according to claim 1, characterized in that The determining of the target classification loss value according to the marked scene category label, the reference scene category label, and the matching value between the sample image and each predicted scene category label includes: When the reference scene category label does not match the annotated scene category label, determining a matching value between the sample image and each reference scene category label according to a matching value between the sample image and each predicted scene category label; Determine the weight parameters corresponding to each reference scene category label, and determine the target classification loss value according to the matching value between the sample image and each reference scene category label and the weight parameters corresponding to each reference scene category label.

3. The method according to claim 1 or 2, characterized in that The scene category determination information of each scene category includes a reference category vector and a reference similarity threshold; The step of determining a reference scene category label of a sample image according to the feature vector and the scene category determination information comprises: Determining a target similarity between the feature vector and a target reference category vector, the target reference category vector being a reference category vector of any scene category stored in the memory unit; comparing the target similarity with a reference similarity threshold corresponding to the target reference category vector; If the comparison result indicates that the target similarity is greater than or equal to the reference similarity threshold corresponding to the target reference category vector, the scene category label corresponding to the target reference category vector is used as the reference scene category label of the sample image.

4. The method according to claim 1, characterized in that The scene category determination information of each scene category includes a reference category vector, and the method further includes: For a target scene category, obtaining feature vectors of one or more target sample images belonging to a target scene category label, wherein the target scene category label is any one of a plurality of annotated scene category labels included in the sample data set; Determine an updated reference category vector of a corresponding scene category according to the feature vectors of the one or more target sample images; The reference category vector of the corresponding scene category stored in the memory unit is updated according to the updated reference category vector.

5. The method according to claim 1, characterized in that The scene category determination information of each scene category includes a reference similarity threshold, and the method further includes: For a target scene category, determining the number of target sample images belonging to a target scene category label, wherein the target scene category label is any one of a plurality of annotated scene category labels included in the sample data set; Obtaining a matching value between each target sample image determined by the initial image recognition model and the target scene category label; Determining a new reference similarity threshold of the target scene category according to a matching value between the target sample image determined by the initial image recognition model and the target scene category label and the number of the target sample images; The reference similarity threshold included in the scene category determination information of the target scene category stored in the memory unit is updated according to the new reference similarity threshold.

6. The method according to claim 4 or 5, characterized in that The target sample image is a sample image corresponding to the target scene category label and whose reference scene category label matches the annotated scene category label.

7. An image processing device, characterized in that: include: An acquisition module, used for acquiring an image to be recognized; A processing module, used to process the image to be identified by using an image recognition model to obtain a scene category corresponding to the content in the image to be identified; The image recognition model is obtained by using a memory unit to assist in training; in the process of using sample data to train the image recognition model, based on the scene category determination information of multiple scene categories stored in the memory unit, the classification loss value corresponding to the sample data is determined, and the model parameters of the initial image recognition model are adjusted based on the classification loss value to obtain the trained image recognition model, including: A sample data set is obtained, wherein the sample data set includes multiple groups of sample data, each group of sample data includes a sample image and an annotated scene category label corresponding to the sample image; the sample data set is input into an initial image recognition model for processing, a feature vector of the sample image is extracted, and a matching value between the sample image and each predicted scene category label is determined according to the feature vector; the scene category determination information stored in the memory unit is obtained, and a reference scene category label of the sample image is determined according to the feature vector and the scene category determination information; a target classification loss value is determined according to the annotated scene category label, the reference scene category label, and the matching value between the sample image and each predicted scene category label; and a model parameter of the initial image recognition model is adjusted based on the target classification loss value to obtain a trained image recognition model.

8. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a network communication function, the memory is used to store program code, and the processor is used to call the program code to execute the image processing method described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the image processing method according to any one of claims 1 to 6 is executed.

Citation Information

Patent Citations

  • Image recognition method and device, equipment and readable storage medium

    CN111582342A

  • Scene recognition method and device, computer equipment and storage medium

    CN112348117A

  • Method and apparatus for training image recognition model, network device, and storage medium

    WO2020073951A1

  • Object detection method and device, and computer storage medium

    WO2020253416A1