A high-speed moving target identification method based on data enhancement
By constructing a multi-level motion blur kernel and a differentiable generative adversarial network to generate pseudo-targets, and combining this with a high-speed moving target background dataset for data augmentation, the confidence loss function of the YOLOv7 target detection algorithm is improved. This solves the problems of motion blur and background inconsistency in high-speed moving target recognition and improves the recognition accuracy.
Patent Information
- Application Number
- CN202310573773.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-05-19
AI Technical Summary
Existing target recognition technologies suffer from problems such as motion blur affecting recognition accuracy in high-speed moving target recognition, insufficient training samples, and inconsistency between training background and actual working background, resulting in low recognition accuracy.
By constructing a multi-level motion blur kernel and a differentiable generative adversarial network to generate pseudo-targets, data augmentation is performed by combining a high-speed moving target background dataset, and the confidence loss function of the YOLOv7 target detection algorithm is improved, thereby expanding the dataset and improving recognition accuracy.
With a limited number of training images, it can accurately identify high-speed moving targets, solving the problems of motion blur and background inconsistency, and improving the recognition accuracy.
Smart Images

Figure CN116597275B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of picture data enhancement, target detection and deep learning, and specifically relates to the field of data enhancement and target recognition of high-speed moving targets, and specifically provides a high-speed moving target recognition method. BACKGROUND
[0002] Before 2012, due to low computing power, immature deep learning theory and other problems, target detection was mainly based on traditional algorithms. With the improvement of computing power, the development of related theories and the enrichment of various open source data sets, after 2012, a large number of deep learning models began to emerge. The first model was mainly the two-stage target detection model based on R-CNN. Due to the increasing demand for real-time target detection, after 2016, the target detection model began to shift to the one-stage model based on the YOLO series. In late 2017, Google launched the Transformers model, which was then applied to the visual field. In 2020, the Facebook AI team proposed an end-to-end target detection model based on Transformers, opening up a new wave of research in target detection.
[0003] At present, target recognition algorithms based on deep learning can be divided into two categories: one category is the two-stage target detection algorithm based on region proposal, including R-CNN, SPP-NET, Fast R-CNN, Faster R-CNN, R-FCN, Mask R-CNN, etc. These algorithms have a common shortcoming of poor network real-time performance. The other category is the single-stage target detection algorithm based on regression analysis, including various recognition algorithms of the YOLO series, SSD, FPN, RetinaNet, etc. The target recognition algorithm based on regression not only outperforms the candidate region-based recognition algorithm in terms of real-time performance, but also outperforms the candidate region-based recognition algorithm in terms of recognition accuracy.
[0004] At present, there are four difficulties in directly using existing target recognition technology for high-speed moving target recognition: (1) The high-speed moving target images taken usually have different degrees of motion blur, which greatly affects the recognition accuracy. (2) There are few training samples. Most of the current target recognition methods are based on public large data sets, such as the COCO data set. However, due to the small number of training samples of high-speed moving targets collected, the samples need to be expanded and enhanced. (3) The collected high-speed moving target pictures mostly come from some exhibition activities, which causes the background of the data set used for training to be inconsistent with the actual working background, resulting in a decrease in the recognition accuracy of high-speed moving targets in actual work. The above problems are the core problems that need to be solved at present. SUMMARY
[0005] To solve the above problems, the application proposes a new method for generating multi-level motion blur kernels to obtain motion blurred images that are closer to the actual motion blur of high-speed moving targets for data enhancement. Meanwhile, a high-speed moving target background dataset is introduced. The confidence of the pseudo-target obtained by the classification network is used to enhance the target instances with confidence greater than the set threshold and the target instances in the initial dataset to the high-speed moving target background dataset. When training the pseudo-target generated by the differentiable generative adversarial network, the confidence of the pseudo-target and the CIoU value of the positive sample bounding box and the real box are weighted and summed to form a new confidence loss function in the YOLOv7 target detection algorithm. The improved loss function can more accurately measure the authenticity of the target. The method can accurately identify high-speed moving targets under the condition of a small amount of training pictures.
[0006] The technical scheme of the application is a high-speed moving target recognition method based on data enhancement, which comprises the following steps:
[0007] Step 1: Use a specific type of high-speed moving target and the remaining objects similar to the target type to construct an initial dataset. Label the images in the initial dataset to obtain an initial dataset with a label file.
[0008] Step 2: Collect pictures of the working environment of the specific type of high-speed moving target to form a background dataset of high-speed moving targets.
[0009] Step 3: According to the label file of the initial dataset, crop the instance segmentation object of each target in the initial dataset to form an initial crop dataset.
[0010] Step 4: Train the initial crop dataset obtained in step 3 using a differentiable generative adversarial network to obtain an enhanced crop dataset. The differentiable generative adversarial network comprises a differentiable discriminator network D and a differentiable generator network G. The specific steps are as follows:
[0011] Step 4.1: Construct the differentiable discriminator network D.
[0012] Step 4.2: Construct the differentiable generator network G. The input of G comes from a random variable z in the latent space, which generates a high-speed moving target of a specific target type.
[0013] Step 4.3: Random noise is continuously generated into a pseudo sample of a specific target type through the differentiable generator network G to form an enhanced crop dataset, achieving the purpose of expanding the dataset.
[0014] Step 4.4: Calculate the loss L D of the differentiable discriminator network D and the loss LG Perform alternating loop optimization; L G and L D The formulas are shown below:
[0015]
[0016] in, Let x represent the mathematical expectation, z represent the real image, and p represent the random variable. data (x) represents the true sample distribution, p z (z) represents the generated sample distribution, G(z) is the high-speed moving target pseudo-image generated after the random variable z passes through the generator G, D(·) is the probability obtained by the image passing through the differentiable discriminator network G, which is a real number in the range of 0 to 1, T(·) represents a differentiable data augmentation method, f D f G These are the loss functions used by the differentiable discriminator D and the differentiable generator G, respectively.
[0017] Step 5: Based on LeNet, train a classification network and filter the augmented crop dataset obtained in Step 4; the specific steps are as follows:
[0018] Step 5.1: Divide the initial crop dataset obtained in Step 3 into a training set and a validation set in an 8:2 ratio;
[0019] Step 5.2: Input the training set into the classification network for training, train for a total of 100 rounds, use the accuracy obtained from the validation set as the evaluation metric, and save the model with the highest accuracy.
[0020] Step 5.3: Use the saved classification network model to test the fake images in the augmented crop dataset. Save the images with a confidence score greater than or equal to the set threshold conf. The confidence score is used as a standard to measure the similarity between the fake images generated by the differentiable generative adversarial network and the real images. Store the confidence score corresponding to the image. Images with a confidence score less than the threshold conf are removed from the augmented crop dataset.
[0021] Step 6: Upgrade the images from the initial crop dataset obtained in Step 3 and the augmented crop dataset obtained in Step 5 to the background dataset to obtain the working dataset;
[0022] Step 7: For each image in the initial dataset obtained in Step 1, perform the following data augmentation techniques with probability p: image rotation, image scaling, random cropping, color transformation, affine transformation, and motion blur to obtain the initial augmented dataset;
[0023] Step 8: Integrate the initial data set obtained in step 1, the working data set obtained in step 6, and the initial enhanced data set obtained in step 7 to form a high-speed moving target data set for target recognition;
[0024] Step 9: Divide the high-speed moving target data set into a training set, a validation set, and a test set at a ratio of 8:1:1;
[0025] Step 10: Build a YOLOv7 network model;
[0026] Step 11: Set the confidence loss function L conf , the classification loss function L class , the position loss function L loc , and the total loss function Loss, and the calculation methods are as follows:
[0027] The confidence loss function L conf is calculated as follows:
[0028]
[0029] wherein, represents whether there is a target in the jth bounding box of the ith grid, and if there is, it is 1, otherwise it is 0; represents whether the target in the jth bounding box of the ith grid comes from the enhanced crop data set obtained in step 5, and if it does, it is 1, otherwise it is 0; represents whether the jth bounding box of the ith grid is background, and if it is, it is 1, otherwise it is 0; C i represents the confidence of the real target; represents the confidence of the predicted target; C gan represents the confidence of the pseudo image obtained in step 5; λ obj represents the target confidence regularization coefficient; λ noobj represents the background confidence regularization coefficient, because the number of bounding boxes that do not contain target center positions is much larger than the number of bounding boxes that contain target center positions, here λ noobj = 0.4; s 2 represents the total number of cells into which the picture is finally divided; B represents the number of bounding boxes generated by each cell;
[0030] The classification loss function L class is calculated as follows:
[0031]
[0032] wherein, λ class represents the class regularization coefficient; represents whether there is a target in the ith grid, and if there is, it is 1, otherwise it is 0; pi (c) represents the probability of the actual existence of class c in the i-th grid; represents the probability of being predicted as class c in the i-th grid;
[0033] Position loss function L loc The calculation method is as follows:
[0034]
[0035] Wherein, λ iou is a regularization coefficient; L CIoU The calculation formula is as follows:
[0036]
[0037] Wherein, b gt represents the center point coordinates of the real box, b represents the center point coordinates of the bounding box, ρ 2 (b,b gt ) represents the Euclidean distance between the bounding box and the real box; c represents the diagonal length of the minimum rectangular box covering the bounding box and the real box; IoU represents the overlap degree of the bounding box and the real box; v is used to measure the consistency of the aspect ratio; α is a weight coefficient, and the calculation formula is as follows:
[0038]
[0039]
[0040]
[0041] Wherein, A and B represent the predicted box and the real box respectively; w and h represent the width and height of the predicted box respectively; w gt and h gt represent the width and height of the real box respectively;
[0042] The total loss function Loss is calculated as follows:
[0043] Loss=L conf +L class +L loc
[0044] Step 12: using the training set to train the YOLOv7 network, using the validation set to evaluate the model, taking mAP as the evaluation index, and saving the model with the maximum mAP value;
[0045] Step 13: using the test set to test the saved YOLOv7 model.
[0046] Further, the specific method of step 7 is:
[0047] Step 7.1: create a multi-level motion blur kernel, and control the shape of the created multi-level motion blur kernel through the following four parameters; the kernel size, which is an overall control parameter of the multi-level motion blur kernel, the greater the value, the greater the degree of motion blur, the more blurred the image; intensity, which is an overall control parameter of the motion blur kernel, used to describe the speed of the change of the motion path direction, the greater the value, the more intense the change of the motion direction, the more tortuous the motion blur path, representing the more complex and difficult to understand motion blur; step, which represents the length of the motion direction maintained; and step_angle, which represents the angle size between the current motion direction and the next motion direction; first, a blank matrix is created according to the parameter kernel_size, second, the motion blur path is determined according to the four parameters of kernel_size, intensity, step and step_angle, and finally, the motion blur path is drawn in the blank matrix to form a multi-level motion blur kernel;
[0048] Step 7.2: the image and the multi-level motion blur kernel are convolved to obtain a motion blurred image; the image blur model can be represented by the following formula:
[0049] Y=K*X+N
[0050] Where X represents the image that needs to be motion blurred, K represents the multi-level motion blur kernel, N represents the additive noise, * represents the convolution operation, and Y represents the obtained motion blurred image;
[0051] Step 7.3: determine whether the following data augmentation operations need to be performed after motion blur enhancement with a probability sigma (0 <= sigma <= 1): image rotation, image scaling, random cropping, color transformation, and affine transformation.
[0052] Compared with the prior art, the present application has the following beneficial effects:
[0053] 1. The present application proposes a new method for generating a multi-level motion blur kernel while performing conventional data augmentation, which can obtain a motion blurred image that is more close to the actual motion blur situation of a high-speed moving target, and can be used for data augmentation, and can solve the problem of reduced recognition accuracy caused by motion blur of a target due to high-speed movement to a certain extent.
[0054] 2. The present application introduces a high-speed moving target background data set, and the pseudo-target generated by the differentiable generative adversarial network is subjected to a classification network to obtain a pseudo-target confidence, and the target with a confidence greater than a set threshold and the initial high-speed moving target instance segmentation object are enhanced into the high-speed moving target background data set, which realizes sample expansion on the one hand, and solves the problem of inconsistency between the training background and the working environment of the high-speed moving target on the other hand.
[0055] 3. The application trains the pseudo target generated by the differentiable generative adversarial network, and the confidence of the pseudo target is weighted and summed with the CIoU value of the positive sample boundary box and the real box to form a new confidence loss function in the YOLOv7 target detection algorithm, and the improved loss function can more accurately measure the authenticity of the target. BRIEF DESCRIPTION OF DRAWINGS
[0056] Figure 1 is a schematic diagram of a differentiable generative adversarial network process;
[0057] Figure 2 is a partial parameter meaning diagram of a multi-level motion blur kernel proposed by the application;
[0058] Figure 3 is a partial schematic diagram of a multi-level motion blur kernel generated by the application;
[0059] Figure 4 is a flowchart of the method of the application; DETAILED DESCRIPTION
[0060] The application will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the application, but do not limit the application in any form. It should be noted that, for those skilled in the art, without departing from the concept of the application, a number of changes and improvements can be made. These all belong to the protection scope of the application.
[0061] The embodiment of the application provides a target recognition method for a high-speed moving target, as shown in Figure 4 , comprising the following steps:
[0062] Step 1: An initial data set is constructed by using a high-speed moving target and the remaining objects similar to the high-speed moving target, and the images in the initial data set are labeled to obtain an initial data set with a label file.
[0063] Step 2: Collect the working environment pictures of a specific type of high-speed moving target to form a background data set of the high-speed moving target.
[0064] Step 3: According to the label file of the initial data set, the high-speed moving target instance segmentation object of each image in the initial data set is cropped to form an initial crop data set. The specific steps of each picture are as follows:
[0065] Step 3.1: The minimum circumscribed rectangle of the high-speed moving target is used to crop the image to obtain A.
[0066] Step 3.2: Create a mask image mask with the same shape as A, and set the region where the high-speed moving target is located to 1, and the remaining regions to 0.
[0067] Step 3.3: Perform an AND operation on A and mask to obtain a result image resultI, and obtain the region where the high-speed moving target is located, while the target background is pure black.
[0068] Step 3.4: Set the background of resultI to gray.
[0069]
[0070] wherein x p represents a pixel value.
[0071] After the above processing, the foreground information is retained, the background information is removed, the interference of the background information on the differentiable generative adversarial network is reduced, and the difficulty of the network to generate high-speed moving targets is reduced.
[0072] Step 4: Use the differentiable generative adversarial network to train the initial crop data set obtained in step 3 to obtain an enhanced crop data set, and the specific steps are as follows:
[0073] Step 4.1: Construct a differentiable discriminator network D. After the picture is subjected to data enhancement, it is input into the differentiable discriminator network D to judge the true or false of the input picture. The differentiable discriminator network D is composed of 6 two-dimensional convolution layers, Batch Nomal layers are added between the convolution layers, and LeakyReLu is used as the activation function. The last layer uses the Sigmoid function for output.
[0074] Step 4.2: Construct a differentiable generator network G, and the input of G comes from a random variable z in the hidden space to generate high-speed moving targets. The generator network G is composed of 6 layers of transposed convolution, Batch Nomal layers are added between the transposed convolution layers, and ReLu is used as the activation function. The last layer uses the Tanh function for output.
[0075] Step 4.3: Random noise is continuously generated into high-speed moving target pseudo samples through the differentiable generator network G to form an enhanced crop data set, achieving the purpose of expanding the data set.
[0076] Step 4.4: Use the stochastic gradient descent method to alternately optimize the loss L D of the differentiable discriminator network D and the loss L G of the differentiable generator network G; L G and L D are respectively as follows:
[0077]
[0078]
[0079] wherein, represents the mathematical expectation, x represents the real image, z represents a random variable, p data (x) represents the real sample distribution, p z (z) represents the generated sample distribution, G(z) is the high-speed moving target pseudo image generated after the random variable z passes through the generator G, D(·) is the probability of the image passing through the differentiable discriminator network G, which is a real number in the range of 0~1, T(·) represents a differentiable data enhancement means, f D , f G are the loss functions used by the differentiable discriminator D and the differentiable generator G, respectively.
[0080] Step 5: Based on LeNet, a classification network is trained to filter the enhanced crop data set obtained in step 4. The specific steps are as follows:
[0081] Step 5.1: Divide the initial crop data set obtained in step 3 into training set and validation set according to 8:2.
[0082] Step 5.2: Input the training set into the classification network for training, a total of 100 rounds, use the accuracy of the validation set as the evaluation index, save the model with the highest accuracy.
[0083] Step 5.3: Use the saved classification network model to test the pseudo pictures in the enhanced crop data set, save the pictures with confidence greater than or equal to the set threshold conf, the confidence is used as the similarity measure between the pseudo pictures generated by the differentiable generative adversarial network and the real pictures, store the confidence corresponding to the picture, and the pictures less than the threshold conf are removed from the enhanced crop data set.
[0084] Step 6: Enhance the pictures in the initial crop data set obtained in step 3 and the enhanced crop data set obtained in step 5 to the background data set to obtain the working data set.
[0085] Step 7: For each image in the initial data set obtained in step 1, do the following data enhancement techniques with a probability p (0≤p≤1): image rotation, image scaling, random cropping, color transformation, affine transformation, motion blur, to obtain the initial enhanced data set. A new method is proposed to generate multi-level motion blur kernel, and then obtain the motion blurred image closer to the actual motion blur of high-speed moving target, the specific steps are as follows:
[0086] Step 7.1: Create a multi-level motion blur kernel, and control the shape of the created multi-level motion blur kernel by the following four parameters. The kernel size kernel_size, as a whole control parameter of the multi-level motion blur kernel, the larger the value, the greater the degree of motion blur, the more blurred the image; the intensity intensity, as a whole control parameter of the motion blur kernel, used to describe the speed of the change of the motion path direction, the larger the value, the more dramatic the change of the motion direction, the more tortuous the motion blur path, representing the more complex and difficult to understand of the motion blur; the step step, representing the length of the motion direction maintained; the angle size step_angle corresponding to each step, representing the angle size between the current motion direction and the next motion direction. First, create a blank matrix according to the parameter kernel_size, second, determine the motion blur path according to the four parameters kernel_size, intensity, step and step_angle, and finally draw the motion blur path in the blank matrix to form a multi-level motion blur kernel.
[0087] Step 7.2: Convolution operation is performed on the image and the multi-level motion blur kernel to obtain a motion blurred image. The image blur model can be represented by the following formula:
[0088] Y = K * X + N
[0089] Where X represents the image that needs to be motion blurred, K represents the multi-level motion blur kernel, N represents the additive noise, * represents the convolution operation, and Y represents the obtained motion blurred image.
[0090] Step 7.3: Determine whether the following one of the data augmentation operations needs to be performed after motion blur enhancement with the probability sigma (0 ≤ sigma ≤ 1): image rotation, image scaling, random cropping, color transformation, and affine transformation.
[0091] Step 8: Integrate the initial data set obtained in step 1, the working data set obtained in step 6, and the initial enhanced data set obtained in step 7 to form a high-speed moving target data set for target recognition.
[0092] Step 9: Divide the high-speed moving target data set into training set, validation set and test set according to the ratio of 8:1:1.
[0093] Step 10: Construct a YOLOv7 network model.
[0094] Step 11: Set the confidence loss function L conf , the classification loss function L class , the position loss function L loc , and the total loss function Loss, and the calculation methods are as follows:
[0095] The confidence loss function Lconf The calculation method is as follows:
[0096]
[0097] Wherein, represents whether there is a target in the jth bounding box of the ith grid, and if there is, it is 1, otherwise it is 0; represents whether the target in the jth bounding box of the ith grid comes from the enhanced crop data set obtained in step 5, and if so, it is 1, otherwise it is 0; represents whether the jth bounding box of the ith grid is background, and if so, it is 1, otherwise it is 0; i represents the confidence of the real target; represents the confidence of the predicted target; gan represents the confidence of the pseudo image obtained in step 5; obj represents the target confidence regularization coefficient; noobj represents the background confidence regularization coefficient, because the number of bounding boxes that do not contain the target center position is much larger than the number of bounding boxes that contain the target center position, here λ noobj = 0.4; 2 represents the total number of cells into which the picture is finally divided; B represents the number of bounding boxes generated by each cell.
[0098] Classification loss function L class The calculation method is as follows:
[0099]
[0100] Wherein, λ class represents the class regularization coefficient; represents whether there is a target in the ith grid, and if there is, it is 1, otherwise it is 0; i (c) represents the probability of actually existing class c in the ith grid; represents the probability of being predicted as class c in the ith grid.
[0101] Position loss function L loc The calculation method is as follows:
[0102]
[0103] Wherein, λ iou is the regularization coefficient; L CIoU The calculation formula is as follows:
[0104]
[0105] Wherein, b gtdenote the center point coordinates of the real bounding box, b denotes the center point coordinates of the bounding box, p 2 (b,b gt ) denotes the Euclidean distance between the bounding box and the real bounding box; c denotes the diagonal length of the minimum rectangular box covering the bounding box and the real bounding box; IoU denotes the overlap degree of the bounding box and the real bounding box; v is used to measure the consistency of the aspect ratio; a is a weight coefficient, and the calculation formulas are as follows:
[0106]
[0107]
[0108]
[0109] wherein A and B represent the predicted box and the real box respectively; w and h represent the width and height of the predicted box respectively; w gt and h gt represent the width and height of the real box respectively.
[0110] The total loss function Loss is calculated as follows:
[0111] Loss=L conf +L class +L loc
[0112] Step 12: The YOLOv7 network is trained using the training set, and the parameter settings are as follows: the SGD optimizer is used, the initial learning rate is 0.01, the learning rate updating strategy adopts the cosine annealing method, and the training round number is 300 rounds. The model is evaluated using the validation set, and the mAP is used as the evaluation index, and the model with the maximum mAP value is saved.
[0113] Step 13: The saved YOLOv7 model is tested using the test set.
[0114] The embodiment of the application provides a recognition method for high-speed moving targets. The application first performs data enhancement on high-speed moving targets, then constructs a YOLOv7 network model, modifies the confidence loss function, and after evaluation, the mAP value reaches 93.33%.
[0115] The specific embodiments of the application are described above. It should be understood that the application is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essential content of the application. In the case of no conflict, the embodiments of the application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A high-speed moving target recognition method based on data enhancement, the method comprising: Step 1: Constructing an initial data set using a specific type of high-speed moving target and the remaining objects similar to the target type, labeling the images in the initial data set, and obtaining an initial data set with a label file; Step 2: Collecting pictures of the working environment of the specific type of high-speed moving target to form a background data set of the high-speed moving target; Step 3: According to the label file of the initial data set, crop the instance segmentation object of each image target in the initial data set to form an initial crop data set; Step 4: Training the initial crop data set obtained in step 3 using a differentiable generative adversarial network to obtain an enhanced crop data set, the differentiable generative adversarial network comprising a differentiable discriminator network D and a differentiable generator network G, the specific steps being as follows: Step 4.1: Constructing a differentiable discriminator network D; Step 4.2: Constructing a differentiable generator network G, the input of G coming from a random variable z in the latent space, generating a high-speed moving target of a specific target type; Step 4.3: Random noise is continuously generated into a target type pseudo sample through the differentiable generator network G to form an enhanced crop data set, achieving the purpose of expanding the data set; Step 4.4: Loss L for the differentiable discriminator network D D and loss L for the differentiable generator network G G Alternating cycle optimization; L G and L D The formulas are as follows, respectively: wherein, represents the mathematical expectation, x represents the real image, z represents the random variable, p data (x) represents the real sample distribution, p z (z) represents the generated sample distribution, G(z) is the high-speed moving target pseudo image generated after the random variable z passes through the generator G, D(·) is the probability of the image passing through the differentiable discriminator network G, which is a real number in the range of 0~1, T(·) represents a differentiable data enhancement means, f D , f G are the loss functions used by the differentiable discriminator D and the differentiable generator G, respectively; Step 5: Based on LeNet, training a classification network to filter the enhanced crop data set obtained in step 4, the specific steps being as follows: Step 5.1: Dividing the initial crop data set obtained in step 3 into a training set and a validation set in a ratio of 8:2; Step 5.2: Inputting the training set into the classification network for training, a total of 100 rounds of training, using the accuracy rate of the validation set as the evaluation index, and saving the model with the highest accuracy rate; Step 5.3: Using the saved classification network model to test the pseudo pictures in the enhanced crop data set, saving the pictures with a confidence greater than or equal to a set threshold conf, the confidence being a standard for measuring the similarity between the pseudo pictures generated by the differentiable generative adversarial network and the real pictures, storing the confidence corresponding to the picture, and removing the pictures with a confidence less than the threshold conf from the enhanced crop data set; Step 6: Enhancing the pictures in the initial crop data set obtained in step 3 and the enhanced crop data set obtained in step 5 to the background data set to obtain a working data set; Step 7: Performing the following data enhancement techniques on each image in the initial data set obtained in step 1 with a probability p: image rotation, image scaling, random cropping, color transformation, affine transformation, and motion blur, to obtain an initial enhanced data set; Step 8: Integrating the initial data set obtained in step 1, the working data set obtained in step 6, and the initial enhanced data set obtained in step 7 to form a high-speed moving target data set for target recognition; Step 9: Dividing the high-speed moving target data set into a training set, a validation set, and a test set in a ratio of 8:1:1; Step 10: Constructing a YOLOv7 network model; Step 11: Set the confidence loss function L conf , the classification loss function L class , the position loss function L loc , and the total loss function Loss, the calculation methods are as follows: Confidence loss function L conf The calculation method is as follows: wherein, represents whether there is a target in the jth bounding box of the ith grid, and is 1 if there is a target, otherwise is 0; represents whether the target in the jth bounding box of the ith grid is from the enhanced crop dataset obtained in step 5, and is 1 if it is, otherwise is 0; represents whether it is background in the jth bounding box of the ith grid, and is 1 if it is, otherwise is 0;C i represents the confidence of the real target; represents the confidence of the predicted target;C gan represents the confidence of the pseudo image obtained in step 5;λ obj represents the target confidence regularization coefficient;λ noobj represents the background confidence regularization coefficient, because the number of bounding boxes that do not contain the target center position is much more than the number of bounding boxes that contain the target center position, hereλ noobj = 0.4;s 2 represents the total number of cells into which the picture is finally divided;B represents the number of bounding boxes generated by each cell; Classification loss function L class The calculation method is as follows: where λ class denotes the class regularization coefficient; denotes whether there is a target in the i-th grid, 1 if there is, otherwise 0; p i (c) denotes the probability that class c is actually present in the i-th grid; denotes the probability that class c is predicted in the i-th grid; Position loss function L loc The calculation method is as follows: where λ iou is a regularization coefficient; L CIoU The calculation formula is as follows: wherein b gt denotes the center point coordinates of the real frame, b denotes the center point coordinates of the bounding box, denotes the Euclidean distance between the bounding box and the real frame; c denotes the diagonal length of the minimum rectangular frame covering the bounding box and the real frame; IoU denotes the overlapping degree of the bounding box and the real frame; v is used to measure the consistency of the aspect ratio; a is a weight coefficient, and the calculation formulas are as follows: wherein A and B represent the predicted box and the real box, respectively; w and h represent the width and height of the predicted box, respectively; w gt and h gt represent the width and height of the real box, respectively. The total loss function Loss is calculated as follows: Loss = L conf + L class + L loc Step 12: Training the YOLOv7 network using the training set and evaluating the model using the validation set, using mAP as the evaluation index, and saving the model with the maximum mAP value; Step 13: Test the saved YOLOv7 model using the test set.
2. The method of claim 1, wherein the data augmentation-based high-speed moving target recognition method is characterized by, The specific method of step 7 is: Step 7.1: Create a multi-level motion blur kernel, and control the shape of the created multi-level motion blur kernel through the following four parameters; kernel size, which is an overall control parameter of the multi-level motion blur kernel, the larger the value, the greater the degree of motion blur, and the more blurred the image; intensity, which is an overall control parameter of the motion blur kernel, used to describe the speed of the change in the direction of motion, the larger the value, the more drastic the change in the direction of motion, the more tortuous the motion blur path, representing more complex and difficult to understand motion blur; step, which represents the length of the motion direction maintained; step_angle, which represents the angle size corresponding to each step, which represents the angle size between the current motion direction and the next motion direction; first, create a blank matrix according to the parameter kernel_size, second, determine the motion blur path according to the four parameters of kernel_size, intensity, step and step_angle, and finally draw the motion blur path in the blank matrix to form a multi-level motion blur kernel; Step 7.2: Convolution operation is performed on the image and the multi-level motion blur kernel to obtain a motion blurred image; the image blur model can be represented by the following formula: Y = K * X + N Where X represents the image that needs to be motion blurred, K represents the multi-level motion blur kernel, N represents the additive noise, * represents the convolution operation, and Y represents the obtained motion blurred image; Step 7.3: With a probability sigma, 0 ≤ sigma ≤ 1, determine whether the following data augmentation operations are needed after motion blur enhancement: image rotation, image scaling, random cropping, color transformation, and affine transformation.
Citation Information
Patent Citations
Image motion blur removing method based on improved cyclic generative adversarial network
CN112634163A
KR20190120489A