Image acquisition method and device, equipment, storage medium and computer program product

By screening and annotating traffic sign shadow images that cannot be recognized by the initial recognition model, new training data is generated, which solves the problem of insufficient training data and difficulty in recognition under shadow conditions in autonomous driving, and improves the accuracy and robustness of the traffic sign recognition model. sex.

CN118736259AInactive Publication Date: 2024-10-01BEIJING CO WHEELS TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310315722.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-28
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In autonomous driving scenarios, the accuracy of recognition models of traffic signs in the existing technology is affected by the amount of training data. As a result, when the training data is insufficient, a large amount of manpower and material resources are required for data collection and enhancement, making it difficult to cover various scenarios, especially in Recognition is difficult under shaded conditions.

Method used

By acquiring multiple sample images, including shadow images of the target object, and inputting them into the initial recognition model, the sample images that cannot be accurately recognized by the initial recognition model are screened out as target images, and are annotated and trained to generate new training data. Improve model accuracy.

Benefits of technology

Screen out the sample images incorrectly recognized by the initial recognition model from the existing data, generate new training data through data enhancement and training, improve the recognition model's ability to accurately recognize traffic sign shadow images, and enhance the robustness and generalization of the model. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736259A_ABST
    Figure CN118736259A_ABST
Patent Text Reader

Abstract

The invention discloses an image acquisition method and device, equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring a plurality of sample images, wherein the sample images comprise shadow images of a target object; inputting the plurality of sample images into an initial recognition model to obtain a first recognition result corresponding to the target object in each sample image; according to the first recognition result, determining a sample image, the first recognition result of which is not matched with the target object, in the plurality of sample images as a target image; and training the initial recognition model based on the target image to obtain a target recognition model. Therefore, the sample image, namely the target image, which cannot be accurately recognized by the initial recognition model can be screened out from the plurality of sample images, so that the training data capable of improving the accuracy of the initial recognition model can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and in particular, relates to an image acquisition method, device, equipment, storage medium and computer program product. Background Art

[0002] In the scenario of autonomous driving, the correct recognition of traffic signs is very important. In the existing technology, recognition models are mostly used to recognize traffic signs in images. The accuracy of recognition models is related to the amount of training data to a certain extent. When the training data is small, people often choose to purchase images containing traffic signs as new training data, or spend time to collect images containing traffic signs in actual scenes as new training data. Either way, it takes a lot of manpower and material resources. Therefore, how to obtain new training data that can improve the accuracy of the recognition model from the existing training data has become a problem that needs to be solved urgently. Summary of the invention

[0003] The embodiments of the present application provide an image acquisition method, apparatus, device, storage medium and computer program product to solve the problem of obtaining a target image that can improve the accuracy of a recognition model from existing training data.

[0004] In a first aspect, an embodiment of the present application provides an image acquisition method, the method comprising:

[0005] Acquire a plurality of sample images, wherein the sample images include a shadow image of a target object;

[0006] Inputting the plurality of sample images into an initial recognition model to obtain a first recognition result corresponding to the target object in each of the sample images;

[0007] According to the first recognition result, a sample image among the multiple sample images whose first recognition result does not match the target object is determined as a target image.

[0008] In some embodiments, acquiring a plurality of sample images comprises:

[0009] Acquire a first image, wherein the first image includes a target object;

[0010] A shadow image is randomly generated in the area where the target object is located in the first image to obtain the sample image, wherein the sample image includes the shadow image of the target object and real classification information of the target object.

[0011] In some embodiments, randomly generating a shadow image in the area where the target object is located in the first image to obtain the sample image includes:

[0012] Determining a mask region of a target object in the first image;

[0013] Convert the color space of the first image to Lab color space to obtain a second image;

[0014] Randomly determine N coordinate points in the mask area of ​​the second image, where N is an integer greater than 2;

[0015] Determine the shadow area according to the N coordinate points;

[0016] The brightness value of the shadow area is adjusted to P to obtain a third image, where P is obtained by multiplying the original brightness value of the shadow area by a brightness coefficient k, where k∈(0,1);

