Intelligent monitoring method and system based on small target detection

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

CN120656124AActive Publication Date: 2025-09-16FOSHAN ZHIQING TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510806876.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-09-16
Estimated Expiration
2045-06-17

AI Technical Summary

Technical Problem

Traditional intelligent monitoring systems have difficulty effectively extracting small target features in complex scenarios, resulting in missed detections and false detections, and insufficient cross-scale feature interaction, which affects the accuracy of small target detection.

Method used

Based on the YOLOv5 model, the small target detection model is improved by introducing a hybrid channel attention mechanism and a window self-attention mechanism. Multi-scale feature fusion is performed through the neck network module, and target detection is performed in the detection head module to enhance feature extraction and fusion capabilities.

Benefits of technology

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

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120656124A_ABST
    Figure CN120656124A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent monitoring method and system based on small target detection, and relates to the technical field of intelligent monitoring, and the method comprises the steps: obtaining video image data collected by a monitoring camera in real time; performing multiple times of convolution and sampling processing on the video image data through a backbone network module of the model to obtain multi-scale features of the video image data; performing fusion processing on the multi-scale features of the video image data through a neck network module of the model to obtain scale feature maps of multiple levels; adding a preset attention module at the output end of the neck network module of the model, and performing feature extraction processing and image reconstruction processing on the scale feature map of each level to obtain a high-resolution scale feature map corresponding to each level; performing target detection processing on the high-resolution scale feature map of each level through a detection head module of the model to obtain a detection result of the small target object; therefore, automatic identification and detection of the small target object are realized, and the accuracy and real-time performance of small target detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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 Art

[0002] Because small targets occupy relatively few pixels in an image, their feature information is limited, and they are easily obscured by background noise or occlusion, traditional intelligent monitoring systems often fail to fully extract small target features in complex scenarios, risking missed detections and false detections. Although some intelligent monitoring systems utilize pre-trained small target detection models to detect small targets, the target feature extraction process is often limited to a single scale or specific range, lacking cross-scale feature interaction and failing to effectively integrate small target feature information at different scales, affecting the accuracy of small target detection. Summary of the Invention

[0003] To solve the above technical problems, the present invention provides an intelligent monitoring method and system based on small target detection, which can realize automatic recognition and detection of small target objects in monitoring videos, and improve 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: Acquire video image data collected by multiple surveillance cameras in real time within the surveillance area; The backbone network module of the small target detection model performs multiple convolution and sampling processes on the video image data to obtain multi-scale features of the video image data. The small target detection model is improved based on the YOLOv5 model. The neck network module of the small target detection model is used to fuse the multi-scale features of the video image data to obtain multi-level scale feature maps; A preset attention module is added to the output end of the neck network module of the small target detection model to perform feature extraction and image reconstruction on the scale feature map of each layer, thereby obtaining a high-resolution scale feature map corresponding to each layer. The preset attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism. The detection head module of the small target detection model performs target detection processing on the high-resolution scale feature map of each layer to obtain the detection results of the small target object; wherein the detection results include the prediction results of the small target object position, category and confidence.

[0005] Furthermore, a preset attention module is added to the output end of the neck network of the small target detection model to perform feature extraction and image reconstruction on the scale feature map of each level, respectively, to obtain a high-resolution scale feature map corresponding to each level, including: Based on a variety of different attention mechanisms, multi-dimensional feature enhancement calculations are performed on the scale feature maps of each layer to obtain multi-dimensional feature enhancement results; a variety of different attention mechanisms include channel attention mechanism and window self-attention mechanism; Perform overlapping cross-attention calculation on the multi-dimensional feature enhancement results to obtain the attention feature mapping results; The attention feature map result and the scale feature map are fused to obtain the feature enhancement fusion result; The enhanced feature fusion results are reconstructed to obtain high-resolution scale feature maps corresponding to each level.

