Intelligent monitoring method and system based on small target detection

By improving the small target detection method of the YOLOv5 model and introducing a hybrid channel and window self-attention mechanism, the problem of insufficient small target feature extraction in traditional monitoring systems is solved, achieving high-precision and real-time small target detection, which is suitable for intelligent monitoring systems.

CN120656124BActive Publication Date: 2026-04-21SU ZHOU ZHI QING KE JI YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SU ZHOU ZHI QING KE JI YOU XIAN GONG SI
Filing Date
2025-06-17
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Traditional intelligent monitoring systems struggle to effectively extract features from small targets in complex scenarios, leading to missed detections and false detections. Furthermore, insufficient cross-scale feature interaction affects the accuracy of small target detection.

Method used

This small object detection model is an improvement on the YOLOv5 model. It introduces a hybrid channel attention mechanism and a window self-attention mechanism, performs multi-scale feature fusion through the neck network module, and performs object detection in the detection head module, thereby improving feature extraction and fusion capabilities.

Benefits of technology

It improves the accuracy and real-time performance of small target detection, reduces the false negative and false positive rates, enhances the model's generalization performance in complex environments, and meets the high-precision and real-time detection requirements in actual monitoring scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120656124B_ABST
    Figure CN120656124B_ABST
Patent Text Reader

Abstract

A smart monitoring method and system based on small target detection, relating to the field of smart monitoring technology, includes: acquiring real-time video image data collected by a surveillance camera; performing multiple convolutions and sampling processes on the video image data through the backbone network module of the model to obtain multi-scale features of the video image data; fusing the multi-scale features of the video image data through the neck network module of the model to obtain scale feature maps at multiple levels; adding a pre-set attention module to the output of the neck network module of the model to perform feature extraction and image reconstruction processing on the scale feature maps at each level to obtain high-resolution scale feature maps corresponding to each level; and performing target detection processing on the high-resolution scale feature maps at each level through the detection head module of the model to obtain the detection results of small target objects; thereby achieving automatic identification and detection of small target objects, improving the accuracy and real-time performance of small target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent monitoring technology, and in particular to an intelligent monitoring method and system based on small target detection. Background Technology

[0002] Because small objects occupy relatively few pixels in an image, their feature information is limited, and they are easily interfered with by background noise or occlusion. Traditional intelligent monitoring systems often fail to fully extract the features of small objects in complex scenes, leading to the risk of missed detections and false detections. Although some intelligent monitoring systems use pre-trained small object detection models to detect small objects, the feature extraction process is often limited to a single scale or a specific range, with insufficient cross-scale feature interaction and failure to effectively integrate small object feature information at different scales, thus affecting the accuracy of small object detection. Summary of the Invention

[0003] To address the aforementioned technical problems, this invention provides an intelligent monitoring method and system based on small target detection, which enables automatic identification and detection of small target objects in surveillance videos, thereby improving the accuracy and real-time performance of small target detection.

[0004] In a first aspect, the present invention provides an intelligent monitoring method based on small target detection, the method comprising:

[0005] Acquire video image data in real time from multiple surveillance cameras within the monitored area;

[0006] The small object detection model performs multiple convolutions and sampling processes on the video image data through its backbone network module to obtain multi-scale features of the video image data; the small object detection model is an improvement based on the YOLOv5 model.

[0007] The neck network module of the small target detection model is used to fuse multi-scale features of video image data to obtain scale feature maps at multiple levels.

[0008] A pre-defined attention module is added to the output of the neck network module of the small target detection model to perform feature extraction and image reconstruction on the scale feature maps of each level, thereby obtaining the high-resolution scale feature maps corresponding to each level. The pre-defined attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism.

[0009] The detection head module of the small target detection model performs target detection processing on the high-resolution scale feature map of each level to obtain the detection results of small target objects; wherein, the detection results include the predicted results of the small target object's position, category and confidence.

[0010] Furthermore, a preset attention module is added to the output of the neck network of the small target detection model to perform feature extraction and image reconstruction processing on the scale feature maps of each level, thereby obtaining a high-resolution scale feature map corresponding to each level, including:

[0011] Multi-dimensional feature enhancement calculations are performed on the scale feature maps of each level based on various attention mechanisms to obtain multi-dimensional feature enhancement results; the various attention mechanisms include channel attention mechanism and window self-attention mechanism;

[0012] Overlapping cross-attention calculation is performed on the multi-dimensional feature enhancement results to obtain the attention feature mapping results;

[0013] The attention feature map result and the scale feature map are fused together to obtain the feature enhancement fusion result;

[0014] The enhanced feature fusion results are processed by image reconstruction to obtain high-resolution scale feature maps corresponding to each level.