[0017] The color space of the third image is converted into the RGB color space to obtain the sample image.

[0018] In some embodiments, the first recognition result includes a plurality of first classification results of the target object and a probability corresponding to each first classification result;

[0019] The step of determining, according to the first recognition result, a sample image of the plurality of sample images whose first recognition result does not match the target object as a target image comprises:

[0020] For each sample image, when the second classification result does not match the real classification information of the target object in the sample image, it is determined that the first recognition result of the sample image does not match the target object, and the second classification result is the first classification result with the lowest probability among the first recognition results;

[0021] A sample image among the multiple sample images whose first recognition result does not match the target object is determined as a target image.

[0022] In some embodiments, the first recognition result includes a plurality of first classification results of the target object and a probability corresponding to each first classification result;

[0023] The step of determining, according to the first recognition result, a sample image of the plurality of sample images whose first recognition result does not match the target object as a target image comprises:

[0024] For each sample image, when the probability of the third classification result is less than a preset threshold, it is determined that the first recognition result of the sample image does not match the target object, and the third classification result is the first classification result corresponding to the true classification information of the target object in the first recognition result;

[0025] A sample image among the multiple sample images whose first recognition result does not match the target object is determined as a target image.

[0026] In some embodiments, the method further comprises:

[0027] Labeling each of the target images according to the real classification information of the target object in the target image to obtain a classification label;

[0028] Creating training samples according to each of the target images and the corresponding classification labels respectively;

[0029] The initial recognition model is trained according to the plurality of training samples until a training stop condition is met, thereby obtaining a target recognition model.

[0030] In some embodiments, the initial recognition model is trained according to the plurality of training samples until a training stop condition is met to obtain a target recognition model, including:

[0031] For each training sample, perform the following steps:

[0032] Inputting the training sample into the initial recognition model to obtain a predicted classification result of the target object in the target image;

[0033] Determining a loss function value of the initial recognition model according to the predicted classification result and the classification label;

[0034] When the loss function value does not meet the training stop condition, the model parameters of the initial recognition model are adjusted, and the initial recognition model with adjusted training parameters is trained using the training samples until the training stop condition is met to obtain the target recognition model.

[0035] In a second aspect, an embodiment of the present application provides an image acquisition device, the device comprising:

[0036] An acquisition module, used for acquiring a plurality of sample images, wherein the sample images are shadow images of the target object;

[0037] Inputting the plurality of sample images into an initial recognition model to obtain a first recognition result corresponding to the target object in each of the sample images;

[0038] A determination module is used to determine, according to the first recognition result, a sample image among the multiple sample images whose first recognition result does not match the target object as a target image.

[0039] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing program instructions;

[0040] When the processor executes the program instructions, the method of the first aspect as described above is implemented.

[0041] In a fourth aspect, an embodiment of the present application provides a storage medium having computer program instructions stored thereon, and the computer program instructions, when executed, implement the method of the first aspect described above.

[0042] The image acquisition method, device, equipment and medium of the embodiment of the present application can acquire multiple sample images, the sample images include the shadow image of the target object; input the multiple sample images into the initial recognition model to obtain the first recognition result corresponding to the target object in each sample image; according to the first recognition result, the sample image whose first recognition result does not match the target object in the multiple sample images is determined as the target image. In this way, the sample images that cannot be accurately recognized by the initial recognition model, i.e., the target images, can be screened out from the existing multiple sample images, thereby obtaining training data that can improve the accuracy of the initial recognition model. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0044] Figure 1 is a flowchart of an image acquisition method provided by an embodiment of the present application;

[0045] Figure 2 is a flowchart of an image acquisition method provided by another embodiment of the present application;

[0046] Figure 3 is a structural schematic diagram of an image acquisition device provided in one embodiment of the present application;

[0047] Figure 4 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0048] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0049] It should be noted that, in this article, relational terms 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 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 device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0050] In the scenario of autonomous driving, it is very important to correctly identify traffic signs. Traffic signs in various scenarios need to be identified, and shadows have a great interference in the identification of traffic sign content. Minor differences in light, acquisition time, etc. can lead to different images, especially in bad weather conditions. The imaging difference is even greater. Manually collected data is also difficult to cover various scenarios.

