A data augmentation method based on small sample scenarios

Through the improved WCT algorithm and image conversion technology, it solves the problem of difficulty in obtaining data sets and high labeling costs in small sample scenarios, improves the detection accuracy of target detection, generates more realistic synthetic data, and solves the problem of small sample scenarios. data limitation issues.

CN113763234BActive Publication Date: 2024-09-13BEIJING INST OF TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202111005177.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2024-09-13
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

In a small sample scenario, the target detection task faces the problems of difficulty in obtaining data sets and high labeling costs. Existing deep learning methods are less effective in small sample target detection and fail to effectively solve the unique positioning problem in target detection algorithms. sex.

Method used

The improved WCT algorithm is used for style transfer, and the source domain and target domain images are converted through image conversion technology. Combined with wavelet pooling and image smoothing processing, the adaptive effect at the sample level is improved and a more realistic synthetic image is generated. for data amplification.

Benefits of technology

It achieves low-cost and rapid amplification of small sample data sets, improves the detection accuracy of target detection, effectively solves the data limitation problem in small sample scenarios, and enhances the realism and detection accuracy of synthetic data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113763234B
    Figure CN113763234B
Patent Text Reader

Abstract

The present invention discloses a data augmentation method based on a small sample scenario. The method comprises the following steps: first, according to the requirements of a target detection task, a WCT algorithm is used to perform style transfer on a content image and a style image, and the content of the obtained synthetic image is consistent with the content image, and the style is the style provided by the style image; second, an image conversion technology is used to convert a source domain synthetic image and a target domain real image respectively, and domain adaptation is completed while retaining the image content, so as to obtain a final synthetic image; the method of the present invention can rapidly amplify a small sample data set at a low cost, and solves the problems of difficulty in obtaining data sets, high cost, and data limitation of target detection in a small sample scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of target detection, and particularly relates to a data set in a small sample scenario in target detection, and relates to a data set expansion through style transfer and adaptive methods. Background Art

[0002] Deep learning is a data-driven technology that directly learns rules and builds corresponding models on massive data. The emergence of massive data in the big data era has brought about a boom in the development of deep learning. Object detection algorithms based on deep learning also rely on massive labeled data. Existing large-scale labeled data, such as Pascal VOC, MS COCO, Open Image, etc., provide good data support for object detection algorithms based on deep learning. At present, the mainstream research direction of object detection is mainly focused on improving the accuracy and speed of algorithms in existing large-scale public data sets. Deep learning has brought significant performance improvements to object detection. Most of the existing object detection research is based on public data sets. However, in the actual application of object detection algorithms, due to the uniqueness of different object detection tasks, the availability of existing public data is low, and it is necessary to obtain massive labeled data according to task requirements. Data collection and labeling is a task that requires a lot of manpower and material resources. At the same time, due to privacy factors and scene restrictions, there is a problem that data cannot be obtained or there are few data samples. Therefore, in the actual application of object detection based on deep learning, data is a key limiting factor, and object detection research in small sample scenarios is the key to solving data limitations in the actual application of object detection. Existing research on small-sample target detection mainly combines small-sample machine learning methods with traditional target detection methods. There are few studies on target detection based on deep learning in small-sample scenarios. Moreover, existing research on small-sample target detection based on deep learning is mainly migrated from small-sample target recognition algorithms, without considering the uniqueness of positioning problems in target detection algorithms. Existing small-sample machine learning methods such as metric learning and meta-learning have poor effects in small-sample target detection tasks. Summary of the invention

[0003] In view of this, the present invention provides a data augmentation method based on a small sample scenario, which can provide an improved WCT (Whitening and Coloring Transform) algorithm to convert images in the source domain and the target domain when the data set is difficult to obtain and the collection and annotation cost is high, so as to improve the sample-level adaptive effect and better reduce the difference between the source domain and the target domain.

[0004] The technical solution for implementing the present invention is as follows:

[0005] A data augmentation method based on a small sample scenario includes the following steps:

[0006] Step 1: According to the requirements of the target detection task, the WCT algorithm is used to transfer the style of the content image and the style image. The content of the obtained synthetic image is consistent with the content image, and the style is the style provided by the style image.

[0007] Step 2: Use image conversion technology to convert the source domain synthetic image and the target domain real image respectively, complete domain adaptation while retaining the image content, and obtain the final synthetic image.

[0008] Furthermore, step one specifically includes:

[0009] Step 1.1, when using the WCT style transfer algorithm for data augmentation, first use the seed sample to train the WCT style transfer algorithm image reconstruction network module; train the decoding module corresponding to the encoder to achieve the algorithm's identity transformation of the seed sample image content part, and then achieve good reconstruction of the content image under any style;