[0015] Furthermore, the multi-dimensional feature enhancement calculation is performed on the scale feature map of each level based on multiple different attention mechanisms to obtain the multi-dimensional feature enhancement result, including:

[0016] The scale feature map corresponding to each level is subjected to layer normalization to obtain the first normalized feature result;

[0017] Channel attention is calculated on the first standardized feature result to obtain the channel attention weight feature result;

[0018] Window self-attention is calculated on the first normalized feature results to obtain the window self-attention weight feature results;

[0019] The scale feature map, channel attention weight feature results, and window self-attention weight feature results are fused to obtain a hybrid attention weight feature result.

[0020] The hybrid attention weight feature results are subjected to layer normalization to obtain the second normalized feature results;

[0021] The second standardized feature result is subjected to multi-layer perceptual processing to obtain the first spatial enhanced feature result;

[0022] The first-space enhanced feature results and the hybrid attention weight feature results are fused to obtain multi-dimensional feature enhancement results.

[0023] Furthermore, the overlapping cross-attention calculation performed on the multi-dimensional feature enhancement results to obtain the attention feature mapping results includes:

[0024] The multi-dimensional feature enhancement results are subjected to layer normalization to obtain the third normalized feature results.

[0025] The third-standard feature results are subjected to window partitioning and overlapping cross-attention calculation to obtain weighted feature results;

[0026] The weighted feature results are subjected to layer normalization to obtain the fourth normalized feature results;

[0027] The fourth normative feature results are subjected to multi-layer perceptual processing to obtain attention feature mapping results.

[0028] Furthermore, the small object detection model is pre-trained, and the pre-training methods for the small object detection model include:

[0029] The labeled training data is input into the small object detection model to obtain the initial detection results of small objects; the initial detection results include the predicted results of the small object's position, category, and confidence level;

[0030] Based on the initial detection results of small target objects and the loss function of the small target detection model, the loss value is calculated, and the loss value between the predicted result and the true label is obtained.

[0031] The calculated loss value is used for backpropagation, and the running parameters of the small target detection model and attention module are updated by gradient descent algorithm;

[0032] Continue iterative training until the loss value converges to obtain the small target detection model to be validated.

[0033] Furthermore, performance evaluation methods for small target detection models include:

[0034] The untrained training data is input into the small object detection model to be validated to obtain the evaluation detection results; the untrained training data includes image data in various environments, and the evaluation detection results include the prediction results of the small object's position, category, and confidence.

[0035] Based on the evaluation index algorithm, the performance evaluation results of the small target detection model to be verified are obtained;

[0036] Based on the performance evaluation results, the small target detection model is optimized to obtain the best small target detection model.

[0037] Secondly, the present invention provides an intelligent monitoring system based on small target detection. The system is used to execute the intelligent monitoring method based on small target detection as described in any of the preceding claims. The system includes a data acquisition module and a small target detection model improved based on the YOLOv5 model. The small target detection model includes a backbone network module, a neck network module, and a detection head module. A preset attention module is added to the output of the neck network module.

[0038] Data acquisition module: used to acquire video image data of the monitored area in real time from multiple surveillance cameras;

[0039] Backbone network module: used to perform multiple convolutions and sampling processes on video image data to obtain multi-scale features of the video image data;

[0040] Neck network module: used to fuse multi-scale features of video image data to obtain multi-level scale feature maps;

[0041] The attention module is used to perform feature extraction and image reconstruction on the scale feature maps of each level to obtain the high-resolution scale feature maps corresponding to each level. The attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism.

[0042] The detection head module is used to perform target detection processing on the high-resolution scale feature maps of each level to obtain the detection results of small target objects; wherein, the detection results include the predicted results of the position, category and confidence of the small target objects.

[0043] In a second aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the intelligent monitoring method based on small target detection as described in any of the preceding claims.

[0044] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the intelligent monitoring method based on small target detection as described in any of the preceding claims.

[0045] Fourthly, the present invention provides a computer program product, the computer program product comprising a computer program stored on a computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is capable of executing the intelligent monitoring method based on small target detection as described in any of the preceding claims.

[0046] The above-described one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects:

[0047] The intelligent monitoring method and system based on small target detection provided by this invention improves the small target detection model based on the YOLOv5 model, enabling cross-scale feature interaction and effectively fusing small target feature information at different scales. By introducing a hybrid channel attention mechanism and a window self-attention mechanism into the neck network of the improved YOLOv5 model, the local and global feature information of small targets can be extracted and fused more effectively, thereby improving the accuracy of small target detection. This enables real-time deep analysis and accurate prediction of input images, assisting the monitoring system in accurately and efficiently identifying, tracking, and locating small targets in real time, meeting the high-precision and real-time detection requirements of small targets in actual monitoring scenarios. Attached Figure Description