[0051] Therefore, in the process of training the recognition model, it is necessary to enable the recognition model to fully learn so that it has the ability to accurately recognize and analyze traffic sign images containing shadows. To this end, a large number of traffic sign images with shadows are needed to train the recognition model. However, some traffic sign images do not have shadows, or the types of shadows are limited. Therefore, it is necessary to perform data enhancement processing on the sample images used to train the recognition model.

[0052] Based on the above research findings, the embodiments of the present application provide an image acquisition method and related equipment to solve the above technical problems.

[0053] The following first introduces the image acquisition method provided in the embodiment of the present application.

[0054] Figure 1 The following is a flow chart of the image acquisition method provided in the embodiment of the present application. Figure 1 As shown, the method may include the following steps S101 to S103:

[0055] S101, acquiring a plurality of sample images, where the sample images include a shadow image of a target object.

[0056] S102: Input a plurality of sample images into an initial recognition model to obtain a first recognition result corresponding to a target object in each sample image.

[0057] S103: According to the first recognition result, determine, among the plurality of sample images, a sample image whose first recognition result does not match the target object as a target image.

[0058] The specific implementation of the above steps will be described in detail below.

[0059] The image acquisition method provided in the embodiment of the present application can acquire multiple sample images, the sample images include the shadow image of the target object; input the multiple sample images into the initial recognition model to obtain the first recognition result corresponding to the target object in each sample image; according to the first recognition result, determine the sample image whose first recognition result does not match the target object in the multiple sample images as the target image; train the initial recognition model based on the target image to obtain the target recognition model. Therefore, the sample images that cannot be accurately recognized by the initial recognition model, i.e., the target images, can be screened out from the existing multiple sample images, thereby obtaining new training data that can improve the accuracy of the initial recognition model.

[0060] In S101 , a plurality of sample images are acquired.

[0061] The sample image includes a shadow image of a target object, which may be any identifiable object, building, sign, etc., and is not limited in this application.

[0062] Optionally, the sample image can be obtained by the terminal device through the image acquisition device carried by itself, or by other devices (such as radar) to acquire the image of the target object, and the acquired sample image is transmitted to the terminal device by wire or wirelessly. In addition, the sample can be a color image or a grayscale image. When acquiring the sample image, the target object can be photographed in a photographic mode to obtain a sample image; or a video can be acquired in a video acquisition mode, and then one frame of the image is selected from the video as the sample image, or a frame with the best imaging effect is selected as the sample image.

[0063] Optionally, the sample image may also be generated according to a preset rule. For example, an image of a target object with a shadow may be randomly generated according to an existing image of the target object.

[0064] In some embodiments, the above S101 may include the following steps:

[0065] Acquire a first image, where the first image includes a target object;

[0066] A shadow image is randomly generated in the area where the target object is located in the first image to obtain a sample image, wherein the sample image includes the shadow image of the target object and true classification information of the target object.

[0067] The first image may be an image including a target object acquired by an electronic device.

[0068] Specifically, first, a first image including a target object is acquired, and then a region where the target object is located in the first image is determined, and a shadow image is randomly generated in the region, thereby obtaining a sample image including a shadow image of the target object.

[0069] In this embodiment, sample images of various shadow image types including target objects can be randomly generated, thereby solving the problem of imbalance between sample image shadow types caused by insufficient sample data.

[0070] In some embodiments, the above-mentioned randomly generating a shadow image in the area where the target object is located in the first image to obtain a sample image may include the following steps:

[0071] S1011, determining a mask area of ​​a target object in a first image;

[0072] Specifically, the first image can be segmented and connected domain analyzed to obtain a mask image of the target object, thereby obtaining a mask region of the target object. In the field of image processing, segmenting and connected domain analysis of images are relatively mature technologies, and this application does not specifically limit this.

[0073] S1012, converting the color space of the first image into the Lab color space to obtain a second image;

