Data augmentation method and device for alignment of different target scenes

Through the data augmentation method of the Poria detection model, the color space conversion and gamma adjustment are used to generate augmented data, which solves the problem of low scene labeling efficiency under different lighting and equipment, and realizes the painless expansion of the model in new scenarios and efficiency improvement.

CN119048858APending Publication Date: 2024-11-29YUNNAN BAIYAO GRP MEDICINE E-COMMERCE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411073860.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

In the training of the Poria cocos detection model, scene images taken under different lighting and shooting equipment need to be marked, resulting in an increase in the amount of data and reducing the efficiency of algorithm development.

Method used

By acquiring reference scene images and target scene images, performing instance data annotation, and color space conversion and gamma adjustment are performed according to color deviation analysis to generate augmented data, and data augmentation training is performed on instance detection and segmentation models, reducing the new Re-marking requirements for scenes.

Benefits of technology

Without adding new labels, the model can be painlessly expanded to new scenarios, greatly reducing the workload of labeling engineers and improving the efficiency of product development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048858A_ABST
    Figure CN119048858A_ABST
Patent Text Reader

Abstract

The invention relates to a data augmentation method and device for alignment of different target scenes and electronic equipment, and the method comprises the steps: obtaining a reference scene image and a target scene image, carrying out the instance data annotation of the reference scene image, obtaining initial annotation data, carrying out the color deviation analysis of the target scene image, and carrying out the color deviation analysis of the target scene image; and performing color space conversion on the reference scene image according to an analysis result to obtain first augmented data, and performing data augmented training on the instance detection and segmentation model by using the first augmented data. According to the method for obtaining augmented data by utilizing image style conversion, a new extended scene does not need to be re-labeled, and only a certain amount of new scene sample data needs to be prepared as a target domain, style migration is carried out on a standard inventory reference scene image, the extended scene is simulated, and incremental training is carried out on a model; therefore, the model can be expanded to a new scene without annotation cost on the basis of no need of newly adding annotations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a data augmentation method, device and electronic device for aligning different target scenes. Background Art

[0002] In the actual production quality inspection scenario of Poria cocos, there are usually hundreds of Poria cocos instances in one image. The algorithm needs to detect Poria cocos from the image for the next stage of Poria cocos classification. To train a full-scale deep learning detection model for Poria cocos, it is necessary to annotate scene images taken under different lighting and shooting equipment for Poria cocos detection training, so as to achieve the model's fitting and generalization capabilities for Poria cocos in these scenarios. However, this will greatly increase the amount of data that needs to be annotated, increase the workload of image annotation engineers, and thus reduce the efficiency of algorithm development. Summary of the invention

[0003] In view of this, the present application proposes a data augmentation method for aligning different target scenes to solve the problems reflected in the above-mentioned background technology.

[0004] According to one aspect of the present application, a data augmentation method for aligning different target scenes is provided, comprising:

[0005] Acquire a reference scene image and a target scene image respectively, and annotate the reference scene image with instance data to obtain initial annotated data;

[0006] Performing a color deviation analysis on the target scene image, and performing a color space conversion on the reference scene image according to the analysis result to obtain first augmented data;

[0007] An instance detection and segmentation model is trained according to the initial labeled data, and data augmentation training is performed on the instance detection and segmentation model using the first augmented data.

[0008] As an optional implementation scheme of the present application, the step of performing a color deviation analysis on the target scene image and performing a color space conversion on the reference scene image according to the analysis result to obtain the first augmented data includes:

[0009] Converting the reference scene image from a first color space to a second color space;

[0010] Performing a first gamma adjustment on the reference scene image in the second color space to obtain first augmented data.

[0011] As an optional implementation scheme of the present application, performing a first gamma adjustment on the reference scene image in the second color space to obtain first augmented data includes:

[0012] generating a first random number;

[0013] Determine whether the first random number is greater than or equal to a preset first random number threshold;

[0014] When the first random number is greater than or equal to a preset first random number threshold, obtaining a first gamma value from a first gamma value range;

[0015] The color channel values ​​of the second color space are compressed according to the first gamma value to obtain first augmented data.

[0016] As an optional implementation scheme of the present application, the step of performing a first gamma adjustment on the reference scene image in the second color space to obtain first augmented data further includes:

[0017] When the first random number is less than a preset random number threshold, obtaining a second gamma value from a second gamma value range;

[0018] Amplify the color channel value of the second color space according to the second gamma value to obtain first augmented data.