[0048] Figure 1 This is a flowchart illustrating the intelligent monitoring method provided by the present invention;

[0049] Figure 2 This is a schematic diagram of the intelligent monitoring system provided by the present invention;

[0050] Figure 3 This is a schematic diagram of the structure of the small target detection model in the intelligent monitoring system provided by the present invention;

[0051] Figure 4 This is a schematic diagram of the structure of the attention module in the intelligent monitoring system provided by the present invention;

[0052] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention. The following embodiments are used to illustrate this invention but cannot be used to limit the scope of this invention.

[0054] In the description of the embodiments of the present invention, it should be noted that the terms "first", "second" and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0055] In the description of the embodiments of the present invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of the present invention based on the specific circumstances.

[0056] In the description of the embodiments of the present invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of the present invention based on the specific circumstances.

[0057] The following is combined with Figures 1 to 4 Description of embodiments of the present invention:

[0058] Figure 1 A flowchart illustrating the intelligent monitoring method provided by this invention is provided. Step S100 involves acquiring video image data from multiple surveillance cameras in real-time within the monitored area. Step S200 involves performing multiple convolutions and sampling processes on the video image data using the backbone network module of a small target detection model to obtain multi-scale features of the video image data. The small target detection model is an improvement based on the YOLOv5 model. Step S300 involves fusing the multi-scale features of the video image data using the neck network module of the small target detection model to obtain scale feature maps at multiple levels. Step S400 involves adding a preset attention module to the output of the neck network module of the small target detection model to perform feature extraction and image reconstruction processing on the scale feature maps at each level, obtaining a high-resolution scale feature map corresponding to each level. The preset attention module incorporates a hybrid channel attention mechanism and / or a window self-attention mechanism. Step S500 involves performing target detection processing on the high-resolution scale feature maps at each level using the detection head module of the small target detection model to obtain the detection results of small target objects. The detection results include predictions of the small target object's location, category, and confidence level.

[0059] Figure 2 A schematic diagram of the intelligent monitoring system of the present invention is shown in the figure. Figure 3 A schematic diagram illustrating the structure of the small target detection model of the present invention is shown. Figure 4A schematic diagram of the attention module of the small target detection model of the present invention is illustrated. The system is used to execute the intelligent monitoring method based on small target detection as described above. The system includes a data acquisition module 2 and a small target detection model 3 improved based on the YOLOv5 model. The small target detection model 3 includes a backbone network module 31, a neck network module 32, and a detection head module 33. A preset attention module 34 is added to the output end of the neck network module 32. The data acquisition module 2 is used to execute the above step S100, the backbone network module 31 is used to execute the above step S200, the neck network module 32 is used to execute the above step S300, the attention module 34 is used to execute the above step S400, and the detection head module 33 is used to execute the above step S500.

[0060] It is understood that the intelligent monitoring method and system of the present invention improves the small target detection model based on the YOLOv5 model, enabling cross-scale feature interaction and effectively fusing small target feature information at different scales. By introducing a hybrid channel attention mechanism and a window self-attention mechanism into the neck network of the improved YOLOv5 model, the local and global feature information of small targets can be extracted and fused more effectively, thereby improving the accuracy of small target detection, realizing real-time depth analysis and accurate prediction of input images, assisting the monitoring system in accurately and efficiently recognizing, tracking and locating small targets in real time, and meeting the high-precision and real-time detection requirements of small targets in actual monitoring scenarios.

[0061] Specifically, in combination Figures 1-4 This invention provides an intelligent monitoring method based on small target detection, comprising the following steps S100~S500:

[0062] Step S100: Acquire video image data of the monitored area in real time from multiple surveillance cameras.

[0063] Multiple surveillance cameras 1 collect video image data in real time within the monitored area. These video image data contain various small and difficult-to-detect target objects. The data acquisition module 2 inputs them into the small target detection model 3. The small target detection model preprocesses the images and extracts features, and analyzes the image content.

[0064] Step S200: The video image data is subjected to multiple convolutions and sampling processes through the backbone network module of the small target detection model to obtain multi-scale features of the video image data.

[0065] It is important to understand that the small object detection model 3 is an improvement upon the YOLOv5 model, combined with... Figure 3The backbone network module of the small target detection model 3 of this invention consists of convolutional modules, fusion modules, and pooling modules. It performs multiple convolutions and sampling processes on the input video image data, outputting the results to the neck network module 32. The convolutional module is the Conv module, mainly composed of convolutional layers, batch normalization (BN) layers, and activation functions. The fusion module is the C3 module, which adaptively aggregates the preceding feature maps. The pooling module is the SPPF module, which obtains more comprehensive spatial information through weighted fusion of global and local features. This backbone network, composed of these modules, can minimize computational load and memory consumption while ensuring high detection accuracy.