[0006] Furthermore, the multi-dimensional feature enhancement calculation is performed on the scale feature map of each level based on a plurality of different attention mechanisms to obtain a multi-dimensional feature enhancement result, including: Perform layer normalization on the scale feature map corresponding to each level to obtain the first normalized feature result; Perform channel attention calculation on the first canonical feature result to obtain the channel attention weight feature result; Perform window self-attention calculation on the first canonical feature result to obtain the window self-attention weight feature result; The scale feature map, channel attention weight feature result and window self-attention weight feature result are fused to obtain the mixed attention weight feature result; Perform layer normalization on the mixed attention weight feature result to obtain the second normalized feature result; Performing multi-layer perception processing on the second standard feature result to obtain the first spatial enhanced feature result; The first spatial enhancement feature result and the mixed attention weight feature result are fused to obtain a multi-dimensional feature enhancement result.

[0007] Furthermore, the overlapping cross attention calculation is performed on the multi-dimensional feature enhancement result to obtain the attention feature mapping result, including: Perform layer normalization on the multi-dimensional feature enhancement results to obtain the third normalized feature results; Perform window partitioning and overlapping cross attention calculation on the third canonical feature result to obtain the weighted feature result; Perform layer normalization on the weighted feature results to obtain the fourth normalized feature results; The fourth canonical feature result is subjected to multi-layer perception processing to obtain the attention feature mapping result.

[0008] Furthermore, the small target detection model is obtained by pre-training. The pre-training method of the small target detection model includes: Input the labeled training data into the small target detection model to obtain the initial detection results of the small target object; the initial detection results include the prediction results of the small target 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 to obtain the loss value between the predicted result and the true annotation; The calculated loss value is used for backpropagation processing, and the operating parameters of the small target detection model and attention module are updated through the gradient descent algorithm; Continue iterating training until the loss value converges to obtain the small target detection model to be verified.

[0009] Furthermore, the performance evaluation methods of small target detection models include: The training data that has not participated in the training is input into the small target detection model to be verified to obtain the evaluation detection results; the training data that has not participated in the training includes image data in various environments, and the evaluation detection results include the prediction results of the small target object position, category and confidence level; 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.

[0010] In a second aspect, the present invention provides an intelligent monitoring system based on small target detection, the system being used to execute any of the above-described intelligent monitoring methods based on small target detection, the system comprising a data acquisition module and a small target detection model improved based on the YOLOv5 model, the small target detection model comprising a backbone network module, a neck network module and a detection head module, the output end of the neck network module being added with a preset attention module; wherein, Data acquisition module: used to obtain video image data collected by multiple surveillance cameras in real time within the monitoring area; Backbone network module: used to perform multiple convolution and sampling processes on video image data to obtain multi-scale features of video image data; Neck network module: used to fuse the multi-scale features of video image data to obtain multi-level scale feature maps; The attention module is used to perform feature extraction and image reconstruction on the scale feature map of each layer to obtain a high-resolution scale feature map corresponding to each layer. The attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism. The detection head module is used to perform target detection processing on the high-resolution scale feature map of each layer to obtain the detection results of small target objects; wherein the detection results include the prediction results of the small target object position, category and confidence.

[0011] In a second aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the intelligent monitoring method based on small target detection as described in any one of the above items is implemented.

[0012] In a third aspect, 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 one of the above items.

[0013] In a fourth aspect, the present invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the intelligent monitoring method based on small target detection as described in any one of the above items.

[0014] The above one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects: The intelligent monitoring method and system based on small target detection provided by the present invention improve the small target detection model based on the YOLOv5 model, can realize cross-scale feature interaction, and effectively fuse the feature information of small targets at different scales. The hybrid channel attention mechanism and window self-attention mechanism are introduced into the neck network of the improved YOLOv5 model, which can more effectively extract and fuse the local and global feature information of small targets, thereby improving the accuracy of small target detection, realizing real-time in-depth analysis and precise prediction of input images, and assisting the monitoring system to accurately and efficiently realize the recognition, tracking and real-time positioning of small targets, meeting the high-precision and real-time detection requirements of small targets in actual monitoring scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flow chart of the intelligent monitoring method provided by the present invention; Figure 2 It is a structural diagram of the intelligent monitoring system provided by the present invention; 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; Figure 4 Schematic diagram of the structure of the attention module in the intelligent monitoring system provided by the present invention; Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0016] To make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be described clearly and completely below. Obviously, the embodiments described are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0017] 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 understood as indicating or implying relative importance.