[0019] As an optional implementation scheme of the present application, after performing a first gamma adjustment on the reference scene image in the second color space to obtain the first augmented data, the method further includes:

[0020] Converting the reference scene image from the second color space to the first color space;

[0021] Based on the first color space, converting the reference scene image from the first color space to a third color space;

[0022] Performing a second gamma adjustment on the reference scene image in the third color space to obtain second augmented data.

[0023] As an optional implementation scheme of the present application, performing a second gamma adjustment on the reference scene image in the third color space to obtain second augmented data includes:

[0024] generating a second random number;

[0025] Determine whether the second random number is greater than or equal to a preset second random number threshold;

[0026] When the second random number is greater than or equal to a preset second random number threshold, obtaining a third gamma value from a third gamma value range;

[0027] The saturation channel value of the third color space is compressed according to the third gamma value to obtain second augmented data.

[0028] As an optional implementation scheme of the present application, performing a second gamma adjustment on the reference scene image in the third color space to obtain second augmented data further includes:

[0029] When the second random number is less than a preset second random number threshold, obtaining a fourth gamma value from a fourth gamma value range;

[0030] The saturation channel value of the third color space is amplified according to the fourth gamma value to obtain second augmented data.

[0031] As an optional implementation scheme of the present application, the method of respectively acquiring a reference scene image and a target scene image, and performing instance data annotation on the reference scene image to obtain initial annotation data further includes:

[0032] Analyzing the resolution and clarity of the target scene image;

[0033] When at least one of the resolution and the definition is correspondingly lower than the reference resolution and the reference definition of the reference scene image, performing sampling processing and blurring processing on the reference scene image to obtain third augmented data;

[0034] The instance detection and segmentation model is trained by using the third augmented data.

[0035] The present application also provides a data augmentation device for aligning different target scenes, including:

[0036] The first unit is used to obtain a reference scene image and a target scene image respectively, and annotate the reference scene image with instance data to obtain initial annotated data;

[0037] The second unit is used to perform color deviation analysis on the target scene image, and perform color space conversion on the reference scene image according to the analysis result to obtain first augmented data;

[0038] The third unit is used to train an instance detection and segmentation model according to the initial labeled data, and perform data augmentation training on the instance detection and segmentation model using the first augmented data.

[0039] The present application also provides an electronic device, comprising:

[0040] processor;

[0041] a memory for storing processor-executable instructions;

[0042] Wherein, the processor is configured to implement the above-mentioned data augmentation method for aligning different target scenes when executing the executable instructions.

[0043] Beneficial effects of this application:

[0044] The present invention obtains reference scene images and target scene images respectively, and annotates the reference scene images with instance data to obtain initial annotated data, performs color deviation analysis on the target scene images, performs color space conversion on the reference scene images according to the analysis results to obtain first augmented data, trains an instance detection and segmentation model according to the initial annotated data, and performs data augmentation training on the instance detection and segmentation model using the first augmented data. When applied in quality inspection scenarios, there are some scenes that are not currently set. The method of using image style conversion to obtain augmented data no longer requires re-annotation of new extended scenes. It only requires preparing a certain amount of new scene sample data as the target domain, performing style transfer on the annotated inventory reference scene images, simulating the extended scenes, and performing incremental training on the model, so that the model can be painlessly expanded to new scenes without the need for additional annotations, greatly reducing the workload of annotation engineers and improving the efficiency of product development.

[0045] Other features and aspects of the present application will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present application and, together with the description, serve to explain the principles of the present application.

[0047] Figure 1 A flowchart showing a data augmentation method for aligning different target scenes according to an embodiment of the present application;

[0048] Figure 2 A block diagram of a data augmentation device for aligning different target scenes according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0049] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0050] Among them, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application or simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.

[0051] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0052] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0053] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.

[0054] Data augmentation generates new data samples that are similar to but not identical to the original data by performing a series of transformations (such as flipping, rotating, scaling, cropping, color conversion, etc.) on the original data set, thereby expanding the size of the data set and increasing its diversity. Its main purpose is to help deep learning models better generalize to unknown data and improve the robustness and accuracy of the model.

[0055] Example 1

[0056] Figure 1 FIG. 1 is a flow chart showing a data augmentation method for aligning different target scenes according to an embodiment of the present application. Figure 1 As shown, the flow chart includes:

[0057] S100, respectively acquiring a reference scene image and a target scene image, and annotating instance data of the scene reference image to obtain initial annotated data;