[0066] In step S300, the multi-scale features of the video image data are fused through the neck network module of the small target detection model to obtain scale feature maps at multiple levels.

[0067] Combination Figure 3 and Figure 4 The neck network module 32 of the small target detection model 3 of the present invention adopts a PANet (Path Aggregation Network) structure, such as... Figure 3 As shown, the neck network module 32 of the small object detection model 3 includes a convolution module, an upsampling module, a concatenation module, and a fusion module. The upsampling module uses the Upsample module to enlarge low-resolution feature maps to higher resolution. The concatenation module uses the Concat module to concatenate feature maps of different scales along the channel dimension. The neck network module 32 designs an aggregation strategy through multiple upsampling, concatenation, dot products, and dot products to better utilize multi-scale features. It performs multi-scale feature fusion on the features extracted by the backbone network module. The neck network module of this invention outputs three levels of scale feature maps, such as 20*20*1024, 40*40*512, and 80*80*256, and passes these features to the attention module 34 located within the neck network layer for further processing.

[0068] Step S400: A preset attention module is added to the output of the neck network module of the small target detection model to perform feature extraction and image reconstruction processing on the scale feature maps of each level to obtain the high-resolution scale feature maps corresponding to each level; wherein, the preset attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism.

[0069] like Figure 3 As shown, the neck network module 32 of this invention adds an attention module 34 to the output of each layer, fusing multiple different attention mechanisms, such as a hybrid channel attention mechanism and a window self-attention mechanism, to effectively extract and fuse local and global feature information of small target objects. Figure 4 As shown, the attention module 34 consists of a convolution module, a mixed-channel attention submodule 341, an overlapping cross-attention submodule 342, and an image reconstruction module. The mixed-channel attention submodule 341 includes channel attention blocks and window attention blocks, and the overlapping cross-attention submodule 342 includes overlapping cross-attention blocks. In this invention, multiple sets of mixed-channel attention submodules 341 are set, and one set of overlapping cross-attention submodules 342 is set. The overlapping cross-attention submodule 342 is placed after multiple sets of mixed-channel attention submodules 341. The mixed-channel attention submodules 341 and the overlapping cross-attention submodules 342 are integrated into a functional block and then placed within the attention module.

[0070] Further, step S400 includes the following steps S410~S440:

[0071] Step S410: Perform multi-dimensional feature enhancement calculations on the scale feature maps of each level based on various different attention mechanisms to obtain multi-dimensional feature enhancement results; the various different attention mechanisms include channel attention mechanism and window self-attention mechanism.

[0072] like Figure 4 As shown, the hybrid channel attention submodule 341 of the present invention integrates channel attention blocks and window attention blocks. The channel attention block selects a CAB (Channel Attention Mechanism) block to weight the importance of each channel, amplifying important features and weakening irrelevant features. The window attention block selects a W-MSA (Window-based Multi-head Self-Attention) block to divide the input feature map into multiple non-overlapping small windows and perform self-attention operations within these windows. Further, step S410 includes the following steps S411~S417:

[0073] Step S411: Perform layer normalization on the scale feature map corresponding to each level to obtain the first normalized feature result. For example... Figure 4 As shown, after the scale feature map (Input) undergoes convolution, it is normalized by layer normalization, which is implemented using the LayerNorm module.

[0074] Step S412: Channel attention is calculated on the first normalized feature result to obtain the channel attention weight feature result. The channel attention calculation is performed through a channel attention block. For example, if the CAB block is selected, the data after normalization by the LayerNorm block is processed by applying a fully connected layer or other nonlinear transformation to the result of global average pooling to obtain the importance representation of each channel, and the channel attention weight feature result is output.

[0075] Step S413: Perform window self-attention calculation on the first normalized feature result to obtain the window self-attention weight feature result. The window self-attention calculation is implemented through window attention blocks. For example, the entire scale feature map is divided into non-overlapping sub-regions of fixed size using W-MSA blocks, and then the multi-head self-attention function is called to complete the modeling of the relationship between pixels in the local region. Finally, the initial size is restored by using the inverse process for the next step.

[0076] Step S414: The scale feature map, channel attention weight feature results and window self-attention weight feature results are fused to obtain the hybrid attention weight feature results.

[0077] Step S415 involves performing layer normalization on the hybrid attention weight feature results to obtain the second normalized feature results. This invention sets layer normalization modules before and after the channel attention block / window attention block, which helps to shorten training time without sacrificing accuracy and enhances the system's generalization ability.