[0018] In the description of the embodiments of the present invention, it should be noted that, unless otherwise specified or limited, the terms "connected" and "connection" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; mechanical connections, electrical connections; and direct connections or indirect connections through an intermediary. Those skilled in the art will understand the specific meanings of the above terms in the embodiments of the present invention based on the specific circumstances.

[0019] In the description of the embodiments of the present invention, it should be noted that, unless otherwise specified or limited, the terms "connected" and "connection" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; mechanical connections, electrical connections; and direct connections or indirect connections through an intermediary. Those skilled in the art will understand the specific meanings of the above terms in the embodiments of the present invention based on the specific circumstances.

[0020] The following combination Figures 1 to 4 Describing embodiments of the present invention: Figure 1The flowchart of the intelligent monitoring method provided by the present invention is illustrated. In which, step S100 is to obtain video image data within the monitoring area collected in real time by multiple surveillance cameras; step S200 is to perform multiple convolution and sampling processing on the video image data through the backbone network module of the small target detection model to obtain multi-scale features of the video image data. The small target detection model is based on the improved YOLOv5 model; step S300 is to fuse the multi-scale features of the video image data through the neck network module of the small target detection model to obtain scale feature maps of multiple levels; step S400 is to add a preset attention module to the output end of the neck network module of the small target detection model to perform feature extraction and image reconstruction processing on the scale feature map of each level respectively to obtain a high-resolution scale feature map corresponding to each level. The preset attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism; step S500 is to perform target detection processing on the high-resolution scale feature map of each level respectively through the detection head module of the small target detection model to obtain a detection result of the small target object, wherein the detection result includes a prediction result of the small target object position, category and confidence.

[0021] Figure 2 The schematic diagram of the structure of the intelligent monitoring system of the present invention is illustrated. Figure 3 The schematic diagram of the structure of the small target detection model of the present invention is illustrated. Figure 4 The structural diagram of the attention module of the small target detection model of the present invention is illustrated. The system is used to perform 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. The output end of the neck network module 32 is added with a preset attention module 34; wherein, the data acquisition module 2 is used to perform the above step S100, the backbone network module 31 is used to perform the above step S200, the neck network module 32 is used to perform the above step S300, the attention module 34 is used to perform the above step S400, and the detection head module 33 is used to perform the above step S500.

[0022] It can be understood that the intelligent monitoring method and system of the present invention improve the small target detection model based on the YOLOv5 model, which can realize cross-scale feature interaction and effectively fuse the feature information of small targets at different scales. The hybrid channel attention mechanism and the window self-attention mechanism are introduced into the neck network of the improved YOLOv5 model, which can more effectively extract and fuse the local and global feature information of small targets, thereby improving the accuracy of small target detection, realizing real-time in-depth analysis and precise prediction of input images, and assisting the monitoring system to accurately and efficiently realize the recognition, tracking and real-time positioning of small targets, meeting the high-precision and real-time detection requirements of small targets in actual monitoring scenarios.

[0023] Specifically, combined Figures 1 to 4 The present invention provides an intelligent monitoring method based on small target detection, comprising the following steps S100 to S500: Step S100: obtaining video image data collected in real time by multiple surveillance cameras within a surveillance area.

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

[0025] In step S200 , the backbone network module of the small target detection model performs multiple convolution and sampling processes on the video image data to obtain multi-scale features of the video image data.

[0026] It should be understood that the small target detection model 3 is improved based on the YOLOv5 model, combined with Figure 3 The backbone network module (Backbone) of the small target detection model 3 of the present invention is composed of a convolution module, a fusion module, a pooling module, etc., which performs multiple convolution and sampling processes on the input video image data and outputs the results to the neck network module 32 (Neck). The convolution module selects the Conv module, which is mainly composed of a convolution layer, a BN layer, and an activation function. The fusion module selects the C3 module to adaptively aggregate the previous feature map. The pooling module selects the SPPF module to obtain more comprehensive spatial information through weighted fusion of global features and local features. The backbone network composed of these modules can minimize the amount of calculation and memory usage while ensuring high detection accuracy.