[0058] In this embodiment, the reference scene image and the target scene image are obtained by collecting images of Poria cocos in multiple scenes, and the Poria cocos image taken by the iPhone 15 device in an indoor environment with normal incandescent light is selected as the reference scene image. The Poria cocos images taken by other devices and other ambient lighting conditions are used as target scene images. The Poria cocos in the reference scene image is annotated with instance detection and segmentation as the initial annotation data.

[0059] S200, performing color deviation analysis on the target scene image, and performing color space conversion on the reference scene image according to the analysis result to obtain first augmented data;

[0060] Based on the target scene images taken under different lighting and different equipment of scenes containing Poria cocos, the target scene images are analyzed for color deviation according to the reference scene images, and the reference scene images are subjected to corresponding color transformation. Compared with the original reference scene images, the reference scene images after color transformation are new training data sets, i.e., the first augmented data, for the subsequent instance detection and segmentation model used for quality inspection of Poria cocos. In practical applications, the number of images containing Poria cocos scenes is large. If all of them need to be annotated and then the detection and segmentation model is trained based on the instance, it will take a lot of time and manpower. Based on one or more reference scene images, images of other scenes containing Poria cocos are used as target scene images, the reference scene images are processed and the processed augmented data is used for training instance detection and segmentation models, so as to achieve the purpose of incorporating the target scene images into the training instances to train the detection and segmentation models, and obtain a full instance detection and segmentation model of Poria cocos.

[0061] S300: training an instance detection and segmentation model according to the initial labeled data, and performing data augmentation training on the instance detection and segmentation model using the first augmented data.

[0062] Based on the initial labeled data, an instance detection and segmentation model with good generalization in the reference scene is trained. The first augmented data obtained is used for model training to enhance the generalization of the model.

[0063] As an optional implementation scheme of the present application, a color deviation analysis is performed on the target scene image, and a color space conversion is performed on the reference scene image according to the analysis result to obtain first augmented data, including: converting the reference scene image from a first color space to a second color space; and performing a first gamma adjustment on the reference scene image in the second color space to obtain first augmented data.

[0064] Specifically, the reference scene image is converted from the RGB color space to the LAB color space, wherein the RGB color space is the first color space and the LAB color space is the second color space. In the LAB color space, a first gamma adjustment is performed on the A color channel and the B color channel respectively, and the adjusted reference scene image is compared with the original reference scene image as the first augmented data.

[0065] As an optional implementation scheme of the present application, a first gamma adjustment is performed on the reference scene image in a second color space to obtain first augmented data, including: generating a first random number; determining whether the first random number is greater than or equal to a preset first random number threshold; when the first random number is greater than or equal to the preset first random number threshold, obtaining a first gamma value from a first gamma value range; and compressing color channel values ​​of the second color space according to the first gamma value to obtain first augmented data.

[0066] The reference scene image performs a first gamma adjustment on the A color channel in the LAB color space, specifically generating a first random number, and determining whether the first random number is greater than or equal to a first random number threshold. In this embodiment, the first random number threshold is set to 0.5. When the first random number is greater than or equal to 0.5, a value is randomly selected from the first gamma value range (1, 1.2) as the first gamma value, and the A color channel value is compressed according to the selected first gamma value, so that the reference scene image is biased towards green to varying degrees. Similarly, when the first gamma adjustment is performed on the B color channel, the B color channel value is compressed according to the selected first gamma value, so that the reference scene image is biased towards blue to varying degrees. At this time, the A color channel value and the B color channel data of the reference scene image are changed compared to the original corresponding color channel values, and the first augmented data similar to but not completely the same as the original reference scene image is obtained.

[0067] As an optional implementation scheme of the present application, performing a first gamma adjustment on the reference scene image in a second color space to obtain first augmented data also includes: when the first random number is less than a preset random number threshold, obtaining a second gamma value from a second gamma value range; and amplifying the color channel values ​​of the second color space according to the second gamma value to obtain the first augmented data.

[0068] When the first random number is less than 0.5, a value is randomly selected from the second gamma value range (0.8, 1) as the second gamma value. The A color channel value is amplified according to the selected second gamma value, so that the reference scene image is biased towards red to varying degrees. Similarly, when the first gamma adjustment is performed on the B color channel, the B color channel value is amplified according to the selected second gamma value, so that the reference scene image is biased towards yellow to varying degrees. At this time, the A color channel value and the B color channel data of the reference scene image are changed compared to the original corresponding color channel values, and the first augmented data similar to but not completely the same as the original reference scene image is obtained.