[0078] Step S416: Perform multilayer perceptron processing on the second normalized feature result to obtain the first spatially enhanced feature result. The multilayer perceptron processing is implemented using an MLP (Multilayer Perceptron) module, which performs nonlinear transformation on the features processed by the channel attention mechanism and the window-based self-attention mechanism, which helps to further enhance the spatial expressive power of the features.

[0079] Step S417: The first spatial enhancement feature result and the hybrid attention weight feature result are fused to obtain the multi-dimensional feature enhancement result.

[0080] It is understood that the attention module of this invention integrates channel attention mechanism and window self-attention mechanism, which can capture global and local features at the same time. The channel attention mechanism can enhance important global features, while the window self-attention mechanism focuses on processing the contextual relationship within the local area and improves the attention to details, so that the small target detection model of this invention has higher accuracy in detecting small target objects in complex scenes.

[0081] Step S420: Perform overlapping cross-attention calculation on the multi-dimensional feature enhancement results to obtain the attention feature mapping results.

[0082] Following steps S411-S417 above, an overlapping cross-attention mechanism is introduced. The overlapping cross-attention calculation can be implemented using overlapping cross-attention blocks, specifically OCAB (Overlapping Cross Attention Blocks). This mechanism enhances feature representation while reducing computational complexity by introducing cross-attention within a local window. Further, step S420 includes the following steps S421-S424:

[0083] Step S421: Perform layer normalization on the multi-dimensional feature enhancement results to obtain the third normalized feature results.

[0084] Step S422: Perform window partitioning and overlapping cross-attention calculation on the third-order feature results to obtain weighted feature results. Window partitioning and overlapping cross-attention calculation can be implemented through an OCA (Overlapping Cross Attention Block). The input third-order feature results are divided into multiple non-overlapping sub-blocks of fixed size, and then a query key-value matching operation, i.e., cross-attention calculation, is performed to obtain weighted feature results.

[0085] Step S423 involves performing layer normalization on the weighted feature results to obtain the fourth normalized feature results. This invention also incorporates layer normalization modules before and after the overlapping cross-attention calculation, which enhances the system's generalization ability.

[0086] Step S424: Perform multilayer perceptron processing on the fourth-standard feature results to obtain the attention feature mapping results. The multilayer perceptron processing is performed using the MLP multilayer perceptron module to enhance the spatial representation capability of the features.

[0087] Step S430 involves fusing the attention feature mapping result and the scale feature map to obtain the feature enhancement fusion result. By fusing feature results based on different attention mechanisms at multiple levels, multi-level data fusion can be achieved, better capturing the correlation and importance distribution between features at different levels and improving detection accuracy.

[0088] Step S440 involves image reconstruction processing of the enhanced feature fusion result to obtain a high-resolution scale feature map corresponding to each level. For example... Figure 4 As shown, the enhanced feature fusion result undergoes convolution operations and image reconstruction processing to gradually transform the fused data back into a high-resolution image format within the pixel domain. The image reconstruction processing is implemented using the Pixel Shuffle block.

[0089] Therefore, the channel attention and window self-attention mechanism introduced in step S410, combined with the overlapping cross-attention mechanism in step S420, can effectively capture the dependencies between different scales, effectively extract and fuse global and local feature information of small target objects, and improve detection accuracy.

[0090] Step S500: The detection head module of the small target detection model performs target detection processing on the high-resolution scale feature maps of each level to obtain the detection results of small target objects; wherein, the detection results include the predicted results of the small target object's location, category, and confidence level. Combined with... Figure 3 That is, in step S400, the attention module outputs the result to the detection head module, and the detection head module outputs the final result after detecting the high-resolution scale feature map.

[0091] In summary, existing monitoring technologies often limit target feature extraction to a single scale or a specific range, lack cross-scale feature interaction, and fail to effectively integrate feature information of small targets at different scales. This invention improves the YOLOv5 model by using its unique hybrid channel attention mechanism and window self-attention mechanism to more effectively extract and integrate local and global feature information of small targets. This improves the accuracy of small target detection, reduces false negative and false positive rates, enhances the model's generalization performance under complex environmental conditions, and achieves performance improvement without significantly increasing computational costs. This meets the high-precision and real-time detection requirements for small targets in actual monitoring scenarios.

[0092] For example, the small object detection model is an improvement on the YOLOv5 model. The small object detection model needs to be pre-trained, and the pre-training method of the small object detection model includes steps A100 to A400:

[0093] Step A100: Input the labeled training data into the small object detection model to obtain the initial detection results of the small object; the initial detection results include the predicted results of the small object's position, category, and confidence level;