[0074] In the field of image processing, the RGB color space is a system that obtains various colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. Lab is a color system based on physiological characteristics. It uses a digital method to describe human visual perception. The L component in the Lab color space is used to represent the brightness of the pixel, with a value range of [0,100], representing from pure black to pure white; a represents the range from red to green, with a value range of [127,-128]; b represents the range from yellow to blue, with a value range of [127,-128]. The XYZ color space is a color space defined by mathematical methods, and a new colorimetric system is established using three imaginary primary colors X, Y, and Z. Among the three components of XYZ, XY represents chromaticity, and the Y component can represent both brightness and chromaticity. The units of the three components are cm / m2 (or nit).

[0075] Optionally, the first image may be converted from the RGB color space to the XYZ color space, and then the XYZ color space may be converted to the Lab color space.

[0076] The color space of the first image may also be converted to the Lab color space using the RGB2Lab(x) function.

[0077] S1013, randomly determining N coordinate points in the mask area of ​​the second image, where N is an integer greater than 2;

[0078] Among them, N coordinate points are different coordinate points. Because a surface is to be formed, the number of coordinate points needs to be greater than or equal to 3.

[0079] S1014: Determine a shadow area according to the N coordinate points.

[0080] After the N coordinate points are determined, a shadow area may be generated within the mask area according to the N coordinate points.

[0081] S1015, adjusting the brightness value of the shadow area to P to obtain a third image, where P is obtained by multiplying the original brightness value of the shadow area by a brightness coefficient k, where k∈(0,1).

[0082] The brightness coefficient k is a random number in the range of (0,1). The brightness of the shadow area can be randomly adjusted by the brightness coefficient k, thereby generating more types of sample images, greatly enriching the types of samples and increasing the diversity of sample images.

[0083] S1016: Convert the color space of the third image to the RGB color space to obtain a sample image.

[0084] Here, the color space of the third image is converted into the RGB color space by using a method similar to S1012, which will not be described in detail here.

[0085] In the embodiment of the present application, a sample image including a target object and a shadow image of any size, type and different brightness can be generated, which greatly enriches the sample image.

[0086] In one example, generating a sample image may include the following steps:

[0087] 1. Get the traffic sign area mask M of the original image A (i.e. the first image); 2. Convert the color space of image A, and obtain the L, a, and b channel values ​​of image A in Lab space through the RGB2Lab(x) function; 3. Randomly generate three coordinate points of different lines in the traffic sign area mask M, and the three points constitute the initial shadow area;

[0088] 4. Randomly generate brightness coefficient k∈(0,1);

[0089] 4. Multiply the value in the brightness channel L of the initial shadow area by the brightness coefficient k;

[0090] 6. Convert the three-channel image in Lab color space to RGB space;

[0091] 7. Get the shadow image xshadow (i.e. the sample image).

[0092] In S102, a plurality of sample images are input into an initial recognition model to obtain a first recognition result corresponding to a target object in each sample image.

[0093] Here, the initial recognition model can be any model that can recognize the target object in the sample image. For example, the initial recognition model can be a CNN network. For example, images including traffic signs can be classified through a typical CNN network, that is, a traffic sign image is input to obtain the probability of the image under each traffic sign.

[0094] In S103, according to the first recognition result, a sample image whose first recognition result does not match the target object among the plurality of sample images is determined as a target image.

[0095] Specifically, determine whether the initial recognition model's recognition result of the target object in the sample image is accurate. If the first recognition result does not match the target object, it means that the initial recognition model has not recognized the target object. If the first recognition result matches the target object, it means that the initial recognition model can recognize the target object in the sample image.

[0096] Conventional shadow synthesis methods generally do not perform further operations after obtaining the shadow image. However, a large number of "simple" shadow images cannot effectively improve the recognition ability of the model. Therefore, it is necessary to automatically filter the synthesized shadow images. Therefore, the minimum probability method of the positive class is used to filter and remove simple synthetic samples.

[0097] In some embodiments, the first recognition result includes a plurality of first classification results of the target object and a probability corresponding to each first classification result;