[0010] Step 1.2: Take cascade stylization operations on the feature maps of the content image and the style image, combine the characteristics of low-level features that are easy to restore image content and high-level features that are easy to capture style features, and use multi-level stylization operations to obtain stylized images that retain content; use seed samples as content images and real images of various styles as style images, and use the trained algorithm to implement the forward process of the WCT style transfer network model.

[0011] Furthermore, the WCT algorithm is optimized and improved: through wavelet pooling, de-pooling and image smoothing, the image distortion and artifact problems existing in the WCT algorithm are improved.

[0012] Furthermore, based on the image reconstruction module of the WCT algorithm, all the pooling layers in the encoding network are replaced by Haar wavelet pooling, and the wavelet unpooling layer is used in the decoder to replace the commonly used upsampling layer; at the same time, skip connections are added to the encoding and decoding network; the high-frequency sub-band feature information obtained by the encoder pooling is sent to the unpooling layer of the decoder as information supplement.

[0013] Furthermore, the image smoothing process is implemented by an image smoothing process module, and the image smoothing process module is added after the encoding and decoding network and the WCT stylization operation module.

[0014] Beneficial effects:

[0015] (1) The improved style transfer method provided by the present invention can quickly expand small sample data sets at low cost, solving the problems of difficulty in obtaining data sets, high cost, and data limitation of target detection in small sample scenarios.

[0016] (2) The improved WCT style transfer method provided by the present invention can enhance the realism of the synthesized image and effectively improve the problems existing in the WCT style transfer algorithm. The sample-level adaptive method based on image conversion can improve the detection accuracy and better utilize synthetic data to solve the target detection problem in small sample scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 Schematic diagram of the style transfer implementation process of the WCT algorithm of the present invention.

[0018] Figure 2 It is a VGG-19 network structure diagram of the present invention.

[0019] Figure 3 It is a network structure diagram of the WCT algorithm based on multi-level stylization operation of the present invention.

[0020] Figure 4 Schematic diagram of the network structure of the improved WCT style transfer algorithm of the present invention.

[0021] Figure 5 It is a schematic diagram of the encoding and decoding process of the improved image reconstruction network based on wavelet transform of the present invention. DETAILED DESCRIPTION

[0022] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0023] The present invention provides a data amplification method based on a small sample scenario, which specifically includes the following steps:

[0024] Step S1: In the dataset augmentation task under the small sample scenario, it is necessary to perform stylization operations on the image data to obtain a variety of synthetic data with the same annotation information. The style transfer implementation process of the WCT algorithm is as follows: Figure 1 As shown, the specific steps are as follows:

[0025] S11: The style transfer process is mainly divided into four steps: image encoding, style conversion, feature map decoding, and multi-layer cascade of stylized operations. The image encoding and decoding operations are implemented by the image reconstruction network module in the WCT algorithm, and the style conversion is implemented by the WCT operation module. The reconstruction network module and the WCT operation module are combined to implement the stylized operation of the WCT algorithm, and the multi-layer cascade of stylized operations is implemented through multi-level stylized operations.

[0026] S111: The encoder of the reconstruction module is a VGG-19 network, which consists of 5 modules, including 16 convolutional layers and 3 fully connected layers, a total of 9 layers, with the following structure: Figure 2 As shown. The convolution layer is 3X3, and the 5X5 convolution effect is achieved by cascading two convolution kernels, and the 7X7 convolution effect is achieved by cascading three convolution kernels. Under the premise of ensuring the same receptive field, the network depth is increased, thereby improving the network performance. The pooling layer is a 2X2 maximum pooling, and the five modules are connected by the pooling layer. The training of the module network is supervised by minimizing the reconstruction loss function to achieve the identity transformation of the reconstruction module. The loss function formula is:

[0027]

[0028]

[0029] Among them, I o The reconstructed output, I i is the input content image, Φ is the encoder network VGG-19, and λ is the function that balances the two losses. The trained decoder and encoder keep their parameters fixed in subsequent operations and act as a feature transformer.

[0030] S112: The operation of the WCT module is divided into two parts: whitening conversion and coloring conversion. The encoder of the reconstructed network in the previous step can obtain the content image I c and style picture I s The corresponding feature map f c and f s . c Subtract its mean matrix m c Centralize and then c Perform linear transformation operation:

[0031]

