A method for generating target detection dataset

Through the target detection data set generation method, using technologies such as image style transfer and transmission transformation, the problem of insufficient military target detection data sets is solved, the performance of smart weapons is improved, and false alarms and false negatives are reduced.

CN118552811BActive Publication Date: 2024-10-29杭州长望智创科技有限公司
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411025290.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-29
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

Due to the confidentiality of military targets, publicly available target detection data sets are very limited, resulting in insufficient training samples for smart weapon ammunition models, resulting in false alarms and missed negatives, thereby reducing the overall performance of smart weapons.

Method used

Using the target detection data set generation method, by collecting target images and background images, image style transfer, foreground and background separation, transmission transformation and image processing are performed, a one-to-one correspondence between the label file and the background image is established, a mask is generated, and the Stochastic regression and adjustment are processed to generate an object detection dataset.

Benefits of technology

It effectively expands the target detection data set, increases the model training sample size, reduces false alarms and false negatives, and improves the overall performance of smart weapons and ammunition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552811B_ABST
    Figure CN118552811B_ABST
Patent Text Reader

Abstract

The present application discloses a method for generating a target detection data set, comprising: collecting a plurality of target images, separating the foreground and background of the target image and then saving the foreground; collecting a plurality of background images, resizing the background images so that the size of the background images matches the target in the target image; reading a label file of the identified target, renaming the background image based on the label file, and forming a one-to-one correspondence between the two; eliminating the corresponding position of the background image based on the internal information of the label file and generating a mask; randomly reading the target image and performing transmission transformation and mask processing; randomly regressing the target image processed in step five and the background image processed in step four, adjusting and smoothing the regression area; and repeatedly executing step six until the target detection data set is generated, so as to solve the problem that the publicly available data set is very limited, resulting in insufficient model sample training, causing false alarms and missed reports, and improving the overall performance of intelligent weapon ammunition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and specifically to a method for generating a target detection data set. Background Art

[0002] Object detection is an important field in computer vision that involves identifying objects of a certain class in an image or video and determining where those objects are located in the scene. This is usually done by drawing a bounding box around each object and assigning a class label to the box.

[0003] Existing target detection algorithms can be divided into the following categories:

[0004] 1. Two-stage detectors: such as the R-CNN series and Cascade R-CNN, which first generate candidate regions and then classify and localize these regions.

[0005] 2. Single-stage detectors: such as the YOLO series and SSD, which directly predict the bounding box and category of the object from the input image without generating candidate regions, so they are faster.

[0006] 3. Anchor-based methods: Use predefined bounding box shapes (called anchors) to predict the location of objects, such as Faster R-CNN and YOLOv2 / v3.

[0007] 4. Anchor-free method: does not use preset anchors, but directly predicts the center point and size of the object, such as CenterNet and FCOS.

[0008] 5. Instance segmentation-based methods: such as Mask R-CNN, which can not only detect objects, but also generate pixel-level segmentation masks for each object.

[0009] The applications based on the above target detection are very extensive, including but not limited to obstacle detection in self-driving cars, security monitoring systems, medical image analysis, drone aerial photography, and product identification in the retail industry.

[0010] With the rapid development of precision-guided weapons, higher requirements will be placed on the overall performance of weapon confrontation systems in the future. As a key technology for current intelligent weapons and ammunition, target detection can improve the accuracy and reliability of strikes, support diversified combat missions, and enhance intelligence collection and analysis capabilities. However, due to the confidentiality of military targets, publicly available data sets are very limited, resulting in insufficient sample size for model training, which will cause problems such as false alarms and missed reports, thereby reducing the overall performance of intelligent weapons and ammunition. How to effectively solve the problem of military target data sets, improve the quality of target detection, and thus improve the overall performance of intelligent weapons is particularly important. Summary of the invention

[0011] The present application provides a method for generating a target detection dataset to solve the problems in the above-mentioned background technology.