[0094] Step A200: Based on the initial detection results of small target objects and the loss function of the small target detection model, calculate the loss value and obtain the loss value between the predicted result and the true label.

[0095] Step A300: Use the calculated loss value for backpropagation processing, and update the running parameters of the small target detection model and attention module through the gradient descent algorithm;

[0096] Step A400: Continue iterative training until the loss value converges to obtain the small target detection model to be validated.

[0097] In summary, steps A100 to A400 involve inputting the labeled training data into the improved YOLOv5 model. The model performs feature extraction and attention mechanism learning through convolutional operations and the attention module to predict the location, category, and confidence of small targets in the image. The model's loss functions (classification loss, localization loss, and confidence loss) are used to calculate the error between the predicted values ​​and the ground truth labels, obtaining the loss value. Backpropagation is then performed using the loss value calculated during training, and the parameters of the YOLOv5 model and the attention module are updated using the gradient descent algorithm to optimize model performance. Steps A100 to A400 are repeated iteratively until the loss value converges, resulting in a model with optimal small target detection performance.

[0098] After thorough validation, the trained YOLOv5 model that meets performance requirements is deployed to a real-world monitoring scenario. Therefore, performance validation of the small object detection model is necessary after training. The performance evaluation method for the small object detection model includes steps B100~B300:

[0099] Step B100: Input the untrained training data into the small object detection model to be validated to obtain the evaluation detection results; the untrained training data includes image data in various environments, and the evaluation detection results include the prediction results of the small object's position, category, and confidence.

[0100] Step B200: Based on the evaluation index algorithm, obtain the performance evaluation results of the small target detection model to be verified.

[0101] Step B300: Based on the performance evaluation results, optimize the small target detection model to obtain the best small target detection model.

[0102] It is understandable that the training data not used in training is a validation set selected from the material set to verify the model's performance. The model is used to predict and detect small targets in the validation set, outputting the target's category, location, and confidence information. Evaluation metrics (such as mean AP, precision, and recall) are used to quantify the model's detection performance and evaluate the model's accuracy and generalization ability in detecting small targets in real-world monitoring scenarios.

[0103] The following comparative experiments were conducted using the traffic sign dataset TT100K to compare the traditional YOLOv5s model and the improved YOLOv5s model of this invention. Table 1 shows the comparison of detection results on the TT100K dataset, and Table 2 shows the comparison of experimental results under different simulation environments.

[0104] Table 1 Comparison of detection results on the TT100K dataset

[0105]

[0106] Table 2 Comparison of experimental results under different simulation environments

[0107]

[0108] The experimental results are analyzed as follows:

[0109] 1. The improved YOLOv5 model of this invention can improve the detection accuracy of small targets.

[0110] Because small targets occupy fewer pixels in an image, traditional YOLOv5 models often struggle to capture enough effective features, resulting in low detection accuracy. This invention significantly improves the model's ability to perceive small target features and its ability to interact across scales, effectively overcoming the problem of insufficient feature extraction in traditional detection methods. Experimental results show that the mAP value of this model for small target detection is 1.4% higher than that of the original YOLOv5 model.

[0111] 2. Reduce the rate of missed detections and false detections.

[0112] By employing the unique hybrid channel attention and window self-attention mechanism of this invention, it is possible to more effectively focus on small target regions, suppress background interference, and achieve more accurate target localization and classification prediction. As shown in Table 1, the false negative rate of small targets in this invention is reduced by approximately 2% compared to the traditional YOLOv5 algorithm, and the false positive rate is reduced by approximately 2.2%, significantly improving the reliability of the detection results.

[0113] 3. Improve model generalization performance:

[0114] This invention utilizes a unique attention mechanism to ensure the model maintains high recognition stability and robustness even in complex environments and changing backgrounds. As shown in Table 2, cross-scenario testing has verified that the generalization performance of this model is approximately 1.5% to 9.8% higher than that of the traditional YOLOv5s algorithm, demonstrating better adaptability to different monitoring scenarios.

[0115] It is important to emphasize that the improved YOLOv5 model using this invention has 22.7M parameters and a computational cost of 16.1 GFLOPs. If the same method is used to improve the YOLOv8 model, the improved YOLOv8 model has 26.7M parameters and a computational cost of 28.7 GFLOPs. Furthermore, experimental results show that the detection performance of the improved YOLOv8 model is lower than that of the improved YOLOv5 model of this invention. Therefore, using the YOLOv5 model as the baseline model ensures both high detection performance and lightweight design, making it well-suited for use in intelligent monitoring systems and achieving higher accuracy in small target detection.