[0098] Therefore, in the above S103, according to the first recognition result, the sample image whose first recognition result does not match the target object among the multiple sample images is determined as the target image, including:

[0099] For each sample image, when the second classification result does not match the real classification information of the target object in the sample image, it is determined that the first recognition result of the sample image does not match the target object, and the second classification result is the first classification result with the lowest probability among the first recognition results;

[0100] A sample image whose first recognition result does not match the target object among the multiple sample images is determined as the target image.

[0101] Among them, the first recognition result of each sample image obtained in the above S102 may include multiple first classification results of the target object and the probabilities corresponding to each first classification result. For example: the first recognition result of sample image B is: the probability of the target object in sample image B being classified as 1 is x1, the probability of being classified as 2 is x2, the probability of being classified as 3 is x3, and the probability of being classified as 4 is x4. Therefore, based on the prediction of each classification result of the target object in the first recognition result, the accuracy of the initial recognition model in recognizing the target object can be determined, and then it can be judged whether the initial recognition model can recognize the target object in the sample image.

[0102] Specifically, for each sample image, a corresponding first recognition result is obtained through the initial recognition model, and the classification result with the lowest probability is determined from the first recognition results for comparison with the true classification of the target object. If the classification result with the lowest probability matches the true classification of the target object, that is, the classification result with the lowest probability is consistent with the true classification of the target object, this indicates that the initial recognition model did not recognize the target object. It can be determined that the first recognition result of the sample image does not match the target object, that is, the sample image is an image that cannot be recognized by the initial recognition model, and the sample image is determined to be the target image.

[0103] In this embodiment, sample images that cannot be accurately recognized by the initial recognition model can be screened out from a plurality of sample images.

[0104] In some embodiments, in the above S103, according to the first recognition result, determining the sample image whose first recognition result does not match the target object among the multiple sample images as the target image may include the following steps:

[0105] For each sample image, when the probability of the third classification result is less than a preset threshold, it is determined that the first recognition result of the sample image does not match the target object, and the third classification result is the first classification result corresponding to the true classification information of the target object in the first recognition result;

[0106] A sample image whose first recognition result does not match the target object among the multiple sample images is determined as the target image.

[0107] Among them, the preset threshold can be set according to actual conditions.

[0108] Specifically, for each sample image, a corresponding first recognition result is obtained through the initial recognition model, and the probability of the first classification result corresponding to the true classification of the target object is determined from the first recognition result, that is, the probability corresponding to the true classification of the target object in the recognition result of the target object in the sample image by the initial recognition model is obtained. If the probability corresponding to the true classification of the target object is lower than a preset threshold (for example, 60%), this indicates that the initial recognition model has not recognized the target object, and it can be determined that the first recognition result of the sample image does not match the target object, that is, the sample image is an image that cannot be recognized by the initial recognition model, and the sample image is determined to be the target image.

[0109] In this embodiment, sample images that cannot be accurately recognized by the initial recognition model can be screened out from a plurality of sample images.

[0110] In some embodiments, the above S103 may further include the following steps:

[0111] Label each target image according to the real classification information of the target object in the target image to obtain a classification label;

[0112] Create training samples based on each target image and its corresponding classification label;

[0113] According to multiple training samples, the initial recognition model is trained until the training stop condition is met to obtain the target recognition model.

[0114] Specifically, the target object in the target image can be annotated with a classification label by manual or automatic labeling, wherein the classification label may include the real classification information of the target object; then a sample image and its corresponding classification label form a training sample, and all target images and their corresponding classification labels form a training sample set; then the initial recognition model is trained with the training sample set until the training conditions are met.

[0115] In this embodiment, the target image is a sample image that cannot be accurately recognized by the initial recognition model. Therefore, by training the initial recognition model with the target image, the robustness of the recognition model for recognizing images with various complex shadows can be enhanced.

[0116] In some embodiments, the initial recognition model is trained according to the plurality of training samples until a training stop condition is met to obtain a target recognition model, including:

[0117] For each training sample, perform the following steps:

[0118] Input the training samples into the initial recognition model to obtain the predicted classification results of the target object in the target image;