[0012] The technical solution adopted by the present application to solve the technical problem is: a method for generating a target detection data set, comprising:

[0013] Step 1: Collect several target images, separate the foreground and background of the target images, and save the foreground;

[0014] Step 2: Collect several background images, and resize the background images so that the size of the background images matches the target in the target image;

[0015] Step 3: Read the label file of the identified target and establish a one-to-one correspondence between the label file and the background image;

[0016] Step 4: Remove the corresponding position of the background image based on the internal information of the label file and generate a mask;

[0017] Step 5: Randomly read the target image and perform transmission transformation and mask processing;

[0018] Step 6: Randomly regress the target image processed in step 5 and the background image processed in step 4, and adjust and smooth the regression area;

[0019] Step 7: Repeat step 6 until the target detection dataset is generated.

[0020] This target detection dataset generation method uses background collection and target replacement, in which the image is processed to generate the target detection dataset to ensure that due to the confidentiality of military targets, the publicly available dataset is very limited, resulting in insufficient model sample training, causing false alarms and missed reports, thereby improving the overall performance of smart weapons and ammunition.

[0021] Preferably, in step one: collect n target images, n≥2, crop the target images according to the target boundaries, obtain m different coatings, m≥1, perform random style transfer of m coatings on n-1 targets based on the image style transfer network, separate the foreground and background of the n target images and save the foreground, the saved foreground includes n-1 randomly style transferred targets and 1 original target, and the foreground and background are separated using a Gaussian mixture model and morphological closing operations to perform AND operations on the image.

[0022] Preferably, the image style transfer network receives the target and the paint, and features of both the target and the paint are extracted through several convolution operations. Activation functions are inserted between the convolution layers to introduce nonlinear factors, wherein the paint is convolved and processed in parallel through different convolution layers, and then a dot multiplication operation is performed. After the dot multiplication operation, it is convolved with the target feature and the output is activated.

[0023] Preferably, when the background image is resized, the length and width of the background image are traversed, and the images with mismatched length and width are scaled to ensure the normal size of the images. Image scaling uses area interpolation or cubic spline interpolation to reduce or enlarge the image, and the background image is resized so that the size of the background image matches the target in the target image. This step performs a check operation after the image is scaled. If the scaling is not successful or the size is inappropriate, it is scaled again until the size is appropriate.

[0024] Preferably, after reading the label file of the identified target in step three, the target frame information of the label file is denormalized to restore it to a normal size. After the denormalization, a check operation is performed. If the size is not appropriate, normalization is continued.

[0025] Preferably, when renaming the background image based on the tag file in step three, ensure that the number of tag files and background images is the same. If they are different, delete or add the tag file.

[0026] Preferably, the transmission transformation includes: transforming the projection and two-dimensional coordinates into homogeneous coordinates and solving the corresponding coordinates after the transmission transformation. This step realizes the presentation of a 3D effect. The specific transmission transformation process is as follows:

[0027] Transmission: Project the (X, Y, Z) space coordinates to (x, y, 1), that is, divide by Z at the same time, ;

[0028] Transform two-dimensional coordinates to homogeneous coordinates: ; Solve the above equation to obtain the corresponding coordinates after transmission transformation.

[0029] Preferably, the adjustment of the regression region in step 6 includes adjusting the color, transparency and brightness of the regression region, and the adjustment method is as follows:

[0030] 1.1. Calculate the logarithmic gradient for the 2.5 times area of ​​each regression area, and record the logarithmic gradient matrix as V;

[0031] 1.2. Calculate the mean, standard deviation and variance of each log gradient matrix V;

[0032] 1.3. Count the variance of each logarithmic gradient matrix V. If the variance is greater than the threshold, the logarithmic gradient matrix is ​​adjusted;

[0033] 1.4. After adjustment, a 2.5-fold regression area image is obtained.

[0034] Preferably, the regression region is adjusted and then smoothed, and the smoothing process uses Gaussian filtering with a Gaussian kernel of 3×3.

