Small target detection method and device combining Kalman filtering and YOLO
By combining Kalman filtering and YOLO for small target detection, the problems of accuracy and real-time performance in small target detection, as well as tracking stability under occlusion and multiple target intersections in remote sensing and low-altitude monitoring are solved, thus achieving high-precision continuous monitoring.
Patent Information
- Application Number
- CN202611458338.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-18
- Publication Date
- 2026-11-06
AI Technical Summary
Existing detection and tracking technologies in remote sensing and low-altitude monitoring scenarios suffer from several problems: difficulty in achieving both accuracy and real-time performance in small target detection; poor detector stability under complex interference; lack of occlusion adaptive control mechanism and target loss tolerance in Kalman filtering; and ID drift and trajectory confusion when multiple targets intersect.
Combining the small target detection methods of Kalman filtering and YOLO, this paper improves the YOLO network by introducing a C2f module, a C2PS.A context enhancement module, and a sparse global attention mechanism. It dynamically adjusts the noise covariance matrix, sets a maximum loss tolerance frame threshold, and adopts an Euclidean distance matching disambiguation mechanism to achieve target state prediction and tracking.
It effectively solves the problems of target loss due to occlusion, trajectory breakage, and tracking confusion when multiple targets intersect, improves detection accuracy and tracking stability, and meets the high-precision continuous monitoring needs of remote sensing and low-altitude security.
Smart Images