[0119] Determine the loss function value of the initial recognition model based on the predicted classification results and classification labels;

[0120] When the loss function value does not meet the training stop condition, the model parameters of the initial recognition model are adjusted, and the initial recognition model with adjusted parameters is trained using training samples until the training stop condition is met to obtain the target recognition model.

[0121] The image acquisition method in this embodiment can generate sample data of various categories, solving the problem of insufficient training samples in the prior art. The unrecognizable target images in the sample images are screened out through the initial recognition model, and then the initial recognition model is trained through the target images to improve the accuracy of model recognition.

[0122] The image acquisition method provided in the embodiment of the present application is described below in conjunction with a specific application example.

[0123] like Figure 2 As shown, the target image acquisition method includes the following steps:

[0124] S201, input image x, traffic sign category label y.

[0125] That is, a first image is acquired, and the first image includes the target object.

[0126] S202, random shadow synthesis. That is, randomly generate a shadow image in the area where the target object is located in the first image to obtain a sample image, which includes the shadow image of the target object and the real classification information of the target object.

[0127] S203. Classification of traffic signs.

[0128] The target image and the classification label of the target object in the target image are input into the initial recognition model.

[0129] S204: Determine whether the probability corresponding to label y in the classification result is the lowest. If yes, keep it; otherwise, discard it.

[0130] That is, according to the first recognition result, a sample image whose first recognition result does not match the target object among the multiple sample images is determined as the target image.

[0131] In this embodiment, data enhancement can be effectively performed on traffic signs to improve the generalization of the model and the accuracy of recognition.

[0132] Based on the image acquisition method provided in the above embodiment, the present application also provides a specific implementation of the training device. Please refer to the following embodiment.

[0133] See first Figure 3The image acquisition device 300 provided in the embodiment of the present application may include the following modules:

[0134] In some embodiments, the training device 300 may further include:

[0135] An acquisition module 301 is used to acquire a plurality of sample images, where the sample images are shadow images of the target object;

[0136] The recognition module 302 is used to input a plurality of sample images into an initial recognition model to obtain a first recognition result corresponding to a target object in each sample image;

[0137] The determination module 303 is used to determine, according to the first recognition result, a sample image whose first recognition result does not match the target object among the multiple sample images as a target image.

[0138] In some embodiments, the first recognition result includes multiple first classification results of the target object and the probability corresponding to each first classification result. The acquisition module 301 is specifically used to:

[0139] Acquire a first image, where the first image includes a target object;

[0140] A shadow image is randomly generated in the area where the target object is located in the first image to obtain a sample image, wherein the sample image includes the shadow image of the target object and true classification information of the target object.

[0141] In some embodiments, the acquisition module 301 may include:

[0142] A first determining unit, configured to determine a mask area of ​​a target object in the first image;

[0143] A first conversion unit, used for converting the color space of the first image into a Lab color space to obtain a second image;

[0144] A second determining unit, configured to randomly determine N coordinate points in the mask area of ​​the second image, where N is an integer greater than 2;

[0145] A third determining unit, configured to determine a shadow area according to the N coordinate points;

[0146] An adjustment unit, configured to adjust the brightness value of the shadow area to P to obtain a third image, wherein P is obtained by multiplying the original brightness value of the shadow area by a brightness coefficient k, where k∈(0,1);

[0147] The second conversion unit is used to convert the color space of the third image into the RGB color space to obtain the sample image.

[0148] In some embodiments, the determination module 303 is specifically used to:

[0149] For each sample image, when the second classification result does not match the real classification information of the target object in the sample image, it is determined that the first recognition result of the sample image does not match the target object, and the second classification result is the first classification result with the lowest probability among the first recognition results;

[0150] A sample image whose first recognition result does not match the target object among the multiple sample images is determined as the target image.

[0151] In some embodiments, the determination module 303 is specifically used to:

[0152] For each sample image, when the probability of the third classification result is less than a preset threshold, it is determined that the first recognition result of the sample image does not match the target object, and the third classification result is the first classification result corresponding to the true classification information of the target object in the first recognition result;