[0035] As a preference, in step 1.3, the adjustment rule of the logarithmic gradient matrix is: if but ,in, is the element value of the logarithmic gradient matrix V; , , is the mean of the logarithmic gradient matrix, and n is the set threshold.

[0036] As a preferred method, the calculation formula for denormalization is as follows: , , , , , , , ,in, Represents the value of the i-th column and k-th row of the label file. , is the width and height of the annotation box, , Represents the center point coordinates of the annotation box in the label. , Represents the horizontal and vertical coordinates of the upper left corner of the annotation box after denormalization; , Represents the horizontal and vertical coordinates of the lower right corner of the annotation box after denormalization.

[0037] The substantial effect of the present application is that the target detection dataset generation method adopts an image style transfer Gaussian mixture model, morphological operations, mask generation, transmission transformation and image processing methods to generate a target detection dataset to ensure that the problems of false alarms and missed reports caused by insufficient model sample training due to the confidentiality of military targets are improved, thereby improving the overall performance of smart weapons and ammunition. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a flowchart of the steps of an embodiment of the present application;

[0039] Figure 2 is a structural diagram of an image style transfer network in an embodiment of the present application;

[0040] Figure 3 It is a diagram of target detection data obtained in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The technical solution of the present application is further described below through specific embodiments. Example

[0042] A method for generating a target detection dataset, such as Figure 1-3 As shown, including:

[0043] First, create a target set and collect n target images, n≥2. Crop the target images according to the target boundary to obtain m different coatings, m≥1. Based on the image style transfer network, perform m coating random style transfer on n-1 targets. After separating the foreground and background of the n target images, save the foreground. The saved foreground includes n-1 randomly style transferred targets and 1 original target. After separating the foreground and background, judge the saved foreground. If the separation is not successful, perform the separation operation again to ensure the success of the separation. For the separation of foreground and background, Gaussian mixture model and morphological closing operation can be used to perform AND operation on the image to achieve it.

[0044] like Figure 2 As shown in the figure, the image style transfer network receives the target and the paint. The features of both the target and the paint are extracted through several convolution operations. The activation function is inserted between the convolution layers to introduce nonlinear factors. Among them, the paint is convolved and processed in parallel through different convolution layers, and then a dot multiplication operation is performed. After the dot multiplication operation, it is convolved with the target feature and activated for output, so as to realize the random style transfer of m paints for n-1 targets. Specifically, convolution 1 is a convolution with a kernel size of 1×1 and a stride of 1; convolution 2 is a convolution with a kernel size of 3×3 and a stride of 1; convolution 3 is a convolution with a kernel size of 3×3 and a stride of 2; convolution 4 is a recursive gated convolution with a kernel size of 3×3 and a stride of 1; convolution 5 is a dilated convolution with a kernel size of 3×3 and a stride of 1; convolution 6 is a depthwise separable convolution with a kernel size of 3×3 and a stride of 1; the activation function is the ReLu activation function; the scoring function is the Softmax function; the pooling is the global maximum average pooling; and the stacking is performed in the channel dimension.

[0045] Then create a background set, collect several background images as negative samples, traverse the length and width of the background images, and scale the images with mismatched length and width to ensure the normal size of the images. Image scaling uses area interpolation or cubic spline interpolation to reduce or enlarge the image, and resize the background image so that the size of the background image matches the target in the target image. This step performs a check operation on the image after scaling. If the scaling is not successful or the size is inappropriate, it is scaled again until the size is appropriate.

[0046] After reading the label file of the identified target, the target box information of the label file is denormalized and restored to its normal size. Then the number of background images and label files is obtained to ensure that the number of label files and background images is the same. If they are different, the label file is deleted or added. The next step is to traverse the label files and background images and rename the background images to the label files that correspond to them one by one.

