Infrared moving target detection system based on improved YOLOv8
By improving the YOLOv8 model, combining optical flow processing and dual-input processing modules, and fusing multi-frame motion information and original frame information, the problem of false alarms and missed detections under complex backgrounds in infrared moving target detection is solved, and efficient and accurate infrared detection is achieved. Small object detection.
Patent Information
- Application Number
- CN202410669458.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-28
AI Technical Summary
Existing infrared moving target detection systems are difficult to efficiently and accurately detect small objects in complex backgrounds, especially due to the limitations of single-frame detection methods and the reliance of multi-frame detection methods on image feature extraction, resulting in high false alarm and missed detection rates. , and the YOLOv8 model has false detections and missed detections when identifying small objects.
Using the improved YOLOv8 model, combined with the optical flow processing module and the dual-input processing module, the optical flow processing module is controlled by detection confidence, and the improved Horn-Schunck method and CBAM_α attention mechanism are used in the target detection module to integrate multiple Frame motion information and original frame information to improve detection performance.
It achieves efficient and accurate detection of infrared moving small objects, reduces the false alarm rate and missed detection rate, ensures detection performance and real-time performance, and enhances the model's robustness and computational efficiency through feature fusion and attention mechanisms.
Smart Images

Figure CN118608995A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine vision and target detection, and in particular relates to an infrared moving target detection system based on improved YOLOv8. Background Art
[0002] In the field of aircraft target detection, the detection of infrared moving small objects faces great challenges. Such objects usually occupy only a small number of pixels in infrared images, resulting in limited feature information, large feature loss, low recognition accuracy, and various challenges in single-frame detection. At present, infrared small target detection methods can be mainly divided into two categories: single-frame detection methods and multi-frame detection methods. Single-frame detection methods are applicable to many situations and are currently the mainstream method type. They use a single image for target detection. Among single-frame detection methods, they can generally be divided into three categories. The first category is morphology-based methods, and the second category is filter-based methods. These two methods have high computational efficiency, but it is difficult to find suitable templates or filters for different scenes. The third category is based on outliers. This method regards small targets as outliers in the saliency map, generates the saliency map of the infrared image through different technologies, and then filters out small targets as outliers from the saliency map through a certain threshold or rule. These methods still have a high false alarm rate under point-like background features and noise interference.
[0003] Therefore, multi-frame detection methods have been widely studied. Multi-frame detection methods use multi-frame images for detection and achieve target detection by extracting the target's motion spatiotemporal information from continuous frames. They are mainly suitable for scenes with moving targets. Multi-frame detection algorithms rely heavily on image feature extraction. When the results of image feature extraction fail to meet expectations, or when the target is stationary, the real target may be mistakenly regarded as the background and missed or misjudged, thereby reducing the stability of the system.
[0004] Choosing the right target detection algorithm for a specific scenario is crucial for the proper processing of input data. In recent years, convolutional neural networks (CNNs) have made many breakthroughs in the field of computer vision. Compared with traditional methods, such methods have great advantages in detection accuracy and robustness. Detection algorithms based on CNNs have superior computing performance compared to traditional algorithms, but due to the large amount of computation, they are difficult to deploy in real time on UAV platforms. The You Only Look Once (YOLO) model is a (CNN) target detection model that has developed into a basic real-time target detection model in the fields of robots, autonomous vehicles, and video surveillance. At present, the YOLOv8 model has become the dominant target detection algorithm in the YOLO model due to its significant advantages such as fast speed, simplicity, and multi-scale detection. However, the detection accuracy of the YOLO model is affected by the quality of the input image, which limits its ability to identify small objects. In addition, YOLOv8 is a single-frame detection method, which is prone to detection failure when facing targets with fast motion relative to complex backgrounds.
[0005] Due to the characteristics of infrared objects such as small pixels, fast movement speed, and complex background, the YOLOv8 model may have false detection or missed detection in infrared object detection. First, a single input cannot carry motion information, which may lead to a decrease in the object detection performance of large moving objects. Second, in complex backgrounds, the model may not be able to fully focus on the information of small objects. Third, in complex backgrounds, the interference level of similar small objects is high, which increases the possibility of false detection. In addition, small and dark objects move a long distance, which easily leads to missed detection. Finally, the characteristics of infrared moving small objects are greatly affected by scene factors such as illumination and temperature, which may cause large changes in characteristics in the same scene and different detection difficulties. In recent years, researchers have proposed various improved YOLOv8 models to solve the challenges of infrared moving target detection. In summary, there are generally several aspects. The first is the innovation of the target detection model structure, including the use of multiple networks and the increase and decrease of detection heads; the second is the replacement and modification of modules such as attention mechanism and convolution kernel; and finally, it also includes innovations in loss function, training method, hyperparameter setting, etc. In addition, research has also been gradually carried out in the aspects of fast training, lightweight, and input type of the model. However, existing methods do not consider using more reasonable multi-input combinations to ensure that the target detection model maintains good detection performance while ensuring real-time efficiency. Moreover, the effective fusion of multi-frame motion information and original frame information, as well as the robustness of the model after feature extraction failure, have not been fully considered.
[0006] At the same time, considering the limitations of single-frame detection methods, researchers use continuous frames to extract effective spatiotemporal information to improve the accuracy and efficiency of object recognition. Representatively, Guimin J et al. use inertial navigation information to perform image registration between continuous frames, which can suppress background pixels and highlight moving targets; Yi X et al. use adaptive local contrast modules and temporal correlation modules after visual saliency modules to detect infrared small targets; Zhang W et al. combine target motion features extracted from multiple frames by Kalman filtering with saliency maps, Zhao F et al. use optical flow method and spatiotemporal consistency of trajectory points to detect infrared small targets; Kwan C et al. use motion features extracted from multiple frames by optical flow to enhance the detection performance of moving small targets. The above studies all use background suppression or optical flow methods to process multi-frame images. Although the input of the object detection network includes motion information, the object information of the original frame may be lost. For complex backgrounds, the above detection models may mistakenly identify backgrounds with significant motion as objects. Li D et al. Image registration is used to extract multi-frame motion information, which is then used together with the original image as input data for infrared object detection. However, the original frame is fed to the object detection network together with the background suppressed image, and the use of additional input data may cause computational waste when the original frame alone can achieve satisfactory detection results. However, existing methods do not consider using a more reasonable dual-input combination to ensure that the object detection model maintains excellent detection performance while ensuring real-time efficiency. Moreover, the effective fusion of multi-frame motion information and original frame information, as well as the model robustness after the background suppression or optical flow method fails, have not been fully considered. Summary of the invention
[0007] To solve the above problems, the present invention provides an infrared motion target detection system based on improved YOLOv8, in which a dual-input processing module decides whether to enable an optical flow processing module for the next frame according to the detection confidence values output by the previous frame and the current frame; according to the decision, the dual-input processing module processes the current frame and the optical flow processed image respectively, so that the information obtained from multiple input ends can be thoroughly integrated and effectively utilized, the detection performance of the target detection model is effectively improved, and efficient and accurate detection of infrared moving small objects is achieved.
[0008] An infrared moving target detection system based on improved YOLOv8, comprising an optical flow processing module, a dual-input processing module, a target detection module, and an output module;
[0009] The optical flow processing module is used to process the received previous frame infrared image and current frame infrared image using the improved Horn-Schunck method to obtain an optical flow processed image when the detection confidence of the current iteration output by the output module is less than a set threshold;
[0010] The dual-input processing module is used to extract features from the received image to obtain a fused feature map; wherein, when the detection confidence output by the output module is less than a set threshold, the image received by the dual-input processing module is the optical flow processed image and the current frame infrared image; when the detection confidence of the current iteration output by the output module is not less than the set threshold, the image received by the dual-input processing module is only the current frame infrared image;
[0011] The target detection module is used to detect the infrared moving target and the detection confidence of the infrared moving target in the infrared image of the current frame according to the aggregated feature map;
[0012] The output module is used to use the average of the detection confidence corresponding to the current frame infrared image and the detection confidence corresponding to the previous frame infrared image as the detection confidence of the next iteration.
[0013] Furthermore, the optical flow processing module uses the improved Horn-Schunck method to process the received previous infrared image and the current infrared image, and obtains the optical flow processed image as follows:
[0014] The same convolution is used to perform convolution operations on the grayscale image of the previous frame of infrared image and the grayscale image of the current frame of infrared image, and the convolution results corresponding to the two frames of infrared images are fused to obtain a first convolution grayscale image;
[0015] Two opposite convolutions are used to perform convolution operations on the grayscale image of the previous frame of infrared image and the grayscale image of the current frame of infrared image respectively, and the convolution results corresponding to the two frames of infrared images are fused to obtain a second convolution grayscale image;
[0016] Give the initial velocity component u of the optical flow in the u direction (0) and the initial velocity component v of the optical flow in the v direction (0) Set initial value;
[0017] The initial velocity component u of the optical flow (0) and the initial velocity component v of the optical flow (0) After a set number of iterations as the initial value of the following iterative formula of the optical flow equation, the optical flow velocity component u is obtained. * and the optical flow velocity component v * :
[0018]
[0019]
[0020] Where k represents the number of iterations, I x Represents the partial derivative of the image grayscale pixel (x, y) on the x-axis on the first convolution grayscale image, I yRepresents the partial derivative of the image grayscale pixel (x, y) on y in the first convolution grayscale image, I t represents the partial derivative of the image grayscale pixel (x, y) on the second convolution grayscale image with respect to t, λ represents the optical flow constant that controls the smoothness of the optical flow field, ρ represents the momentum constant, It represents the local average optical flow velocity of the current pixel point in the neighborhood set in the u direction obtained in the kth iteration. represents the local average optical flow velocity of the current pixel point in the neighborhood in the v direction obtained by the kth iteration, u (k-1) 、u k 、u (k+1) They represent the optical flow velocity components in the u direction obtained by the k-1th, kth, and k+1th iterations, respectively. (k-1) 、v (k) 、v (k+1) They represent the optical flow velocity components in the v direction obtained by the k-1th, kth, and k+1th iterations respectively, ω1(x, y) and ω2(x, y) represent the first weight and the second weight respectively, and there are:
[0021]
[0022] Among them, α1 is the weight for suppressing the size of the optical flow vector, α2 is the ratio of adjusting the optical flow equation constraint and the smoothness constraint, and T is the set threshold;
[0023] The optical flow velocity component u at each pixel * and the optical flow velocity component v * The optical flow field is formed, and the optical flow processed image is obtained after the required visualization processing.
[0024] Furthermore, let α1=α2, then simplify the first weight ω1(x, y) and the second weight ω2(x, y) to the following piecewise function ω(x, y):
[0025]
[0026] Among them, k' is the slope related to the values of α1 and α2.
[0027] Further, the dual-input processing module includes a first Focus submodule, a second Focus submodule, a maximum pooling layer Maxpool, an average pooling layer Avgpool, a first Concat submodule, a second Concat submodule, a first CBS convolution submodule, and a second CBS convolution submodule;
[0028] When the detection confidence output by the output module is less than the set threshold, the first Focus submodule operates on the infrared image of the current frame to obtain the first Focus feature map; the second Focus submodule operates on the optical flow processed image to obtain the second Focus feature map; the second Focus feature map is respectively subjected to the maximum pooling layer Maxpool and the average pooling layer Avgpool for pooling operations, and the first pooling feature map and the second pooling feature map are correspondingly obtained; the second Focus feature map, the first pooling feature map, and the second pooling feature map are superimposed by the second Concat submodule to obtain the optical flow feature map; the optical flow feature map is subjected to feature fusion by the second CBS convolution submodule to obtain the optical flow fusion feature map; the first Focus feature map and the optical flow fusion feature map are superimposed by the first Concat submodule to obtain the intermediate fusion feature map; the intermediate fusion feature map is subjected to feature fusion by the first CBS convolution submodule to obtain the final fusion feature map;
[0029] When the detection confidence of the current iteration output by the output module is not less than the set threshold, the current frame infrared image is directly used as the final fusion feature map.
[0030] Further, the target detection module is an improved YOLOv8 network model, and the improved YOLOv8 network model includes a Backbone subnetwork, a Neck subnetwork, and a Head subnetwork; wherein the C2f module in the Neck subnetwork is connected to the Upsample module through a CBAM_α module, the C2f module is connected to the CBS module through a CBAM_α module, and at the same time, the SPPF module in the Backbone subnetwork is connected to the first Upsample module in the Neck subnetwork through a CBAM_α module;
[0031] The CBAM_α module includes a channel attention module, a spatial attention module, a first CBS module and a second CBS module; after the aggregated feature map F passes through the channel attention module and the spatial attention module respectively, the corresponding channel attention feature map M is obtained. c (F) and spatial attention feature map M s (F); Channel attention feature map M c (F) and spatial attention feature map M s (F) is multiplied element by element with the aggregate feature map F, and the corresponding channel attention intermediate feature map is obtained. and spatial attention intermediate feature map and After feature fusion through the first CBS module and the second CBS module respectively, they are multiplied element by element with the aggregated feature map F to obtain the output feature map output to the next level module.
[0032] Furthermore, the target detection module is an improved YOLOv8 network model, and the improved YOLOv8 network model includes a Backbone subnetwork, a Neck subnetwork, and a Head subnetwork;
[0033] The Neck subnetwork includes a cascaded CBAM_α module I, an Upsample module I, a Concat module I, a C2f module I, a CBAM_α module II, an Upsample module II, a Concat module II, a C2f module II, a CBAM_α module III, an Upsample module III, a Concat module III, a C2f module III, a CBAM_α module IV, a CBS module I, a Concat module IV, a C2f module IV, a CBAM_α module V, a CBS module II, a Concat module V, and a C2f module V;
[0034] Among them, the output of C2f module I is also connected to the input of Concat module V; the output of C2f module II is also connected to the input of Concat module IV; the output of C2f module III is also used as the input of the first level DetectI of the Head subnetwork; the output of C2f module IV is also used as the input of the second level DetectⅡ of the Head subnetwork; the output of C2f module V is also used as the input of the third level DetectⅢ of the Head subnetwork, wherein the feature map sizes of the three levels are different;
[0035] The Backbone sub-network includes a first-level CBS module, a first-level C2f module, a second-level CBS module, a second-level C2f module, a third-level CBS module, a third-level C2f module, a fourth-level CBS module, a fourth-level C2f module, and an SPPF module connected in sequence;
[0036] Among them, the output of the first-level C2f module of the Backbone subnetwork is also connected to the input of the Concat module III, the output of the second-level C2f module is also connected to the input of the Concat module II, the output of the third-level C2f module is also connected to the input of the Concat module I, and the output of the SPPF module is connected to the input of the CBAM_α module I.
[0037] Furthermore, the WIoU v3 function is adopted as the bounding box regression loss function for training the improved YOLOv8 network model.
[0038] Beneficial effects:
[0039] 1. The present invention provides an infrared motion target detection system based on improved YOLOv8, and proposes a dual-input target detection model, wherein the input can be divided into single input and multiple input, wherein the multiple input includes motion information and original frame information at the same time; specifically, the dual-input processing module uses the detection confidence to control whether the optical flow processing module is turned on or not, and effectively fuses the features from the main input and the sub-input together, and the dual-input processing module replaces the input of the YOLOv8 model, so that the main and sub-inputs can be efficiently fused together, avoiding the use of two YOLO networks to process features, and only one YOLO network can be used after fusion; furthermore, the present invention uses the detection confidence to control whether the sub-input is turned on or not, when the detection confidence is high, only a single input can complete the detection task well, so that the intervention of the sub-input is not required, and the computing power can be saved to the greatest extent and the real-time performance of the detection can be guaranteed; when the detection confidence is low, the sub-input assists the main input in target detection, so that the detection performance can be guaranteed, so that the present invention can stably and quickly process the detection of small infrared objects that move rapidly under complex backgrounds.
[0040] 2. The present invention provides an infrared motion target detection system based on improved YOLOv8, wherein dual inputs have different image features, wherein the main input is the current frame as the original image, which contains a large number of pixels required for object positioning, but also contains noise pixels and a large number of complex background pixels; the sub-input is an optical flow processed image, and the larger part of the optical flow vector in the optical flow processed image represents the position of the object; since the features of the main input and the sub-input are different, the present invention uses different feature extraction methods to respectively extract features of multiple input images to ensure full mining and utilization of information.
[0041] 3. The present invention provides an infrared motion target detection system based on improved YOLOv8, which adopts the method of adding momentum term ρ to speed up the calculation speed of optical flow field, which can shorten the convergence time and ensure the high stability of optical flow field; in addition, the weight function set by the present invention can suppress the optical flow calculation of background pixels, thereby reducing the overall calculation burden.
[0042] 4. The present invention provides an infrared motion target detection system based on improved YOLOv8. The Concat operation in the dual-input processing module only superimposes the features of the dual inputs in channels, so that the features of the two inputs can remain independent in the channel direction. Even when the secondary input fails, the features of the secondary input will not contaminate the features of the main input, thereby increasing the stability of the algorithm.
[0043] 5. The present invention provides an infrared motion target detection system based on improved YOLOv8, which replaces the "cascade connection" of traditional CBAM with "parallel connection" to improve the serial attention module of CBAM, so that the two attention modules of the present invention directly learn the original input feature map, reducing the impact that may be caused by the disadvantages in the original input feature map, without paying attention to the spatial and channel attention order.
[0044] 6. The present invention provides an infrared motion target detection system based on improved YOLOv8. After the channel attention and spatial attention are respectively multiplied element by element with the original features and then undergo a convolution operation, it can more effectively extract and convert features and enhance the learning and generalization capabilities of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 The dual-input YOLOv8 algorithm flow chart provided by the present invention;
[0046] Figure 2 The dual-input YOLOv8 model diagram provided by the present invention;
[0047] Figure 3 A flow chart of a dual-input processing module provided by the present invention;
[0048] Figure 4 A network diagram of a dual-input YOLOv8 model provided by the present invention;
[0049] Figure 5 This is the structure diagram of the traditional attention mechanism CBAM;
[0050] Figure 6 It is the channel attention structure diagram;
[0051] Figure 7 This is the spatial attention structure diagram;
[0052] Figure 8 The structure diagram of the attention mechanism CBAM_α provided by the present invention;
[0053] Fig. 9 Schematic diagram of the visualization results of the ISD dataset and Anti-UAV dataset provided by the present invention. DETAILED DESCRIPTION
[0054] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0055] Various CNN models have made significant progress in the field of target detection. These methods can be roughly divided into two structural groups: two-stage methods and end-to-end methods. The former includes Region-CNN (R-CNN), Faster-RCNN and Cascade R-CNN, and the latter includes SSD, Retinanet, YOLO, Yolov3 and Fcos. The two-stage method can achieve higher accuracy than the end-to-end method, but the calculation speed is slower. At the same time, the end-to-end method has computational advantages, but at the cost of detection performance. The end-to-end method is suitable for the target detection module of the aircraft.
[0056] The YOLO algorithm has undergone several extensive enhancements, especially with the introduction of the YOLOv8 model. YOLOv8 is the latest version of the YOLO model family, which can achieve a significant balance between detection accuracy and efficiency. Infrared small targets are characterized by small size, low brightness, blurred shape, and fast movement compared to complex backgrounds. In infrared target detection, the main improvements of the YOLO model mainly involve the attention mechanism, small object detection structure, and loss function. This can significantly improve the discrimination of infrared small objects and backgrounds and the model's attention to moving objects.
[0057] In view of the problems existing in the prior art, the present invention takes the YOLO series as the research target and selects Yolov8s as the baseline model. The present invention optimizes the model in terms of loss function, attention mechanism, and small object detection layer. And proposes an infrared motion target detection network and detection system based on improved YOLOv8.
[0058] Specifically, Figure 1 and Figure 2 As shown, an infrared moving target detection system based on improved YOLOv8 includes an optical flow processing module, a dual-input processing module, a target detection module, and an output module;
[0059] The optical flow processing module is used to process the received previous frame infrared image and current frame infrared image using the improved Horn-Schunck method to obtain an optical flow processed image when the detection confidence of the current iteration output by the output module is less than a set threshold;
[0060] The dual-input processing module is used to extract features from the received image to obtain a fused feature map; wherein, when the detection confidence output by the output module is less than a set threshold, the image received by the dual-input processing module is the optical flow processed image and the current frame infrared image; when the detection confidence of the current iteration output by the output module is not less than the set threshold, the image received by the dual-input processing module is only the current frame infrared image;
[0061] The target detection module is used to detect the infrared moving target and the detection confidence of the infrared moving target in the current frame infrared image according to the fusion feature map;
[0062] The output module is used to output the detection confidence corresponding to the current frame infrared image The detection confidence corresponding to the previous infrared image frame The mean of is used as the detection confidence of the next iteration.
[0063] That is to say, the present invention compares the detection confidence mean with the corresponding predefined detection confidence threshold, such as the threshold value set to 0.5, and determines whether the optical flow processing module is activated according to the comparison result. In other words, the dual-input processing module uses the detection confidence to control whether the optical flow processing module is turned on or not, and effectively fuses the features from the main input and the secondary input together. The dual-input processing module replaces the input of the YOLOv8 model. The advantages of doing so are: ① The main and secondary inputs are efficiently fused together, avoiding the use of two YOLO networks to process features, and a YOLO network can be used after fusion; ② The detection confidence is used to control whether the secondary input is turned on or not. When the detection confidence is high, only a single input can complete the detection task well, so that the intervention of the secondary input is not required, which can save computing power and ensure the real-time performance of the detection. When the detection confidence is low, the secondary input assists the main input in target detection, so that the detection performance can be guaranteed. ③ Such a design makes the target detection model form a closed loop, and the model can be controlled to be in a single input / dual input state by adjusting the detection confidence threshold.
[0064] It should be noted that the iterative equation of the traditional Horn-Schunck method is
[0065]
[0066] The optical flow calculated by the traditional HS method may be unreasonable at some points. In the field of view of an aircraft, there are very few pixels of small infrared objects, and the outline of the moving object area is relatively blurred. The HS method requires a certain number of iterations to meet the accuracy requirements, which not only reduces the calculation efficiency, but also increases the interference of complex backgrounds. This patent improves the iterative equation of the HS method and introduces a pyramid calculation method.
[0067] Specifically, the optical flow processing module of the present invention uses the improved Horn-Schunck method to process the received previous frame infrared image and the current frame infrared image, and obtains the optical flow processed image specifically as follows:
[0068] The initial velocity component u of the optical flow in the u direction (0) and the initial velocity component v of the optical flow in the v direction (0)Generally, the initial value is set to 0 or according to the experimental requirements;
[0069] The same convolution is used to perform convolution operations on the grayscale image of the previous frame of infrared image and the grayscale image of the current frame of infrared image, and the convolution results corresponding to the two frames of infrared images are fused to obtain a first convolution grayscale image;
[0070] Two opposite convolutions are used to perform convolution operations on the grayscale image of the previous frame of infrared image and the grayscale image of the current frame of infrared image respectively, and the convolution results corresponding to the two frames of infrared images are fused to obtain a second convolution grayscale image;
[0071] Give the initial velocity component u of the optical flow in the u direction (0) and the initial velocity component v of the optical flow in the v direction (0) Set initial value;
[0072] The initial velocity component u of the optical flow (0) and the initial velocity component v of the optical flow (0) After a set number of iterations as the initial value of the following iterative formula of the optical flow equation, the optical flow velocity component u is obtained. * and the optical flow velocity component v * :
[0073]
[0074] Where k represents the number of iterations, I x Represents the partial derivative of the image grayscale pixel (x, y) on the x-axis on the first convolution grayscale image, I y Represents the partial derivative of the image grayscale pixel (x, y) on y in the first convolution grayscale image, I t represents the partial derivative of the image grayscale pixel (x, y) on the second convolution grayscale image with respect to t, λ represents the optical flow constant that controls the smoothness of the optical flow field, ρ represents the momentum constant, It represents the local average optical flow velocity of the current pixel point in the neighborhood set in the u direction obtained in the kth iteration. represents the local average optical flow velocity of the current pixel point in the neighborhood in the v direction obtained by the kth iteration, u (k-1) 、u k 、u (k+1) They represent the optical flow velocity components in the u direction obtained by the k-1th, kth, and k+1th iterations, respectively. (k-1) 、v (k) 、v (k+1) They represent the optical flow velocity components in the v direction obtained by the k-1th, kth, and k+1th iterations respectively, ω1(x, y) and ω2(x, y) represent the first weight and the second weight respectively, and there are:
[0075]
[0076] Among them, α1 is the weight for suppressing the size of the optical flow vector, α2 is the ratio of adjusting the optical flow equation constraint and the smoothness constraint, α1 and α2 are generally greater than 20, and T is the set threshold;
[0077] The optical flow velocity component u at each pixel * and the optical flow velocity component v * The optical flow field is formed, and the optical flow processed image is obtained after visualization.
[0078] Furthermore, for the convenience of calculation, the present invention designs an approximate piecewise function to replace the power function. Let α1=α2, then the first weight ω1(x, y) and the second weight ω2(x, y) are simplified to the following piecewise function ω(x, y):
[0079]
[0080] Among them, k' is a slope related to the values of α1 and α2. By setting different k' parameter values, some pixels can be excluded from the iterative calculation of the HS method and their optical flow vectors can be suppressed.
[0081] It should be noted that for the improved Horn-Schunck method, the hyperparameters are set as follows:
[0082] 1. α1, α2 and k′ are parameters of the weight function. The present invention recommends setting the value range of parameters α1 and α2 to [20, 80]. The larger the values of α1 and α2, the fewer the number of iterative calculations. The parameter k′ can be adjusted according to specific experimental needs. The recommended combination of α1, α2 and k′ is (20, 0.8) or (30, 0.9).
[0083] 2. The general setting of T value depends on the spatial variation of pixel values, illumination variation and specific scene. For scenes with large target motion or objects hovering near the edge of the image, the recommended range is [15,30]. For scenes with small target motion, the recommended range is [5,15].
[0084] 3. The momentum constant ρ should be in the range [0,1] and is recommended not to exceed 0.8 to obtain a stable optical flow field and reduce the number of iterations.
[0085] 4. The optical flow constant λ controls the smoothness of the optical flow field. The larger the λ, the smoother the flow field, while the smaller the λ, the more subtle the flow field changes. The choice of the λ value is affected by the data characteristics and the application scenario. For scenes with complex backgrounds, high noise, small objects, large object motion, low image resolution, and low brightness, the λ value should be in the range of [50,500]. For different datasets, the value of λ can be adjusted from zero.
[0086] 5. According to many experimental results, the optimal number of iterations is in the range of [10,50] or fixed at 30.
[0087] Furthermore, the dual inputs have different image features. The main input of the present invention is the current frame infrared image as the original image, which contains a large number of pixels required for object positioning, but also contains noise pixels and a large number of complex background pixels. The secondary input is an optical flow processed image, and the larger part of the optical flow vector in the optical flow processed image represents the position of the object. Since the features of the main input and the secondary input are different, different feature extraction methods need to be used to extract the features of multiple input images respectively to ensure full mining and utilization of information.
[0088] Specifically, the dual-input processing module of the present invention includes a first Focus submodule, a second Focus submodule, a maximum pooling layer Maxpool, an average pooling layer Avgpool, a first Concat submodule, a second Concat submodule, a first CBS convolution submodule, and a second CBS convolution submodule;
[0089] When the detection confidence output by the output module is less than the set threshold, the first Focus submodule operates on the infrared image of the current frame to obtain the first Focus feature map; the second Focus submodule operates on the optical flow processed image to obtain the second Focus feature map; the second Focus feature map is respectively subjected to the maximum pooling layer Maxpool and the average pooling layer Avgpool for pooling operations, and the first pooling feature map and the second pooling feature map are correspondingly obtained; the second Focus feature map, the first pooling feature map, and the second pooling feature map are superimposed by the second Concat submodule to obtain the optical flow feature map; the optical flow feature map is subjected to feature fusion by the second CBS convolution submodule to obtain the optical flow fusion feature map; the first Focus feature map and the optical flow fusion feature map are superimposed by the first Concat submodule to obtain the intermediate fusion feature map; the intermediate fusion feature map is subjected to feature fusion by the first CBS convolution submodule to obtain the final fusion feature map;
[0090] When the detection confidence of the current iteration output by the output module is not less than the set threshold, the current frame infrared image is directly used as the final fusion feature map.
[0091] For example, taking a single-channel image of 1×256×256 as the main input, a Focus module with a parameter of "1,32" is used to obtain a feature dimension of 32×128×128. To extract features from the optical flow processed image, a Focus module with a parameter of "1,16" is first used for preliminary feature extraction, and the extracted feature C dimension is 16×128×128. Then, a 5×5 window Maxpool maximum pooling layer and an Avgpool average pooling layer are used for processing. Finally, the features of the optical flow processed image are superimposed in the channel direction using the Concat operation, and the superimposed feature dimension is 48×128×128. Then, a CBS convolution unit is used for processing, and the superimposed features are channel-dimensionalized, and the features are 32×128×128. After that, the features of the original image of the current frame processed and the features of the optical flow image processed are superimposed through the Concat operation. The Concat operation only superimposes the features of the dual inputs in channels, which can keep the features of the two inputs independent in the channel direction. Even if the secondary input fails, the features of the secondary input will not pollute the features of the primary input, thus increasing the stability of the algorithm. The final output dimension of the dual input module is 64×128×128. The flow chart of the input processing module is as follows: Figure 3 shown.
[0092] The following is Figure 3 The modules involved are explained in the following section.
[0093] CBS is the basic convolution unit. CBS is the abbreviation of "Conv+BN+SiLU", which is composed of Conv convolution layer, BatchNormalization batch normalization layer, and SiLU activation function layer. For details of CBS structure, see Figure 4 .
[0094] The Concat operation concatenates two or more feature maps together according to the dimension to generate a larger feature map. In YOLOv8, feature maps of different layers are usually concatenated in the direction of depth (number of channels) to form a richer feature representation. This cross-layer connection can be performed at different levels, allowing the model to utilize feature information from both shallow and deep layers at the same time.
[0095] The Focus module consists of a slice operation, Concat, and CBS units. First, a slice operation is performed to slice the input image every other pixel in width and height to obtain four sub-images; secondly, a Concat operation is performed to splice the four sub-images in the channel dimension, so that the width and height information of the original image is transferred to the channel dimension, and the number of channels is increased four times; finally, a convolution operation is performed, and the spliced feature map is processed through a convolution layer to extract features. The slicing operation in Focus is similar to neighboring downsampling, which can reduce the input size while expanding the number of channels. Since the slicing operation reduces the input size, the size and number of parameters of the subsequent part of the network will also decrease. Therefore, the slicing operation in Focus can reduce the amount of computation of the entire network and speed up the process. More importantly, the slicing process will not cause the loss of input information. For details of the Focus structure, see Figure 4 .
[0096] The Maxpooling operation divides the input feature map into several rectangular regions, and then selects the maximum value from each region as the representative of the region and outputs it to the next layer. This method helps to extract significant features in the image and has a certain invariance to small changes in the input data. The Avgpooling operation calculates the average of all elements in each rectangular region and uses this average as the output. Average pooling is usually used to retain background information or reduce the size of the feature map. The main difference between the two is that Maxpooling tends to retain the strongest feature signal, while Avgpooling provides an average representation of all features in a region.
[0097] It is particularly important to note that in the present invention, the system only uses the original frame as input to detect the first frame and set The initial value of is 0.5. In order to avoid constant switching between single input and multiple inputs, the input processing module combines the confidence value of the previous frame output to enhance the stability of the system. This method not only ensures detection accuracy, but also saves computing resources, thereby reducing the time required for the model detection process.
[0098] Furthermore, the infrared moving target detection system of the present invention is an aircraft infrared moving small target detection model based on the YOLOv8s model. The dual-input YOLOv8 model uses an optical flow processing module to process multi-frame motion information and compare it with the original frame. Figure 1 The two inputs are sent to the input processing module and after processing, they are used as the input of the YOLOv8 target detection module for target detection. Figure 4 shown.
[0099] Specifically, Figure 4As shown, the target detection module of the present invention is an improved YOLOv8 network model, and the improved YOLOv8 network model includes a Backbone subnetwork, a Neck subnetwork, and a Head subnetwork;
[0100] The Neck subnetwork includes a cascaded CBAM_α module I, an Upsample module I, a Concat module I, a C2f module I, a CBAM_α module II, an Upsample module II, a Concat module II, a C2f module II, a CBAM_α module III, an Upsample module III, a Concat module III, a C2f module III, a CBAM_α module IV, a CBS module I, a Concat module IV, a C2f module IV, a CBAM_α module V, a CBS module II, a Concat module V, and a C2f module V;
[0101] Among them, the output of C2f module I is also connected to the input of Concat module V; the output of C2f module II is also connected to the input of Concat module IV; the output of C2f module III is also used as the input of the first level DetectI of the Head subnetwork; the output of C2f module IV is also used as the input of the second level DetectⅡ of the Head subnetwork; the output of C2f module V is also used as the input of the third level DetectⅢ of the Head subnetwork, wherein the feature map sizes of the three levels are different;
[0102] Each level of Detect processes the output from the Neck subnetwork and obtains the final detection result. However, each time the CBS convolution kernel passes through, the length and width of the feature map can be reduced to half of the original size. Therefore, the feature map size received by the first-level output DetectI is the largest, covering more comprehensive feature information, and the smaller the receptive field, the smaller the target can be detected. The feature map size received by the third-level output DetectⅢ is the smallest, covering more one-sided feature information, and the larger the receptive field, the larger the target can be detected. It can be seen that due to the different sizes of the received feature maps, the YOLOv8 network model can perform target detection at different scales. The third-level output DetectⅢ of the improved YOLOv8 network model of the present invention is equivalent to the second-level output DetectⅡ in the traditional YOLOv8 network model. The first-level output DetectI has the ability to detect smaller target sizes. Therefore, the detection system of the present invention can detect smaller infrared moving targets.
[0103] The Backbone sub-network includes a first-level CBS module, a first-level C2f module, a second-level CBS module, a second-level C2f module, a third-level CBS module, a third-level C2f module, a fourth-level CBS module, a fourth-level C2f module, and an SPPF module connected in sequence;
[0104] Among them, the output of the first-level C2f module of the Backbone subnetwork is also connected to the input of the Concat module III, the output of the second-level C2f module is also connected to the input of the Concat module II, the output of the third-level C2f module is also connected to the input of the Concat module I, and the output of the SPPF module is connected to the input of the CBAM_α module I.
[0105] That is, the C2f module in the Neck sub-network is connected to the Upsample module through the CBAM_α module, the C2f module is connected to the CBS module through the CBAM_α module, and at the same time, the SPPF module in the Backbone sub-network is connected to the first Upsample module in the Neck sub-network through the CBAM_α module;
[0106] It should be noted that Figure 4 The "Submodule Structure Diagram" section in the figure gives the structure of each submodule used in the model. "Upsample" is an upsampling operation, which is used to increase the resolution of the feature map, which is particularly important for improving the model's ability to detect small targets. Specifically, upsampling enlarges the size of the feature map by using an interpolation method without adding new information. In YOLOv8, this is usually achieved by using bilinear interpolation or nearest neighbor interpolation. Doing so can make the feature map more dense in space, which helps detect smaller objects.
[0107] From a structural point of view, the present invention uses a small target detection layer and a large target detection layer, which can make the target detection model more adaptable to the detection environment of infrared small targets.
[0108] It should be noted that the present invention adds an attention mechanism CBAM_α after the C2f module of the Neck subnetwork. The design idea of the attention mechanism CBAM_α comes from CBAM. CABM is a lightweight attention mechanism module that can be easily embedded in the existing popular convolutional neural network structure without any additional calculation. In order to achieve the scaling operation of the original features, it uses two pooling methods: maximum pooling and average pooling. It generates weights based on two-dimensional (channel and space) information. The existing CBAM structure is as follows Figure 5 shown.
[0109] Given an intermediate feature map F∈R C×H×W As input, CBAM sequentially infers the channel attention M c ∈R C×1×1 With spatial attention M s ∈R 1×H×W , and its calculation formula is:
[0110]
[0111] in, represents element-wise multiplication. During the multiplication, the attention value is copied accordingly. F2 is the final refined output.
[0112] The structure of channel attention is as follows Figure 6 The calculation is as follows:
[0113]
[0114] in, and denote the average pooling feature and the maximum pooling feature, respectively. The shared network consists of a multilayer perceptron (MLP) with one hidden layer. To reduce parameter overhead, the hidden activation size is set to R C / r×1×1 , where r is the reduction ratio. σ represents the sigmoid function, W0∈R C / r×C , W1∈R C×C / r Represents the weights of the MLP, the two inputs share the MLP weights W0 and W1, and the ReLU activation function is followed by W0.
[0115] The structure of spatial attention is as follows Figure 7 As shown, the calculation is as follows:
[0116]
[0117] in, and They represent the average pooling feature and the maximum pooling feature of the entire channel respectively. Then, they are connected and convolved through a standard convolutional layer to generate a 2D spatial attention map. σ represents the sigmoid function, f 7×7 Represents a convolution operation with a filter size of 7×7.
[0118] However, whether channel attention is enabled before spatial attention or spatial attention is enabled before channel attention, the weights of the lower-ranked features will be generated from the higher-ranked feature maps. To some extent, the input of the attention features at the back is affected by the previous attention mechanism, which will cause interference and make the model unstable; the present invention designs a new CBAM attention mechanism named CBAM_α. In the present invention, the original "cascade connection" is replaced with "parallel connection" to improve the serial attention module of CBAM. Therefore, both attention modules directly learn the original input feature map without paying attention to the spatial and channel attention order.
[0119] The detailed structure of CBAM_α is as follows Figure 8As shown, the CBAM_α module includes a channel attention module, a spatial attention module, a first CBS module and a second CBS module; after the aggregated feature map F passes through the channel attention module and the spatial attention module respectively, the corresponding channel attention feature map M is obtained c (F) and spatial attention feature map M s (F); Channel attention feature map M c (F) and spatial attention feature map M s (F) is multiplied element by element with the aggregate feature map F, and the corresponding channel attention intermediate feature map is obtained. and spatial attention intermediate feature map and After feature fusion through the first CBS module and the second CBS module respectively, they are multiplied element by element with the aggregated feature map F to obtain the output feature map output to the next level module.
[0120] It should be noted that the present invention will undergo a convolution operation after the channel attention and spatial attention are respectively multiplied element-by-element with the original features. This is to more effectively extract and transform features and enhance the learning and generalization capabilities of the network. The final output is then obtained after element-by-element multiplication.
[0121] It should be noted that the loss function of bounding box regression takes into account various geometric factors related to the bounding box. Generalized IoU (GIoU) is proposed by combining the concept of minimum closed area, which represents the smallest rectangular box that can enclose the predicted box and the ground truth box. Distance-IoU (DIoU) is extended from GIoU and is designed by combining the distance between the center of the predicted box and the real box. In addition, complete-IoU (CIoU) is developed on the basis of DIoU, taking into account the aspect ratio difference between the predicted box and the real box. Efficient-IoU (EIoU) is developed by replacing the aspect ratio consistency in CIoU with a separate aspect ratio consistency calculation. As the bounding box regression loss function in YOLOv8, CIoU may hinder the effective optimization of the model when the predicted box and the groundtruth box have the same aspect ratio but different width and height values; and the calculation process of CIoU is also complicated. In infrared detection tasks, the size, brightness, and distance of objects show significant changes in the field of view. The clarity and quality of images captured by infrared thermal imagers can vary greatly. In addition, most existing methods assume that the training data is of high quality and therefore focus on improving the fitting ability of the bounding box regression loss. However, indiscriminately strengthening the bounding box regression for low-quality data samples will degrade the localization performance. These shortcomings can be addressed by Wise-IoU (WIoU), which enables the bounding box regression loss to focus on anchor boxes of average quality by allocating small quality gradient gains using a focusing mechanism. WIoU can be roughly divided into three types: WIoU v1, which constructs an attention-based bounding box loss; WIoU v2 and WIoU v3, which are based on WIoU v1 and add a focusing mechanism through a gradient gain method. WIoU v3 adopts a reasonable gradient gain allocation strategy to dynamically optimize the weights of high-quality and low-quality anchor boxes in the loss, so that the model focuses on average quality samples and improves the overall performance of the model.
[0122] That is to say, the traditional YOLOv8 model uses distribution focal loss and CIoU to calculate the bounding box regression loss. However, CIoU has certain defects. First, CIoU does not consider the balance of different samples. Secondly, CIoU introduces the aspect ratio as a penalty factor in the loss function. However, if the aspect ratio of the real box and the predicted box is the same, but the width and height values are different, the penalty term cannot accurately distinguish the two boxes. Third, the CIoU formula involves the calculation of inverse trigonometric functions, which increases the overall computational cost of the model. Based on this, the present invention uses WIoU v3 as the bounding box regression loss function, and its expression is as follows:
[0123]
[0124] The elements in equation 11 are calculated using equations 12-15.
[0125]
[0126] r=β / δα β-δ (14)
[0127]
[0128] Among them, IoU measures the degree of overlap of two regions by calculating the ratio between the intersection of two regions and their union; W g and H g Represents the width and height of the minimum enclosing box formed by the real box and the predicted box; and Represent the coordinates of the center points of the real box and the predicted box respectively; β is the outlier that measures the quality of the anchor box. According to β, a non-monotonic focusing factor r is constructed and applied to WIoU v1; δ and α are hyperparameters that can be adjusted according to different models; is the constructed monotone focusing factor coefficient; is the running average of the momentum m.
[0129] A smaller β value indicates a higher quality anchor frame, and a smaller r is assigned to it, reducing the weight of the high-quality anchor frame in the larger loss function. A larger β value indicates a low-quality anchor frame, and a smaller gradient gain is assigned to it, thereby reducing the harmful gradients generated by the low-quality anchor frame. Constructing a monotonic focusing coefficient This effectively reduces the weight of simple instances in the loss value. However, considering the model training along with The decrease of decreases leads to a slow convergence speed, so the introduction of The average value of Normalize.
[0130] WIoU v3 adopts a reasonable gradient gain allocation strategy to dynamically optimize the weights of high-quality and low-quality anchor boxes in the loss, so that the model focuses on average quality samples and improves the overall performance of the model. On the one hand, WIoU v3 takes into account some of the advantages of EIoU and SIoU, which conforms to the excellent design concept of the loss function. On the other hand, WIoU v3 adopts a dynamic non-monotonic mechanism to evaluate the quality of the anchor box, which makes the model pay more attention to the anchor box of ordinary quality and improves the model's ability to locate the target. For the detection task of infrared small targets, the proportion of small objects is high, which increases the difficulty of detection. WIoU v3 can dynamically optimize the loss weight of small objects to improve the detection performance of the model.
[0131] Use the improved dual-input YOLOv8 model for training and evaluation. During the training process, you first need to select appropriate hyperparameters, optimizers, and loss functions, and reasonably divide the training set, validation set, and test set to train and evaluate the model.
[0132] Analyze and judge the data after model training, adjust and optimize the model, retain the optimal weight model after training, and conduct experimental tests on the trained model. Visualization tools can be used to analyze the changing trends of indicators such as model loss and precision, and adjust and optimize the model to improve the performance of the model. If the modified model has no significant difference in loss, precision, recall, AP, etc. 50 ,AP 50:95 If the model has better performance than the original model in terms of parameters, the current training result is selected as the optimal model. Otherwise, the model training does not meet the standard, and the training parameters are adjusted to carry out the next round of training. The optimal weight model after training is retained. After screening, the optimal weight model obtained is better than the original model in terms of precision, recall, AP 50 ,AP 50:95 Get promoted.
[0133] The experimental platform of the present invention runs on the Windows 10 operating system, and the training platform uses an Intel Core i9-13900K processor and NVIDIA TM RTX 3090Ti GPU, the code running framework is PyTorch1.9.2, and the running environment is Python3.8, CUDA11.4.
[0134] In the model training process of the present invention, the stochastic gradient descent method with a momentum of 0.937 was used. The initial learning rate was set to 0.03 and the final learning rate was set to 0.0001. The batch size of the training was 32, which lasted for 200 rounds, and the size of the input image was 256×256. The weight decay was 0.0005. The mosaic method was used as a data enhancement strategy, but the mosaic data enhancement was stopped in the last 10 rounds of training to accelerate convergence. In the testing phase, the object confidence threshold was 0.001, the non-maximum suppression IoU threshold was 0.6, and the batch size was 1.
[0135] In order to verify the effectiveness of the algorithm performance of the present invention, the present invention selects the current mainstream single-stage target detection algorithm model to design a comparative experiment. The purpose of the comparative experiment is to evaluate the performance of the proposed dual-input YOLOv8 model and other mainstream models, including YOLOv3, YOLOv5s, YOLOv7-tiny, and YOLOv8s models. The reason for selecting these methods for comparative experiments is that they are all representative methods or advanced methods in the field of infrared detection. These models differ in backbone networks, neck networks, and prediction heads, so comparative experiments will help evaluate the performance of each model in different scenarios. Specifically, the comparative experiments will compare the accuracy, recall, and AP respectively. 50 ,AP 50:95 to conduct comparative analysis.
[0136] Table 1 Comparative experimental results
[0137]
[0138] From the experimental results, we can see that as the latest algorithm in the YOLO series, the YOLOv8 model has been shown to have higher detection performance than other existing algorithms. This is also the main motivation for using this model as a baseline model in this study. The proposed dual-input YOLOv8 model exhibits the highest average detection accuracy and the best overall detection performance among all models, with a real-time running speed of 77FPS. Although the improved model has a slightly longer inference time compared to the YOLOv8 model, it can still achieve real-time detection, which is better than most detection algorithms.
[0139] In order to further verify the effectiveness of the algorithm performance of the present invention, the present invention conducts an ablation experiment. In the algorithm without adding WIoU v3 and CBAM_α in Table 2, the small target detection layer and the dual input mode have been integrated into the model.
[0140] Table 2 Ablation experiment results
[0141]
[0142] It can be seen from the experimental results in Table 2 that, first, compared with the single-frame detection method, the multi-frame detection method can capture more motion and object information, and the input processing module can well fuse the features of multiple inputs to save computing power. Secondly, in the single-frame detection model, YOLOv8s has the best detection performance, so the present invention selects it as the benchmark model. WIoU v3 uses a more reasonable sample allocation strategy to improve the positioning ability of the model. In addition, CBAM_α enhances the noise suppression ability of the model, making the model pay more attention to key information. Finally, the added small target detection layer improves the model's detection ability for small targets. In short, when detecting infrared moving small objects in complex backgrounds, the dual-input YOLOv8 model maintains good performance, while the performance of other methods decreases.
[0143] It should be noted that the dual-input YOLOv8 model was experimented on the InfraredShimmering Aircraft Detection and Tracking dataset (ISD) and compared with existing methods. The experimental results show that compared with existing methods, the dual-input YOLOv8 model can significantly improve the detection performance in terms of precision, recall, AP50 and AP50:95 indicators while maintaining real-time processing speed.
[0144] from Fig. 9 The visualization results shown show that the dual-input YOLOv8 model is very effective in detecting infrared moving targets in complex backgrounds. The proposed model can show excellent detection performance even in dim small objects and complex environments, achieving higher detection confidence and avoiding false positives and negatives. Good performance was also achieved under different data sets, proving that the dual-input YOLOv8 model method has good generalization ability.
[0145] It can be seen that the present invention aims at the difficulty of detecting small infrared moving targets with unclear features and relatively complex background motion, and proposes an infrared moving target detection system based on improved YOLOv8 named as dual-input YOLOv8 model. Specifically, the improvements of the present invention are summarized as follows:
[0146] 1. The feature map obtained by fusing the optical flow processed image with the original frame infrared image is used to replace the original YOLOv8 input layer; specifically, the dual-input YOLOv8 model uses the current frame and the optical flow processed image as input (the current frame is the main input and the optical flow processed image is the secondary input) for infrared moving small object detection. The model can obtain the original feature information, object information and motion information from the input to improve the detection performance.
[0147] 2. The optical flow processing module in the dual-input YOLOv8 model uses the improved Horn-Schunck (HS) optical flow processing method;
[0148] 3. In order to optimize the utilization of multiple input information, the proposed input processing module of the dual-input YOLOv8 model determines the input composition according to the detection confidence, so that the input processing module can more efficiently process the feature information carried by each input, thereby enabling the model to switch between single input and multiple inputs, effectively integrating features from multiple inputs and balancing detection performance and real-time performance, thereby improving the detection performance of the model and saving computing power;
[0149] 4. A small target detection layer is added to the traditional YOLOv8 model, and a detection layer for large-size targets is removed, so that the model is more focused on the detection of small targets and the model is lighter, thereby achieving better detection performance in infrared small target detection and avoiding the degradation of real-time performance caused by increasing the number of model layers. The purpose of removing the detection layer for large targets is to reduce the model size for later embedded deployment;
[0150] 5. Use Wise-IoU (WIoU) v3 instead of CIoU as the bounding box regression loss function of the model. Experiments have verified that its effect is better than the existing bounding box regression loss function, and can effectively balance the gradient gain of high-quality and low-quality samples. At the same time, this improvement significantly enhances the model's positioning ability and bounding box regression accuracy, while also increasing the flexibility of the target detection model in various scenarios and improving the model's ability to locate moving targets.
[0151] 6. The dual-input YOLOv8 model also uses an improved Convolutional Block Attention Module (CBAM) to enhance the feature representation capability of the convolutional neural network. CBAM focuses on important features of the image and suppresses unnecessary regional responses, making the model pay more attention to the key information in the feature map and improving the detection performance of the model.
[0152] Of course, the present invention may have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may certainly make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.
Claims
1. An infrared moving target detection system based on improved YOLOv8, characterized in that: It includes optical flow processing module, dual input processing module, target detection module and output module; The optical flow processing module is used to process the received previous frame infrared image and current frame infrared image using the improved Horn-Schunck method to obtain an optical flow processed image when the detection confidence of the current iteration output by the output module is less than a set threshold; The dual-input processing module is used to extract features from the received image to obtain a fused feature map; wherein, when the detection confidence output by the output module is less than a set threshold, the image received by the dual-input processing module is the optical flow processed image and the current frame infrared image; when the detection confidence of the current iteration output by the output module is not less than the set threshold, the image received by the dual-input processing module is only the current frame infrared image; The target detection module is used to detect the infrared moving target and the detection confidence of the infrared moving target in the infrared image of the current frame according to the aggregated feature map; The output module is used to use the average of the detection confidence corresponding to the current frame infrared image and the detection confidence corresponding to the previous frame infrared image as the detection confidence of the next iteration.
2. An infrared moving target detection system based on improved YOLOv8 as claimed in claim 1, characterized in that: The optical flow processing module uses the improved Horn-Schunck method to process the received previous infrared image and the current infrared image, and obtains the optical flow processed image as follows: The same convolution is used to perform convolution operations on the grayscale image of the previous frame of infrared image and the grayscale image of the current frame of infrared image, and the convolution results corresponding to the two frames of infrared images are fused to obtain a first convolution grayscale image; Two opposite convolutions are used to perform convolution operations on the grayscale image of the previous frame of infrared image and the grayscale image of the current frame of infrared image respectively, and the convolution results corresponding to the two frames of infrared images are fused to obtain a second convolution grayscale image; Give the initial velocity component u of the optical flow in the u direction (0) and the initial velocity component v of the optical flow in the v direction (0) Set initial value; The initial velocity component u of the optical flow (0) and the initial velocity component v of the optical flow (0) After a set number of iterations as the initial value of the following iterative formula of the optical flow equation, the optical flow velocity component u is obtained. * and the optical flow velocity component v * : Where k represents the number of iterations, I x Represents the partial derivative of the image grayscale pixel (x, y) on the x-axis on the first convolution grayscale image, I y Represents the partial derivative of the image grayscale pixel (x, y) on y in the first convolution grayscale image, I t represents the partial derivative of the image grayscale pixel (x, y) on the second convolution grayscale image with respect to t, λ represents the optical flow constant that controls the smoothness of the optical flow field, ρ represents the momentum constant, It represents the local average optical flow velocity of the current pixel point in the neighborhood set in the u direction obtained in the kth iteration. represents the local average optical flow velocity of the current pixel point in the neighborhood in the v direction obtained by the kth iteration, u (k-1) 、u k 、u (k+1) They represent the optical flow velocity components in the u direction obtained by the k-1th, kth, and k+1th iterations, respectively. (k-1) 、v (k) 、v (k+1) They represent the optical flow velocity components in the v direction obtained by the k-1th, kth, and k+1th iterations respectively, ω1(x, y) and ω2(x, y) represent the first weight and the second weight respectively, and there are: Among them, α1 is the weight for suppressing the size of the optical flow vector, α2 is the ratio of adjusting the optical flow equation constraint and the smoothness constraint, and T is the set threshold; The optical flow velocity component u at each pixel * and the optical flow velocity component v * The optical flow field is formed, and the optical flow processed image is obtained after the required visualization processing.
3. An infrared moving target detection system based on improved YOLOv8 as claimed in claim 2, characterized in that: Let α1=α2, then simplify the first weight ω1(x, y) and the second weight ω2(x, y) to the following piecewise function ω(x, y): Among them, k' is the slope related to the values of α1 and α2.
4. An infrared moving target detection system based on improved YOLOv8 as claimed in claim 1, characterized in that: The dual-input processing module includes a first Focus submodule, a second Focus submodule, a maximum pooling layer Maxpool, an average pooling layer Avgpool, a first Concat submodule, a second Concat submodule, a first CBS convolution submodule, and a second CBS convolution submodule; When the detection confidence output by the output module is less than the set threshold, the first Focus submodule operates on the infrared image of the current frame to obtain the first Focus feature map; the second Focus submodule operates on the optical flow processed image to obtain the second Focus feature map; the second Focus feature map is respectively subjected to the maximum pooling layer Maxpool and the average pooling layer Avgpool for pooling operations, and the first pooling feature map and the second pooling feature map are correspondingly obtained; the second Focus feature map, the first pooling feature map, and the second pooling feature map are superimposed by the second Concat submodule to obtain the optical flow feature map; the optical flow feature map is subjected to feature fusion by the second CBS convolution submodule to obtain the optical flow fusion feature map; the first Focus feature map and the optical flow fusion feature map are superimposed by the first Concat submodule to obtain the intermediate fusion feature map; the intermediate fusion feature map is subjected to feature fusion by the first CBS convolution submodule to obtain the final fusion feature map; When the detection confidence of the current iteration output by the output module is not less than the set threshold, the current frame infrared image is directly used as the final fusion feature map.
5. An infrared moving target detection system based on improved YOLOv8 as claimed in claim 1, characterized in that: The target detection module is an improved YOLOv8 network model, and the improved YOLOv8 network model includes a Backbone subnetwork, a Neck subnetwork, and a Head subnetwork; wherein the C2f module in the Neck subnetwork is connected to the Upsample module through a CBAM_α module, the C2f module is connected to the CBS module through a CBAM_α module, and at the same time, the SPPF module in the Backbone subnetwork is connected to the first Upsample module in the Neck subnetwork through a CBAM_α module; The CBAM_α module includes a channel attention module, a spatial attention module, a first CBS module and a second CBS module; after the aggregated feature map F passes through the channel attention module and the spatial attention module respectively, the corresponding channel attention feature map M is obtained. c (F) and spatial attention feature map M s (F); Channel attention feature map M c (F) and spatial attention feature map M s (F) is multiplied element by element with the aggregate feature map F, and the corresponding channel attention intermediate feature map is obtained. and spatial attention intermediate feature map and After feature fusion through the first CBS module and the second CBS module respectively, they are multiplied element by element with the aggregated feature map F to obtain the output feature map output to the next level module.
6. An infrared moving target detection system based on improved YOLOv8 as claimed in claim 1, characterized in that: The target detection module is an improved YOLOv8 network model, and the improved YOLOv8 network model includes a Backbone subnetwork, a Neck subnetwork, and a Head subnetwork; The Neck subnetwork includes a cascaded CBAM_α module I, an Upsample module I, a Concat module I, a C2f module I, a CBAM_α module II, an Upsample module II, a Concat module II, a C2f module II, a CBAM_α module III, an Upsample module III, a Concat module III, a C2f module III, a CBAM_α module IV, a CBS module I, a Concat module IV, a C2f module IV, a CBAM_α module V, a CBS module II, a Concat module V, and a C2f module V; Among them, the output of C2f module I is also connected to the input of Concat module V; the output of C2f module II is also connected to the input of Concat module IV; the output of C2f module III is also used as the input of the first level DetectI of the Head subnetwork; the output of C2f module IV is also used as the input of the second level DetectⅡ of the Head subnetwork; the output of C2f module V is also used as the input of the third level DetectⅢ of the Head subnetwork, wherein the feature map sizes of the three levels are different; The Backbone sub-network includes a first-level CBS module, a first-level C2f module, a second-level CBS module, a second-level C2f module, a third-level CBS module, a third-level C2f module, a fourth-level CBS module, a fourth-level C2f module, and an SPPF module connected in sequence; Among them, the output of the first-level C2f module of the Backbone subnetwork is also connected to the input of the Concat module III, the output of the second-level C2f module is also connected to the input of the Concat module II, the output of the third-level C2f module is also connected to the input of the Concat module I, and the output of the SPPF module is connected to the input of the CBAM_α module I.
7. An infrared moving target detection system based on improved YOLOv8 as claimed in claim 5 or 6, characterized in that: The WIoU v3 function is used as the bounding box regression loss function for training the improved YOLOv8 network model.
Citation Information
Patent Citations
Single-frame infrared weak and small target detection method based on improved YOLOv7
CN117611911A
Cited By
Target sensing method and device, robot, storage medium and program product
CN119974018A
Method for detecting moving target in dynamic flight of unmanned aerial vehicle
CN120510539A
Detection method of moving targets in dynamic flight of UAV
CN120510539B