[0027] In step S300 , the neck network module of the small target detection model is used to fuse the multi-scale features of the video image data to obtain scale feature maps of multiple levels.

[0028] Combine 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, path aggregation network) structure, such as Figure 3 As shown, the neck network module 32 of the small target detection model 3 includes a convolution module, an upsampling module, a splicing module and a fusion module. The upsampling module selects the Upsample module to amplify the low-resolution feature map to a higher resolution. The splicing module selects the Concat module to splice feature maps of different scales in the channel dimension. The neck network module 32 designs an aggregation strategy through multiple upsampling, splicing, points and dot products to better utilize multi-scale features and perform multi-scale feature fusion on the features extracted by the backbone network module (Backbone). The neck network module of the present 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 in the neck network layer for the next step of processing.

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

[0030] like Figure 3 As shown, the neck network module 32 of the present invention adds an attention module 34 to the output end of each layer, integrating multiple different attention mechanisms, such as the hybrid channel attention mechanism and the window self-attention mechanism, to effectively extract and fuse the local and global feature information of small target objects. Figure 4 As shown, the attention module 34 is composed 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 a channel attention block and a window attention block, and the overlapping cross attention submodule 342 includes an overlapping cross attention block. In the present invention, multiple groups of mixed channel attention submodules 341 are provided, and one group of overlapping cross attention submodules 342 is provided. The overlapping cross attention submodule 342 is placed after the multiple groups of mixed channel attention submodules 341. The mixed channel attention submodule 341 and the overlapping cross attention submodule 342 are integrated into a functional block and then provided in the attention module.

[0031] Furthermore, step S400 includes the following steps S410 to S440: In step S410, multi-dimensional feature enhancement calculation is performed on the scale feature map of each level based on a plurality of different attention mechanisms to obtain a multi-dimensional feature enhancement result; the plurality of different attention mechanisms include a channel attention mechanism and a window self-attention mechanism.

[0032] like Figure 4 As shown, the hybrid channel attention submodule 341 of the present invention integrates a channel attention block and a window attention block. The channel attention block selects the CAB block (Channel Attention Mechanism) to weight the importance of each channel, amplify important features and weaken irrelevant features. The window attention block selects the W-MSA block (Window-based Multi-head Self-Attention), divides the input feature map into multiple non-overlapping small windows, and performs self-attention operations within these windows. Further, step S410 includes the following steps S411 to S417: Step S411: perform layer normalization on the scale feature map corresponding to each level to obtain the first normalized feature result. Figure 4 As shown in the figure, after the scale feature map (Input) undergoes convolution operation, layer normalization is performed, and the layer normalization module is implemented by the LayerNorm module.

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

[0034] In step S413, a windowed self-attention calculation is performed on the first canonical feature result to obtain a windowed self-attention weighted feature result. This calculation is implemented using a windowed attention block. For example, the W-MSA block is used to divide the entire scale feature map into fixed-size, non-overlapping sub-regions. A multi-headed self-attention function is then called to model the inter-pixel relationships within the local region. Finally, an inverse process is used to restore the image to its original size for processing in the next step.

[0035] In step S414, the scale feature map, the channel attention weight feature result and the window self-attention weight feature result are fused to obtain a mixed attention weight feature result.

[0036] In step S415, the mixed attention weight feature result is layer-normalized to obtain a second normalized feature result. The present invention provides layer-normalization modules before and after the channel attention block / window attention block, which helps shorten training time without losing accuracy and enhances the system's generalization capability.

[0037] In step S416, multi-layer perceptron processing is performed on the second canonical feature result to obtain a first spatially enhanced feature result. This multi-layer perceptron processing is implemented using an MLP (Multilayer Perceptron) module. This nonlinear transformation is performed on the features processed by the channel attention mechanism and the window-based self-attention mechanism, further enhancing the spatial representation capability of the features.

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