[0047] The calculation formula for denormalization is as follows: , , , , , , , ,in, Represents the value of the i-th column and k-th row of the label file. , is the width and height of the annotation box, , Represents the center point coordinates of the annotation box in the label. , Represents the horizontal and vertical coordinates of the upper left corner of the annotation box after denormalization; , Represents the horizontal and vertical coordinates of the lower right corner of the annotation box after denormalization.

[0048] It should be noted that after the denormalization process, a check operation is performed. If the size is not appropriate, the normalization process is continued.

[0049] Furthermore, the corresponding positions of the background image are removed based on the internal information of the label file and a mask is generated. The target image is randomly read and subjected to transmission transformation and mask processing to meet the target information under different viewing angles. Transmission transformation includes: transforming the projection and two-dimensional coordinates to homogeneous coordinates and solving the corresponding coordinates after transmission transformation. This step realizes the presentation of 3D effect. The specific transmission transformation process is as follows:

[0050] Transmission: Project the (X, Y, Z) space coordinates to (x, y, 1), that is, divide by Z at the same time, ;

[0051] Transform two-dimensional coordinates to homogeneous coordinates: ; Solve the above equation to obtain the corresponding coordinates after transmission transformation.

[0052] The processed target image and the background image processed in step 4 are randomly regressed, and the regression area is adjusted and smoothed. The adjustment of the regression area includes adjusting the color, transparency and brightness of the regression area. The adjustment method is as follows:

[0053] 1.1. Calculate the logarithmic gradient for the 2.5 times area of ​​each regression area, and record the logarithmic gradient matrix as V;

[0054] 1.2. Calculate the mean, standard deviation and variance of each log gradient matrix V;

[0055] 1.3. Count the variance of each logarithmic gradient matrix V. If the variance is greater than 0.5, the logarithmic gradient matrix is ​​adjusted. The adjustment rule is: if but ,in, is the element value of the logarithmic gradient matrix V; , , is the mean of the logarithmic gradient matrix, n is the set threshold, and 0.5 is used in this example;

[0056] 1.4. After the adjustment is completed, solve the Poisson equation to get the 2.5 times regression area image.

[0057] It should be noted that the regression region is smoothed after adjustment, and the smoothing process uses Gaussian filtering with a Gaussian kernel of 3×3.

[0058] Finally, random regression and regression region image adjustment are repeated until the target detection dataset is generated, as shown in Figure 3 As shown, it is a diagram of target detection data obtained in this embodiment.

[0059] It should be noted that when separating the foreground and background in this application, the pictures to be separated are first classified. For complex images, it is necessary to use a deep learning model for preliminary segmentation, and then combine edge detection and manual correction to improve the details. For simple images, the appropriate separation method is matched according to the characteristics of the image. For grayscale images with a bimodal histogram, a threshold segmentation method is used to find a threshold to divide the image into foreground and background; for pictures with easy-to-distinguish colors and tones, the Otsu algorithm can be used to separate the foreground, and for images with clear target edges, edge detection methods are used to find the edges in the image, thereby helping to define the boundaries of the foreground and background; clustering algorithms can be used to classify pixels in the image to distinguish different areas to achieve foreground and background separation, or deep learning methods can be used for semantic segmentation to distinguish foreground and background; each method has its applicable scenarios and limitations, and the selection of an appropriate method depends on the content, quality, and required accuracy of the image. In practical applications, this application combines a variety of the above methods according to the characteristics of the picture to achieve the best results.

[0060] In summary, this method first constructs the target set and the background set, and processes the two sets; secondly, the processed target set is subjected to affine transformation and masking operations to adapt to different target scale information; finally, random regression is performed according to the label information, and image adjustment is performed on the 2.5 times regression area of ​​the image to eliminate the sense of disharmony in the image. When the publicly available data set is very limited, the data set can be effectively expanded to solve the problems of false alarm and missed detection caused by insufficient model sample training.

[0061] The above-described embodiment is only a preferred solution of the present application and does not limit the present application in any form. There are other variations and modifications without exceeding the technical solution described in the claims.

Claims

