A high-precision target detection method for complex environments
Through the SAYOLO algorithm, using the YOLOv4 and ANYOLOv4 neural networks combined with the CBAM attention module and the twin network architecture, the problem of insufficient robustness of target detection in complex environments is solved, and high-precision and high-robustness target detection is achieved.
Patent Information
- Application Number
- CN202211551601.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-05
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-12-05
AI Technical Summary
Existing target detection algorithms based on image preprocessing are not robust enough in complex environments and are difficult to adapt to various environmental changes, resulting in a decrease in detection accuracy.
The Siamese Attention YOLO (SAYOLO) algorithm is adopted. The YOLOv4 neural network and the improved ANYOLOv4 neural network are used to process ordinary and complex images respectively. The images are evaluated through the Score evaluation function, and the high evaluation result is finally selected for output. The CBAM attention module and the twin network architecture are combined to improve the detection robustness.
The accuracy and robustness of target detection in complex environments are significantly improved, with an increase of 10.34% to 23.14% compared to existing algorithms, and the performance is particularly better under various environmental changes.
Smart Images

Figure CN115830337B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence target detection, and in particular to a high-precision target detection method for complex environments. Background Art
[0002] Object detection in complex environments typically involves image preprocessing and detectors. For example, Chunle Guo et al. proposed the Zero-DCE algorithm for images in low-light conditions. The Zero-DCE algorithm uses a light enhancement curve to adjust the input image at the pixel level. Under complex lighting conditions, the Zero-DCE algorithm can effectively enhance the detailed features of the input image. Kaiming He et al. proposed the DCP algorithm for image dehazing based on the dark channel prior theory, improving the feature enhancement of foggy images. However, the DCP dehazing algorithm performs poorly on images under complex lighting conditions. Hang Dong et al. proposed the MSBDN-DFF algorithm based on the U-Net architecture. The MSBDN-DFF algorithm uses a "Strengthen-Operate-Subtract" strategy to restore foggy input images. Furthermore, the MSBDN-DFF algorithm enhances the network's ability to perceive spatial information through the DFFM module. The MSBDN-DFF algorithm achieves better dehazing results for foggy images, but the network's computational overhead is relatively high.
[0003] Because image preprocessing algorithms are often designed for a specific, complex environment, object detection algorithms based on image preprocessing often suffer from poor robustness. While these algorithms can achieve high detection accuracy when faced with a single type of environmental change, they often fail to effectively detect targets when the environment changes more complexly. These algorithms are not well suited to the high robustness requirements of target detection algorithms in response to environmental changes.
[0004] Currently, no effective solutions have been proposed for the problems in related technologies. Summary of the Invention
[0005] (1) Technical problems solved
[0006] In response to the shortcomings of the existing technology, the present invention provides a high-precision target detection method for complex environments, which has the advantage of effectively improving the robustness of target detection algorithms based on image preprocessing for target detection in complex environments. In addition, the existing target detection algorithms cannot adapt well to the high robustness requirements for environmental changes during the application of target detection algorithms.
[0007] (2) Technical solution
[0008] In order to achieve the above advantages of effectively improving the robustness of target detection algorithms based on image preprocessing for target detection in complex environments, the specific technical solutions adopted by the present invention are as follows:
[0009] A high-precision target detection method for complex environments, the method comprising the following steps:
[0010] S1, dividing the image to be detected into ordinary images and complex images and inputting them separately;
[0011] S2. Detect the normal image using the YOLOv4 neural network in the SAYOLO algorithm and output the normal image detection result;
[0012] S3, using the ANYOLOv4 neural network in the SAYOLO algorithm to detect the complex image and output the complex image detection result;
[0013] S4, using the Score evaluation function to evaluate the ordinary image detection result and the complex image detection image respectively, and outputting their respective evaluation results;
[0014] S5. Select the evaluation result with a high value and output the corresponding detection result.
[0015] Furthermore, the detecting of the ordinary image by using the YOLOv4 neural network in the SAYOLO algorithm and outputting the ordinary image detection result includes the following steps:
[0016] S21, resizing the normal image to an appropriate size and inputting the image into a YOLOv4 neural network;
[0017] S22, the YOLOv4 neural network extracts features from the ordinary image and outputs detection information of the target;
[0018] S23. Filter the redundant detection information using a non-maximum suppression method to obtain final target detection information as a normal image detection result.
[0019] Furthermore, the detection information is a three-dimensional tensor of S×S×(B×5+C);
[0020] Wherein, S×S represents the number of grids that the ordinary image needs to be divided into;
[0021] B×5 represents the number of bounding boxes that need to be predicted in each grid and the bounding box information of x, y, w, h, and confidence included in each predicted bounding box;
[0022] x,y represents the coordinates of the center point of the predicted bounding box in the grid;
[0023] w,h represent the width and height information of the predicted bounding box respectively;
[0024] Confidence indicates the probability that the predicted bounding box contains an object;
[0025] C represents the number of object categories that need to be classified.
[0026] Furthermore, the network structure of the YOLOv4 neural network includes five operational structural units and three main functional parts;
[0027] Among them, the operation structure unit includes a CBM operation unit, a CBL operation unit, a Res Unit operation unit, a CSP×N operation unit, an SPP operation unit and a YOLO Head operation unit, and the main functional part includes a CSPDarknet53 module, an SPP+PANet module and a Head module.
[0028] Furthermore, the CBM operation unit is composed of a convolutional layer, a batch normalization layer, and a Mish activation function layer in sequence;
[0029] The CBL operation unit is composed of a convolutional layer, a batch normalization layer, and a Leaky ReLu activation function layer in sequence;
[0030] The Res Unit operation unit divides the input features into two branches, one branch performs CBM processing on the input features twice, and the other branch keeps the input features unchanged, and then adds the input features of the two branches;
[0031] The CSP×N operation unit performs a CBM process on the input features and then divides them into two branches. One branch first performs a CBM process on the input features, then performs N Res Unit processes on the input features, and finally performs a CBM process on the input features again. The other branch only performs a CBM process on the input features, then performs a splicing operation on the input features of the two branches, and finally performs a CBM process on the spliced input features.
[0032] The SPP operation unit divides the input features into 4 branches, and performs 1×1, 5×5, 9×9 and 13×13 maximum pooling operations on each branch respectively, and concatenates the features of the 4 branches;
[0033] The YOLO Head operation unit performs CBM operation and convolution operation on the input features.
[0034] Furthermore, the CSPDarknet53 module is used to extract input feature information of the image, and is composed of the CBM operation unit and the CSP×N operation unit;
[0035] The SPP+PANet module is the Neck structure of the network, which is used to perform feature fusion on the extracted input features, that is, to achieve the fusion of features at different levels through SPP, upsampling operation, splicing operation, and CBL operation;
[0036] The Head module is used to predict the feature information output by the network.
[0037] Furthermore, the ANYOLOv4 neural network adds a CBAM attention module to the PANet structure of the YOLOv4 neural network to improve the perception ability of the features extracted by the CSPDarknet53 backbone network;
[0038] Among them, the CBAM attention module includes a channel attention mechanism and a spatial attention mechanism.
[0039] Furthermore, the ANYOLOv4 neural network and the YOLOv4 neural network use non-shared network weights.
[0040] Furthermore, the step of using the Score evaluation function to evaluate the ordinary image detection result and the complex image detection image respectively and outputting the respective evaluation results includes the following steps:
[0041] S41, calculating the dark channel values of the ordinary image and the complex image as input images, the formula is:
[0042]
[0043] S42. Calculate the average value of the dark channel using the formula:
[0044]
[0045] Where D represents the dark channel of the input image, and
[0046] I represents the input image, and
[0047] w represents the width of the input image;
[0048] h represents the height of the input image;
[0049] y∈Ω(x) represents a window centered at pixel x and is represented by Operation implementation Filtering of the output results after the operation;
[0050] I c represents one of the R, G, and B channels of the input image, and
[0051] MDCV represents the mean value of the dark channel;
[0052] S43. Construct a Score evaluation function based on the average value of the dark channel, and score the detection results output by the YOLOv4 neural network and the ANYOLOv4 neural network respectively, and finally obtain the evaluation results of the ordinary image and the complex image respectively.
[0053] Furthermore, the Score evaluation function includes a common image evaluation function and a complex image evaluation function;
[0054] The formula of the common image evaluation function is:
[0055]
[0056] The formula of the complex image evaluation function is:
[0057]
[0058] In the formula, confidence represents the confidence of all detection targets output by the ordinary image detection module,
[0059] n represents the total number of targets detected by the common image detection module;
[0060] confidence' represents the confidence of all detected targets output by the complex image detection module, and
[0061]
[0062] m represents the total number of targets detected by the complex image detection module;
[0063] MDCV represents the mean dark channel of the input image.
[0064] (3) Beneficial effects
[0065] Compared with the existing technology, the present invention provides a high-precision target detection method for complex environments, which has the following beneficial effects:
[0066] (1) By proposing the ANYOLOv4 complex image detection module based on the YOLOv4 algorithm and the CBAM attention mechanism module, and proposing the SAYOLO algorithm based on the ANYOLOv4 algorithm, the twin network architecture and the specially designed network scoring module, the robustness of the target detection algorithm based on image preprocessing for target detection in complex environments is effectively improved.
[0067] (2) Compared with the target detection algorithm based on image preprocessing, the SAYOLO algorithm constructed by the present invention has a mAP@50 that is 10.34%, 11.51%, 23.14% and 1.03% higher than the YOLOv4 algorithm, MSBDN-DFF+YOLOv4 algorithm, Zero DCE+YOLOv4 algorithm and Dark Channel Prior+YOLOv4 algorithm trained in the complex environment dataset, respectively. Compared with the target detection algorithm based on image preprocessing in the complex environment, the SAYOLO algorithm has higher detection accuracy and is more robust to a variety of different environmental changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0069] Figure 1 is a flow chart of a high-precision target detection method for complex environments according to an embodiment of the present invention;
[0070] Figure 2 1. This is a structural diagram of Siamese Attention YOLO (SAYOLO) in a high-precision target detection method for complex environments according to an embodiment of the present invention;
[0071] Figure 3 1. A YOLOv4 neural network structure diagram in a high-precision target detection method for complex environments according to an embodiment of the present invention;
[0072] Figure 4 2. It is a structural diagram of the CBAM attention module in the high-precision target detection method for complex environments according to an embodiment of the present invention;
[0073] Figure 5 This is a diagram of the AttentionNeck YOLOv4 (ANYOLOv4) neural network structure in a high-precision target detection method for complex environments according to an embodiment of the present invention;
[0074] Figure 6 This is an example of an image in a complex environment dataset in a high-precision target detection method for a complex environment according to an embodiment of the present invention;
[0075] Figure 7 This is a comparison chart of the perception effects of the ANYOLOv4_3 algorithm and the YOLOv4 algorithm on targets in complex environments in a high-precision target detection method for complex environments according to an embodiment of the present invention;
[0076] Figure 8 It is the method for high-precision target detection in complex environments according to an embodiment of the present invention. s Comparison chart of the impact of numerical changes on the detection accuracy of the SAYOLO algorithm;
[0077] Figure 9 It is the method for high-precision target detection in complex environments according to an embodiment of the present invention. m Comparison chart of the impact of numerical changes on the detection accuracy of the SAYOLO algorithm;
[0078] Figure 10 This is a comparison chart of the detection effects of YOLOv4 and SAYOLO in complex environments in a high-precision target detection method for complex environments according to an embodiment of the present invention. DETAILED DESCRIPTION
[0079] According to an embodiment of the present invention, a high-precision target detection method for complex environments is provided.
[0080] The present invention will now be further described with reference to the accompanying drawings and specific embodiments. Figures 1-10 As shown, according to an embodiment of the present invention, the high-precision target detection method for complex environments includes the following steps:
[0081] S1, dividing the image to be detected into ordinary images and complex images and inputting them separately;
[0082] The SAYOLO algorithm structure mainly includes the general image detection module, the complex image detection module and the network scoring module. The network structure of SAYOLO is as follows: Figure 2 As shown in the figure, during the detection process, the SAYOLO algorithm simultaneously inputs the image to be detected into the general image detection module and the complex image detection module for detection. The general image detection module uses the YOLOv4 algorithm to detect the input image.
[0083] The weights of the YOLOv4 algorithm are trained on a common image dataset. To improve the detection accuracy of the SAYOLO algorithm for complex images, the twin network architecture corresponding to the YOLOv4 neural network uses an improved ANYOLOv4 neural network to detect input images; the weights of the ANYOLO algorithm are trained on a complex image dataset.
[0084] S2. Detect the normal image using the YOLOv4 neural network in the SAYOLO algorithm and output the normal image detection result;
[0085] YOLOv4 was proposed by Alexey Bochkovskiy et al., building on the work of Joseph Redmon et al., and improving upon YOLOv3. The YOLOv4 algorithm primarily optimizes its backbone and neck structures. Building on YOLOv3, YOLOv4 uses the CSPDarknet53 network as its backbone, enabling it to more effectively extract deep information from input images. Furthermore, YOLOv4 employs a combination of SPP and PANet modules as its neck structure, effectively enhancing the network's ability to perceive spatial information.
[0086] The detecting of the ordinary image by using the YOLOv4 neural network in the SAYOLO algorithm and outputting the ordinary image detection result comprises the following steps:
[0087] S21, resizing the normal image to an appropriate size and inputting the image into a YOLOv4 neural network;
[0088] S22, the YOLOv4 neural network extracts features from the ordinary image and outputs detection information of the target;
[0089] The detection information is a three-dimensional tensor of S×S×(B×5+C);
[0090] Where S×S represents the number of grids that the ordinary image needs to be divided into;
[0091] B×5 represents the number of bounding boxes that need to be predicted in each grid and the bounding box information of x, y, w, h, and confidence included in each predicted bounding box;
[0092] x,y represents the coordinates of the center point of the predicted bounding box in the grid;
[0093] w,h represent the width and height information of the predicted bounding box respectively;
[0094] Confidence indicates the probability that the predicted bounding box contains an object;
[0095] C represents the number of object categories that need to be classified.
[0096] S23. Filter the redundant detection information using a non-maximum suppression method to obtain final target detection information as a normal image detection result.
[0097] like Figure 3 As shown, the network structure of the YOLOv4 neural network includes 5 operation structural units and 3 main functional parts;
[0098] Among them, the operation structure unit includes a CBM operation unit, a CBL operation unit, a Res Unit operation unit, a CSP×N operation unit, an SPP operation unit and a YOLO Head operation unit, and the main functional part includes a CSPDarknet53 module, an SPP+PANet module and a Head module.
[0099] Specifically, the composition of each operation structure unit and its corresponding functions include:
[0100] The CBM operation unit is composed of a convolutional layer (Conv), a batch normalization layer (BN), and a Mish activation function layer (Mish) in sequence;
[0101] The CBL operation unit is composed of a convolutional layer (Conv), a batch normalization layer (BN), and a Leaky ReLu activation function layer (Leaky ReLu) in sequence;
[0102] The Res Unit operation unit divides the input features into two branches, one branch performs CBM processing on the input features twice, and the other branch keeps the input features unchanged, and then adds the input features of the two branches;
[0103] The CSP×N operation unit performs a CBM process on the input features and then divides them into two branches. One branch first performs a CBM process on the input features, then performs N Res Unit processes on the input features, and finally performs a CBM process on the input features again. The other branch only performs a CBM process on the input features, then performs a concatenation operation (Concat) on the input features of the two branches, and finally performs a CBM process on the concatenated input features.
[0104] The SPP operation unit divides the input features into 4 branches, and performs 1×1, 5×5, 9×9 and 13×13 maximum pooling operations on each branch respectively, and concatenates the features of the 4 branches;
[0105] The YOLO Head operation unit performs CBM operation and convolution operation on the input features.
[0106] The composition of each main functional part and its corresponding functions include:
[0107] The CSPDarknet53 module is used to extract input feature information of the image, and is composed of the CBM operation unit and the CSP×N operation unit;
[0108] The SPP+PANet module is the Neck structure of the YOLOv4 neural network, which is used to perform feature fusion on the extracted input features, that is, to achieve the fusion of features at different levels through SPP, upsampling operation (UpSamping), splicing operation (Concat), and CBL operation;
[0109] The Head module is used to predict the feature information output by the YOLOv4 neural network.
[0110] S3, using the ANYOLOv4 neural network in the SAYOLO algorithm to detect the complex image and output the complex image detection result;
[0111] For images in complex environments, the SAYOLO algorithm uses the Attention NeckYOLOv4 (ANYOLOv4) algorithm in the complex image detection module to detect the input images; based on the YOLOv4 neural network, the improvement of the ANYOLOv4 neural network focuses on the PANet structure.
[0112] The ANYOLOv4 neural network adds a CBAM attention module to the PANet structure of the YOLOv4 neural network to improve the perception ability of the features extracted by the CSPDarknet53 backbone network. The CBAM attention module can simply and efficiently perform adaptive feature optimization of the channel dimension and spatial dimension of the input features in the neural network.
[0113] Among them, such as Figure 4 As shown, the CBAM attention module includes a channel attention mechanism and a spatial attention mechanism.
[0114] Specifically, the process steps of the channel attention mechanism include: first, performing global average pooling and global maximum pooling on each single feature layer of the input feature, then using a shared fully connected layer to process the results of average pooling and maximum pooling, and adding the two processed results, inputting the added result into the Sigmoid activation layer for activation to obtain the weight of each channel of the input feature layer, and then adding the weight of each channel of the input feature layer to the original input feature layer to obtain the output feature with channel feature enhancement;
[0115] The process steps of the spatial attention mechanism include: first, taking the maximum and average values of the input features on the channel of each feature point, splicing the results, and adjusting the output channel to 1 using a convolution operation with a convolution kernel size of 7×7. The convolution result is input into the Sigmoid activation layer for activation to obtain the weight of each feature point in the input feature layer, and then multiplying the weight of each feature point by the original input feature layer to obtain the output feature with spatial feature enhancement.
[0116] The network structure of ANYOLOv4 neural network is as follows Figure 5 As shown in Figure 1, considering the impact of network structure depth on algorithm training results and the possible overfitting problem during network training, the ANYOLOv4 neural network selects four positions, Attention_1, Attention_2, Attention_3, and Attention_4, as the locations for adding CBAM attention modules. The specific configuration information of the number and position of the CBAM attention mechanism modules in these four neural network structures is shown in Table 1:
[0117] Table 1: Number and location of CBAM attention modules in different ANYOLOv4 network structures
[0118]
[0119] It can be seen that the CBAM attention module is added to Figure 5 After Attention_1, Attention_2, Attention_3 and Attention_4 in the network, only the input feature information is enhanced and suppressed without changing the size of the input feature. This improves the network's perception of sensitive features while maintaining the original network structure.
[0120] The key concept of the twin neural network is to utilize different input information and the same network structure to compare and analyze different network outputs to ultimately classify the object. The SAYOLO algorithm adopts a similar architecture to the twin neural network. The SAYOLO algorithm comprises two structurally similar sub-networks: the YOLOv4 neural network and the ANYOLOv4 neural network. The YOLOv4 and ANYOLOv4 neural networks are identical except for the CBAM attention mechanism module in the Neck architecture. Furthermore, the SAYOLO algorithm draws on the twin neural network's principle of comparative analysis of outputs, comparing the object detection performance of the two sub-networks by differentiating their outputs after the image is fed into the two sub-networks. Since the SAYOLO algorithm uses the same image input for detection in both sub-networks, to ensure that the two sub-networks can output different results for analysis, the YOLOv4 and ANYOLOv4 neural networks use unshared network weights.
[0121] This invention tests the detection and processing of complex images and provides an adaptive test environment and parameter settings. The specific process and steps are as follows:
[0122] The dataset used in the test process is a self-made complex environment dataset based on the PASCAL VOC dataset (VOC 2007+VOC 2012). In order to improve the training speed of the neural network and ensure the effectiveness of the neural network training results, 20% of the images were randomly extracted from the PASCAL VOC dataset during the test to obtain the Mini VOC dataset. At the same time, in order to simulate the complex detection environment, 25% of the images were extracted from the Mini VOC dataset for random brightness attenuation and 25% of the images were added with random fog concentration. Afterwards, in order to simulate the extreme meteorological conditions that may occur during the actual detection process, 25% of the images were randomly extracted from the MiniVOC dataset and a stronger concentration of fog was added to them, and finally the complex environment dataset was obtained. Some images in the complex environment dataset are shown below. Figure 4 As shown in Figure 2, the complex environment dataset contains 3559 training images, 396 verification images, and 440 test images.
[0123] The specific configuration of the experimental environment is shown in Table 2.
[0124] Table 2: Experimental environment
[0125] name Numerical CPU 11th Gen Intel(R)Core(TM)i7-11800H@2.30GHz GPU NVIDIA GeForce RTX 3060Laptop GPU operating system Windows 11 Python 3.8.13 torch 1.9.1+cu111 CUDA 11.1 cuDNN 8005
[0126] The specific parameter settings during the neural network training process are shown in Table 3.
[0127] Table 3: Neural network parameter settings
[0128] name Numerical Image input size 416×416 Total training sessions 100 Freeze training epochs 50 Freeze training Batch Size 6 Unfreeze training Batch Size 4 Optimizer Type Adam Momentum 0.937 Learning rate decay type cos Initial learning rate <![CDATA[10 -3 ]]> Minimum learning rate <![CDATA[10 -5 ]]>
[0129] Through experimental testing, we compared the performance of the Attention Neck YOLOv4 (ANYOLOv4) algorithm with that of the YOLOv4 algorithm. We trained and tested ANYOLOv4_1, ANYOLOv4_2, ANYOLOv4_3, and ANYOLOv4_4 on a complex environment dataset. The results of the ANYOLOv4 algorithms with these four network structures on the complex environment dataset are shown in Table 4. Figure 7 The results show that the ANYOLOv4_3 algorithm and the YOLOv4 algorithm can perceive targets in complex environments.
[0130] Table 4: Test results of ANYOLOv4 algorithms with different network structures on complex environment datasets
[0131]
[0132]
[0133] Results show that in complex environment datasets, the ANYOLOv4_3 algorithm achieves a 1.12% improvement in mAP@50 compared to the YOLOv4 algorithm. Furthermore, for objects in complex environments, the ANYOLOv4_3 algorithm achieves higher object perception accuracy than the YOLOv4 algorithm.
[0134] In the actual application of the algorithm, the position and number of CBAM attention mechanism modules in the ANYOLOv4 algorithm are adjusted according to the actual situation of the training data set. In this invention, the CBAM configuration of the ANYOLO subnetwork of the SAYOLO complex environment object detection algorithm adopts the ANYOLOv4_3 neural network structure.
[0135] S4, using the Score evaluation function to evaluate the ordinary image detection result and the complex image detection image respectively, and outputting the respective evaluation results, including the following steps:
[0136] S41, calculating the dark channel values of the ordinary image and the complex image as input images, the formula is:
[0137]
[0138] S42. Calculate the average value of the dark channel using the formula:
[0139]
[0140] Where D represents the dark channel of the input image, and
[0141] I represents the input image, and
[0142] w represents the width of the input image;
[0143] h represents the height of the input image;
[0144] y∈Ω(x) represents a window centered at pixel x and is represented by Operation implementation Filtering of the output results after the operation;
[0145] I c represents one of the R, G, and B channels of the input image, and
[0146] MDCV represents the mean value of the dark channel;
[0147] S43. Construct a Score evaluation function based on the average value of the dark channel, and score the detection results output by the YOLOv4 neural network and the ANYOLOv4 neural network respectively, and finally obtain the evaluation results of the ordinary image and the complex image respectively.
[0148] The Score evaluation function includes a common image evaluation function and a complex image evaluation function;
[0149] The formula of the common image evaluation function is:
[0150]
[0151] The formula of the complex image evaluation function is:
[0152]
[0153] In the formula, confidence represents the confidence of all detection targets output by the ordinary image detection module,
[0154] n represents the total number of targets detected by the common image detection module;
[0155] confidence' represents the confidence of all detected targets output by the complex image detection module, and
[0156]
[0157] m represents the total number of targets detected by the complex image detection module;
[0158] MDCV represents the mean dark channel of the input image.
[0159] In addition, the present invention analyzes and compares Score s 、Score m 、Score sd The effects of three network scoring functions.
[0160] Score s The scoring function is expressed as:
[0161]
[0162] Score m The scoring function is expressed as:
[0163]
[0164] Where confidence represents the confidence of all detection targets output by the ordinary image (complex image) detection module, and
[0165] n represents the total number of targets detected by the common image (complex image) detection module;
[0166] confidence i Represents the confidence of the i-th target detected by the ordinary image (complex image) detection module;
[0167] α s , α m is a parameter, and α s ∈(0,1],α m ∈(0,1].
[0168] The Score compared by this invention s 、Score m In the scoring function, since there is a parameter α that can be manually adjusted in the function expression s and α m , let's first explore α s and α m The impact of numerical changes on the detection accuracy of the SAYOLO algorithm. s and α m The impact of the numerical change on the detection accuracy of the SAYOLO algorithm is as follows Figure 8-9 shown.
[0169] Figure 8 and Figure 9 Medium α s and α m The numerical change of the parameter acts on the scoring process of the complex image detection module. For the scoring process of the ordinary image detection module, αs and α m The value of this parameter is always 1. Figure 8 and Figure 9 It shows that by introducing the twin network architecture and Score s 、Score m Scoring function can effectively improve the target detection accuracy of the target detection algorithm in complex environments. Compared with the original YOLOv4 algorithm, the Score s and Score m The scoring function can maximize the detection accuracy of the algorithm in complex environments by 8.98% and 6.49% respectively.
[0170] According to the dark channel mean characteristics of the input image and Score s Scoring function, the present invention proposes Score sd Scoring function. Table 5 shows the test results of the SAYOLO algorithm using different scoring functions on the complex environment dataset.
[0171] The results show that using Score s and Score m The scoring function can effectively improve the detection accuracy of the target detection algorithm for complex environment images. By introducing the dark channel features of the input image into the scoring function of the SAYOLO algorithm, the recognition accuracy of the SAYOLO algorithm for complex images can be further improved. sd As the scoring function, the network structure of ANYOLOv4_3 is adopted as the network structure of ANYOLO. Compared with the YOLOv4 algorithm, the detection accuracy evaluation index of the SAYOLO algorithm can be improved by 10.34% in complex environment data sets.
[0172] Table 5: Test results of the SAYOLO algorithm using different scoring functions
[0173]
[0174] Figure 10 The figure shows the detection performance of the YOLOv4 and SAYOLO algorithms in complex environments. As can be seen from the figure, under conditions of low external environmental interference, both the YOLOv4 and SAYOLO algorithms can effectively detect target objects. As external environmental interference increases, although the detection capabilities of both the YOLOv4 and SAYOLO algorithms decrease, the SAYOLO algorithm's detection capability for complex targets remains higher than that of the YOLOv4 algorithm, and the SAYOLO algorithm can achieve higher detection accuracy for target objects in complex environments.
[0175] S5. Select the evaluation result with a high value and output the corresponding detection result.
[0176] The SAYOLO algorithm in the present invention is used to compare the application effects of target detection algorithms in commonly used complex environments. The detection effects of the image enhancement algorithms (MSBDN-DFF, Zero DCE, Dark Channel Prior) commonly used in complex environments at this stage are compared with the SAYOLO algorithm. The experimental results are shown in Table 6.
[0177] Table 6: Comparison of detection performance between the SAYOLO algorithm and the target detection algorithm based on image preprocessing in complex environments
[0178]
[0179] Results show that when a single image enhancement algorithm is combined with the YOLOv4 object detection algorithm, the YOLOv4 algorithm, trained on the VOC dataset, achieves high detection accuracy. However, the best algorithm still differs from the SAYOLO algorithm by 1.03% in terms of mAP@50. If an image dehazing algorithm is combined with an image light adjustment algorithm (such as MSBDN-DFF+Zero DCE+YOLOv4 or Dark Channel Prior+Zero DCE+YOLOv4), the different image enhancement algorithms are not well compatible, which may lead to a decrease in object detection accuracy. Furthermore, because image enhancement algorithms typically target a single type of environmental variation, they lack robustness to the diverse complex environments encountered in practical applications. The SAYOLO algorithm, on the other hand, does not require a specific image enhancement algorithm or modifications to the network structure due to environmental changes, making it highly robust to diverse complex environments.
[0180] In summary, with the help of the above technical scheme of the present invention, an Attention neck YOLOv4 (ANYOLOv4) complex image detection module is proposed based on the YOLOv4 algorithm and the CBAM attention mechanism module, and a Siamese Attention YOLO (SAYOLO) algorithm is proposed based on the ANYOLOv4 algorithm, a twin network architecture and a specially designed network scoring module, which effectively improves the robustness of the target detection algorithm based on image preprocessing for target detection in complex environments. Compared with the target detection algorithms based on image preprocessing, the SAYOLO algorithm constructed by the present invention has a mAP@50 that is 10.34%, 11.51%, 23.14% and 1.03% higher than the YOLOv4 algorithm, MSBDN-DFF+YOLOv4 algorithm, ZeroDCE+YOLOv4 algorithm and Dark Channel Prior+YOLOv4 algorithm trained on the complex environment dataset, respectively. Compared with the target detection algorithms based on image preprocessing in complex environments, the SAYOLO algorithm has higher detection accuracy and is more robust to a variety of different environmental changes.
[0181] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A high-precision target detection method for complex environments, characterized in that: The method comprises the following steps: S1, dividing the image to be detected into ordinary images and complex images and inputting them separately; S2. Detect the normal image using the YOLOv4 neural network in the SAYOLO algorithm and output the normal image detection result; S3, using the ANYOLOv4 neural network in the SAYOLO algorithm to detect the complex image and output the complex image detection result; The ANYOLOv4 neural network adds a CBAM attention module to the PANet structure of the YOLOv4 neural network; wherein the CBAM attention module includes a channel attention mechanism and a spatial attention mechanism; The ANYOLOv4 neural network and the YOLOv4 neural network use non-shared network weights; S4, using the Score evaluation function to evaluate the ordinary image detection result and the complex image detection image respectively, and outputting their respective evaluation results; The step of using the Score evaluation function to evaluate the ordinary image detection result and the complex image detection image respectively and outputting the respective evaluation results includes the following steps: S41, calculating the dark channel values of the ordinary image and the complex image as input images, the formula is: S42. Calculate the average value of the dark channel using the formula: Where D represents the dark channel of the input image, and I represents the input image, and w represents the width of the input image; h represents the height of the input image; y∈Ω(x) represents a window centered at pixel x and is represented by Operation implementation Filtering of the output results after the operation; I c represents one of the R, G, and B channels of the input image, and MDCV represents the mean value of the dark channel; S43. Constructing a Score evaluation function based on the average value of the dark channel, and scoring the detection results output by the YOLOv4 neural network and the ANYOLOv4 neural network respectively, and finally obtaining evaluation results of the ordinary image and the complex image respectively; The Score evaluation function includes a common image evaluation function and a complex image evaluation function; The formula of the common image evaluation function is: The formula of the complex image evaluation function is: Where confidence represents the confidence of all detection targets output by the common image detection module. n represents the total number of targets detected by the common image detection module; confidence' represents the confidence of all detected targets output by the complex image detection module, and m represents the total number of targets detected by the complex image detection module; MDCV represents the mean of the dark channel of the input image; S5. Select the evaluation result with a high value and output the corresponding detection result.
2. The high-precision target detection method for complex environments according to claim 1, characterized in that: The detecting of the ordinary image by using the YOLOv4 neural network in the SAYOLO algorithm and outputting the ordinary image detection result comprises the following steps: S21, resizing the normal image to an appropriate size and inputting the image into a YOLOv4 neural network; S22, the YOLOv4 neural network extracts features from the ordinary image and outputs detection information of the target; S23. Filter the redundant detection information using a non-maximum suppression method to obtain final target detection information as a normal image detection result.
3. The high-precision target detection method for complex environments according to claim 2, characterized in that: The detection information is a three-dimensional tensor of S×S×(B×5+C); Wherein, S×S represents the number of grids that the ordinary image needs to be divided into; B×5 represents the number of bounding boxes that need to be predicted in each grid and the bounding box information of x, y, w, h, and confidence included in each predicted bounding box; x,y represents the coordinates of the center point of the predicted bounding box in the grid; w,h represent the width and height information of the predicted bounding box respectively; Confidence indicates the probability that the predicted bounding box contains an object; C represents the number of object categories that need to be classified.
4. The high-precision target detection method for complex environments according to claim 3, characterized in that: The network structure of the YOLOv4 neural network includes five operational structural units and three main functional parts; Among them, the operation structure unit includes a CBM operation unit, a CBL operation unit, a Res Unit operation unit, a CSP×N operation unit, an SPP operation unit and a YOLO Head operation unit, and the main functional part includes a CSPDarknet53 module, an SPP+PANet module and a Head module.
5. The high-precision target detection method for complex environments according to claim 4, characterized in that: The CBM operation unit is composed of a convolutional layer, a batch normalization layer, and a Mish activation function layer in sequence; The CBL operation unit is composed of a convolutional layer, a batch normalization layer, and a Leaky ReLu activation function layer in sequence; The Res Unit operation unit divides the input features into two branches, one branch performs CBM processing on the input features twice, and the other branch keeps the input features unchanged, and then adds the input features of the two branches; The CSP×N operation unit performs a CBM process on the input features and then divides them into two branches. One branch first performs a CBM process on the input features, then performs N Res Unit processes on the input features, and finally performs a CBM process on the input features again. The other branch only performs a CBM process on the input features, then performs a splicing operation on the input features of the two branches, and finally performs a CBM process on the spliced input features. The SPP operation unit divides the input features into 4 branches, and performs 1×1, 5×5, 9×9 and 13×13 maximum pooling operations on each branch respectively, and concatenates the features of the 4 branches; The YOLO Head operation unit performs CBM operation and convolution operation on the input features.
6. The high-precision target detection method for complex environments according to claim 5, characterized in that: The CSPDarknet53 module is used to extract input feature information of the image, and is composed of the CBM operation unit and the CSP×N operation unit; The SPP+PANet module is the Neck structure of the YOLOv4 neural network, which is used to perform feature fusion on the extracted input features, that is, to achieve the fusion of features at different levels through SPP, upsampling operation, splicing operation, and CBL operation; The Head module is used to predict the feature information output by the YOLOv4 neural network.
Citation Information
Patent Citations
Fluorescent water-solvated conjugated polymers
CN109661439A
Deep learning-based remote sensing image ship target detection method
CN115272876A