[0032] Where D c is the covariance matrix f c f c T Diagonal matrices with the same matrix eigenvalues, E c is an orthogonal matrix corresponding to the eigenvector, satisfying:

[0033] f c f c T =E c D c E c T

[0034] After the whitening operation, de-stylization is completed and only the content information is retained.

[0035] S113: The coloring conversion operation can be regarded as the inverse process of the whitening operation. First, the style feature map is centered, and the diagonal matrix D is calculated using the style feature map. s The orthogonal matrix E corresponding to the eigenvector of the covariance matrix s Perform stylization on the whitened content feature map. The degree of stylization can be controlled by changing the style weight coefficient α:

[0036]

[0037] S114: A cascade stylization operation is performed on the feature map, combining the low-level features that can better restore the image content with the high-level features that can easily capture the style features. The network structure of the WCT algorithm for multi-level stylization operation is as follows: Figure 3 As shown in Figure 2, the reconstruction of local detail features is achieved, thereby obtaining an excellent stylized synthetic image.

[0038] S12: When using the WCT image style transfer algorithm for data augmentation, it is necessary to first use seed samples to train the WCT style transfer algorithm, and then use the seed samples as content images and real images of various styles as style images to implement the forward process of the WCT style transfer network model.

[0039] S121: During training, the WCT style transfer algorithm only needs to train the image reconstruction network module. Since the WCT algorithm performs multi-level stylization operations, during the training process, 5 decoding modules that are symmetrical to the encoder need to be trained.

[0040] S122: Use the seed sample as the content image and real images of various styles as style images to perform style transfer and obtain an amplified synthetic dataset.

[0041] Through the above method, an image dataset for the five types of target detection tasks was constructed, with a total of about 12,600 images, each with 1 to 4 targets.

[0042] Step S2: After the synthetic data set is expanded, the source domain synthetic images and the target domain real images are converted using image conversion technology to achieve sample-level adaptation. Domain adaptation is completed while preserving the image content, so that the representations of the two at the sample level are closer, improving the generalization of the model trained with synthetic data in the real world.

[0043] S21: The reconstruction network of the algorithm is trained using 9000 synthetic images and 600 real images given by the target detection task, and the loss balance parameter λ is set to 1.

[0044] S22: After the WCT algorithm is trained, 25 unlabeled real seed samples are used as style images to perform style conversion on the synthetic image training set, making it closer to the real test set after conversion. 20 synthetic image training sets are selected as style images, and style conversion is performed on the real image test set, so that the difference between the real test set and the synthetic training set is further reduced, completing the sample-level adaptation based on the WCT algorithm.

[0045] S23: The deep learning framework of this experiment is Pytorch, and the target detection network is the Faster R-CNN network using the ImageNet pre-training model of VGG-16. The training method adopts the alternating training method. The evaluation index is the mAP index commonly used in target detection, and the mAP value when the IOU value is 0.5 is selected as the evaluation index.

[0046] S231: After completing the validation level adaptation using the WCT algorithm, the synthetic data before and after the conversion are used as the training set, and the real data before and after the conversion are used as the test set to train and test the target monitoring network Faster R-CNN.

[0047] S232: The test results show that when sample-level adaptation is performed on both synthetic data and real data, the detection accuracy is improved by about 2.6% compared with the results without adaptation, which is higher than the accuracy when only adapting to the test set or training set.

[0048] In order to solve the problems of spatial distortion and artifacts in the WCT algorithm and improve the global stylization of the converted image, wavelet transformation and image smoothing are introduced. The present invention also proposes an improved WCT algorithm network, which is a more optimized solution compared to step S2. The overall structure of the network is as follows: Figure 4 As shown, the specific steps include the following:

[0049] 1. The image reconstruction network module is improved by wavelet transformation based on the image reconstruction module of the WCT algorithm. All the pooling layers in the encoding network VGG-19 are replaced by Haar wavelet pooling, and the wavelet unpooling layer is used in the decoder to replace the commonly used upsampling layer. At the same time, jump connections are added to the encoding and decoding network. The high-frequency sub-band feature information obtained by the encoder pooling is sent to the unpooling layer of the decoder as information supplement. The encoding and decoding process of the improved image reconstruction network based on wavelet transform is as follows: Figure 5 shown.

[0050] 1.1. For a matrix representation A of a picture with a given dimension of (n,n,m), perform the following transformation:

[0051]

[0052] Where W, H, G are defined as:

[0053]

[0054]

[0055]