[0039] It can be understood that the attention module of the present invention integrates the channel attention mechanism and the 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 contextual relationships within local areas, improving attention to details, so that the small target detection model of the present invention has higher accuracy in detecting small target objects in complex scenes.

[0040] Step S420: perform overlapping cross-attention calculation on the multi-dimensional feature enhancement result to obtain an attention feature mapping result.

[0041] After steps S411 to S417 above, the overlapping cross attention mechanism is introduced. The overlapping cross attention calculation can be implemented by the overlapping cross attention block. The overlapping cross attention block selects the OCAB block (Overlapping Cross Attention Block). By introducing the cross attention mechanism within the local window, the feature expression capability is enhanced while reducing the computational complexity. Further, step S420 includes the following steps S421 to S424: Step S421, performing layer normalization processing on the multi-dimensional feature enhancement result to obtain a third normalized feature result.

[0042] Step S422: Window partitioning and overlapping cross attention calculation are performed on the third canonical feature result to obtain a weighted feature result. Window partitioning and overlapping cross attention calculation can be implemented using the Overlapping Cross Attention Block (OCA block). The input third canonical feature result is divided into multiple non-overlapping sub-blocks of fixed size. A query key matching operation, i.e., cross attention calculation, is then performed to obtain a weighted feature result.

[0043] In step S423, the weighted feature results are subjected to layer normalization processing to obtain a fourth normalized feature result. The present invention also sets a layer normalization module before and after the overlapping cross attention calculation, which is beneficial to enhancing the generalization ability of the system.

[0044] Step S424: Multi-layer perception processing is performed on the fourth canonical feature result to obtain an attention feature mapping result. The multi-layer perception processing is performed using an MLP multi-layer perception module to enhance the spatial expression capability of the feature.

[0045] In step S430, the attention feature map results and the scale feature map are fused to obtain a feature enhancement fusion result. By integrating the feature results based on different attention mechanisms into multi-level data fusion, we can better capture the correlation and importance distribution between features at different levels, thereby improving detection accuracy.

[0046] Step S440: Perform image reconstruction on the enhanced feature fusion result to obtain a high-resolution scale feature map corresponding to each level. Figure 4 As shown in the figure, the enhanced feature fusion results are processed by convolution operation and image reconstruction, and the fused data is gradually converted back to the high-resolution image form in the pixel domain. The image reconstruction process is implemented by the Pixel Shuffle block.

[0047] 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 the global and local feature information of small target objects, and improve detection accuracy.

[0048] 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 layer to obtain the detection result of the small target object; wherein the detection result includes the prediction result of the position, category and confidence of the small target object. Figure 3 That is, in step S400, the attention module outputs the result to the detection head module, and the detection head module detects the high-resolution scale feature map and outputs the final result.

[0049] In summary, in view of the problem that the existing monitoring technology is often limited to a single scale or a specific range in the process of target feature extraction, the cross-scale feature interaction is insufficient, and the feature information of small targets at different scales cannot be effectively integrated, the present invention improves the YOLOv5 model. Through its unique hybrid channel attention mechanism and window self-attention mechanism, it can more effectively extract and integrate the local and global feature information of small targets, thereby improving the accuracy of small target detection, reducing the missed detection and false detection rates, and enhancing the generalization performance of the model under complex environmental conditions. It also achieves the improvement of model performance without significantly increasing the computational cost, and meets the high-precision and real-time detection requirements for small targets in actual monitoring scenarios.

[0050] Exemplarily, the small target detection model is improved based on the YOLOv5 model. The small target detection model needs to be pre-trained. The pre-training method of the small target detection model includes steps A100 to A400: Step A100: Input the labeled training data into the small target detection model to obtain the initial detection results of the small target objects; the initial detection results include the prediction results of the small target object location, category and confidence level; Step A200: Based on the initial detection result of the small target object and the loss function of the small target detection model, a loss value is calculated to obtain the loss value between the predicted result and the true annotation; Step A300: Perform backpropagation processing using the calculated loss value and update the operating parameters of the small target detection model and the attention module through the gradient descent algorithm; Step A400: Continue iterative training until the loss value converges to obtain a small target detection model to be verified.