[0069] As an optional implementation scheme of the present application, after performing a first gamma adjustment on the reference scene image in the second color space to obtain the first augmented data, it also includes: converting the reference scene image from the second color space to the first color space; based on the first color space, converting the reference scene image from the first color space to a third color space; performing a second gamma adjustment on the reference scene image in the third color space to obtain second augmented data.

[0070] After performing the first gamma adjustment on the A color channel and the B color channel respectively, the reference scene image is converted from the LAB color space to the RGB color space. Then, the reference scene image is converted from the RGB color space to the HSV color space, wherein the third color space is the HSV color space, and the gamma adjustment is also performed on the S channel of the HSV color space. Compared with the reference scene image before the adjustment, the adjusted reference scene image is the second augmented data.

[0071] As an optional implementation scheme of the present application, a second gamma adjustment is performed on the reference scene image in a third color space to obtain second augmented data, including: generating a second random number; determining whether the second random number is greater than or equal to a preset second random number threshold; when the second random number is greater than or equal to the preset second random number threshold, obtaining a third gamma value from a third gamma value range; and compressing a saturation channel value of the third color space according to the third gamma value to obtain second augmented data.

[0072] Specifically, a second random number is generated, and it is determined whether the second random number is greater than or equal to a second random number threshold. In this embodiment, the second random number threshold is set to 0.5. When the second random number is greater than or equal to 0.5, a value is randomly selected from the third gamma value range (1, 1.2) as the third gamma value. The S saturation channel value is compressed according to the selected third gamma value to reduce the saturation of the reference scene image, making the reference scene image grayer. At this time, the S saturation channel value of the reference scene image is changed compared to the original corresponding S saturation channel value, and the second augmented data similar to but not completely the same as the reference scene image before adjustment is obtained.

[0073] As an optional implementation scheme of the present application, performing a second gamma adjustment on the reference scene image in a third color space to obtain second augmented data also includes: when the second random number is less than a preset second random number threshold, obtaining a fourth gamma value from a fourth gamma value range; and amplifying the saturation channel value of the third color space according to the fourth gamma value to obtain second augmented data.

[0074] When the second random number is less than 0.5, a value is randomly selected from the fourth gamma value range (0.8, 1) as the fourth gamma value. The S saturation channel value is amplified according to the selected fourth gamma value to increase the saturation of the reference scene image, making the reference scene image more vivid. At this time, the S saturation channel value of the reference scene image is changed compared with the original corresponding S saturation channel value, and the second augmented data similar to but not completely the same as the reference scene image before adjustment is obtained.

[0075] After obtaining the first augmented data and the second augmented data, both can be used for training the instance detection and segmentation model to improve the generalization of the model.

[0076] As an optional implementation scheme of the present application, a reference scene image and a target scene image are obtained respectively, and instance data is annotated for the reference scene image. After the initial annotated data is obtained, the method further includes: analyzing the resolution and clarity of the target scene image; when at least one of the resolution and clarity corresponds to a reference resolution and a reference clarity lower than that of the reference scene image, sampling and blurring the reference scene image to obtain third augmented data; and performing data augmentation training on the instance detection and segmentation model using the third augmented data.

[0077] The resolution and clarity of the target scene image are analyzed. For example, it is found that the resolution and clarity of the target scene images taken by devices such as iPhoneX are lower than the reference resolution and reference clarity of the reference scene images. At the same time, the color cast of different devices will be different under different lighting conditions. For example, Huawei P40 will be yellowish when taken under warm light; the Poria scene image taken under no lighting conditions in the conference room will be gray, etc. Based on the above analysis, the reference scene images with instance data annotation are downsampled and Gaussian blurred based on the reference resolution and reference clarity. The reference scene images are downsampled by 2 / 4 / 8 times, and Gaussian blurs with kernels of 7x7, 5x5, and 3x3 are performed on each downsampled reference scene image to simulate the different resolutions and clarity of the target scene images. During the processing, the local optimal adjustment of parameters can be selected based on the analysis of prior knowledge based on observation to further enhance the generalization of the instance detection and segmentation model.

[0078] The reference scene image after downsampling and Gaussian blur processing is similar to the reference scene image before downsampling processing but not completely the same, and the processed reference scene image can be used as the third augmented data. The third augmented data and the initial annotated data are input into the instance detection and segmentation model trained under the aforementioned single device and single illumination conditions, and the instance detection and segmentation model is incrementally trained based on the set weights.