Figure CN123052631A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of signal processing technology, and in particular to a method and apparatus for small target detection that combines Kalman filtering and YOLO. Background Technology
[0002] In remote sensing and low-altitude monitoring scenarios, small targets specifically refer to targets with a pixel size ≤32×32 and a very low screen area. They are divided into static targets such as storage tanks and parked vehicles, and moving targets such as drones, moving vehicles, and speedboats. These scenarios commonly suffer from multiple interferences, including tree canopy occlusion, dense building interference, drastic changes in lighting due to rain or snow, target overlap, and long-distance imaging blur. Existing detection and tracking technologies have significant shortcomings. Traditional YOLO networks rely on the basic C3 module for feature extraction, but their ability to capture shallow, fine-grained features of extremely small targets is weak. Conventional feature fusion does not extend the global context, and inference from high-resolution remote sensing images is prone to missing small targets. Simply increasing image size to improve accuracy cannot balance detection accuracy and real-time performance. Furthermore, in complex interference scenarios, single-frame detectors exhibit poor stability, easily leading to missed detections and skipped detections, resulting in broken target trajectories and lost tracking IDs, significantly increasing the cost of target re-identification. Traditional Kalman filtering's occlusion-free adaptive control mechanism lacks target loss tolerance, trajectory buffering, and overlapping box disambiguation logic. Long-term occlusion can easily lead to the direct deletion of trackers, and ID drift and trajectory confusion can easily occur when multiple targets intersect. Furthermore, existing detection and tracking modules operate independently, failing to dynamically adjust filter noise parameters based on detection confidence levels, and lacking a coordinated strategy for matching thresholds, trajectory optimization, and the destruction of older trackers. Mainstream solutions such as YOLO+ByteTrack cannot simultaneously address issues like missed detection of small targets, lost occluded trajectories, and interference from overlapping multiple targets, making it difficult to meet the high-precision continuous monitoring requirements of remote sensing and low-altitude security. Summary of the Invention
[0003] Therefore, it is necessary to provide a small target detection method and apparatus that combines Kalman filtering and YOLO to address the aforementioned technical problems.
[0004] A small target detection method combining Kalman filtering and YOLO, the method comprising: Acquire the video stream to be processed and preprocess the video stream; The preprocessed video frame is input into the improved YOLO11 small object detection network to obtain the set of valid small object detection boxes and the corresponding YOLO detection confidence of the current video frame. The improved YOLO11 small object detection network consists of a backbone network, a multi-scale fusion network and a decoupled detection head. The backbone network consists of a C2f module and a C2PS.A context enhancement module and embeds a sparse global attention mechanism. For each small target that appears for the first time, an independent adaptive Kalman filter is initialized, a target state prediction model is constructed, and the noise covariance matrix is dynamically adjusted by YOLO detection confidence. The Kalman filter prediction and update phases are executed cyclically. In the prediction phase, the Kalman predicted coordinates are estimated based on the optimal state of the previous frame. The Euclidean distance between the Kalman predicted coordinates and the small target detection box is calculated. If the Euclidean distance is less than a preset threshold, it is determined to be the same small target, the update phase is executed, and the target loss count is reset. Otherwise, it is determined to be a new small target, the update phase is not executed, and an independent adaptive Kalman filter is established for the new small target. For scenarios where the target is occluded and is not the same small target, if the target loss count is greater than the maximum loss tolerance frame threshold, the corresponding independent adaptive Kalman filter is destroyed. Otherwise, the predicted trajectory is continuously output and historical coordinates are cached. If multiple tracking boxes appear in the same frame, the Euclidean distance between the old predicted box and the new detection box is calculated. If the Euclidean distance is less than a preset value, the independent adaptive Kalman filter corresponding to the old predicted box is destroyed. All target tracking information is superimposed onto video frames and written frame by frame into the video stream to be processed, thus completing the continuous detection and tracking of small targets in complex backgrounds.
[0005] In one embodiment, the preprocessing includes: The video frame images are scaled proportionally to the standard input size of the model, 640×640, and gray borders are filled to maintain the original aspect ratio. Linearly map pixel values from 0 to 255 to the range [0,1]; For high-resolution video frame images, a sliding window is used to segment them into 640×640 sub-images; Random flipping, Gaussian blur, illumination perturbation, and simulated rain and snow noise are used to expand small target samples.
[0006] In one embodiment, the independent adaptive Kalman filter employs a 4-dimensional state vector. ,in, The coordinates of the target center are These are the lateral motion speed and the longitudinal motion speed, respectively.
[0007] In one embodiment, the multi-scale fusion network adopts an FPN+PAN bidirectional feature pyramid structure; the post-processing of the decoupled detection head performs confidence threshold filtering and NMS non-maximum suppression.
[0008] In one embodiment, the target state prediction model includes a state transition matrix and an observation matrix; The state transition matrix for:
[0009] in, This is a single frame time interval; Observation matrix for: .
[0010] In one embodiment, the Kalman filter prediction phase and update phase are performed cyclically, including: In the prediction phase, based on the optimal state estimate of the previous frame, the current prior state and covariance are predicted to obtain the Kalman prediction coordinates:
[0011]
[0012] in, For prior state estimation; Estimating the optimal state; The prior error covariance matrix; The posterior error covariance matrix; The process noise covariance matrix; For the number of frames; In the update phase, the observed values are fused to correct the prediction results, yielding the optimal posterior estimate:
[0013]
[0014]
[0015] in, The Kalman gain matrix; To observe the noise covariance matrix; For posterior state estimation; This is the observation vector for the current frame; The posterior error covariance matrix; It is an identity matrix.
[0016] In one embodiment, dynamically adjusting the noise covariance matrix using YOLO detection confidence includes: Dynamically adjust based on target type If the target type is a dynamic small target, then zoom in. If the target type is a static small target, then reduce the size. ; Based on the YOLO detection confidence level and Negative correlation, dynamically adjusted .
[0017] In one embodiment, all target tracking information is superimposed onto video frames and written frame by frame into the video stream to be processed, completing the continuous detection and tracking of small targets in complex backgrounds, including: Visual identifiers distinguish between normal detected targets and occluded predicted targets. All target tracking information is overlaid onto video frames and written frame by frame into the video stream to be processed, thus completing the continuous detection and tracking of small targets in complex backgrounds.
[0018] In one embodiment, the maximum frame loss tolerance threshold is proportional to the frame rate.
[0019] A small target detection device combining Kalman filtering and YOLO, the device comprising: The data acquisition module is used to acquire the video stream to be processed and to preprocess the video stream. The YOLO detection module is used to input the preprocessed video frame into the improved YOLO11 small object detection network to obtain the set of valid small object detection boxes and the corresponding YOLO detection confidence of the current video frame. The improved YOLO11 small object detection network consists of a backbone network, a multi-scale fusion network and a decoupled detection head. The backbone network consists of a C2f module and a C2PS.A context enhancement module and embeds a sparse global attention mechanism. The target configuration module is used to initialize an independent adaptive Kalman filter for each small target that appears for the first time, build a target state prediction model, and dynamically adjust the noise covariance matrix by detecting confidence using YOLO. The Kalman filter prediction module is used to cyclically execute the Kalman filter prediction stage and the update stage. In the prediction stage, the Kalman predicted coordinates are estimated based on the optimal state of the previous frame. The Euclidean distance between the Kalman predicted coordinates and the small target detection box is calculated. If the Euclidean distance is less than a preset threshold, it is determined to be the same small target, the update stage is executed and the target loss count is reset. Otherwise, it is determined to be a new small target, the update stage is not executed, and an independent adaptive Kalman filter is established for the new small target. For scenarios where the target is occluded and is not the same small target, if the target loss count is greater than the maximum loss tolerance frame threshold, the corresponding independent adaptive Kalman filter is destroyed. Otherwise, the predicted trajectory is continuously output and historical coordinates are cached. If multiple tracking boxes appear in the same frame, the Euclidean distance between the old predicted box and the new detection box is calculated. If the Euclidean distance is less than a preset value, the independent adaptive Kalman filter corresponding to the old predicted box is destroyed. The output module is used to overlay all target tracking information onto video frames and write them frame by frame into the video stream to be processed, thus completing the continuous detection and tracking of small targets in complex backgrounds.
[0020] The aforementioned small target detection method and device combining Kalman filtering and YOLO expands the context of small targets by introducing a C2f module, a C2PS.A context enhancement module, and a sparse global attention mechanism into the backbone network. This effectively overcomes the weakness of feature extraction in complex noisy backgrounds. Furthermore, the lightweight design achieved through the C2f module can meet the requirements of real-time video processing. By setting a maximum loss tolerance frame threshold in the adaptive Kalman filter, continuous prediction is made by the motion model during target occlusion, outputting the predicted trajectory and caching historical coordinates. This effectively solves the problems of target loss, trajectory breakage, and ID jumps caused by occlusion in traditional schemes. At the same time, the noise covariance matrix is dynamically and adaptively adjusted based on the detection confidence to effectively suppress interference from low-confidence invalid observations and significantly improve tracking stability. By introducing an Euclidean distance matching disambiguation mechanism, multiple tracking boxes for the same target are automatically identified, and redundant historical trackers are destroyed in a timely manner to ensure that only one valid tracking trajectory is retained for each target. This solves the problem of tracking chaos when multiple small targets are densely intersecting. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating a small target detection method combining Kalman filtering and YOLO in one embodiment; Figure 2 This is a schematic diagram of the structure of the improved YOLO11 small target detection network in one embodiment; Figure 3 This is a flowchart illustrating the prediction and update stages of a Kalman filter in one embodiment. Figure 4 This is a block diagram of a small target detection device that combines Kalman filtering and YOLO in one embodiment. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0023] In one embodiment, such as Figure 1 As shown, a small target detection method combining Kalman filtering and YOLO is provided, the method comprising: Step 201: Obtain the video stream to be processed and preprocess the video stream.
[0024] It should be noted that the video stream to be processed is a video stream containing small objects.
[0025] Step 202: Input the preprocessed video frame into the improved YOLO11 small object detection network to obtain the set of valid small object detection boxes and the corresponding YOLO detection confidence of the current video frame; the improved YOLO11 small object detection network consists of a backbone network, a multi-scale fusion network and a decoupled detection head, the backbone network consists of a C2f module and a C2PS.A context enhancement module and embeds a sparse global attention mechanism.
[0026] It should be noted that, referring to Figure 2 This improved YOLO11 small object detection network is based on the native YOLO11 CBS+C3k module. All C3k modules in the backbone network are replaced with C2f modules, and a PSABlock sparse global attention mechanism is embedded. A C2PS.A context enhancement module is added after the SPPF layer to dynamically expand the receptive field of small objects, extract long-distance spatial context features, and distinguish between foreground micro-objects and background noise. The backbone network outputs three layers of feature maps at different scales: 80×80 shallow fine-grained features (adapted to extremely small objects), 40×40 mid-level features, and 20×20 high-level semantic features. This provides the set of valid small object detection boxes for the current video frame. , , ( () represents the coordinates of the target center. () represents the width and height observation vector. A two-dimensional observation vector for an effective small target.
[0027] Step 203: For each small target that appears for the first time, initialize an independent adaptive Kalman filter, construct a target state prediction model, and dynamically adjust the noise covariance matrix by using YOLO detection confidence.
[0028] Step 204: The Kalman filter prediction and update phases are executed cyclically. In the prediction phase, the Kalman predicted coordinates are estimated based on the optimal state of the previous frame. The Euclidean distance between the Kalman predicted coordinates and the small target detection box is calculated. If the Euclidean distance is less than a preset threshold, it is determined to be the same small target, the update phase is executed, and the target loss count is reset. Otherwise, it is determined to be a new small target, the update phase is not executed, and an independent adaptive Kalman filter corresponding to the new small target is established. For scenarios where the target is occluded and is not the same small target, if the target loss count is greater than the maximum loss tolerance frame threshold, the corresponding independent adaptive Kalman filter is destroyed. Otherwise, the predicted trajectory is continuously output and historical coordinates are cached. If multiple tracking boxes appear in the same frame, the Euclidean distance between the old predicted box and the new detection box is calculated. If the Euclidean distance is less than a preset value, the independent adaptive Kalman filter corresponding to the old predicted box is destroyed.
[0029] Step 205: Overlay all target tracking information onto the video frames and write them frame by frame into the video stream to be processed, thus completing the continuous detection and tracking of small targets in complex backgrounds.
[0030] The aforementioned small target detection method combining Kalman filtering and YOLO expands the small target context by introducing a C2f module, a C2PS.A context enhancement module, and a sparse global attention mechanism into the backbone network. This effectively overcomes the weakness in feature extraction under complex noise backgrounds. Furthermore, the lightweight design achieved through the C2f module meets the requirements of real-time video processing. By setting a maximum loss tolerance frame threshold in the adaptive Kalman filter, continuous prediction is made by the motion model during target occlusion, outputting the predicted trajectory and caching historical coordinates. This effectively solves the problems of target loss, trajectory breakage, and ID jumps caused by occlusion in traditional schemes. At the same time, the noise covariance matrix is dynamically and adaptively adjusted based on the detection confidence to effectively suppress interference from low-confidence invalid observations and significantly improve tracking stability. By introducing an Euclidean distance matching disambiguation mechanism, multiple tracking boxes for the same target are automatically identified, and redundant historical trackers are destroyed in a timely manner to ensure that only one valid tracking trajectory is retained for each target. This solves the problem of tracking confusion when multiple small targets are densely intersecting.
[0031] In one embodiment, the preprocessing includes: The video frame images are scaled proportionally to the standard input size of the model, 640×640, and gray borders are filled to maintain the original aspect ratio. Linearly map pixel values from 0 to 255 to the range [0,1]; For high-resolution video frame images, a sliding window is used to segment them into 640×640 sub-images; Random flipping, Gaussian blur, illumination perturbation, and simulated rain and snow noise are used to expand small target samples.
[0032] In this embodiment, proportional image scaling is used to avoid deformation of small targets; for high-resolution video frame images, a sliding window is used to divide them into 640×640 sub-images to eliminate the problem of dilution of small target features in ultra-large images; and small target samples are expanded by random flipping, Gaussian blurring, illumination perturbation, and simulated rain and snow noise to effectively alleviate sample imbalance.
[0033] In one embodiment, the multi-scale fusion network adopts an FPN+PAN bidirectional feature pyramid structure; the post-processing of the decoupled detection head performs confidence threshold filtering and NMS non-maximum suppression.
[0034] Specifically, the multi-scale fusion network adopts an FPN+PAN bidirectional feature pyramid structure, adding cross-layer weighted fusion logic to assign higher fusion weights to shallow small target features; the lateral connection introduces feature denoising and reweighting to suppress high-frequency noise in the background of buildings and vegetation, highlighting the texture contours of small targets; the decoupled detection head adopts classification, bounding box regression, and confidence decoupled branches, outputting grid prediction coordinates, category ID, and YOLO detection confidence; post-processing performs confidence threshold filtering and NMS non-maximum suppression to remove low-confidence redundant boxes and output the effective detection set of the current frame.
[0035] The confidence threshold filtering specifically involves setting a fixed confidence threshold (e.g., 0.25). It iterates through all candidate detection boxes output by the decoupled detection head, comparing the YOLO detection confidence score of each candidate box with the confidence threshold. If the YOLO detection confidence score is less than the threshold, the corresponding candidate detection box is discarded; otherwise, it is retained for subsequent NMS processing. This confidence threshold filtering effectively removes false background detections and blurry, small false alarm boxes.
[0036] Non-maximum suppression (NMS) is achieved through the following steps: S1. Sort the candidate detection boxes after the confidence threshold according to the YOLO detection confidence from high to low. Take the candidate detection box with the highest YOLO detection confidence as the reference box. Traverse all non-reference boxes and calculate the IoU (Intersection over Union) between the reference box and non-reference boxes. S2. Compare the IoU with the preset IoU threshold. If the IoU is greater than the IoU threshold, it is determined to be a duplicate detection box for the same target, and redundant boxes with low YOLO detection confidence are deleted. S3. Repeat steps S1 to S2 until there are no redundant boxes, and output the set of valid small target detection boxes.
[0037] It should be noted that for densely packed small targets in remote sensing, NMS does not use a globally uniform high IoU threshold, but rather a low IoU threshold to avoid accidentally removing closely adjacent small targets from each other. The IoU threshold is set based on empirical judgment.
[0038] In one embodiment, the independent adaptive Kalman filter employs a 4-dimensional state vector. ,in, The coordinates of the target center are These are the lateral motion speed and the longitudinal motion speed, respectively.
[0039] In one embodiment, the target state prediction model includes a state transition matrix and an observation matrix; The state transition matrix for:
[0040] in, This is a single frame time interval; Observation matrix for: .
[0041] In one embodiment, reference Figure 3 The Kalman filter prediction and update phases are executed cyclically, including: In the prediction phase, based on the optimal state estimate of the previous frame, the current prior state and covariance are predicted to obtain the Kalman prediction coordinates:
[0042]
[0043] in, For prior state estimation; Estimating the optimal state; The prior error covariance matrix; The posterior error covariance matrix; The process noise covariance matrix; For the number of frames; In the update phase, the observed values are fused to correct the prediction results, yielding the optimal posterior estimate:
[0044]
[0045]
[0046] in, The Kalman gain matrix; To observe the noise covariance matrix; For posterior state estimation; This is the observation vector for the current frame; The posterior error covariance matrix; It is the identity matrix; This represents the measurement residual.
[0047] In one embodiment, dynamically adjusting the noise covariance matrix using YOLO detection confidence includes: Dynamically adjust based on target type If the target type is a dynamic small target, then zoom in. If the target type is a static small target, then reduce the size. ; Based on the YOLO detection confidence level and Negative correlation, dynamically adjusted .
[0048] In this embodiment, the adjustment is dynamically based on the target type. This technology enables differentiated noise configurations for static targets (with velocity components approaching zero) and dynamic moving targets, thus simultaneously supporting two typical small target scenarios: remotely sensed static storage tanks and low-altitude dynamic UAVs, effectively enhancing generalization capabilities. Furthermore, it dynamically and adaptively adjusts the noise covariance matrix based on detection confidence, effectively suppressing interference from low-confidence invalid observations and significantly improving tracking stability.
[0049] The process calculates the Euclidean distance between the Kalman predicted coordinates and the small target detection box. If the Euclidean distance is less than a preset threshold, the target is identified as the same small target, an update phase is executed, and the target loss count is reset. Otherwise, the target is identified as a new small target, the update phase is not executed, and an independent adaptive Kalman filter is established for the new small target. In essence, by calculating the Euclidean distance between the Kalman predicted coordinates and the small target detection box, accurate matching between the predicted and detected boxes is achieved based on a preset threshold. Furthermore, by configuring an independent adaptive Kalman filter for the new small target, the stability and orderliness of multi-target parallel tracking are effectively improved.
[0050] For scenarios where targets are occluded and not the same small target, if the target loss count exceeds the maximum loss tolerance frame threshold, the corresponding independent adaptive Kalman filter is destroyed; otherwise, the predicted trajectory is continuously output and historical coordinates are cached. Understandably, in scenarios where targets are occluded and not the same small target—that is, scenarios where no predicted bounding box matches the detection box for consecutive preset frames—setting a maximum loss tolerance frame threshold controls whether to use the Kalman filter for continuous blind prediction. This effectively solves the problems of traditional trackers such as deletion upon occlusion, trajectory breakage, and frequent ID jumps. Simultaneously, when the maximum loss tolerance frame threshold is exceeded, the corresponding independent adaptive Kalman filter is destroyed promptly, effectively releasing computational resources and reducing resource consumption.
[0051] In one embodiment, the maximum frame loss tolerance threshold is proportional to the frame rate.
[0052] Specifically, the maximum frame loss tolerance threshold is set to the number of frames corresponding to 10 to 30 seconds.
[0053] In one embodiment, all target tracking information is superimposed onto video frames and written frame by frame into the video stream to be processed, completing the continuous detection and tracking of small targets in complex backgrounds, including: Visual identifiers distinguish between normal detected targets and occluded predicted targets. All target tracking information is overlaid onto video frames and written frame by frame into the video stream to be processed, thus completing the continuous detection and tracking of small targets in complex backgrounds.
[0054] Specifically, normally detected targets are visualized as solid blue rectangles, labeled with the target ID and detection confidence score; occluded predicted targets are visualized as orange lock boxes with broken corners, with continuous orange historical trajectory lines drawn simultaneously. All target tracking information includes visualized bounding boxes (i.e., small target detection boxes), target IDs, YOLO detection confidence scores, historical trajectory lines, and trajectory data such as historical coordinates, motion states (i.e., target state estimation in Kalman filtering), and target loss counts cached in the background.
[0055] To verify the validity of this application, the original Yolo11 algorithm was compared with the mAP50 and mAP50-95 of this application. The dataset used was DOTA remote sensing aerial imagery, containing small targets such as small vehicles, ships, and storage tanks. The large image was divided into 640×640 sub-images by a sliding window, and duplicates were removed from overlapping areas. The results are shown in Table 1: Table 1 Comparison of the performance of the original Yolo11 algorithm and this application
[0056] Yolov11n-512, Yolov11n-1024, and Yolov11s-512 represent the original YOLO11 algorithm, while Yolov11n-512-spd, Yolov11n-1024-spd, and Yolov11s-512-spd represent this application. n and s represent the size of the YOLO model, and 512 and 1024 represent the image training size.
[0057] As shown in Table 1, under the same model size, the mAP50 and mAP50-95 of this application are superior to the native YOLO, achieving a significant improvement in detection accuracy with a slight increase in parameters. Combined with Kalman filtering, the false negative rate of small targets in consecutive frames of remote sensing images is reduced by 61%, and the number of false alarms is significantly reduced against complex building backgrounds. Therefore, this application can improve the detection accuracy and trajectory continuity of small targets in complex occlusion, dense distribution, and variable lighting scenarios.
[0058] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0059] In one embodiment, such as Figure 4 As shown, a small target detection device combining Kalman filtering and YOLO is provided, the device comprising: The data acquisition module 901 is used to acquire the video stream to be processed and to preprocess the video stream.
[0060] YOLO detection module 902 is used to input the preprocessed video frame into the improved YOLO11 small object detection network to obtain the set of effective small object detection boxes of the current video frame and the corresponding YOLO detection confidence. The improved YOLO11 small object detection network consists of a backbone network, a multi-scale fusion network and a decoupled detection head. The backbone network consists of a C2f module and a C2PS.A context enhancement module and embeds a sparse global attention mechanism.
[0061] The target configuration module 903 is used to initialize an independent adaptive Kalman filter for each newly emerging small target, construct a target state prediction model, and dynamically adjust the noise covariance matrix by detecting confidence through YOLO.
[0062] The Kalman filter prediction module 904 is used to cyclically execute the Kalman filter prediction stage and the update stage. In the prediction stage, the Kalman predicted coordinates are estimated based on the optimal state of the previous frame. The Euclidean distance between the Kalman predicted coordinates and the small target detection box is calculated. If the Euclidean distance is less than a preset threshold, it is determined to be the same small target, the update stage is executed and the target loss count is reset. Otherwise, it is determined to be a new small target, the update stage is not executed, and an independent adaptive Kalman filter corresponding to the new small target is established. For scenarios where the target is occluded and is not the same small target, if the target loss count is greater than the maximum loss tolerance frame threshold, the corresponding independent adaptive Kalman filter is destroyed. Otherwise, the predicted trajectory is continuously output and historical coordinates are cached. If multiple tracking boxes appear in the same frame, the Euclidean distance between the old predicted box and the new detection box is calculated. If the Euclidean distance is less than a preset value, the independent adaptive Kalman filter corresponding to the old predicted box is destroyed.
[0063] The output module 905 is used to overlay all target tracking information onto video frames and write them frame by frame into the video stream to be processed, thus completing the continuous detection and tracking of small targets in complex backgrounds.
[0064] Specific limitations regarding the small target detection device combining Kalman filtering and YOLO can be found in the limitations of the small target detection method combining Kalman filtering and YOLO mentioned above, and will not be repeated here. Each module in the aforementioned small target detection device combining Kalman filtering and YOLO can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independent of the processor in a computer device, or stored in software in the memory of a computer device, so that the processor can call and execute the corresponding operations of each module.
[0065] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0066] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A small target detection method combining Kalman filtering and YOLO, characterized in that, The method includes: Acquire the video stream to be processed and preprocess the video stream; The preprocessed video frame is input into the improved YOLO11 small object detection network to obtain the set of valid small object detection boxes and the corresponding YOLO detection confidence of the current video frame. The improved YOLO11 small object detection network consists of a backbone network, a multi-scale fusion network and a decoupled detection head. The backbone network consists of a C2f module and a C2PS.A context enhancement module and embeds a sparse global attention mechanism. For each small target that appears for the first time, an independent adaptive Kalman filter is initialized, a target state prediction model is constructed, and the noise covariance matrix is dynamically adjusted by YOLO detection confidence. The Kalman filter prediction and update phases are executed cyclically. In the prediction phase, the Kalman predicted coordinates are estimated based on the optimal state of the previous frame. The Euclidean distance between the Kalman predicted coordinates and the small target detection box is calculated. If the Euclidean distance is less than a preset threshold, it is determined to be the same small target, the update phase is executed, and the target loss count is reset. Otherwise, it is determined to be a new small target, the update phase is not executed, and an independent adaptive Kalman filter is established for the new small target. For scenarios where the target is occluded and is not the same small target, if the target loss count is greater than the maximum loss tolerance frame threshold, the corresponding independent adaptive Kalman filter is destroyed. Otherwise, the predicted trajectory is continuously output and historical coordinates are cached. If multiple tracking boxes appear in the same frame, the Euclidean distance between the old predicted box and the new detection box is calculated. If the Euclidean distance is less than a preset value, the independent adaptive Kalman filter corresponding to the old predicted box is destroyed. All target tracking information is superimposed onto video frames and written frame by frame into the video stream to be processed, thus completing the continuous detection and tracking of small targets in complex backgrounds.
2. The small target detection method combining Kalman filtering and YOLO according to claim 1, wherein, The preprocessing includes: The video frame images are scaled proportionally to the standard input size of the model, 640×640, and gray borders are filled to maintain the original aspect ratio. Linearly map pixel values from 0 to 255 to the range [0,1]; For high-resolution video frame images, a sliding window is used to segment them into 640×640 sub-images; Random flipping, Gaussian blur, illumination perturbation, and simulated rain and snow noise are used to expand small target samples.
3. The small target detection method combining Kalman filtering and YOLO according to claim 1, characterized in that, The independent adaptive Kalman filter employs a 4-dimensional state vector. ,in, The coordinates of the target center are These are the lateral motion speed and the longitudinal motion speed, respectively.
4. The small target detection method combining Kalman filtering and YOLO according to claim 3, characterized in that, The multi-scale fusion network adopts an FPN+PAN bidirectional feature pyramid structure; the post-processing of the decoupled detection head performs confidence threshold filtering and NMS non-maximum suppression.
5. The small target detection method combining Kalman filtering and YOLO according to claim 4, characterized in that, The target state prediction model includes a state transition matrix and an observation matrix; The state transition matrix for: in, This is a single frame time interval; Observation matrix for: 。 6. The small target detection method combining Kalman filtering and YOLO according to claim 5, characterized in that, The Kalman filter prediction and update phases are executed cyclically, including: In the prediction phase, based on the optimal state estimate of the previous frame, the current prior state and covariance are predicted to obtain the Kalman prediction coordinates: in, For prior state estimation; Estimating the optimal state; The prior error covariance matrix; The posterior error covariance matrix; The process noise covariance matrix; For the number of frames; In the update phase, the observed values are fused to correct the prediction results, yielding the optimal posterior estimate: in, The Kalman gain matrix; To observe the noise covariance matrix; For posterior state estimation; This is the observation vector for the current frame; The posterior error covariance matrix; It is an identity matrix.
7. The small target detection method combining Kalman filtering and YOLO according to claim 6, characterized in that, Dynamically adjust the noise covariance matrix based on YOLO test confidence, including: Dynamically adjust based on target type If the target type is a dynamic small target, then zoom in. If the target type is a static small target, then reduce the size. ; Based on the YOLO detection confidence level and Negative correlation, dynamically adjusted .
8. The small target detection method combining Kalman filtering and YOLO according to claim 7, characterized in that, All target tracking information is superimposed onto video frames and written frame by frame into the video stream to be processed, completing the continuous detection and tracking of small targets in complex backgrounds, including: Visual identifiers distinguish between normal detected targets and occluded predicted targets. All target tracking information is overlaid onto video frames and written frame by frame into the video stream to be processed, thus completing the continuous detection and tracking of small targets in complex backgrounds.
9. The small target detection method combining Kalman filtering and YOLO according to claim 1, characterized in that, The maximum frame loss tolerance threshold is proportional to the frame rate.
10. A small target detection device combining Kalman filtering and YOLO, characterized in that, The device includes: The data acquisition module is used to acquire the video stream to be processed and to preprocess the video stream. The YOLO detection module is used to input the preprocessed video frame into the improved YOLO11 small object detection network to obtain the set of valid small object detection boxes and the corresponding YOLO detection confidence of the current video frame. The improved YOLO11 small object detection network consists of a backbone network, a multi-scale fusion network and a decoupled detection head. The backbone network consists of a C2f module and a C2PS.A context enhancement module and embeds a sparse global attention mechanism. The target configuration module is used to initialize an independent adaptive Kalman filter for each small target that appears for the first time, build a target state prediction model, and dynamically adjust the noise covariance matrix by detecting confidence using YOLO. The Kalman filter prediction module is used to cyclically execute the Kalman filter prediction stage and the update stage. In the prediction stage, the Kalman predicted coordinates are estimated based on the optimal state of the previous frame. The Euclidean distance between the Kalman predicted coordinates and the small target detection box is calculated. If the Euclidean distance is less than a preset threshold, it is determined to be the same small target, the update stage is executed and the target loss count is reset. Otherwise, it is determined to be a new small target, the update stage is not executed, and an independent adaptive Kalman filter is established for the new small target. For scenarios where the target is occluded and is not the same small target, if the target loss count is greater than the maximum loss tolerance frame threshold, the corresponding independent adaptive Kalman filter is destroyed. Otherwise, the predicted trajectory is continuously output and historical coordinates are cached. If multiple tracking boxes appear in the same frame, the Euclidean distance between the old predicted box and the new detection box is calculated. If the Euclidean distance is less than a preset value, the independent adaptive Kalman filter corresponding to the old predicted box is destroyed. The output module is used to overlay all target tracking information onto video frames and write them frame by frame into the video stream to be processed, thus completing the continuous detection and tracking of small targets in complex backgrounds.