[0056] 1.2. After the wavelet transform, the low-frequency feature information is separated as the obtained feature map, and the stylization operation is performed separately. At this time, the wavelet transform realizes the function of downsampling and reduces the amount of data. It can better complete the image style feature conversion while retaining the position information, and there is no problem of spatial information loss. The feature map X output by the Relu layer of the encoding network VGG-19 is subjected to two wavelet transform operations by applying low-frequency and high-frequency filters on the rows and columns respectively. The corresponding eigenvalues ​​at the (i, j) position are as follows:

[0057]

[0058] 1.3. The stylized low-frequency features and the high-frequency sub-band features obtained by wavelet pooling are sent to the decoding network together, and the wavelet unpooling layer is used to restore the image content feature information, restore the feature map size, and complete the image reconstruction. The implementation process is as follows:

[0059]

[0060] 2. The image smoothing module is a new module, which is added after the encoding and decoding network and WCT stylization operation module. It smoothes the stylized reconstructed image to eliminate the style inconsistency of the stylized image.

[0061] 2.1. Let the image S after smoothing given input image I, and its gradient information is as follows:

[0062]

[0063] Where S p is the pixel at position p in the image, is the gradient value in the x direction at that position. Calculate the L0 norm C(S) of the gradient of image S:

[0064]

[0065] Where #{} represents the number of elements p in the geometry. Given the objective function:

[0066]

[0067] exist

[0068] C(S)=k

[0069] Under the L0 norm constraint, solve S that minimizes the objective function, that is, the smoothed image obtained by the smoothing method based on the gradient L0 norm, that is, the smoothed image that smoothes most of the noise without losing the edge information.

[0070] 2.2. In order to obtain the optimal solution, the objective function minimization problem under the above constraints is transformed into an equivalent unconstrained problem using the Lagrange multiplier method:

[0071]

[0072] The parameter λ controls the ratio of the objective function to the constraint, and can be used to control the degree of smoothing. The larger the λ, the fewer non-zero gradient values ​​and the stronger the smoothing effect.

[0073] Introduce the gradient value at the pixel p position The corresponding auxiliary variable h P ,v P By replacing variables, the above unconstrained problem can be approximately decoupled into a quadratic programming problem of local scope:

[0074]

[0075] C(h,v)=#{p||h P |+|v P |≠0}

[0076] β is continuously increased through iteration, and the optimal solution process of the above variables S and (h, v) is repeatedly executed alternately during the iteration process to obtain a more accurate optimal solution to the original problem. During the iteration process, the value of β is used as the iteration termination condition, and the iteration process steps are as follows:

[0077] Step 1: Input image I, smoothing weight λ, parameters β0, β max and k, where k is the update weight during the β iteration process.

[0078] Step 2: Initialize parameter S 0 =I,β=β0,i=0.

[0079] Step 3: Use the obtained parameter S i ,according to

[0080]

[0081] Find the corresponding parameters and

[0082] Step 4: Use the obtained parameter h i and vi ,according to

[0083]

[0084] Find the corresponding parameter S i .

[0085] Step 5: Repeat steps 3, 4, and 5 until β ≥ β is satisfied max .

[0086] Step 6: Output S, which is the final smoothed image.

[0087] When the image is smoothed using the smoothing method based on the gradient L0 norm, the value of the above parameter β0 is set to 2λ, β max It is usually set around 1E5 according to the requirements, and the iteration weight k is often set to 2. At this time, the optimal solution can be obtained after 20-30 iterations, and the smoothing process can achieve a better smoothing effect at a relatively fast speed. In the image smoothing process, different smoothing degrees can be achieved by setting different smoothing parameters λ. The larger the λ value, the deeper the smoothing process. The λ value is usually set around 0.02.

[0088] 3. The objects of sample-level adaptation in this section are still the 9000 synthetic image training set and the 600 real image test set. When using the improved WCT algorithm for sample-level adaptation, it is necessary to first train the improved WCT algorithm using 9000 synthetic training images and 600 real test images. The improved WCT algorithm is similar to the WCT algorithm in terms of overall network structure. The newly added wavelet pooling module and smoothing processing module are both fixed parameter layers and do not need to participate in the network training process. Therefore, the loss function of this algorithm is the same as the loss function of the WCT algorithm, and will not be described in detail here. The network training process is as follows:

[0089] Step 1: Use the ImageNet pre-trained model of VGG-19 to initialize the parameters of the encoder network containing the wavelet pooling layer. The wavelet pooling layer has fixed parameters and does not need to be initialized, keeping the encoding network parameters fixed.

[0090] Step 2: Use the content image as the training set to input into the encoder network, obtain the output feature maps of the five modules and send them to the corresponding five symmetrical decoding networks.

