Method and device for determining training sample data
By manually calibrating short video frames and processing image changes, training sample data that conforms to video characteristics is generated, which solves the problem of low accuracy of static picture models in video frame recognition, improves recognition accuracy, and saves human resources.
Patent Information
- Application Number
- CN202210329395.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-03-30
AI Technical Summary
Existing static picture image recognition models have low accuracy in short video frame recognition, mainly due to the low definition of video frames, complex backgrounds, biased subject positions, and inappropriate sizes, resulting in uncertain recognition results.
By manually calibrating uncertain video frames, the baseline recognition results are obtained, and the attribute information is combined with image change processing to generate training sample data that conforms to the characteristics of the video frames, which is used to train new image recognition models and improve recognition difficulty and accuracy. .
It improves the recognition accuracy of video frames by the image recognition model, saves human resources, reduces the need for manual calibration of each sample image, and improves training efficiency.
Smart Images

Figure CN114677578B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a method and device for determining training sample data. Background Art
[0002] With the rapid development of short video business, a new function has emerged on the short video platform. Users can search for short videos based on the type of items, for example, searching for videos related to "air conditioners". For this function, the server needs to add tags to the short videos to record the types of items involved in the short videos. In this way, users only need to enter keywords, such as mobile phones, lipsticks, lighters, etc., and the server can use the keywords to find short videos with the corresponding item type tags.
[0003] When adding tags, the server generally uses an image recognition model to identify the video frames of the short video, determine the types of items involved, and then record the corresponding item type tags. Because this function is a relatively new function, the above-mentioned image recognition model generally directly uses the existing image recognition model for static pictures. In this way, there is no need to retrain the model, which can save a lot of human resources and equipment resources.
[0004] Existing image recognition models for static images are generally trained using a large number of static image samples. Such static images generally have the characteristics of high clarity, simple background, and moderate position and proportion of the subject in the image. However, short video frames often have the following characteristics: low clarity, complex background, biased position of the subject in the image, and the subject is too large or too small. This will result in low accuracy of the recognition results of the image recognition model. Summary of the invention
[0005] The present application provides a method and device for determining training sample data, which can effectively improve the recognition result accuracy of an image recognition model.
[0006] In a first aspect, a method for determining training sample data is provided, the method comprising:
[0007] Based on the trained first image recognition model, performing image recognition on the first sample image to obtain a first predicted recognition result corresponding to the first sample image;
[0008] If the first predicted recognition result satisfies the deterministic condition, the first predicted recognition result is determined as the benchmark recognition result corresponding to the first sample image, and the first sample image and the corresponding benchmark recognition result are determined as training sample data of a second image recognition model to be trained;
[0009] If the first predicted recognition result does not meet the deterministic condition, a benchmark recognition result obtained by calibrating the first sample image is obtained, and the first sample image and the calibrated benchmark recognition result are determined as training sample data for the second image recognition model to be trained.
[0010] In a possible implementation manner, the first predicted recognition result includes predicted object type information, and the reference recognition result includes reference object type information.
[0011] In a possible implementation manner, the predicted object type information includes confidences corresponding to a plurality of types, and the certainty condition includes the presence of a confidence greater than a threshold in the predicted object type information.
[0012] In a possible implementation, the method further includes:
[0013] Obtain any sample image and a corresponding benchmark recognition result in the training sample data of the second image recognition model to be trained;
[0014] Perform a change processing for increasing the difficulty of image recognition on any of the sample images to obtain a second sample image, determine a benchmark recognition result corresponding to the second sample image based on the benchmark recognition result corresponding to any of the sample images, and determine the second sample image and the corresponding benchmark recognition result as training sample data for the second image recognition model to be trained.
[0015] In a possible implementation, the change processing includes at least one of object displacement processing, scaling processing, noise adding processing, background image replacement processing, contrast reduction processing, and rotation processing.
[0016] In a possible implementation, before obtaining any sample image and a corresponding benchmark recognition result in the training sample data of the second image recognition model to be trained, the method further includes:
[0017] Obtaining attribute information of sample images whose corresponding predicted recognition results in the training sample data do not meet the deterministic condition; determining the attribute category to which each attribute information belongs, and determining a target attribute category whose number of attribute information accounts for a proportion exceeding a proportion threshold in all attribute information; determining a target image change mode corresponding to the target attribute category based on a correspondence between the attribute category and an image change mode for increasing the difficulty of image recognition;
[0018] The step of performing a change process on any of the sample images to increase the difficulty of image recognition to obtain a second sample image includes:
[0019] Based on the target image change mode, any one of the sample images is changed to obtain a second sample image.
[0020] In a possible implementation manner, the first sample image is a video frame of a sample video;
[0021] The method further comprises:
[0022] Training the second image recognition model to be trained based on the training sample data;
[0023] The video frame of the target video is input into a trained second image recognition model to obtain a second predicted recognition result.
[0024] In a second aspect, a device for determining training sample data is provided, the device comprising:
[0025] A recognition module, configured to perform image recognition on a first sample image based on a trained first image recognition model to obtain a first predicted recognition result corresponding to the first sample image;
[0026] A determination module is used to determine the first predicted recognition result as a benchmark recognition result corresponding to the first sample image if the first predicted recognition result meets the deterministic condition, and determine the first sample image and the corresponding benchmark recognition result as training sample data for a second image recognition model to be trained; if the first predicted recognition result does not meet the deterministic condition, obtain the benchmark recognition result obtained by calibrating the first sample image, and determine the first sample image and the calibrated benchmark recognition result as training sample data for the second image recognition model to be trained.
[0027] In a possible implementation manner, the first predicted recognition result includes predicted object type information, and the reference recognition result includes reference object type information.
[0028] In a possible implementation manner, the predicted object type information includes confidences corresponding to a plurality of types, and the certainty condition includes the presence of a confidence greater than a threshold in the predicted object type information.
[0029] In a possible implementation manner, the determining module is further configured to:
[0030] Obtain any sample image and a corresponding benchmark recognition result in the training sample data of the second image recognition model to be trained;
[0031] Perform a change processing for increasing the difficulty of image recognition on any of the sample images to obtain a second sample image, determine a benchmark recognition result corresponding to the second sample image based on the benchmark recognition result corresponding to any of the sample images, and determine the second sample image and the corresponding benchmark recognition result as training sample data for the second image recognition model to be trained.
[0032] In a possible implementation, the change processing includes at least one of object displacement processing, scaling processing, noise adding processing, background image replacement processing, contrast reduction processing, and rotation processing.
[0033] In a possible implementation manner, the determining module is further configured to:
[0034] Obtaining attribute information of sample images whose corresponding predicted recognition results in the training sample data do not meet the deterministic condition; determining the attribute category to which each attribute information belongs, and determining a target attribute category whose number of attribute information accounts for a proportion exceeding a proportion threshold in all attribute information; determining a target image change mode corresponding to the target attribute category based on a correspondence between the attribute category and an image change mode for increasing the difficulty of image recognition;
[0035] The determining module is used to:
[0036] Based on the target image change mode, any one of the sample images is changed to obtain a second sample image.
[0037] In a possible implementation manner, the first sample image is a video frame of a sample video, and the device further includes:
[0038] A training module, used for training the second image recognition model to be trained based on the training sample data;
[0039] The application module is used to input the video frame of the target video into the trained second image recognition model to obtain a second predicted recognition result.
[0040] In a third aspect, a computer device is provided, comprising a processor and a memory, wherein the memory is used to store computer instructions, and the processor is used to execute the computer instructions stored in the memory, so that the computer device executes the method of the first aspect and possible implementations thereof.
[0041] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code. When the computer program code is executed by a computer device, the computer device executes the method of the first aspect and possible implementations thereof.
[0042] In a fifth aspect, a computer program product is provided. The computer program product includes a computer program code. When the computer program code is executed by a computer device, the computer device executes the method of the first aspect and possible implementations thereof.
[0043] In the embodiment of the present application, an image that meets the image characteristics of the use scenario of the second image recognition model to be trained can be selected as a sample image, and the sample image is first recognized by the existing first image recognition model. If the recognition result is accurate, the sample image and the recognition result are used as the training sample data of the second image recognition model. If the result is not accurate enough, manual calibration is performed, and the calibrated recognition result and sample image are used as the training sample data of the second image recognition model. In this way, even if the usage scenarios corresponding to the trained first image recognition model and the second image recognition model to be trained are different (for example, the first image recognition model is for static pictures, and the second image recognition model is for video frames), the above method can also be used to accurately calibrate the sample images that the first image recognition model cannot accurately recognize, thereby obtaining a large amount of training sample data, and the sample images in these training sample data can all use images with image characteristics that meet the use scenario of the second image recognition model, so that the second image recognition model can be trained more accurately, and the accuracy of the recognition results of the second image recognition model can be improved. Moreover, in determining the training sample data in this way, there is no need to manually calibrate each sample image, which saves a lot of manpower and improves efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments 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 creative work.
[0045] Figure 1 It is a processing schematic diagram of an RCNN model provided in an embodiment of the present application;
[0046] Figure 2 It is a processing schematic diagram of a DCN model provided in an embodiment of the present application;
[0047] Figure 3 This is a schematic diagram of a practical application of image recognition provided by an embodiment of the present application;
[0048] Figure 4 A schematic diagram of a practical application of image recognition provided by an embodiment of the present application;
[0049] Figure 5 is a structural schematic diagram of a computer device provided in an embodiment of the present application;
[0050] Figure 6 is a flowchart of a method for determining training sample data provided by an embodiment of the present application;
[0051] Figure 7 is a schematic diagram of manual calibration provided in an embodiment of the present application;
[0052] Figure 8 It is a flowchart of a method for expanding a training sample data set provided in an embodiment of the present application;
[0053] Fig. 9 It is a schematic diagram of dividing a sample image into four regions provided in an embodiment of the present application;
[0054] Fig.10 is a schematic diagram of performing object translation on a sample image provided by an embodiment of the present application;
[0055] Fig.11 is a schematic diagram of object scaling of a sample image provided by an embodiment of the present application;
[0056] Fig.12 This is a schematic diagram of a practical application of image recognition provided by an embodiment of the present application;
[0057] Fig.13 This is a schematic diagram of a practical application of image recognition provided by an embodiment of the present application;
[0058] Fig.14 is a structural diagram of a device for determining training sample data provided by an embodiment of the present application;
[0059] Fig.15 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0061] A method for determining training sample data provided in an embodiment of the present application belongs to computer vision technology in the field of artificial intelligence.
[0062] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0063] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0064] Computer Vision Technology (CV): Computer vision is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further perform graphic processing so that computer processing becomes an image that is more suitable for human eye observation or transmission to instrument 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 map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0065] The nouns involved in the embodiments are explained below:
[0066] Image recognition model: an algorithm model that identifies objects in an input image and obtains recognition results. It is a machine learning model, such as the Region Convolutional Neural Network (RCNN) model, the Fast Regional Convolutional Neural Network model, the Cascade Regional Convolutional Neural Network model, the Deep & Cross Network (DCN) model, etc. The recognition results may include the type of object, the location of the object in the image, etc.
[0067] Figure 1 This is a processing diagram of the RCNN model. A sample image is input into the RCNN model, and the model generates a series of candidate target regions through a region proposal algorithm, where the region proposal algorithm can be a selective search (SelectiveSearch). Then, the Convolutional Neural Network (CNN) features are extracted from these target regions, and the Support Vector Machine (SVM) is trained to classify these features. Finally, a bounding box (BoundingBox) regression is performed based on the classified regions.
[0068] Figure 2 This is a processing diagram of the DCN model.
[0069] The first image recognition model and the second image recognition model mentioned below may be models for performing object recognition on images with different characteristics, and they have the same type of recognition results, for example, their outputs both include the object type and the position of the object in the image.
[0070] For example, the first image recognition model is a model for object recognition for static images, and the second image recognition model is a model for object recognition for video frames. The image characteristics of static images and video frames are significantly different.
[0071] Predicted recognition result: The recognition result directly output by the model. For example, when an image is input into the model, the output may be the predicted object type information.
[0072] The predicted recognition result may include predicted object type information. The predicted recognition result may also include predicted object position information. If there are multiple objects in the image, the predicted recognition result may include predicted object position information and predicted object type information corresponding to each object.
[0073] Benchmark recognition result: A reference value (or true value) used to compare the recognition result output by the model during the model training process. The benchmark recognition result may include benchmark object type information, which includes confidence levels corresponding to multiple types, and the confidence levels are probability values. The benchmark recognition result may also include benchmark object position information. If there are multiple objects in the image, the benchmark recognition result may include benchmark object position information and benchmark object type information corresponding to each object.
[0074] Training sample data: It is data consisting of sample images and benchmark recognition results, which can be used to complete a training and parameter adjustment of the model.
[0075] Object type information: An object is an object in an image. Object type information is information used to directly or indirectly reflect the type of an object in an image. Object type information can be a vector, where each bit of the vector corresponds to an object type, and the value on each bit of the vector represents the probability of an object of the corresponding object type in the image input by the model. For example, if the object type information is (0.8, 0.1, 0.1), the first bit of the vector corresponds to a car, the second bit of the vector corresponds to a mobile phone, and the third bit of the vector corresponds to a lighter, then the probability that the image input by the model contains a car is 0.8, the probability that it contains a mobile phone is 0.1, and the probability that it contains a lighter is 0.1.
[0076] The application scenario of the embodiment of the present application is mainly that the user enters the name of a product on the short video platform to search for short videos containing the product. First, the server needs to use an image recognition model to identify the video frames of the short videos in the entire video library, determine the types of items involved, and then record the corresponding item type labels. For short videos newly added to the video library, the above approach is also adopted to record the corresponding item type labels. In this way, the server stores the identified item type labels in correspondence with the corresponding short videos, and generates a correspondence table between item type labels and short videos. Then, when the user enters the name of the product, such as "lipstick", in the short video application on the terminal, the terminal sends a request message to the server, wherein the function of the request message is to request a short video containing the "lipstick" label. The server receives the request and obtains the corresponding short video containing the "lipstick" label from the stored table of correspondence between item type labels and short videos, and sends a list of short videos containing one or more "lipstick" labels to the terminal, wherein the list includes one or more short video options. The terminal displays a list, in which the user can make a selection and click on the corresponding short video option, thereby triggering the terminal to obtain the corresponding short video from the server for display. Figure 3 , Figure 4 As shown, it is the video recommended to the user after the user searches for "clothing".
[0077] Based on the above application scenarios, a large amount of training sample data is required in the process of training the image recognition model. The embodiment of the present application provides a method for determining the training sample data, which can be implemented by a computer device. The computer device can be a server, etc. The server can be a single server or a server group consisting of multiple servers.
[0078] Figure 5 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. From the perspective of hardware composition, the structure of the computer device 500 can be as follows Figure 5 As shown, it includes a processor 510 and a memory 520.
[0079] Processor 510 may be a central processing unit (CPU) or a system on chip (SoC), etc. Processor 510 may be used to perform image recognition on a first sample image based on a trained first image recognition model, may be used to determine whether a first predicted recognition result satisfies a deterministic condition, may be used to determine the first sample image and the corresponding benchmark recognition result as training sample data for a second image recognition model to be trained, may be used to determine the first sample image and the calibrated benchmark recognition result as training sample data for the second image recognition model to be trained, and so on.
[0080] The memory 520 may include various volatile memories or non-volatile memories, such as a solid state disk (SSD), a dynamic random access memory (DRAM), etc. The memory 520 may be used to cache pre-stored data, intermediate data, and result data in the process of the image recognition model recognizing the sample image, for example, the first predicted recognition result corresponding to the first sample image, the benchmark recognition result corresponding to the first sample image, the benchmark recognition result obtained by calibrating the first sample image, the training sample data of the second image recognition model to be trained, etc.
[0081] In addition to the processor 510 and the memory 520 , the computer device 500 may further include a communication component 530 .
[0082] The communication component 530 may be a wired network connector, a wireless fidelity (WiFi) module, a Bluetooth module, a cellular network communication module, etc. The communication component 530 may be used to transmit data with other devices, and the other devices may be servers or terminals, etc. For example, the server may send the first sample image that does not meet the deterministic condition to the terminal, or the server may generate object type information according to the received location information and tag information.
[0083] In addition, the terminals or user terminals involved in the embodiments of the present application include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, car terminals, etc.
[0084] The present application embodiment provides a method for determining training sample data. Figure 6 , the processing flow of the method may include the following steps:
[0085] 601. Perform image recognition on a first sample image based on a trained first image recognition model to obtain a first predicted recognition result corresponding to the first sample image.
[0086] The first sample image may be a video frame, which may have the characteristics of low definition, complex background, biased position of the subject in the image, or the subject being too large or too small. It is an image that is difficult for the image recognition model to recognize, and may be obtained from a video frame of a short video containing product images.
[0087] For example, a short video with a high number of views is randomly extracted from the entire video account content, such as a short video with a number of views of 1 million and containing product pictures, and then all video frames of the short video are obtained. Alternatively, video frames of the short video can be extracted at certain time intervals, such as extracting one frame every 1 second. In this way, a video frame set is obtained, which is the first sample image.
[0088] The first image recognition model may be an RCNN model, a FastRCNN model, a Cascade RCNN model, etc. The trained first image recognition model is obtained by training the image recognition model with static, well-defined, high-definition, and simple-background images. In other words, this model may not be an image recognition model specifically for image recognition of video frames, and the images targeted by the model may be other types of images, such as cartoon images, in addition to the images with the above characteristics.
[0089] The first predicted recognition result is the recognition result directly output by the first image recognition model after the first sample image is input into the first image recognition model. The output recognition result may include predicted object type information, wherein the predicted object type information is information used to directly or indirectly reflect the type to which the object in the first sample image may belong, and the predicted object type information includes the confidence corresponding to multiple types in the first sample image, and the confidence is a probability value, which is used to illustrate the possibility of the first sample image having the corresponding object type.
[0090] In the embodiment of the present application, the first sample image is input into the first image recognition model, and the output predicted object type information can be a vector, each bit of the vector corresponds to an object type, and the value on each bit of the vector represents the probability (confidence) of an object of the corresponding object type in the image input by the model. For example, if the predicted object type information is (0.7, 0.2, 0.1), the first bit of the vector corresponds to a car, the second bit of the vector corresponds to a mobile phone, and the third bit of the vector corresponds to a lighter, then the probability of the image input by the model containing a car is 0.7, the probability of containing a mobile phone is 0.2, and the probability of containing a lighter is 0.1.
[0091] The first predicted recognition result may also include predicted object position information, such as the coordinates of the four vertices of the circumscribed rectangle of the object in the image. If there are multiple objects in the image, the predicted recognition result may include predicted object position information and predicted object type information corresponding to each object.
[0092] 602: If the first predicted recognition result meets the deterministic condition, the first predicted recognition result is determined as the benchmark recognition result corresponding to the first sample image, and the first sample image and the corresponding benchmark recognition result are determined as training sample data of the second image recognition model to be trained.
[0093] 603: If the first predicted recognition result does not meet the deterministic condition, a reference recognition result obtained by calibrating the first sample image is obtained, and the first sample image and the calibrated reference recognition result are determined as training sample data for a second image recognition model to be trained.
[0094] Deterministic condition, which is used to determine whether the model can identify a relatively certain object type for the sample image. If the predicted recognition result meets the deterministic condition, it means that the image recognition model is relatively certain about the recognition result. If the predicted recognition result does not meet the deterministic condition, it means that the image recognition model is not very certain about the recognition result. In the case where the first predicted recognition result is the predicted object type information, and the predicted object type information includes multiple types of confidence, the deterministic condition includes the presence of a confidence greater than a threshold in the predicted object type information. In the predicted object type information identified by the image recognition model, if the confidence corresponding to a certain object type is very high (exceeding the threshold), it means that the image recognition model can be relatively certain of the object type of the input image. If the confidence corresponding to all object types is not high, it means that the image recognition model is not very certain about the object type of the input image.
[0095] The technicians may set the threshold value based on actual needs. For example, the threshold value may be 0.6, and the deterministic condition is that there is a probability value greater than 0.6 in the prediction object information.
[0096] For example, the object type contained in the first sample image is a car, and the predicted object type information is a multi-dimensional vector (a1, a2, ..., a n ), the car corresponds to the a1 position of the vector, and the first bit of the vector represents the probability value (confidence) of "car".
[0097] For example, the predicted object type information corresponding to the first sample image is (0.8, 0.1, 0.05, 0.05). The meaning of this vector is that the probability that the first sample image contains a car is 0.8, and the probability of containing other object types is 0.1, 0.05, 0.05 respectively. At this time, the predicted object type information includes a confidence level of 0.8 greater than the threshold value of 0.6, indicating that the first image recognition model is relatively certain about the object type of the input image. In this way, it can be considered that the recognition result of the first image recognition model is certain, that is, the first predicted recognition result meets the certainty condition.
[0098] For another example, the predicted object type information corresponding to the first sample image containing only cars is (0.3, 0.2, 0.25, 0.25). At this time, the confidence included in the predicted object type information is less than the threshold value 0.6, indicating that the first image recognition model is not very sure about the object type of the input image. In this way, it can be considered that the recognition result of the first image recognition model is uncertain, that is, the first predicted recognition result does not meet the deterministic condition.
[0099] If the first predicted recognition result meets the deterministic condition, the benchmark recognition result corresponding to the first sample image is the first predicted recognition result corresponding to the first sample image; accordingly, the confidence corresponding to one or more types in the first sample image included in the benchmark object type information is the confidence corresponding to one or more types in the first sample image included in the predicted object type information. For example, if the first predicted recognition result corresponding to the first sample image meets the deterministic condition, and the predicted object type information output by the first image recognition model is (0.8, 0.7, 0.65), then the benchmark object type information is also (0.8, 0.7, 0.65).
[0100] If the first predicted recognition result does not meet the deterministic condition, the server sends the first sample image that does not meet the deterministic condition to the terminal, which can be a computer, tablet, mobile phone, etc. Taking a computer as an example, the technician opens the calibration application on the terminal, displays the first sample image on the calibration application, and uses the mouse to select the object in the first sample image, and the terminal can obtain the location information. Furthermore, the technician can also enter type information for each selected object. Finally, the calibration information is obtained, and the calibration information consists of location information and type information. Then the terminal can send the calibration information to the server. The server can determine the reference object location information based on the location information, and determine the reference object type information based on the type information to obtain the reference recognition result. Figure 7 A schematic diagram of manual calibration is provided.
[0101] The following is a simple example to illustrate:
[0102] The object contained in the first sample image is a truck. For the truck, the technician clicks on the upper left corner of the truck in the image and swipes to the lower right corner. The calibration application displays a box to frame the truck and obtain the position information of the truck in the first image recognition model, which can be the left end coordinate, top end coordinate, width, and height. At this time, an object type selection list automatically pops up above the box, which includes multiple preset type information. The technician selects "truck" in the preset type information, that is, the type information. The technician clicks Save, and the terminal obtains the corresponding calibration information. The terminal sends the calibration information to the server. The server can directly use the left end coordinate, top end coordinate, width, and height as the reference object position information. In addition, based on the type information "truck", the reference object type information can be generated. The reference object type information can be (0, 1, 0). The first bit of the vector corresponds to a car, the second bit corresponds to a truck, and the third bit corresponds to a bus.
[0103] The embodiment of the present application also provides a method for expanding a training sample data set.
[0104] When training an image recognition model, the more sample data is used, the higher the accuracy of the image detection by the trained image recognition model. For the first sample image, after being recognized by the trained first image recognition model, only a small number of sample images have recognition results that do not meet the deterministic condition. These sample images whose recognition results do not meet the deterministic condition can be considered as sample images with higher recognition difficulty. More sample images with higher recognition difficulty are more conducive to improving the accuracy of the model. In order to obtain more sample images with higher recognition difficulty, it is necessary to consider using the following method to expand the training sample data set.
[0105] See also Figure 8 , the method for expanding the training sample data set includes the following steps:
[0106] 801, obtaining attribute information of sample images whose corresponding predicted recognition results do not meet the certainty condition in the training sample data.
[0107] One or more attribute items may be preset, and the attribute items may include one or more of position information, background complexity, object area ratio, clarity, and object angle. Attribute information of the sample image may be obtained for each set attribute item.
[0108] The attribute item is location information. The process of acquiring the attribute information may be: acquiring the coordinates of the area where the coordinates of the center point of the target object are located as the location information of the target object.
[0109] The attribute item is background complexity. The process of acquiring the attribute information can be: first determine the object position information of the sample image, then determine the image area outside the object, that is, the background area, and obtain the pixel value of each pixel in the background area. Each pixel value includes component values of multiple color channels (such as R, G, B). For each color channel, the variance of the component values of each pixel under the color channel can be calculated. Add the variance corresponding to each color channel to obtain the total variance as the attribute information of the sample image.
[0110] The attribute item is the area ratio of the object. The process of obtaining the attribute information can be: obtaining the coordinates of the four vertices of the target object, calculating the area, and dividing it by the image area to obtain a value between 0 and 1.
[0111] The attribute item is definition. The process of acquiring the attribute information may be: various definition algorithms may be used to detect the definition of the sample image, and the definition value may be obtained as the attribute information of the sample image.
[0112] The attribute item is the object angle. The process of acquiring the attribute information may be: an object angle detection model may be used to detect the angle value of the object in the sample image as the attribute information of the sample image. The object angle detection model may be a machine learning model.
[0113] 802. Determine the attribute category to which each attribute information belongs.
[0114] The attribute item is location information. The process of determining the attribute classification can be as follows: Fig. 9 , divide the sample image into four regions in the form of a four-square grid, obtain the coordinates of the four vertices of the four regions, and mark the four-square grid from left to right and from top to bottom as regions 1, 2, 3, and 4. The region where the center coordinates of the object are located can be determined as the corresponding attribute classification.
[0115] The attribute item is background complexity. The process of determining the attribute classification can be as follows: a threshold η can be set by a technician to determine whether the total variance value corresponding to the color channel (such as R, G, B) is greater than the threshold η, and a value greater than the threshold η is determined as high background complexity, and a value less than or equal to the threshold X is determined as low background complexity. High background complexity and low background complexity are attribute classifications.
[0116] The attribute item is the area ratio of the object. The process of determining the attribute classification can be as follows: the technician can set 0 to 0.33 as a low ratio, 0.33-0.66 as a medium ratio, and 0.66-1 as a high ratio. Low ratio, medium ratio, and high ratio are attribute classifications.
[0117] The attribute item is definition. The process of determining the attribute classification may be as follows: a technician may set a definition threshold, and a definition less than or equal to the definition threshold is recorded as low definition, and a definition greater than the definition threshold is recorded as high definition. Low definition and high definition are attribute classifications.
[0118] The attribute item is the object angle. The process of determining the attribute classification may be as follows: the technician may set the reference angle to 180 degrees, record the object angle between 0 degrees and 180 degrees (including 0 degrees but excluding 180 degrees) as one attribute classification, and record 180 degrees and 360 degrees (including 180 degrees but excluding 360 degrees) as one attribute classification.
[0119] 803 , determining a target attribute category whose proportion of the amount of attribute information contained in all attribute information exceeds a proportion threshold.
[0120] A variety of attribute items are mentioned above, and this step can process one or more attribute items. Here, one attribute item is used as an example to illustrate the processing process.
[0121] For the attribute item, in the multiple sample images whose corresponding predicted recognition results in the training sample data do not meet the deterministic condition, the ratio of the number of sample images corresponding to each attribute classification of the attribute item to the number of the multiple sample images is determined to obtain a ratio. In the ratio corresponding to each attribute classification, a target attribute classification greater than the ratio threshold is determined.
[0122] Similarly, the above method is used for each attribute item to finally obtain the target attribute classification corresponding to each attribute item.
[0123] For example, consider the case where the attribute item is the object area ratio, and the ratio threshold is pre-set to 0.5. There are 100 sample images that do not meet the deterministic conditions, of which 60, 30, and 10 have high, medium, and low ratios, respectively, and the corresponding ratio values are 0.6, 0.3, and 0.1. It can be seen that the ratio value 0.6 corresponding to the high ratio is greater than 0.5, so the target attribute classification corresponding to the attribute item being the object area ratio is determined to be a high ratio.
[0124] 804 , based on the correspondence between the attribute classification and the image change mode for increasing the difficulty of image recognition, determine the target image change mode corresponding to the target attribute classification.
[0125] The change processing includes at least one of object displacement processing, scaling processing, noise adding processing, background image replacement processing, contrast reduction processing, rotation processing, etc.
[0126] The server pre-stores a table of correspondence between each attribute classification and the image change mode, as shown in Table 1:
[0127] Table 1
[0128] Property Item Image change method Location Information Object translation processing Background complexity Change background image processing Object area ratio Object scaling Clarity Noise addition or contrast reduction Object Angle Rotation Processing
[0129] Object translation can be handled as follows Fig.10 As shown, object scaling can be done as follows Fig.11 shown.
[0130] When the attribute item is location information, the image change method corresponding to each type can be as shown in Table 2:
[0131] Table 2
[0132]
[0133]
[0134] When the attribute item is background complexity, the image change mode corresponding to each type can be shown in Table 3:
[0135] Table 3
[0136] Background complexity attribute classification Image change method high Increase background complexity Low Reduce background complexity
[0137] The processing of increasing the background complexity may be: for some pixel values with a small difference from the average pixel value, the difference between the pixel values and the average pixel value is increased. The processing of increasing the background complexity may be: for some pixel values with a large difference from the average pixel value, the difference between the pixel values and the average pixel value is decreased.
[0138] When the attribute item is the object area ratio, the image change method corresponding to each type can be shown in Table 4:
[0139] Table 4
[0140] Object area ratio attribute classification Image change method High proportion Enlarge the object to 1.5 times its original size Low proportion Reduce the object to 0.5 times its original size
[0141] When the attribute item is clarity, the image change mode corresponding to each type can be shown in Table 5:
[0142] Table 5
[0143] Clarity attribute classification Image change method Low Reduce to 1 / 2 of the original resolution
[0144] The specific attribute information of which attribute item or items to use can be preset by the technician. If multiple attribute items are set, each attribute item corresponds to a target image change mode.
[0145] 805 , obtaining any sample image and a corresponding benchmark recognition result from the training sample data of the second image recognition model to be trained.
[0146] Through the processing of obtaining the training sample data in the previous embodiment, a large amount of training sample data of the second image recognition model can be obtained, thereby obtaining a training sample data set.
[0147] At this time, you can arbitrarily select training sample data from the training sample data set to obtain the sample images and benchmark recognition results therein.
[0148] Alternatively, only sample images whose corresponding first predicted recognition results meet the certainty condition and their corresponding benchmark recognition results can be obtained from the training sample data set. After the above-mentioned change processing, such sample images are more likely to be sample images with high recognition difficulty.
[0149] 806 , based on the target image change mode, perform change processing on the acquired sample image to obtain a second sample image.
[0150] In the above process, if only one attribute item is used, a target image change mode is determined. The target image change mode is used to perform a change process on the acquired sample image to obtain a second sample image.
[0151] In the above process, if multiple attribute items are used, the target image change mode corresponding to each attribute item is determined, that is, multiple target image change modes are obtained, and one or more target image change modes can be arbitrarily selected from the multiple target image change modes, and the acquired sample image is subjected to change processing to obtain multiple second sample images. For example, after the above process, three target image change modes A, B, and C are obtained, and the acquired sample image can be processed based on the A change mode to obtain a second sample image, and the acquired sample image can be processed based on the A and B change modes to obtain another second sample image, and so on.
[0152] 807 : Determine a second benchmark recognition result corresponding to the second sample image based on the acquired first benchmark recognition result corresponding to the sample image.
[0153] In some cases, the first reference recognition result corresponding to the acquired sample image may be directly determined as the second reference recognition result corresponding to the second sample image.
[0154] In some cases, the second reference recognition result corresponding to the second sample image may be determined based on the target image change mode and the first reference recognition result corresponding to the acquired sample image.
[0155] For example, when the second sample image is obtained and the target image change method adopted is at least one of background image replacement processing, noise addition processing, and contrast reduction processing, the first reference object type information and (or) first reference object position information in the first reference recognition result will not change. Therefore, the first reference recognition result corresponding to the obtained sample image can be directly determined as the second reference recognition result corresponding to the second sample image.
[0156] For example, when a second sample image is obtained and the target image change method adopted is object translation processing, scaling processing, or rotation processing, the first benchmark object type information in the first benchmark recognition result will not change, while the first benchmark object position information changes. The second benchmark object position information is determined based on the target image change method and the first benchmark object position information, and the first benchmark object type information and the second benchmark object position information are combined to form a second benchmark recognition result corresponding to the second sample image.
[0157] 808. Determine the second sample image and the corresponding benchmark recognition result as training sample data for the second image recognition model to be trained.
[0158] In the embodiment of the present application, an image that meets the image characteristics of the use scenario of the second image recognition model to be trained can be selected as a sample image, and the sample image is first recognized by the existing first image recognition model. If the recognition result is accurate, the sample image and the recognition result are used as the training sample data of the second image recognition model. If the result is not accurate enough, manual calibration is performed, and the calibrated recognition result and sample image are used as the training sample data of the second image recognition model. In this way, even if the usage scenarios corresponding to the trained first image recognition model and the second image recognition model to be trained are different (for example, the first image recognition model is for static pictures, and the second image recognition model is for video frames), the above method can also be used to accurately calibrate the sample images that the first image recognition model cannot accurately recognize, thereby obtaining a large amount of training sample data, and the sample images in these training sample data can all use images with image characteristics that meet the use scenario of the second image recognition model, so that the second image recognition model can be trained more accurately, and the accuracy of the recognition results of the second image recognition model can be improved. Moreover, in determining the training sample data in this way, there is no need to manually calibrate each sample image, which saves a lot of manpower and improves efficiency.
[0159] In the embodiment of the present application, after a certain amount of training sample data is determined, the second image recognition model to be trained can be trained based on the training sample data.
[0160] The training process for the second image recognition model can be as follows:
[0161] First, a certain amount of training sample data is obtained, each of which may include a sample image and a benchmark recognition result. The training process may be an iterative training, where the sample image in the first training sample data is input into the second image recognition model to be trained to obtain a predicted recognition result, the predicted recognition result is compared with the benchmark recognition result to obtain a loss value, and the parameters in the second image recognition model to be trained are adjusted according to the loss value.
[0162] Then the model is trained according to the second training sample data, and the above training process is repeated until the training end condition is met. The training end condition can be reaching a specified number of training times, or using a certain number of images to verify that the recognition result accuracy of the model exceeds the accuracy threshold, etc. The second image recognition model obtained at this time is determined as the second image recognition model that has completed training.
[0163] In an embodiment of the present application, the second image recognition model can be a DCN model, which can adaptively change the convolution kernel parameters and can have a more accurate recognition rate for images with characteristics such as objects of different sizes and object deformations, that is, it has a stronger adaptability to images that are difficult to recognize. It can be seen that the trained DCN model will have a higher image recognition accuracy for complex scenes such as video image recognition.
[0164] Table T shows the experimental data comparison between the second image recognition model trained by the above method and the original trained first image recognition model. The second image recognition model can be considered as a model for image recognition for video frames, and the first image recognition model can be considered as a model for image recognition for static images.
[0165] Table T
[0166] optimization mAP AP50 AP75 mAR CascadeRCNN 0.868 0.963 0.911 0.9 +Augmentation 0.89 0.972 0.934 0.932
[0167] The mAP, AP50, AP75, and mAR values corresponding to CascadeRCNN are the experimental data of the first image recognition model. The mAP, AP50, AP75, and mAR values corresponding to data enhancement (+Augmentation) are the experimental data of the second image recognition model.
[0168] The following is a description of the parameters in the table header:
[0169] Mean Average Precision (mAP): used to indicate the accuracy of object type recognition.
[0170] Average Precision (AP) 50: If the intersection-over-intersection ratio of the predicted object position information and the reference object position information is greater than 50, the recognition is considered accurate. In this case, the accuracy of the object position recognition.
[0171] Average Precision (AP) 75: If the intersection-over-intersection ratio of the predicted object position information and the reference object position information is greater than 75, the recognition is considered accurate. In this case, the accuracy of the object position recognition.
[0172] Mean Average Recall (mAR): used to indicate the recall rate of object type recognition.
[0173] In an embodiment of the present application, after the second image recognition model is trained, the second image recognition model can be used to perform image recognition on videos in a database. The corresponding processing can be: inputting the video frame of the target video into the trained second image recognition model to obtain a second predicted recognition result.
[0174] All videos in the database or videos that meet specified conditions (such as having product links) are obtained as target videos. Then for each target video, all video frames of the target video are obtained, or video frames of the target video can be extracted at a certain time interval, for example, one frame is extracted every 1 second. In this way, a video frame set is obtained for each target video. Each video frame in the video frame set is input into the trained second image recognition model to obtain the second prediction recognition result corresponding to the video frame set. The second prediction recognition result can include prediction object type information, and can also include prediction object location information, etc.
[0175] Taking the second prediction recognition result including the predicted object type information as an example, the following processing that the server may perform is introduced. In a certain target video, for an object type, if the proportion of the number of video frames containing the object type in all video frames exceeds the proportion threshold, the label of the object type is added to the target video. If the proportion of the number of video frames containing the object type in all video frames does not exceed the proportion threshold, the type label of the object is not recorded. The proportion threshold can be set by technicians based on experience. For example, the proportion threshold is set to 10%, and a short video has a total of 1,000 video frames. After image model recognition, only 90 video frames contain lighters. The number of video frames containing lighters accounts for 9% of all video frames. If it does not exceed the proportion threshold of 10%, the type label of the lighter is not recorded.
[0176] According to this method, all videos in the database or videos that meet the specified conditions (such as having product links) are labeled with the corresponding object type. For videos newly added to the database, the same approach as above is adopted to add the corresponding object type label. In this way, the server stores the identified object type label and the corresponding video in correspondence, and generates a table of object type label and video correspondence.
[0177] Fig.12 and Fig.13 A comparison of the effects of the first image recognition model and the second image recognition model on image recognition of video frames is given. Fig.12 The left picture is the recognition result of the first image recognition model, and the right picture is the recognition result of the second image recognition model. In comparison, the occluded T-shirt is not recognized by the first image recognition model, but can be recognized by the second image recognition model. Fig.13 The left picture is the recognition result of the first image recognition model, and the right picture is the recognition result of the second image recognition model. In comparison, the mink coat, which occupies too large a proportion in the picture, was not recognized by the first image recognition model, but could be recognized by the second image recognition model.
[0178] Fig.14 A device for determining training sample data provided by an embodiment of the present application includes:
[0179] The recognition module 1401 is used to perform image recognition on a first sample image based on a trained first image recognition model to obtain a first predicted recognition result corresponding to the first sample image;
[0180] Determination module 1402 is used to determine the first predicted recognition result as the benchmark recognition result corresponding to the first sample image if the first predicted recognition result meets the deterministic condition, and determine the first sample image and the corresponding benchmark recognition result as training sample data of the second image recognition model to be trained; if the first predicted recognition result does not meet the deterministic condition, obtain the benchmark recognition result obtained by calibrating the first sample image, and determine the first sample image and the calibrated benchmark recognition result as training sample data of the second image recognition model to be trained.
[0181] In a possible implementation manner, the first predicted recognition result includes predicted object type information, and the reference recognition result includes reference object type information.
[0182] In a possible implementation manner, the predicted object type information includes confidences corresponding to a plurality of types, and the certainty condition includes the presence of a confidence greater than a threshold in the predicted object type information.
[0183] In a possible implementation manner, the determining module is further configured to:
[0184] Obtain any sample image and a corresponding benchmark recognition result in the training sample data of the second image recognition model to be trained;
[0185] Perform a change processing for increasing the difficulty of image recognition on any of the sample images to obtain a second sample image, determine a benchmark recognition result corresponding to the second sample image based on the benchmark recognition result corresponding to any of the sample images, and determine the second sample image and the corresponding benchmark recognition result as training sample data for the second image recognition model to be trained.
[0186] In a possible implementation, the change processing includes at least one of object displacement processing, scaling processing, noise adding processing, background image replacement processing, contrast reduction processing, and rotation processing.
[0187] In a possible implementation manner, the determining module is further configured to:
[0188] Obtaining attribute information of sample images whose corresponding predicted recognition results in the training sample data do not meet the deterministic condition; determining the attribute category to which each attribute information belongs, and determining a target attribute category whose number of attribute information accounts for a proportion exceeding a proportion threshold in all attribute information; determining a target image change mode corresponding to the target attribute category based on a correspondence between the attribute category and an image change mode for increasing the difficulty of image recognition;
[0189] Based on the target image change mode, any one of the sample images is changed to obtain a second sample image.
[0190] In a possible implementation manner, the first sample image is a video frame of a sample video, and the device further includes:
[0191] A training module 1403 is used to train the second image recognition model to be trained based on the training sample data;
[0192] The application module 1404 is used to input the video frame of the target video into the trained second image recognition model to obtain a second predicted recognition result.
[0193] In the embodiment of the present application, an image that meets the image characteristics of the use scenario of the second image recognition model to be trained can be selected as a sample image, and the sample image is first recognized by the existing first image recognition model. If the recognition result is accurate, the sample image and the recognition result are used as the training sample data of the second image recognition model. If the result is not accurate enough, manual calibration is performed, and the calibrated recognition result and sample image are used as the training sample data of the second image recognition model. In this way, even if the usage scenarios corresponding to the trained first image recognition model and the second image recognition model to be trained are different (for example, the first image recognition model is for static pictures, and the second image recognition model is for video frames), the above method can also be used to accurately calibrate the sample images that the first image recognition model cannot accurately recognize, thereby obtaining a large amount of training sample data, and the sample images in these training sample data can all use images with image characteristics that meet the use scenario of the second image recognition model, so that the second image recognition model can be trained more accurately, and the accuracy of the recognition results of the second image recognition model can be improved. Moreover, in determining the training sample data in this way, there is no need to manually calibrate each sample image, which saves a lot of manpower and improves efficiency.
[0194] It should be noted that: the device for determining training sample data provided in the above embodiment only uses the division of the above functional modules as an example when determining the training sample data. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for determining training sample data provided in the above embodiment and the method embodiment for determining training sample data belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0195] Fig.15 1 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 1500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 1501 and one or more memories 1502, wherein the memory 902 stores at least one instruction, and at least one instruction is loaded and executed by the processor 1501 to implement the methods provided in the above-mentioned various method embodiments. Of course, the computer device may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the computer device may also include other components for implementing device functions, which will not be described in detail here.
[0196] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, which can be executed by a processor in a terminal to perform the method of ... in the above embodiment. The computer-readable storage medium can be non-transitory. For example, the computer-readable storage medium can be a ROM (read-only memory), a RAM (random access memory), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0197] A person skilled in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0198] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for determining training sample data, characterized in that: The method comprises: Based on the trained first image recognition model, performing image recognition on the first sample image to obtain a first predicted recognition result corresponding to the first sample image; If the first predicted recognition result satisfies the deterministic condition, the first predicted recognition result is determined as the benchmark recognition result corresponding to the first sample image, and the first sample image and the corresponding benchmark recognition result are determined as training sample data of a second image recognition model to be trained; If the first predicted recognition result does not meet the deterministic condition, obtaining a reference recognition result obtained by calibrating the first sample image, and determining the first sample image and the reference recognition result obtained by calibration as training sample data of the second image recognition model to be trained; Obtaining attribute information of sample images whose corresponding predicted recognition results do not meet the deterministic condition in the training sample data; determining the attribute category to which each attribute information belongs, determining the ratio of the number of sample images corresponding to each attribute category to the number of multiple sample images that do not meet the deterministic condition, and determining a target attribute category greater than a ratio threshold in the ratio corresponding to each attribute category; determining a target image change mode corresponding to the target attribute category based on a correspondence between the attribute category and an image change mode for increasing the difficulty of image recognition; Obtain any sample image and a corresponding benchmark recognition result in the training sample data of the second image recognition model to be trained; In the case that any of the sample images is a sample image whose predicted recognition result does not satisfy the deterministic condition, based on the target image change mode, a change processing is performed on any of the sample images to obtain a second sample image, and based on the benchmark recognition result corresponding to the any of the sample images, a benchmark recognition result corresponding to the second sample image is determined, and the second sample image and the corresponding benchmark recognition result are determined as training sample data of the second image recognition model to be trained.
2. The method according to claim 1, characterized in that: The first predicted recognition result includes predicted object type information, and the reference recognition result includes reference object type information.
3. The method according to claim 2, characterized in that The predicted object type information includes confidences corresponding to a plurality of types, and the certainty condition includes the presence of a confidence greater than a threshold in the predicted object type information.
4. The method according to claim 1, characterized in that: The change processing includes at least one of object displacement processing, scaling processing, noise adding processing, background image replacement processing, contrast reduction processing, and rotation processing.
5. The method according to any one of claims 1 to 4, characterized in that: The first sample image is a video frame of a sample video; The method further comprises: Training the second image recognition model to be trained based on the training sample data; The video frame of the target video is input into a trained second image recognition model to obtain a second predicted recognition result.
6. A device for determining training sample data, characterized in that: The device comprises: A recognition module, configured to perform image recognition on a first sample image based on a trained first image recognition model to obtain a first predicted recognition result corresponding to the first sample image; a determination module, configured to determine the first predicted recognition result as a reference recognition result corresponding to the first sample image if the first predicted recognition result satisfies a deterministic condition, and determine the first sample image and the corresponding reference recognition result as training sample data of a second image recognition model to be trained; and to obtain a reference recognition result obtained by calibrating the first sample image if the first predicted recognition result does not satisfy the deterministic condition, and determine the first sample image and the calibrated reference recognition result as training sample data of the second image recognition model to be trained; The determining module is further used for: Obtaining attribute information of sample images whose corresponding predicted recognition results do not meet the deterministic condition in the training sample data; determining the attribute category to which each attribute information belongs, determining the ratio of the number of sample images corresponding to each attribute category to the number of multiple sample images that do not meet the deterministic condition, and determining a target attribute category greater than a ratio threshold in the ratio corresponding to each attribute category; determining a target image change mode corresponding to the target attribute category based on a correspondence between the attribute category and an image change mode for increasing the difficulty of image recognition; Obtain any sample image and a corresponding benchmark recognition result in the training sample data of the second image recognition model to be trained; In the case that any of the sample images is a sample image whose predicted recognition result does not satisfy the deterministic condition, based on the target image change mode, a change processing is performed on any of the sample images to obtain a second sample image, and based on the benchmark recognition result corresponding to the any of the sample images, a benchmark recognition result corresponding to the second sample image is determined, and the second sample image and the corresponding benchmark recognition result are determined as training sample data of the second image recognition model to be trained.
7. The device according to claim 6, characterized in that The first predicted recognition result includes predicted object type information, and the reference recognition result includes reference object type information.
8. The device according to claim 7, characterized in that The predicted object type information includes confidences corresponding to a plurality of types, and the certainty condition includes the presence of a confidence greater than a threshold in the predicted object type information.
9. The device according to claim 6, characterized in that The change processing includes at least one of object displacement processing, scaling processing, noise adding processing, background image replacement processing, contrast reduction processing, and rotation processing.
10. The device according to any one of claims 6 to 9, characterized in that: The first sample image is a video frame of a sample video; The device also includes: A training module, used for training the second image recognition model to be trained based on the training sample data; The application module is used to input the video frame of the target video into the trained second image recognition model to obtain a second predicted recognition result.
11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the operation performed by the method for determining training sample data according to any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the operation performed by the method for determining training sample data according to any one of claims 1 to 5.