1. A method for generating a target detection dataset, characterized in that: include: Step 1: Collect n target images, n≥2, crop the target images according to the target boundary, obtain m different coatings, m≥1, perform random style transfer of m coatings on n-1 targets based on the image style transfer network, separate the foreground and background of the n target images and save the foreground. The saved foreground includes n-1 randomly style-transferred targets and 1 original target. The foreground and background are separated using the Gaussian mixture model and morphological closing operation to perform AND operations on the image; Step 2: Collect several background images, and resize the background images so that the size of the background images matches the target in the target image; Step 3: Read the label file of the identified target and establish a one-to-one correspondence between the label file and the background image; Step 4: Remove the corresponding position of the background image based on the internal information of the label file and generate a mask; Step 5: Randomly read the target image and perform transmission transformation and mask processing; Step 6: Randomly regress the target image processed in step 5 and the background image processed in step 4, and adjust and smooth the regression area; Step 7: Repeat step 6 until the target detection dataset is generated.

2. The method for generating a target detection dataset according to claim 1, characterized in that: The image style transfer network receives the target and the paint. The features of both the target and the paint are extracted through several convolution operations. Activation functions are inserted between the convolution layers to introduce nonlinear factors. Among them, the paint is convolved and processed in parallel through different convolution layers, and then a dot multiplication operation is performed. After the dot multiplication operation, it is convolved with the target feature and the output is activated.

3. The method for generating a target detection dataset according to claim 1, characterized in that: After reading the label file of the identified target in step 3, the target frame information of the label file is denormalized and restored to its normal size.

4. The method for generating a target detection dataset according to claim 3, characterized in that: When renaming the background image based on the tag file in step 3, ensure that the number of tag files and background images is the same. If they are different, delete or add the tag file.

5. The method for generating a target detection dataset according to claim 1, characterized in that: The transmission transformation includes: transforming the projection and two-dimensional coordinates into homogeneous coordinates and solving the corresponding coordinates after the transmission transformation.

6. The method for generating a target detection dataset according to claim 1, characterized in that: The adjustment of the regression area in step 6 includes adjusting the color, transparency and brightness of the regression area. The adjustment method is as follows: 1.

1. Calculate the logarithmic gradient for the 2.5 times area of ​​each regression area, and record the logarithmic gradient matrix as V; 1.

2. Calculate the mean, standard deviation and variance of each log gradient matrix V; 1.

3. Count the variance of each logarithmic gradient matrix V. If the variance is greater than the threshold, adjust the logarithmic gradient matrix; 1.

4. After adjustment, a 2.5-fold regression area image is obtained.

7. The method for generating a target detection dataset according to claim 6, characterized in that: The regression area is adjusted and then smoothed. Gaussian filtering is used for smoothing, and the Gaussian kernel is 3×3.

8. The method for generating a target detection dataset according to claim 6, characterized in that: In step 1.3, the adjustment rule of the logarithmic gradient matrix is: if but ,in, is the element value of the logarithmic gradient matrix V; , , is the mean of the logarithmic gradient matrix, and n is the set threshold.

9. The method for generating a target detection dataset according to claim 5, characterized in that: The calculation formula for denormalization is as follows: , , , , , , , ,in, Represents the value of the i-th column and k-th row of the label file. , is the width and height of the annotation box, , Represents the center point coordinates of the annotation box in the label. , Represents the horizontal and vertical coordinates of the upper left corner of the annotation box after denormalization; , Represents the horizontal and vertical coordinates of the lower right corner of the annotation box after denormalization.

Citation Information

Patent Citations

  • Data set enhancement method and system based on image target-background transformation

    CN111415293A

  • Tower insulator detection method based on deep learning

    CN114581795A

  • Deep learning-based tank image data set establishment and key point detection method

    CN115439712A

  • Image segmentation domain generalization method based on style migration

    CN116777925A

  • Semantic image synthesis for generating substantially photorealistic images using neural networks

    EP3686848A1