[0116] on the other hand, Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute an intelligent monitoring method based on small target detection, which includes:

[0117] Step S100: Acquire video image data of the monitored area in real time from multiple surveillance cameras.

[0118] Step S200: The video image data is subjected to multiple convolutions and sampling processes through the backbone network module of the small target detection model to obtain multi-scale features of the video image data; wherein, the small target detection model is an improvement based on the YOLOv5 model.

[0119] In step S300, the multi-scale features of the video image data are fused through the neck network module of the small target detection model to obtain scale feature maps at multiple levels.

[0120] Step S400: A preset attention module is added to the output of the neck network module of the small target detection model to perform feature extraction and image reconstruction processing on the scale feature maps of each level to obtain the high-resolution scale feature maps corresponding to each level; wherein, the preset attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism.

[0121] Step S500: The detection head module of the small target detection model performs target detection processing on the high-resolution scale feature map of each level to obtain the detection result of the small target object; wherein, the detection result includes the prediction results of the position, category and confidence of the small target object.

[0122] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0123] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the intelligent monitoring method based on small target detection provided by the above methods, the method comprising:

[0124] Step S100: Acquire video image data of the monitored area in real time from multiple surveillance cameras.

[0125] Step S200: The video image data is subjected to multiple convolutions and sampling processes through the backbone network module of the small target detection model to obtain multi-scale features of the video image data; wherein, the small target detection model is an improvement based on the YOLOv5 model.

[0126] In step S300, the multi-scale features of the video image data are fused through the neck network module of the small target detection model to obtain scale feature maps at multiple levels.

[0127] Step S400: A preset attention module is added to the output of the neck network module of the small target detection model to perform feature extraction and image reconstruction processing on the scale feature maps of each level to obtain the high-resolution scale feature maps corresponding to each level; wherein, the preset attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism.

[0128] Step S500: The detection head module of the small target detection model performs target detection processing on the high-resolution scale feature map of each level to obtain the detection result of the small target object; wherein, the detection result includes the prediction results of the position, category and confidence of the small target object.

[0129] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a garbage detection method for the YOLO model provided by the methods described above, the method comprising:

[0130] Step S100: Acquire video image data of the monitored area in real time from multiple surveillance cameras.

[0131] Step S200: The video image data is subjected to multiple convolutions and sampling processes through the backbone network module of the small target detection model to obtain multi-scale features of the video image data; wherein, the small target detection model is an improvement based on the YOLOv5 model.

[0132] In step S300, the multi-scale features of the video image data are fused through the neck network module of the small target detection model to obtain scale feature maps at multiple levels.

[0133] Step S400: A preset attention module is added to the output of the neck network module of the small target detection model to perform feature extraction and image reconstruction processing on the scale feature maps of each level to obtain the high-resolution scale feature maps corresponding to each level; wherein, the preset attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism.

[0134] Step S500: The detection head module of the small target detection model performs target detection processing on the high-resolution scale feature map of each level to obtain the detection result of the small target object; wherein, the detection result includes the prediction results of the position, category and confidence of the small target object.

[0135] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0136] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An intelligent monitoring method based on small target detection, characterized in that, The method includes: Acquire video image data in real time from multiple surveillance cameras within the monitored area; The small object detection model performs multiple convolutions and sampling processes on the video image data through its backbone network module to obtain multi-scale features of the video image data; the small object detection model is an improvement based on the YOLOv5 model. The neck network module of the small target detection model is used to fuse multi-scale features of video image data to obtain scale feature maps at multiple levels. A pre-defined attention module is added to the output of the neck network module of the small target detection model. Feature extraction and image reconstruction are performed on the scale feature maps of each level to obtain high-resolution scale feature maps corresponding to each level. The pre-defined attention module incorporates a hybrid channel attention mechanism and a window self-attention mechanism. The process of performing feature extraction and image reconstruction on the scale feature maps of each level to obtain high-resolution scale feature maps includes: performing multi-dimensional feature enhancement calculations on the scale feature maps of each level based on the hybrid channel attention mechanism and the window self-attention mechanism to obtain multi-dimensional feature enhancement results; performing overlapping cross-attention calculations on the multi-dimensional feature enhancement results to obtain attention feature mapping results; fusing the attention feature mapping results and the scale feature maps to obtain feature enhancement fusion results; and performing image reconstruction on the enhanced feature fusion results to obtain high-resolution scale feature maps corresponding to each level. The detection head module of the small target detection model performs target detection processing on the high-resolution scale feature map of each level to obtain the detection results of small target objects; wherein, the detection results include the predicted results of the small target object's position, category and confidence.