[0079] On the other hand, in order to further explore the relationship between the Poria scene images collected by different devices under different lighting conditions, the reference scene images and the target scene images can also be subjected to high-dimensional feature mapping to improve the generalization of the Poria instance detection and segmentation model. Specifically, the high-dimensional feature mapping is to establish a high-dimensional semantic information mapping of the target scene image. In this embodiment, an image generation model using an unpaired mapping model styleGAN is used, and the reference scene image is used as input and output as a target scene image. The reference scene image is mapped to other scenes, and the target scene image obtained after style conversion is added to the instance detection and segmentation model for multiple incremental training to obtain a model with better generalization performance.

[0080] After using augmented data to train the instance detection and segmentation model, the model has a certain degree of improvement in the generalization ability of Poria cocos detection in different scenarios. However, it was found in the generalization analysis that the model's detection performance of some categories of Poria cocos needs to be improved. For example, on damaged Poria cocos, for these categories of Poria cocos, a batch of new data needs to be prepared for incremental training to guide the model to increase the attention of this part of the data, thereby improving the performance of the model on this type of data. Specifically: For the collected difficult instance data, the detection and segmentation model of Poria cocos is used to predict the difficult instance data, and the detection box and segmentation coordinates of the predicted Poria cocos difficult instance are stored in a format recognizable by the annotation software. In this embodiment, labelme is used as the annotation software. The annotation engineer corrects the incorrectly identified instance data on the annotation predicted by the model, stores the corrected difficult instance data, and uses it as new annotation data for incremental training on the aforementioned instance detection and segmentation model to improve the performance of the model in the detection and segmentation of difficult Poria cocos instances. Furthermore, users can also interactively correct data based on the prediction results of difficult instance data to update the instance detection and segmentation model online, which can improve the generalization performance of the instance detection and segmentation model in actual scenarios online.

[0081] In terms of the training strategy of the instance detection and segmentation model, two aspects of optimization are performed in this embodiment. On the one hand, for incremental training of newly added difficult instance data samples, when calculating the loss function for samples of this category, the weight of the loss function of this part of samples is increased, thereby improving the generalization of the model.

[0082] And in the training stage of the model, the bootstrap (sampling with replacement) method is adopted in each training. Specifically, after each epoch (batch) model training is completed, the training data set is predicted. Based on the predicted loss function, GMM (Gaussian mixture model) is selected for binary classification in this embodiment, and then a class of data with a larger loss function is selected for training the next batch of models. This integrated model training method, on the one hand, greatly improves the model's attention to difficult instance samples in the training samples. On the other hand, since each difficult instance data instance screened by GMM is different, it also greatly reduces the risk of model overfitting and improves the generalization of the model.

[0083] Through the above method, when applying the Poria cocos quality inspection scenario, there are some scenes that are not currently set. The method of obtaining augmented data by using image style conversion no longer needs to re-annotate the new extended scenes. It only needs to prepare a certain number of new scene sample data as the target domain, and transfer the style of the annotated inventory reference scene images. The extended scenes are simulated and the model is incrementally trained. This allows the model to be expanded to new scenes without the need for additional annotations and without annotation costs, thereby improving the efficiency of product development.

[0084] Example 2

[0085] Based on the same principle as the above method, a data augmentation device for aligning different target scenes is also proposed, see Figure 2 , a data augmentation device 100 for aligning different target scenes according to an embodiment of the present disclosure includes:

[0086] The first unit 110 is used to obtain a reference scene image and a target scene image respectively, and annotate the reference scene image with instance data to obtain initial annotated data;

[0087] The second unit 120 is used to perform color deviation analysis on the target scene image, and perform color space conversion on the reference scene image according to the analysis result to obtain first augmented data;

[0088] The third unit 130 is used to train the instance detection and segmentation model according to the initial labeled data, and perform data augmentation training on the instance detection and segmentation model using the first augmented data.

[0089] Obviously, those skilled in the art should understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned control methods. The modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by computing devices, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules respectively, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.

[0090] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned control methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated as: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.

[0091] Example 3

[0092] Furthermore, an electronic device is proposed, comprising:

[0093] processor;

[0094] a memory for storing processor-executable instructions;

[0095] The processor is configured to implement the data augmentation method for aligning different target scenes in Example 1 when executing executable instructions.

[0096] The electronic device of the embodiment of the present disclosure includes a processor and a memory for storing processor executable instructions, wherein the processor is configured to implement any of the above data augmentation methods for aligning different target scenes when executing the executable instructions.

[0097] It should be noted that the number of processors may be one or more. At the same time, the electronic device of the embodiment of the present disclosure may also include an input device and an output device. The processor, memory, input device, and output device may be connected via a bus or in other ways, which are not specifically limited here.

