A large field of view target detection method based on improved YOLOv4 algorithm
By introducing local color histogram matching and multi-scale fusion prediction network, as well as lightweight target classification sub-network into the YOLOv4 algorithm, the problems of computational complexity and insufficient accuracy in large field of view target detection are solved, and the problem is achieved on GPU-free devices. Efficient detection improves detection accuracy and speed, and is suitable for mobile applications.
Patent Information
- Application Number
- CN202210696206.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-06-20
AI Technical Summary
Traditional convolutional neural networks have complex calculations and large model generation in large field of view target detection, resulting in slow detection speed and insufficient accuracy. Especially on embedded devices without GPU, it is difficult to meet real-time requirements.
A large-field target detection method based on the YOLOv4 improved algorithm is proposed. Through local color histogram matching preprocessing, improved multi-scale fusion prediction network and lightweight target classification sub-network, the detection accuracy and speed are improved, and the amount of calculation and parameters are reduced. , suitable for GPU-less embedded devices.
It achieves efficient and accurate detection results in large-field target detection, reduces dependence on computer hardware and computing power, saves storage space, is suitable for mobile applications, and improves the portability and intelligence of military equipment.
Smart Images

Figure CN114998688B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of detection algorithms, and in particular to a large-field-of-view target detection method based on an improved YOLOv4 algorithm. Background Art
[0002] With the development of remote sensing satellites and camera equipment, the information reflected in large field of view images is becoming more and more abundant, and target detection has important research value. The research on the detection algorithm of targets in large field of view images plays an important role in information security, video supervision, unmanned driving, image search and other military aspects. In view of the problems of high resolution, small targets and complex background in large field of view images, traditional target detection methods are slow and have poor robustness. However, with the convolutional neural network in deep learning, it has achieved very good results in computer vision, especially in the field of target detection, by taking the approach of directional iteration and deepening the network. The target detection effect of large field of view images has also been improved.
[0003] With the rise of deep learning, the target detection algorithm based on convolutional neural network makes up for the shortcomings of traditional algorithms in detection accuracy and speed. However, this type of algorithm has the following problems in large field of view target detection: First, the convolutional neural network itself is complex to calculate and the generated model is large. High-resolution image input will lead to a sharp increase in data volume and occupy a large amount of storage space on the device; second, most targets in large field of view high-resolution images are small and the background is complex, which will lead to insufficient network feature extraction and unclear target information distinction, affecting the detection accuracy of the algorithm model; third, the algorithm has high requirements on computer computing power, and it is difficult to meet the real-time requirements on embedded devices without GPU, which limits the application of large field of view target detection algorithms. Summary of the invention
[0004] In view of the above problems, the present invention combines the characteristics of large field of view image targets and the research on convolutional neural networks, and proposes a detection algorithm with fast detection speed and high accuracy - a large field of view target detection method based on the improved YOLOv4 algorithm. This method can realize efficient and accurate large field of view target detection.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A large field of view target detection method based on an improved YOLOv4 algorithm comprises the following steps:
[0007] Step 1: Build a large field of view image dataset;
[0008] Step 2: performing local color histogram matching preprocessing on the source image S in the large field of view image data set, annotating the preprocessed image, and dividing all the annotated images into a training set and a test set;
[0009] Step 3: construct an improved YOLOv4 network model, the improved YOLOv4 network model includes a high-precision feature extraction subnetwork, an enhanced feature multi-scale fusion subnetwork and a lightweight target classification subnetwork, the high-precision feature extraction subnetwork uses a CSP structure to extract target features from the input image, the enhanced feature multi-scale fusion subnetwork includes three multi-scale fusion prediction network layers, and the extracted target features are subjected to multi-scale fusion prediction in combination with dense connections to obtain fusion features of three scales, and the lightweight target classification subnetwork performs target classification detection based on the fusion features of the three scales;
[0010] Step 4: After initializing the training parameters of the improved YOLOv4 network model, set the number of iterations and the learning rate, input the training set to the initialized network, update the network parameters using the reverse gradient propagation method of the consistent supervision loss, use the loss value and AP value as evaluation indicators, and obtain the optimal network model after training;
[0011] Step 5: Input the large field of view image to be identified into the optimal network model, and the optimal network model outputs the corresponding large field of view target detection result.
[0012] Compared with the prior art, the present invention has the following beneficial effects:
[0013] The present invention proposes an improved large-field target detection method based on YOLOv4 (You Only Look Oncev4) which has a good trade-off between accuracy and speed in the field of target detection. The method mainly improves the network in two aspects: detection accuracy and lightweight. In terms of improving detection accuracy, the image is preprocessed and the multi-scale fusion prediction network is improved. The former distinguishes the target and the background through local histogram equalization to fully extract the target information, and the latter strengthens the target feature association by changing the convolution mode and channel transformation, solving the problem of insufficient accuracy of the original network in the process of large-field target detection. In terms of model lightweighting, a lightweight network module is added to the classification layer, and the global average pooling layer and the evaluation objective function are combined to strengthen the target feature learning and cut redundant convolutions, reduce the calculation amount and parameter amount of the existing network model, and solve the problem of too large model and slow speed in the large-field target detection algorithm based on convolutional neural network. While improving detection accuracy and speed, the present invention reduces dependence on computer hardware and computing power, can run on embedded devices without GPUs, saves device storage space, meets the demand for target detection speed in real life, and can be used to apply detection algorithms for large-field-of-view targets to mobile terminals and other occasions, greatly improving the portability and intelligence of military equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1A flowchart of a large field of view target detection method based on an improved YOLOv4 algorithm of the present invention;
[0015] Figure 2 Schematic diagram of local color histogram matching;
[0016] Figure 3 This is the format diagram of the large field of view image dataset after annotation;
[0017] Figure 4 This is the network structure diagram of the improved YOLOv4 network model;
[0018] Figure 5 This is the improved grouped convolution channel feature transformation map;
[0019] Figure 6 This is a densely connected network structure diagram;
[0020] Figure 7 This is the network structure diagram of the lightweight module;
[0021] Figure 8 Part of the test result diagram of the YOLOv4 network and the optimal network model of the present invention in the test set. DETAILED DESCRIPTION
[0022] The technical solution of the present invention will be described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0023] In one embodiment, if Figure 1 As shown, the present invention provides a large field of view target detection method based on the improved YOLOv4 algorithm, the method comprising the following steps:
[0024] Step 1: Construct a large field of view image dataset, which consists of a number of large field of view images containing targets.
[0025] Step 2: Perform local color histogram matching preprocessing on the source image S in the large field of view image dataset, and annotate the preprocessed image, and divide all annotated images into a training set and a test set, where the training set is used to train the improved YOLOv4 network model.
[0026] In order to solve the problem that the target image with large field of view has high resolution, wide field of view, small target pixels and is difficult to train, the source image S in the large field of view image dataset is preprocessed by local color histogram matching before training. The preprocessing process includes the following steps:
[0027] The local color histogram matching method is used to enhance the image quality of the source S in the large field of view image dataset to strengthen the image quality, and the large field of view image is cut into small images as the input of the network.
[0028] Based on the local color histogram matching, the source image S is divided into m*n rectangular blocks of equal area, such as Figure 2 As shown:
[0029] S=[s1,s2,...,s m*n ] (1)
[0030] The histograms are respectively matched with the rectangular blocks to obtain the probability distribution function of the source image S of each block:
[0031]
[0032] Where (0,r i ) is the histogram interval range, is the probability density, m*n is the number of rectangular blocks. Then, the inverse mapping of all corresponding rectangular blocks is obtained in turn:
[0033]
[0034] Each rectangular block t after matching i (i=1,2,...,m*n) is used as the input of the network, and the matched image T can be obtained:
[0035] T=[t1,t2,...,t m*n ] (4)
[0036] Then adjust the size of the matched image T to 448×448, start the naming method with 0.001.jpg, and put it in the folder JPEGImages.
[0037] The present invention utilizes a local color histogram matching decomposition method to enhance image input, improves the network's way of extracting image feature points into multi-channel grouped convolution, and cooperates with channel feature transformation multi-scale prediction to strengthen the semantic association between channels, thereby obtaining more deep semantic information, improving the detection accuracy, and solving the problem of insufficient accuracy of target detection in large field of view images using traditional feature extraction methods.
[0038] Next, use the open source annotation tool LabelImg to annotate the preprocessed images. Use the open source annotation tool LabelImg to annotate the matched image T into two types of text: .xml and .txt. The naming of the .xml text corresponds to the naming order of the image and is placed in the folder Annotation. The .txt text is divided into the file train.txt for training and the file test.txt for testing. The files train.txt and test.txt contain the relative path of the image and are placed in the Main folder of the folder ImageSets. The annotated files will save the category, size, and position of each target in the image. Label.txt stores the target label, such as Figure 3 shown.
[0039] Step three: construct an improved YOLOv4 network model, the improved YOLOv4 network model includes a high-precision feature extraction subnetwork, an enhanced feature multi-scale fusion subnetwork and a lightweight target classification subnetwork, wherein the high-precision feature extraction subnetwork uses a CSP structure to extract target features from the input image, the enhanced feature multi-scale fusion subnetwork includes three multi-scale fusion prediction network layers, and combines dense connections to perform multi-scale fusion prediction on the extracted target features to obtain fusion features of three scales, and the lightweight target classification subnetwork performs target classification detection based on the fusion features of the three scales.
[0040] (1) High-precision feature extraction subnetwork
[0041] The YOLOv4 network input image uses the CSP (Cross Stage Partial) structure to extract target features, and then predicts and classifies through three multi-scale fusion prediction network layers. However, the texture information of large field target feature extraction is not sufficient, and a large number of iterative parameters are generated in the feature fusion stage, which reduces the accuracy and speed of target detection. The present invention provides an improved YOLOv4 network model, which includes three sub-networks: feature extraction, feature multi-scale fusion and target classification. Figure 4 As shown. The feature extraction part of the improved overall network consists of 8 deep convolution modules, 5 group convolution modules, 3 channel transformation modules, 9 regularization modules and 3 dense connection modules. The target contrast in the large field of view image is weak and the feature details are not obvious. In the high-precision feature extraction subnetwork, the image data set is processed by image enhancement and channel cutting transformation. The three-channel image is used as input, namely x, y, and z. Each group of channels is now divided into 3 equal parts to form an array {x1, x2, x3, y1, y2, y3, z1, z2, z3}. The 3×3 groups of channels are shuffled to form a 3×3 matrix, as shown Figure 5As shown in the figure, through the channel matrix transposition operation, the convolution group features are transformed and flattened, and then distributed back to each group convolution as the input of the next layer, so that the features are fully integrated without increasing the amount of calculation. A 3×3 convolution is used in each channel to extract features from the spatial region. The 1×1 standard convolution is to deeply fuse the features extracted by the depth-by-depth convolution. At the same time, a densely connected network structure is used in the feature acquisition stage and before multi-scale upsampling. The jump connection method is used to integrate the features of each stage, and the output features of the previous layer are added to each input end, so as to achieve dimensional expansion, improve detection accuracy, and reduce the number of parameters generated for multi-scale fusion. The relationship between the two is shown in formula (5):
[0042] x l =H l ([x0,x1,...,x l-1 ]) (5)
[0043] Assume that the network has L layers, where x0 is the input of the network and x l is the output of the lth layer in the network, x l-1 is the output of the l-1th layer, H l () is the nonlinear transformation acting on the lth layer, as shown in the figure.
[0044] (2) Enhanced feature multi-scale fusion sub-network
[0045] The enhanced feature multi-scale fusion sub-network is used to perform multi-scale transformation on the feature information output by the high-precision feature extraction sub-network, and further fuse the features. The three scales selected for multi-scale fusion prediction are I1, I2, and I3, as shown in Figure 4 As shown in the figure, the scale of I1 is 14×14, the scale of I2 is 28×28, and the scale of I3 is 56×56. The target data set is clustered by the K-means method, and the anchor box sizes are (13,20), (21,32), (27,49), (31,54), (34,65), and (47,90). The network consists of a feature pyramid {P1, P2, P3, P4} structure. The resolution of the small-scale feature map is adjusted by upsampling, and the new feature map F is obtained by fusion with the upper large-scale prediction layer. k(k=1,2,3), each pixel in the fused image is added together to obtain the final fused image, which are: F1=I1, F2=I1×2+I2, F3=I1×4+I2×2+I3. Densely connected convolution forms are designed in the branches of the three scale prediction layers, and they are composed of 1×1 point convolutions. The function is to increase the correlation of target information between different layers. After increasing dense connections and then upsampling, redundant parameters can be removed while fusing detailed information of different layers. Appropriately adjust the convolution layer before the prediction layer to reduce the serious problem of model overfitting. During the training process, the network uses the consistency supervision loss function to predict the category. The consistency supervision loss function is shown in formula (6):
[0046] L yolo =λ(L cls,M (p M ,t * )+β[t * >0]L loc,M (d M ,b * ))+(L cls,P (p,t * )+β[t * >0]L loc,P (d,b * )) (6)
[0047] Among them, L cls,M and L loc,M is the auxiliary loss function of the feature pyramid {P1, P2, P3, P4}, L cls,P and L loc,P is the original loss function of the feature pyramid {P1, P2, P3, P4}, p M ,d M and p,d are the predictions of the intermediate and final pyramid layers respectively, t * and b * are the basic category labels and regression targets, respectively, λ is the weight used to balance the auxiliary loss and the original loss, and β is the weight used to balance the classification and localization losses. * >0] is defined as shown in formula (7):
[0048]
[0049] (3) Lightweight object classification subnetwork
[0050] The lightweight object classification subnetwork includes three classifiers for receiving the fusion features output by the enhanced feature multi-scale fusion subnetwork. Each classifier includes a lightweight module, wherein the lightweight module includes a global average pooling layer, a convolution layer, and a BN layer. Figure 7 shown.
[0051] The function of the global average pooling layer in the lightweight module is to average the information on each feature channel into one value. The corresponding calculation is shown in formula (8):
[0052]
[0053] Among them, H, W, and C represent the height, width, and number of feature channels of the input convolution respectively, and X i,j ∈R 1×1×C Represents the output data of the previous layer. The main function of the global average pooling layer is to obtain information on the model channel. In order to obtain the correlation between feature channels, the model needs to be trained based on the entire data set.
[0054] The essence of the BN layer is a normalized network, which normalizes the extracted targets and remaps the feature weights to achieve the purpose of classification. as follows:
[0055]
[0056]
[0057] Among them, Z in and Respectively represent the input and output of the BN layer, μ b and σ b represents the input mean and standard deviation, ε is the offset, γ and β are the affine transformation parameters, and the product of this parameter and the output channel is used as the basis for channel importance to prune the low-scoring redundant weights. The formula for the objective function to evaluate the importance of weight channel information is:
[0058]
[0059] Among them, (f(x,M),y) is the effective item of channel information, x,y are the input and target of the network respectively, M is the training weight of the network, g(γ) is the penalty term on the scaling factor, l,λ are the hyperparameters used to constrain the equation. By evaluating the objective function, the network is further lightweight after improving the network's accuracy loss function.
[0060] By introducing global average pooling and evaluating the model objective function to trim the network channel parameters, the model classification detection speed is improved while ensuring the recognition rate, solving the problem of insufficient real-time performance of traditional feature extraction methods in target detection in large field of view images.
[0061] Step 4: After initializing the training parameters of the improved YOLOv4 network model, set the number of iterations and learning rate, input the training set to the initialized network, update the network parameters using the reverse gradient propagation method of the consistent supervision loss, and use the loss value and AP value as evaluation indicators to obtain the optimal network model after training. The optimal network model trained by this step has a low amount of calculation and parameters, and can be used in embedded devices with small computing power and space.
[0062] Furthermore, when training is performed with loss value and AP value as evaluation indicators, the network model at this time is saved every 4000 iterations during the training process, and the loss value is used as the evaluation indicator. During the iteration process, the training is stopped when the threshold of the iteration loss function is below 0.05. If the loss function does not converge, the network parameters are adjusted once until the loss function converges, and the trained model with the highest AP value (average precision) is selected as the optimal network model.
[0063] The following takes the training software environment as ubuntu18.04 and the hardware configuration as NVIDIA GTX1060 8G video memory as an example to explain the training process of the improved YOLOv4 network model in detail: Initialize the training parameters of the improved network, input the adjusted 448×448 .jpg format large field of view target image to the initialized network, and perform forward propagation. The parameters in the .cfg configuration file are set as follows: the number of training iterations is 100,000 times, the learning rate is set to 0.001, the reverse gradient propagation method with consistent supervision loss is used to update the network parameters, and 3 scales are set for multi-scale fusion prediction. During the training process, the network model at this time is saved every 4,000 iterations, and the loss value is used as the evaluation index. During the iteration process, the training is stopped when the threshold of the iterative loss function is below 0.05. If the loss function does not converge, the network parameters are adjusted until the loss function converges. The AP value is used as an indicator to select the optimal network model. The algorithm model obtained at 61,000 iterations has the highest AP value. The trained model obtained at this time is considered to be the optimal network model of the improved algorithm.
[0064] Step 5: Input the large field of view image to be identified into the optimal network model, and the optimal network model outputs the corresponding large field of view target detection result. The large field of view target detection result includes information such as the location, category and confidence of the detected target.
[0065] Next, we use the test set obtained in step 2 to conduct target detection experiments and model evaluation on the optimal network model obtained after training.
[0066] The test environment is a Raspberry Pi 3B+ without a GPU. The selected optimal network model is used to test and verify the large field of view image test samples (test set) to obtain the location and category of the detected target. Some test results are shown in the figure below. Figure 8 As shown, Figure (a), Figure (c), and Figure (e) are test result diagrams after testing using the traditional YOLOv4 network, and Figure (b), Figure (d), and Figure (f) are corresponding test result diagrams after testing using the optimal network model in the present invention. In Figures (a) to (f), the detection target is marked with a solid line frame, and the category of the detection target (the category of the detection target in the figure is plane) and the confidence are marked above each solid line frame. The overall detection indicators of the two algorithms on the test set are shown in Table 1.
[0067] Table 1 Comparative analysis of algorithms before and after improvement
[0068]
[0069] Experimental results show that the optimal network model of the present invention has higher accuracy and recall rate than the previous YOLOv4 network in detecting small targets, high exposure and complex backgrounds, and the training model takes a short time and the detection speed is faster.
[0070] The large field of view target detection method based on the improved YOLOv4 algorithm proposed in this invention mainly includes three aspects of improvements:
[0071] 1) A decomposition and enhancement image input method based on local color histogram matching. Aiming at the problem that large field of view target images have high resolution, wide field of view, and small targets are difficult to train, the local color histogram matching method is used to further enhance the image before training, and the large field of view image is cut into small images as the input of the network, which is conducive to the distinction and extraction of the target and the background.
[0072] 2) A high-precision multi-scale target extraction network is proposed. To address the problem of insufficient extraction of detail information of targets with a large field of view, the three groups of multi-scale fusion prediction layer structures are improved. A dense connection method is designed between the four convolution blocks before the first upsampling of each branch, which can enhance the fusion of targets of different scales and enrich the feature detail information. Feature channel transposition transformation is performed during fusion to strengthen feature association and improve prediction accuracy.
[0073] 3) A lightweight large-field-of-view object classification network, which reduces the number of network parameters by adding a lightweight module containing a global average pooling layer and adjusting the channel structure to reduce the feature redundancy of the weight model.
[0074] The large field of view target detection method based on the improved YOLOv4 algorithm proposed in the present invention has the following beneficial effects:
[0075] The present invention proposes an improved large-field target detection method based on YOLOv4 (You Only Look Oncev4) which has a good trade-off between accuracy and speed in the field of target detection. The method mainly improves the network in two aspects: detection accuracy and lightweight. In terms of improving detection accuracy, the image is preprocessed and the multi-scale fusion prediction network is improved. The former distinguishes the target and the background through local histogram equalization to fully extract the target information, and the latter strengthens the target feature association by changing the convolution mode and channel transformation, solving the problem of insufficient accuracy of the original network in the process of large-field target detection. In terms of model lightweighting, a lightweight network module is added to the classification layer, and the global average pooling layer and the evaluation objective function are combined to strengthen the target feature learning and cut redundant convolutions, reduce the calculation amount and parameter amount of the existing network model, and solve the problem of too large model and slow speed in the large-field target detection algorithm based on convolutional neural network. While improving detection accuracy and speed, the present invention reduces dependence on computer hardware and computing power, can run on embedded devices without GPUs, saves device storage space, meets the demand for target detection speed in real life, and can be used to apply detection algorithms for large-field-of-view targets to mobile terminals and other occasions, greatly improving the portability and intelligence of military equipment.
[0076] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0077] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A large field of view target detection method based on the improved YOLOv4 algorithm, characterized in that: The following steps are involved: Step 1: Build a large field of view image dataset; Step 2: Perform local color histogram matching preprocessing on the source image S in the large field of view image data set, annotate the preprocessed image, and divide all the annotated images into a training set and a test set; the process of performing local color histogram matching preprocessing on the source image S in the large field of view image data set includes the following steps: Performing image quality enhancement on the source image S in the large field of view image data set by using a local color histogram matching method; Divide the source image S into a number of rectangular blocks of equal area; Performing histogram correspondence with the rectangular blocks respectively to obtain a probability distribution function of the source image of each rectangular block; Obtaining inverse mappings of all corresponding rectangular blocks according to a probability distribution function of the source image of each rectangular block; A matched image T is obtained according to the inverse mapping of each rectangular block, and each small block in the matched image T will be used as the input of the improved YOLOv4 network model; Step 3: construct an improved YOLOv4 network model, wherein the improved YOLOv4 network model includes a high-precision feature extraction subnetwork, an enhanced feature multi-scale fusion subnetwork and a lightweight target classification subnetwork, wherein the high-precision feature extraction subnetwork uses a CSP structure to extract target features from an input image, wherein in the high-precision feature extraction subnetwork, an image data set is processed by image enhancement and channel cutting transformation, and a three-channel image is used as input, each group of channels is divided into three equal parts, and 3×3 groups of channels form a 3×3 matrix; When the high-precision feature extraction subnetwork uses the CSP structure to extract target features from the input image, it performs a matrix transposition operation to transform the position of the convolution group features and then flatten them, and then distributes them back to each group convolution as the input of the next layer; A 3×3 convolution is used in each channel to extract features from the spatial region. A 1×1 standard convolution is used to deeply fuse the features extracted by the depth-wise convolution. At the same time, a densely connected network structure is used in the feature acquisition stage and before multi-scale upsampling. The features of each stage are integrated by skip connections, and the output features of the previous layer are added to each input end. The enhanced feature multi-scale fusion sub-network includes three multi-scale fusion prediction network layers, which perform multi-scale fusion prediction on the extracted target features in combination with dense connections to obtain fusion features of three scales. The scales of the three multi-scale fusion prediction network layers are 14×14, 28×28, and 56×56, respectively. Densely connected convolution forms are designed on the branches of the three multi-scale fusion prediction network layers, which are composed of point convolutions of size 1×1, and upsampling is performed after adding dense connections. The lightweight target classification subnetwork performs target classification detection based on the fusion features of three scales. The lightweight target classification subnetwork includes three classifiers for receiving the fusion features output by the enhanced feature multi-scale fusion subnetwork. Each of the classifiers includes a lightweight module. The lightweight module includes a global average pooling layer, a convolution layer and a BN layer. The global average pooling layer is used to average the information on the feature channel into one value. The BN layer normalizes the extracted targets and remaps the feature weights at the same time. Step 4: After initializing the training parameters of the improved YOLOv4 network model, set the number of iterations and the learning rate, input the training set to the initialized network, update the network parameters using the reverse gradient propagation method of the consistent supervision loss, use the loss value and AP value as evaluation indicators, and obtain the optimal network model after training; Step 5: Input the large field of view image to be identified into the optimal network model, and the optimal network model outputs the corresponding large field of view target detection result.
2. A large field of view target detection method based on the improved YOLOv4 algorithm according to claim 1, characterized in that: The process of annotating the preprocessed image includes the following steps: Use the open source annotation tool LabelImg to annotate the matched image T into two types of text: .xml and .txt. The naming of the .xml text corresponds to the naming order of the image and is placed in the folder Annotation. The .txt text is divided into the file train.txt for training and the file test.txt for testing. The files train.txt and test.txt contain the relative path of the image and are placed in the Main folder of the folder ImageSets. The annotated files will save the category, size, and position of each target in the image.
3. The large field of view target detection method based on the improved YOLOv4 algorithm according to claim 1 is characterized in that: The calculation formula of the global average pooling layer is as follows: Among them, H, W, and C represent the height, width, and number of feature channels of the input convolution respectively, and X i,j ∈R 1×1×C Represents the output data of the previous layer.
4. The method for detecting a target with a large field of view based on an improved YOLOv4 algorithm according to claim 1, characterized in that: The transformation formula of the BN layer as follows: Among them, Z in and Respectively represent the input and output of the BN layer, μ b and σ b represents the input mean and standard deviation, ε is the offset, γ and β are the affine transformation parameters, and the product of this parameter and the output channel is used as the basis for the importance of the channel to delete the weights of low-scoring redundant ones.
5. A large field of view target detection method based on the improved YOLOv4 algorithm according to claim 1 or 2, characterized in that: In step 4, when training with loss value and AP value as evaluation indicators, the network model at this time is saved every 4000 iterations during the training process, and the loss value is used as the evaluation indicator. During the iteration process, the training is stopped when the threshold of the iterative loss function is below 0.
05. If the loss function does not converge, the network parameters are adjusted once until the loss function converges, and the trained model with the highest AP value is selected as the optimal network model.
6. A large field of view target detection method based on the improved YOLOv4 algorithm according to claim 1 or 2, characterized in that: The size of the source image S in the large field of view image dataset is 448×448, the number of iterations is 100,000, and the learning rate is 0.001.
Citation Information
Patent Citations
Aquatic product target real-time detection method suitable for TX2 embedded platform
CN113408423A
Livestock image target detection method and device based on lightweight YOLOv4
CN113537244A
Method and system for detecting near-real-time moving target under field large view field
CN113850835A
Cross-layer fusion improved YOLOv4 road target recognition algorithm
CN114565896A
Method for detecting image target in smart home environment
WO2021244079A1