2. The method according to claim 1, characterized in that, The multi-dimensional feature enhancement calculations are performed on the scale feature maps of each level based on the hybrid channel attention mechanism and the window self-attention mechanism, respectively, to obtain the multi-dimensional feature enhancement results, including: The scale feature map corresponding to each level is subjected to layer normalization to obtain the first normalized feature result; Channel attention is calculated on the first standardized feature result to obtain the channel attention weight feature result; Window self-attention is calculated on the first normalized feature results to obtain the window self-attention weight feature results; The scale feature map, channel attention weight feature results, and window self-attention weight feature results are fused to obtain a hybrid attention weight feature result. The hybrid attention weight feature results are subjected to layer normalization to obtain the second normalized feature results; The second standardized feature result is subjected to multi-layer perceptual processing to obtain the first spatial enhanced feature result; The first-space enhanced feature results and the hybrid attention weight feature results are fused to obtain multi-dimensional feature enhancement results.

3. The method according to claim 1, characterized in that, The overlapping cross-attention calculation of the multi-dimensional feature enhancement results to obtain attention feature mapping results includes: The multi-dimensional feature enhancement results are subjected to layer normalization to obtain the third normalized feature results. The third-standard feature results are subjected to window partitioning and overlapping cross-attention calculation to obtain weighted feature results; The weighted feature results are subjected to layer normalization to obtain the fourth normalized feature results; The fourth normative feature results are subjected to multi-layer perceptual processing to obtain attention feature mapping results.

4. The method according to claim 1, characterized in that, The small object detection model is obtained through pre-training. Pre-training methods for the small object detection model include: The labeled training data is input into the small object detection model to obtain the initial detection results of small objects; the initial detection results include the predicted results of the small object's position, category, and confidence level; Based on the initial detection results of small target objects and the loss function of the small target detection model, the loss value is calculated, and the loss value between the predicted result and the true label is obtained. The calculated loss value is used for backpropagation, and the running parameters of the small target detection model and attention module are updated by gradient descent algorithm; Continue iterative training until the loss value converges to obtain the small target detection model to be validated.

5. The method according to claim 4, characterized in that, Performance evaluation methods for small object detection models include: The untrained training data is input into the small object detection model to be validated to obtain the evaluation detection results; the untrained training data includes image data in various environments, and the evaluation detection results include the prediction results of the small object's position, category, and confidence. Based on the evaluation index algorithm, the performance evaluation results of the small target detection model to be verified are obtained; Based on the performance evaluation results, the small target detection model is optimized to obtain the best small target detection model.

6. An intelligent monitoring system based on small target detection, characterized in that, The system is used to execute the intelligent monitoring method based on small target detection as described in any one of claims 1 to 5. The system includes a data acquisition module and a small target detection model improved based on the YOLOv5 model. The small target detection model includes a backbone network module, a neck network module, and a detection head module. A preset attention module is added to the output of the neck network module. Data acquisition module: used to acquire video image data of the monitored area in real time from multiple surveillance cameras; Backbone network module: used to perform multiple convolutions and sampling processes on video image data to obtain multi-scale features of the video image data; Neck network module: used to fuse multi-scale features of video image data to obtain multi-level scale feature maps; An attention module is used to perform feature extraction and image reconstruction processing on the scale feature maps of each level to obtain high-resolution scale feature maps corresponding to each level. The attention module incorporates a hybrid channel attention mechanism and a window self-attention mechanism. The process of performing feature extraction and image reconstruction processing on the scale feature maps of each level to obtain high-resolution scale feature maps includes: performing multi-dimensional feature enhancement calculations on the scale feature maps of each level based on the hybrid channel attention mechanism and the window self-attention mechanism to obtain multi-dimensional feature enhancement results; performing overlapping cross-attention calculations on the multi-dimensional feature enhancement results to obtain attention feature mapping results; fusing the attention feature mapping results and the scale feature maps to obtain feature enhancement fusion results; and performing image reconstruction processing on the enhanced feature fusion results to obtain high-resolution scale feature maps corresponding to each level. The detection head module is used to perform target detection processing on the high-resolution scale feature maps of each level to obtain the detection results of small target objects; wherein, the detection results include the predicted results of the position, category and confidence of the small target objects.

7. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the intelligent monitoring method based on small target detection as described in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the intelligent monitoring method based on small target detection as described in any one of claims 1 to 5.

9. A computer program product, the computer program product comprising a computer program stored on a computer-readable storage medium, the computer program comprising program instructions, characterized in that, When the program instructions are executed by the computer, the computer is able to execute the intelligent monitoring method based on small target detection as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Target detection model training method and device, electronic equipment and storage medium

    CN119180997A

  • Small target detection method and system

    CN119648980A