[0051] In short, in steps A100 through A400, the labeled training data is fed into the improved YOLOv5 model. The model uses convolution operations and the attention module to extract features and learn the attention mechanism to predict the location, category, and confidence of small objects in the image. The model's loss functions (classification loss, localization loss, and confidence loss) are used to calculate the error between the predicted value and the true annotation to obtain a loss value. The loss value calculated during training is then used for backpropagation, and the parameters of the YOLOv5 model and the attention module are updated using the gradient descent algorithm to optimize model performance. Steps A100 through A400 are repeated, and training continues iteratively until the loss value converges, resulting in a model with optimal small object detection performance.

[0052] After sufficient verification, the trained YOLOv5 model that meets the performance requirements is deployed in the actual monitoring scenario. Therefore, after the training is completed, the performance of the small target detection model needs to be verified. The performance evaluation method of the small target detection model includes steps B100 to B300: In step B100, the training data that has not been involved in the training is input into the small target detection model to be verified to obtain the evaluation detection results; the training data that has not been involved in the training includes image data in a variety of environments, and the evaluation detection results include the prediction results of the small target object position, category and confidence.

[0053] Step B200: Obtain a performance evaluation result of the small target detection model to be verified based on the evaluation index algorithm.

[0054] Step B300: Based on the performance evaluation result, the small target detection model is optimized to obtain the best small target detection model.

[0055] It can be understood that the training data that did not participate in the training is a validation set that selects representative data from the material set to verify the model performance. It is used to verify the model performance. The model predicts and detects small targets in the validation set, outputs the target category, location and confidence information, and uses evaluation indicators (such as average precision mAP, precision, recall, etc.) to quantify the model detection performance and evaluate the model's accuracy and generalization ability in small target detection in actual monitoring scenarios.

[0056] The following traffic sign dataset TT100K is used to conduct comparative experiments on the traditional YOLOv5s model and the improved YOLOv5s model of the present invention, and the comparison of detection results on the TT100K dataset and the comparison of experimental results under different simulation environments are obtained in Table 1.

[0057] Table 1 Comparison of detection results on the TT100K dataset Table 2 Comparison of experimental results under different simulation environments The experimental results are analyzed as follows: 1. The improved YOLOv5 model of this invention can improve the accuracy of small target detection.

[0058] Because small objects occupy fewer pixels in an image, traditional YOLOv5 models often struggle to capture sufficient effective features, resulting in low detection accuracy. This paper significantly improves the model's ability to perceive small object features and interact with features across scales, effectively overcoming the insufficient feature extraction issues of traditional detection methods. Experimental verification shows that this model's mAP for small object detection improves by 1.4% compared to the original YOLOv5 model.

[0059] 2. Reduce missed detection and false detection rates.

[0060] The unique hybrid channel attention and window self-attention mechanism of this invention can more effectively focus on small target areas, suppress background interference, and achieve more accurate target positioning and classification prediction. As shown in Table 1, the small target missed detection rate of this invention is reduced by approximately 2% compared to the traditional YOLOv5 algorithm, and the false detection rate is reduced by approximately 2.2%, significantly improving the reliability of the detection results.

[0061] 3. Improve model generalization performance: Through a unique attention mechanism, this invention enables the model to maintain high recognition stability and robustness in complex environments and changing backgrounds. As shown in Table 2, cross-scenario testing verifies that the generalization performance of this model is approximately 1.5% to 9.8% higher than that of the traditional YOLOv5s algorithm, demonstrating improved adaptability to diverse surveillance scenarios.