[0098] The memory is a computer-readable storage medium for the data augmentation method for aligning different target scenes, and can be used to store software programs, computer executable programs, and various modules, such as: programs or modules corresponding to the data augmentation method for aligning different target scenes in the embodiment of the present disclosure. The processor executes various functional applications and data processing of the electronic device by running the software programs or modules stored in the memory.

[0099] The input device can be used to receive input numbers or signals. The signal can be a key signal related to user settings and function control of the device / terminal / server. The output device can include a display device such as a display screen.

[0100] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A data augmentation method for aligning different target scenes, characterized in that: include: Acquire a reference scene image and a target scene image respectively, and annotate the reference scene image with instance data to obtain initial annotated data; Performing a color deviation analysis on the target scene image, and performing a color space conversion on the reference scene image according to the analysis result to obtain first augmented data; An instance detection and segmentation model is trained according to the initial labeled data, and data augmentation training is performed on the instance detection and segmentation model using the first augmented data.

2. The data augmentation method for aligning different target scenes according to claim 1, characterized in that: The step of performing a color deviation analysis on the target scene image and performing a color space conversion on the reference scene image according to the analysis result to obtain the first augmented data includes: Converting the reference scene image from a first color space to a second color space; Performing a first gamma adjustment on the reference scene image in the second color space to obtain first augmented data.

3. The data augmentation method for aligning different target scenes according to claim 2, characterized in that: The step of performing a first gamma adjustment on the reference scene image in the second color space to obtain first augmented data includes: generating a first random number; Determine whether the first random number is greater than or equal to a preset first random number threshold; When the first random number is greater than or equal to a preset first random number threshold, obtaining a first gamma value from a first gamma value range; The color channel values ​​of the second color space are compressed according to the first gamma value to obtain first augmented data.

4. The data augmentation method for aligning different target scenes according to claim 3, characterized in that: The step of performing a first gamma adjustment on the reference scene image in the second color space to obtain first augmented data further includes: When the first random number is less than a preset random number threshold, obtaining a second gamma value from a second gamma value range; Amplify the color channel value of the second color space according to the second gamma value to obtain first augmented data.

5. The data augmentation method for aligning different target scenes according to claim 2, characterized in that: After performing a first gamma adjustment on the reference scene image in the second color space to obtain first augmented data, the method further includes: Converting the reference scene image from the second color space to the first color space; Based on the first color space, converting the reference scene image from the first color space to a third color space; Performing a second gamma adjustment on the reference scene image in the third color space to obtain second augmented data.

6. The data augmentation method for aligning different target scenes according to claim 5, characterized in that: The step of performing a second gamma adjustment on the reference scene image in the third color space to obtain second augmented data includes: generating a second random number; Determine whether the second random number is greater than or equal to a preset second random number threshold; When the second random number is greater than or equal to a preset second random number threshold, obtaining a third gamma value from a third gamma value range; The saturation channel value of the third color space is compressed according to the third gamma value to obtain second augmented data.

7. The data augmentation method for aligning different target scenes according to claim 6, characterized in that: The step of performing a second gamma adjustment on the reference scene image in the third color space to obtain second augmented data further includes: When the second random number is less than a preset second random number threshold, obtaining a fourth gamma value from a fourth gamma value range; The saturation channel value of the third color space is amplified according to the fourth gamma value to obtain second augmented data.

8. The data augmentation method for aligning different target scenes according to claim 1, characterized in that: The method of respectively acquiring a reference scene image and a target scene image, and annotating the reference scene image with instance data to obtain initial annotated data further includes: Analyzing the resolution and clarity of the target scene image; When at least one of the resolution and the definition is correspondingly lower than the reference resolution and the reference definition of the reference scene image, performing sampling processing and blurring processing on the reference scene image to obtain third augmented data; The instance detection and segmentation model is trained by using the third augmented data.

9. A data augmentation device for aligning different target scenes, characterized in that: include: The first unit is used to obtain a reference scene image and a target scene image respectively, and annotate the reference scene image with instance data to obtain initial annotated data; The second unit is used to perform color deviation analysis on the target scene image, and perform color space conversion on the reference scene image according to the analysis result to obtain first augmented data; The third unit is used to train an instance detection and segmentation model according to the initial labeled data, and perform data augmentation training on the instance detection and segmentation model using the first augmented data.

10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the data augmentation method for aligning different target scenes as described in any one of claims 1 to 8 when executing the executable instructions.