[0153] A sample image whose first recognition result does not match the target object among the multiple sample images is determined as the target image.

[0154] In some embodiments, the training module 304 is specifically used to:

[0155] Label each target image according to the real classification information of the target object in the target image to obtain a classification label;

[0156] Create training samples based on each target image and its corresponding classification label;

[0157] According to multiple training samples, the initial recognition model is trained until the training stop condition is met to obtain the target recognition model.

[0158] In some embodiments, the training of the initial recognition model until a training stop condition is met to obtain a target recognition model includes:

[0159] For each training sample, perform the following steps:

[0160] Input the training samples into the initial recognition model to obtain the predicted classification results of the target object in the target image;

[0161] Determine the loss function value of the initial recognition model based on the predicted classification results and classification labels;

[0162] When the loss function value does not meet the training stop condition, the model parameters of the initial recognition model are adjusted, and the initial recognition model with adjusted parameters is trained using training samples until the training stop condition is met to obtain the target recognition model.

[0163] The above-mentioned embodiment of the present application can obtain multiple sample images, the sample images include the shadow image of the target object; input the multiple sample images into the initial recognition model to obtain the first recognition result corresponding to the target object in each sample image; according to the first recognition result, the sample image whose first recognition result does not match the target object in the multiple sample images is determined as the target image. In this way, the sample images that cannot be accurately recognized by the initial recognition model, i.e., the target images, can be screened out from the multiple sample images, thereby obtaining new training data that can improve the accuracy of the initial recognition model.

[0164] Figure 3 Each module / unit in the device shown has the function of realizing Figure 2 The functions of each step in the process can achieve the corresponding technical effects, which will not be described in detail here for the sake of brevity.

[0165] Based on the image acquisition method provided in the above embodiment, the present application also provides a specific implementation of the electronic device. Please refer to the following embodiment.

[0166] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0167] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.

[0168] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0169] The memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In one example, the memory 402 may include a removable or non-removable (or fixed) medium, or the memory 402 is a non-volatile solid-state memory. The memory 402 may be inside or outside the integrated gateway disaster recovery device.

[0170] In one example, the memory 402 may be a read-only memory (ROM). In one example, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.

[0171] The memory 402 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to any embodiment of the present disclosure.

[0172] The processor 401 reads and executes the computer program instructions stored in the memory 402 to implement Figure 2 The method / steps S201 to S204 in the embodiment shown in the figure are achieved Figure 2 The corresponding technical effects achieved by executing the methods / steps in the example shown are not repeated here for the sake of brevity.

[0173] In one example, the electronic device may further include a communication interface 403 and a bus 410. Figure 4 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.

[0174] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0175] Bus 410 includes hardware, software or both, and the components of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics bus, enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) bus, front side bus (Front Side Bus, FSB), Hyper Transport (Hyper Transport, HT) interconnection, industry standard architecture (Industry Standard Architecture, ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0176] Based on the training device provided in the above embodiment, accordingly, the present application also provides a vehicle, the vehicle comprising: the above training device, the training device is used to implement the image acquisition method provided in the above embodiment.

[0177] In addition, in combination with the image acquisition method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the image acquisition methods in the above embodiment is implemented.

[0178] In summary, the image acquisition method, device, equipment and storage medium of the embodiments of the present application can acquire multiple sample images, the sample images include the shadow image of the target object; input the multiple sample images into the initial recognition model to obtain the first recognition result corresponding to the target object in each sample image; according to the first recognition result, determine the sample image whose first recognition result does not match the target object in the multiple sample images as the target image; train the initial recognition model based on the target image to obtain the target recognition model. In this way, the sample image that cannot be accurately recognized by the initial recognition model, that is, the target image, can be screened out from the multiple sample images, and then the target recognition model of the initial recognition model can be trained by the target image, thereby improving the recognition accuracy of the recognition model.

[0179] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0180] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0181] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0182] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.