[0062] It should be emphasized that the parameter amount of the improved YOLOv5 model using the present invention is 22.7M, and the computational cost is 16.1GFLOPs. If the same method is used to improve the YOLOv8 model, the parameter amount of the improved YOLOv8 model is 26.7M, and the computational cost is 28.7GFLOPs. The experimental results show that the detection effect of the improved YOLOv8 model is lower than that of the improved YOLOv5 model of the present invention. Therefore, using the YOLOv5 model as the baseline model not only ensures that the model has higher detection performance, but also ensures that the model is lightweight, and can be well applied in intelligent monitoring systems to achieve higher-precision small target detection effects.

[0063] on the other hand, Figure 5 An example of a physical structure diagram of an electronic device is shown below. 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 may call the logic instructions in the memory 530 to execute the intelligent monitoring method based on small target detection, which includes: Step S100: obtaining video image data collected in real time by multiple surveillance cameras within a surveillance area.

[0064] In step S200, the backbone network module of the small target detection model performs multiple convolution and sampling processes on the video image data to obtain multi-scale features of the video image data; wherein the small target detection model is improved based on the YOLOv5 model.

[0065] In step S300 , the neck network module of the small target detection model is used to fuse the multi-scale features of the video image data to obtain scale feature maps of multiple levels.

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

[0067] In 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 layer to obtain the detection result of the small target object; wherein the detection result includes the prediction result of the small target object position, category and confidence.

[0068] Furthermore, the logic 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 portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0069] On the other hand, the present invention further provides a computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises program instructions. When the program instructions are executed by a computer, the computer is capable of performing the intelligent monitoring method based on small target detection provided by the above methods, the method comprising: Step S100: obtaining video image data collected in real time by multiple surveillance cameras within a surveillance area.

[0070] In step S200, the backbone network module of the small target detection model performs multiple convolution and sampling processes on the video image data to obtain multi-scale features of the video image data; wherein the small target detection model is improved based on the YOLOv5 model.

[0071] In step S300 , the neck network module of the small target detection model is used to fuse the multi-scale features of the video image data to obtain scale feature maps of multiple levels.

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

[0073] In 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 layer to obtain the detection result of the small target object; wherein the detection result includes the prediction result of the small target object position, category and confidence.

[0074] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the YOLO model junk detection method provided by the above methods, the method comprising: Step S100: obtaining video image data collected in real time by multiple surveillance cameras within a surveillance area.

[0075] In step S200, the backbone network module of the small target detection model performs multiple convolution and sampling processes on the video image data to obtain multi-scale features of the video image data; wherein the small target detection model is improved based on the YOLOv5 model.

[0076] In step S300 , the neck network module of the small target detection model is used to fuse the multi-scale features of the video image data to obtain scale feature maps of multiple levels.

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

[0078] In 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 layer to obtain the detection result of the small target object; wherein the detection result includes the prediction result of the small target object position, category and confidence.

[0079] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0080] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion 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, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. An intelligent monitoring method based on small target detection, characterized in that: The method comprises: Acquire video image data collected by multiple surveillance cameras in real time within the surveillance area; The backbone network module of the small target detection model performs multiple convolution and sampling processes on the video image data to obtain multi-scale features of the video image data. The small target detection model is improved based on the YOLOv5 model. The neck network module of the small target detection model is used to fuse the multi-scale features of the video image data to obtain multi-level scale feature maps; A preset attention module is added to the output end of the neck network module of the small target detection model to perform feature extraction and image reconstruction on the scale feature map of each layer, thereby obtaining a high-resolution scale feature map corresponding to each layer. The preset attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism. The detection head module of the small target detection model performs target detection processing on the high-resolution scale feature map of each layer to obtain the detection results of the small target object; wherein the detection results include the prediction results of the small target object position, category and confidence.

2. The method according to claim 1, characterized in that The preset attention module is added to the output end of the neck network of the small target detection model to perform feature extraction and image reconstruction on the scale feature map of each layer to obtain a high-resolution scale feature map corresponding to each layer, including: Based on a variety of different attention mechanisms, multi-dimensional feature enhancement calculations are performed on the scale feature maps of each layer to obtain multi-dimensional feature enhancement results; a variety of different attention mechanisms include channel attention mechanism and window self-attention mechanism; Perform overlapping cross-attention calculation on the multi-dimensional feature enhancement results to obtain the attention feature mapping results; The attention feature map result and the scale feature map are fused to obtain the feature enhancement fusion result; The enhanced feature fusion results are reconstructed to obtain high-resolution scale feature maps corresponding to each level.