[0091] In summary, the above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A data augmentation method based on a small sample scenario, characterized in that: The following steps are involved: Step 1: According to the requirements of the target detection task, the WCT algorithm is used to transfer the style of the content image and the style image. The content of the obtained synthetic image is consistent with the content image, and the style is the style provided by the style image. Step 1 specifically includes: Step 1.1, when using the WCT style transfer algorithm for data augmentation, first use the seed sample to train the WCT style transfer algorithm image reconstruction network module; train the decoding module corresponding to the encoder to achieve the algorithm's identity transformation of the seed sample image content part, and then achieve good reconstruction of the content image under any style; The style transfer implementation process of the WCT algorithm is as follows: S11: The style migration process is divided into four steps: image encoding, style conversion, feature map decoding, and multi-layer cascade of stylized operations. The image encoding and decoding operations are implemented by the image reconstruction network module in the WCT algorithm, and the style conversion is implemented by the WCT operation module. The reconstruction network module and the WCT operation module are combined to implement the stylized operation, and the multi-layer cascade of stylized operations is implemented through multi-level stylized operations. S111: The encoder of the reconstruction network module is a VGG-19 network, which consists of 5 modules, including 16 convolutional layers and 3 fully connected layers, a total of 9 layers, of which the convolutional layer is 3X3, and a 5X5 convolution effect is achieved by cascading two convolutional kernels, and a 7X7 convolution effect is achieved by cascading three convolutional kernels; the pooling layer is a 2X2 maximum pooling, and the five modules are linked by the pooling layer; the training of the module network is supervised by minimizing the reconstruction loss function to achieve the identity transformation of the reconstruction module; S112: The operation of the WCT module is divided into two parts: whitening conversion and coloring conversion; the encoder of the previous step reconstructs the network to obtain the content image I c and style picture I s The corresponding feature map f c and f s ; f c Subtract its mean matrix m c Centralize and then c Perform linear transformation to obtain Where D c is the covariance matrix f c f c T Diagonal matrices with the same matrix eigenvalues, E c is an orthogonal matrix corresponding to the eigenvector, satisfying: f c f c T =E c D c E c T After the whitening operation, the de-stylization is completed and only the content information is retained; S113: The coloring conversion operation can be regarded as the inverse process of the whitening operation; first, the style feature map is centered, and the style diagonal matrix D calculated using the style feature map is used s The style orthogonal matrix E corresponding to the covariance matrix eigenvector s Perform stylization operation on the whitened content feature map; S114: taking a cascade stylization operation on the feature map, combining the low-level features that can better restore the image content with the high-level features that can easily capture the style features; Step 1.2: Cascade stylization operations are performed on the feature maps of the content image and the style image, combining the characteristics of low-level features that are easy to restore image content and high-level features that are easy to capture style features, and using multi-level stylization operations to obtain stylized images that retain content; using seed samples as content images and real images of various styles as style images, the forward process of the WCT style transfer network model is implemented through the trained algorithm; S121: The WCT style transfer algorithm only needs to train the image reconstruction network module during training, and needs to train 5 decoding modules that are symmetrical to the encoder; S122: Use the seed sample as the content image and the real images of various styles as the style images to perform style migration to obtain an amplified synthetic dataset; Step 2: Use image conversion technology to convert the source domain synthetic image and the target domain real image respectively, complete domain adaptation while retaining the image content, and obtain the final synthetic image.

2. The data augmentation method based on a small sample scenario according to claim 1, characterized in that: Optimize and improve the WCT algorithm: Through wavelet pooling, de-pooling and image smoothing, the image distortion and artifact problems existing in the WCT algorithm are improved.

3. The data augmentation method based on a small sample scenario as claimed in claim 2, characterized in that: Based on the image reconstruction module of the WCT algorithm, all pooling layers in the encoding network are replaced by Haar wavelet pooling, and wavelet unpooling layers are used in the decoder to replace the commonly used upsampling layers. At the same time, skip connections are added to the encoding and decoding network. The high-frequency sub-band feature information obtained by encoder pooling is sent to the unpooling layer of the decoder as information supplement.

4. The data augmentation method based on a small sample scenario as claimed in claim 2, characterized in that: The image smoothing process is implemented by an image smoothing process module, and the image smoothing process module is added after the encoding and decoding network and the WCT stylization operation module.

Citation Information

Cited By

  • Rainy and foggy weather traffic flow data set amplification method based on image style migration

    CN115482510A

  • A method for augmenting traffic flow dataset in rainy and foggy weather based on image style transfer

    CN115482510B