[0183] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. An image acquisition method, characterized in that: The method comprises: Acquire a plurality of sample images, wherein the sample images include a shadow image of a target object; Inputting the plurality of sample images into an initial recognition model to obtain a first recognition result corresponding to the target object in each of the sample images; According to the first recognition result, a sample image among the multiple sample images whose first recognition result does not match the target object is determined as a target image.

2. The method according to claim 1, characterized in that The acquiring of a plurality of sample images comprises: Acquire a first image, wherein the first image includes a target object; A shadow image is randomly generated in the area where the target object is located in the first image to obtain the sample image, wherein the sample image includes the shadow image of the target object and real classification information of the target object.

3. The method according to claim 2, characterized in that The randomly generating a shadow image in the area where the target object is located in the first image to obtain the sample image includes: Determining a mask region of a target object in the first image; Convert the color space of the first image to Lab color space to obtain a second image; Randomly determine N coordinate points in the mask area of ​​the second image, where N is an integer greater than 2; Determine the shadow area according to the N coordinate points; The brightness value of the shadow area is adjusted to P to obtain a third image, where P is obtained by multiplying the original brightness value of the shadow area by a brightness coefficient k, where k∈(0,1); The color space of the third image is converted into the RGB color space to obtain the sample image.

4. The method according to claim 2, characterized in that: The first recognition result includes a plurality of first classification results of the target object and a probability corresponding to each first classification result; The step of determining, according to the first recognition result, a sample image of the plurality of sample images whose first recognition result does not match the target object as a target image comprises: For each sample image, when the second classification result does not match the real classification information of the target object in the sample image, it is determined that the first recognition result of the sample image does not match the target object, and the second classification result is the first classification result with the lowest probability among the first recognition results; A sample image among the multiple sample images whose first recognition result does not match the target object is determined as a target image.

5. The method according to claim 2, characterized in that: The first recognition result includes a plurality of first classification results of the target object and a probability corresponding to each first classification result; The step of determining, according to the first recognition result, a sample image of the plurality of sample images whose first recognition result does not match the target object as a target image comprises: For each sample image, when the probability of the third classification result is less than a preset threshold, it is determined that the first recognition result of the sample image does not match the target object, and the third classification result is the first classification result corresponding to the true classification information of the target object in the first recognition result; A sample image among the multiple sample images whose first recognition result does not match the target object is determined as a target image.

6. The method according to claim 1, characterized in that The method further comprises: Labeling each of the target images according to the real classification information of the target object in the target image to obtain a classification label; Creating training samples according to each of the target images and the corresponding classification labels respectively; The initial recognition model is trained according to the plurality of training samples until a training stop condition is met, thereby obtaining a target recognition model.

7. The method according to claim 6, characterized in that The initial recognition model is trained according to the plurality of training samples until a training stop condition is met to obtain a target recognition model, including: For each training sample, perform the following steps: Inputting the training sample into the initial recognition model to obtain a predicted classification result of the target object in the target image; Determining a loss function value of the initial recognition model according to the predicted classification result and the classification label; When the loss function value does not meet the training stop condition, the model parameters of the initial recognition model are adjusted, and the initial recognition model with adjusted training parameters is trained using the training samples until the training stop condition is met to obtain the target recognition model.

8. An image acquisition device, characterized in that: The device comprises: An acquisition module, used for acquiring a plurality of sample images, wherein the sample images are shadow images of the target object; A recognition model, used to input the plurality of sample images into an initial recognition model to obtain a first recognition result corresponding to a target object in each of the sample images; A determination module is used to determine, according to the first recognition result, a sample image among the multiple sample images whose first recognition result does not match the target object as a target image.

9. An electronic device, characterized in that: The device comprises: a processor and a memory storing program instructions; When the processor executes the program instructions, the method according to any one of claims 1 to 7 is implemented.

10. A storage medium, characterized in that: The storage medium stores computer program instructions, which implement the method according to any one of claims 1 to 7 when executed.

11. A computer program product, characterized in that The computer program product comprises computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Image processing method and device

    CN112837251A

  • Model training method and device, electronic equipment and storage medium

    CN113269721A

  • Training data processing device, training data processing method, and training data processing program

    WO2022208843A1