3. The method according to claim 2, characterized in that The multi-dimensional feature enhancement calculation is performed on the scale feature map of each level based on a variety of different attention mechanisms to obtain the multi-dimensional feature enhancement results, including: Perform layer normalization on the scale feature map corresponding to each level to obtain the first normalized feature result; Perform channel attention calculation on the first canonical feature result to obtain the channel attention weight feature result; Perform window self-attention calculation on the first canonical feature result to obtain the window self-attention weight feature result; The scale feature map, channel attention weight feature result and window self-attention weight feature result are fused to obtain the mixed attention weight feature result; Perform layer normalization on the mixed attention weight feature result to obtain the second normalized feature result; Performing multi-layer perception processing on the second standard feature result to obtain the first spatial enhanced feature result; The first spatial enhancement feature result and the mixed attention weight feature result are fused to obtain a multi-dimensional feature enhancement result.

4. The method according to claim 2, characterized in that The overlapping cross attention calculation is performed on the multi-dimensional feature enhancement result to obtain the attention feature mapping result, including: Perform layer normalization on the multi-dimensional feature enhancement results to obtain the third normalized feature results; Perform window partitioning and overlapping cross attention calculation on the third canonical feature result to obtain the weighted feature result; Perform layer normalization on the weighted feature results to obtain the fourth normalized feature results; The fourth canonical feature result is subjected to multi-layer perception processing to obtain the attention feature mapping result.

5. The method according to claim 1, wherein The small target detection model is pre-trained. The pre-training method of the small target detection model includes: Input the labeled training data into the small target detection model to obtain the initial detection results of the small target object; the initial detection results include the prediction results of the small target 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 to obtain the loss value between the predicted result and the true annotation; The calculated loss value is used for backpropagation processing, and the operating parameters of the small target detection model and attention module are updated through the gradient descent algorithm; Continue iterating training until the loss value converges to obtain the small target detection model to be verified.

6. The method according to claim 5, characterized in that Performance evaluation methods for small object detection models include: The training data that has not participated in the training is input into the small target detection model to be verified to obtain the evaluation detection results; the training data that has not participated in the training includes image data in various environments, and the evaluation detection results include the prediction results of the small target object position, category and confidence level; 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.

7. Intelligent monitoring system based on small target detection, characterized by: The system is used to execute the intelligent monitoring method based on small target detection according to any one of claims 1 to 6, 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, and a preset attention module is added to the output end of the neck network module; wherein, Data acquisition module: used to obtain video image data collected by multiple surveillance cameras in real time within the monitoring area; Backbone network module: used to perform multiple convolution and sampling processes on video image data to obtain multi-scale features of video image data; Neck network module: used to fuse the multi-scale features of video image data to obtain multi-level scale feature maps; The attention module is used to perform feature extraction and image reconstruction on the scale feature map of each layer to obtain a high-resolution scale feature map corresponding to each layer. The attention module introduces a hybrid channel attention mechanism and / or a window self-attention mechanism. The detection head module is used to perform target detection processing on the high-resolution scale feature map of each layer to obtain the detection results of small target objects; wherein the detection results include the prediction results of the small target object position, category and confidence.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the intelligent monitoring method based on small target detection according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the intelligent monitoring method based on small target detection according to any one of claims 1 to 6 is implemented.

10. A 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 a computer, the computer can execute the intelligent monitoring method based on small target detection as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Steel surface defect detection method and system and computer equipment

    CN116664558A

  • Landslide detection method based on improved lightweight YOLOv7

    CN117746252A

  • Forest fire detection method based on improved YOLOv5 network

    CN118537757A

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

    CN119180997A

  • Small target detection method and system

    CN119648980A