Cluster target intelligent identification model based on improved YOLOv5 target detection model and cluster formation identification algorithm
By improving the YOLOv5 target detection model and cluster formation recognition algorithm, the detection accuracy and real-time problems of drone cluster identification technology in complex environments are solved, and the accurate detection and formation recognition of drone cluster targets is achieved, which improves the overall performance of drone cluster identification.
Patent Information
- Application Number
- CN202510593229.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-08-01
AI Technical Summary
The existing drone cluster identification technology is difficult to achieve in complex environments. It is insufficient sensitivity to small targets and poor intensive target detection results. The existing solutions cannot identify the drone cluster formation in real time, resulting in challenges to public safety and industry applications.
The improved YOLOv5 target detection model and cluster formation recognition algorithm are adopted, and feature extraction and fusion are performed through the SPD-Conv module, Swin Transformer V2 module, BiFPN network and BiFormer attention mechanism, and combined with traditional machine learning clustering algorithms, accurate detection and formation recognition of drone cluster targets are achieved.
Accurate detection and formation recognition of drone cluster targets are achieved in complex environments, the detection accuracy and efficiency are improved, adapted to complex environments and have real-time performance, and are applied in fields such as intelligent security.
Smart Images

Figure CN120411731A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of UAV swarm recognition technology, and specifically to an intelligent recognition model for swarm targets based on an improved YOLOv5 object detection model and a swarm formation recognition algorithm. Background Art
[0002] With the rapid development of social digitalization and informatization, UAV technology has become increasingly mature and is widely used in multiple fields such as civilian and scientific research, such as logistics distribution, agricultural plant protection, disaster relief, film shooting, and environmental monitoring. However, with the continuous increase in the number of UAVs and the increasing complexity of usage scenarios, UAV swarm activities have become more frequent, bringing a series of new problems and challenges. For example, in some specific scenarios, UAV swarms may pose potential threats to public safety, such as interfering with public order and infringing on privacy; at the same time, in some industrial applications, it is also necessary to effectively monitor and manage UAV swarms to ensure their safe and efficient operation. Existing object detection technologies have limitations when facing UAV swarms, such as insufficient sensitivity to small targets, poor detection effects for dense targets, difficulty in adapting to complex environments and high real-time processing requirements, and it is difficult to meet the needs of actual applications. Therefore, conducting research on UAV swarm target recognition systems is of great significance for improving the detection accuracy and efficiency of UAV targets and ensuring the smooth development of public safety and industrial applications.
[0003] UAV swarm recognition is mainly divided into two steps: object detection and swarm formation recognition. At present, the main UAV object detection methods are based on deep learning. Relevant algorithms have made significant progress in terms of accuracy, robustness, and precision in dealing with background diversity and small-size targets, but there is still room for optimization and improvement. In addition, there is less research on UAV swarm formation recognition algorithms. Existing solutions mostly conduct simulation experiments on MATLAB, obtain longitude and latitude coordinate information with the help of sensors such as radar, and use neural networks for recognition after processing the data. However, the results obtained by this data processing method cannot accurately reflect the coordinate positions and require a certain amount of time. Therefore, real-time recognition cannot be effectively carried out in complex environments. Summary of the Invention
[0004] (1) Technical Problems to be Solved
[0005] Aiming at the deficiencies of the existing technology, the present invention provides an intelligent recognition model for swarm targets based on an improved YOLOv5 object detection model and a swarm formation recognition algorithm, which can accurately detect UAV swarm targets captured from the ground-to-air perspective in complex environments, timely identify UAV swarm formations, and improve the detection accuracy and efficiency of UAV target swarms.
[0006] (2) Technical Solutions
[0007] To achieve the above object, the present invention provides the following technical solution: a cluster target intelligent recognition model based on an improved YOLOv5 object detection model and a cluster formation recognition algorithm, the recognition model including a backbone network, a neck network, and a head network;
[0008] The backbone network is used to extract feature information from the scene picture to obtain high-level feature information;
[0009] The neck network is used to fuse the high-level feature information to obtain feature maps of different sizes;
[0010] The head network includes a plurality of detection heads of different sizes, which are used to receive the feature maps and put them into the detection heads of corresponding sizes, and use the Ensemble Boxes technology to fuse the prediction boxes of the plurality of detection heads of different sizes. The prediction box refers to the prediction result of the object detection model on the position and size of the object in the scene picture, which is obtained by the model analyzing and calculating the feature map and is usually represented by a rectangular box; the drone targets in the scene picture are screened out through the cluster formation recognition algorithm and their two-dimensional coordinate information is obtained, and after the two-dimensional coordinate information is converted into a clustering vector, the formation recognition is completed through a traditional machine learning clustering algorithm.
[0011] Further, the present invention is improved in that the operation process of the backbone network is as follows: the SPD-Conv module is adopted and the Swin Transformer V2 module is introduced. The SPD-Conv module is used to downsample the scene picture to extract features, and the Swin Transformer V2 module is used to enhance the feature extraction ability. Finally, multi-scale feature fusion is performed through SPPF to obtain the high-level feature information. The core function of this module is to expand the model to a larger capacity and resolution and solve the problems existing in the Swin Transformer module. Its feature is that the operation process of the module is as follows: the res-post-norm structure is adopted to place LayerNorm after Attention and FFN to enhance the training stability, and scaledcosine attention is introduced to alleviate the problem of attention concentration. The relative position bias is dynamically predicted through the Log-CPB mechanism, where G is a double-layer MLP, and this design supports flexible change of the window size. Finally, the ZeRO-1 optimizer is combined to achieve efficient training of the video memory.
[0012] Furthermore, the present invention is improved in that the Swin Transformer V2 module separately outputs information to the neck network to enrich semantic information. The specific process is as follows: First, res-post-norm is adopted to adjust LayerNorm after Attention and FFN. The output of Attention or FFN is added to the shortcut only after passing through LayerNorm, which reduces the accumulation of activation values during the deepening of the network and prevents the instability of training when the model scale increases. Second, the original self-attention uses scaled dot product to calculate the similarity between two tokens: calculate the dot product of two tokens and then divide it by the square root of the feature dimension size. For the training scenario of visual models with a large number of parameters, the learned attention map is often dominated by a small number of pixels, especially when using res-post-norm. To solve this problem, STR-V2 introduces scaled cosine attention, that is, calculates the cosine similarity between two tokens and then divides it by a learnable scalar τ:
[0013] Sim(q i ,k j )=cos(q i ,k j ) / τ+B ij
[0014] where B ij represents relative position bias, τ is a training parameter, which is not shared among different layers and attention heads, and is restricted to be greater than 0.01. Since the cosine similarity ranges from 0 to 1, it can ensure that the similarity distribution between different tokens is within the same range, thus reducing the problem of over-concentration of the attention map, making the training process of the model more stable and improving the accuracy at the same time.
[0015] Second, STR-V2 adopts Log-CPB (log-spaced continuous position bias), that is, STR adds a relative position bias when calculating attention, as follows:
[0016]
[0017] Denoted as relative position bias, it is used to encode the relative positions between different tokens in a window. M is the size of the window, and there are a total of M 2 tokens. Since the image is a 2D structure, the relative position of tokens in each dimension is distributed in the range of [-M + 1, M - 1], so there are a total of 2M - 1 values. Define a trainable bias matrix and B can be obtained by indexing. The advantage of this method is that the number of parameters is relatively small. When changing the window size, interpolation needs to be performed on . The improved strategy of continuous position bias in STR-V2 is different from that of STR in that it does not set to a fixed value, but uses a small network to predict the bias:
[0018] The difference between the improved strategy of continuous position bias in STR-V2 and that of STR is that it does not set to a fixed value, but uses a small network to predict the bias:
[0019] B(Δx,Δy) = G(Δx,Δy)
[0020] In the formula, G is an MLP model with 2 layers, and RELU activation is applied in the middle. The advantage of using the G network is that it can generate relative position bias at any position, so no modification is required when transitioning to a larger window, enabling it to adapt to different window sizes. Secondly, since the relative position range changes with the change of the window size, this means that the G network must accept an input range different from that of the pre-trained model. To minimize the change in the input range, STR-V2 replaces the coordinates under Log-CPB with the original Linear-CPB. The conversion formula between the two is as follows:
[0021]
[0022] The advantage of using Log-CPB is that it can reduce the change in the input range and lower the generalization requirement for the G network. This enables the model to perform well when transitioning to larger windows and higher resolutions, making it more suitable for visual models with typical large resolutions.
[0023] Finally, STR-V2 adopts the ZeRo optimizer, which distributes model parameters and optimizer state parameters to different GPUs. This helps reduce GPU memory usage. Here, ZeRO-1 in the DeepSpeed library is used, which has a minimal impact on the training speed while reducing memory consumption.
[0024] Furthermore, the present invention is improved in that the operation process of the neck network is as follows: Using the Concat module in the BiFPN network, the feature information output by the upsampling module and the feature information output by the Swin Transformer V2 module are fused bottom-up; wherein, the upsampling module refers to a module used to increase the size of the feature map, and specifically, methods such as bilinear interpolation or transposed convolution can be used to achieve it;
[0025] Then, using the Concat module again, the feature information output by the SPD-Conv module after convolutional downsampling is fused top-down with the feature information output by the SPD-Conv module during bottom-up fusion;
[0026] Then, through the BiFormer attention mechanism module, feature maps of different sizes are finally obtained.
[0027] Furthermore, the present invention is improved in that in the traditional machine learning clustering algorithm, the Euclidean distance is selected to measure the similarity between samples. For two sample data x and y, the calculation formula is as follows:
[0028]
[0029] wherein, x i and y i are respectively the i-th features of sample x and sample y, and n is the number of features.
[0030] Furthermore, the present invention is improved in that the operation process of the SPD-Conv module is as follows: First, the scene picture is split into multiple sub-feature maps, and the pixel size of each sub-feature map is 1 / scale of the original size, where scale is the downsampling ratio; then, the sub-feature maps are concatenated along the channel dimension to form a new feature map X'; the spatial dimension of X' is 1 / scale of the original feature map, and the channel dimension is scale 2 times the original number of channels;
[0031] Finally, X' is sent into a convolutional layer with a stride of 1 to further reduce the channel dimension and generate the final output feature map X”.
[0032] Furthermore, the present invention is improved in that the calculation formula of the BiFormer attention mechanism module is:
[0033] Given an input image First, it is divided into S×S different regions, where each region contains feature vectors, that is, changing C to Then, through linear mapping, obtain where:
[0034] Q = X r W q , K = X r W k , V = X r W v
[0035] In the formula are the projection weights of query, key, and value respectively;
[0036] Then use the region-to-region routing of the directed graph to find the regions that each given region should participate in by constructing a directed graph; first calculate the average of Q and K in each region to obtain Then calculate the adjacency matrix of the inter-region correlation of Q r and K r :
[0037] A r = Q r (K r ) T
[0038] Then only keep the top k connections of each region to prune the correlation graph, and save the indices of the top k connections row by row by the routing index matrix ;
[0039] I r = topkIndex(A r )
[0040] The i-th row of I r contains the indices of the top k most relevant regions to the i-th region;
[0041] Using the region-to-region routing index matrix I r , calculate the fine-grained token to token attention; for each Query token in region i, the attention focuses on all key-value pairs in k routing regions, and the indices of these regions are And gather the tensors of key and value, that is:
[0042] K g = gather(K, I r ), Vg = gather(V, I r )
[0043] where K g and V g are tensors of the key and value after aggregation, and then an attention operation is applied to the aggregated K-V pairs:
[0044] O = Attention(Q, K g , V g ) + LCE(V)
[0045] Here, a local context enhancement term LCE((V)) is introduced, and this function is parameterized using depthwise separable convolution. BiFormer sets the convolution kernel size to 5.
[0046] Furthermore, the present invention is improved in that the head network is composed of four detection heads, and the sizes of the detected feature maps are 20x20, 40x40, 80x80, and 160x160 respectively.
[0047] In the baseline network model before improvement, a structure combining FPN (Feature Pyramid Network) and PANet (Path Aggregation Network) is adopted. This structure performs object detection through three detection heads (Head) of different scales, and their downsampling factors are 32 times, 16 times, and 8 times respectively. Three anchor boxes (Anchor) are set at each scale to capture targets of different sizes. The feature map generated by the deepest convolutional network has a lower resolution and is mainly used to detect large targets, and the corresponding anchor box sizes are (116×90), (156×198), and (373×326) respectively. The feature maps output by the middle layer are suitable for detecting medium-sized targets, and the anchor box sizes are (30×61), (62×45), and (59×119) respectively. The feature map generated by the shallowest convolutional network has a higher resolution and can effectively detect small targets, and its anchor box sizes are (10×13), (16×30), and (33×23).
[0048] The improved detection structure can better retain and detect the feature map information of extremely small targets by increasing the detection scale, thereby significantly improving the detection performance for small targets. The newly added feature map has a size of 160×160, contains richer shallow feature information, and has a smaller receptive field, which can effectively improve the detection accuracy and alleviate the problem of missed detection of small targets. To add a 160×160 detection head, the 160×160 feature map in the Backbone needs to be fused with the 160×160 feature map in the Neck. Since the Neck part of the YOLOv5s network does not directly provide a 160×160 feature map, a 160×160 feature map is generated by performing an upsampling operation on the 80×80 feature map in the Neck. This improvement further optimizes the network's detection ability for small targets.
[0049] (III) Beneficial Effects
[0050] Compared with the prior art, the present invention provides a cluster target intelligent recognition model based on an improved YOLOv5 object detection model and a cluster formation recognition algorithm, having the following beneficial effects: The present invention can accurately detect the UAV cluster targets captured from the ground-to-air perspective in a complex environment, timely identify the UAV cluster formations, use the improved YOLOv5 model to detect the UAV cluster targets, and identify the cluster formations based on the obtained coordinate frames and category information, etc., providing information assistance for UAV cluster recognition, and having a broad application prospect. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 Schematic diagram of the improved YOLOv5 detection network of the present invention;
[0052] Figure 2 Schematic diagram of the SwinTransformer V2 module;
[0053] Figure 3 Schematic diagram of the SPD-Conv module of the present invention;
[0054] Figure 4 Schematic diagram of the structure of the BiFormer attention mechanism module of the present invention;
[0055] Figure 5 Schematic diagram of the basic structure of BiFPN;
[0056] Figure 6 Schematic diagram of the cluster formation recognition algorithm process of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0057] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0058] The present invention provides an intelligent recognition model for cluster targets based on an improved YOLOv5 target detection model and a traditional clustering algorithm, which can accurately detect the drone cluster targets captured from the ground-to-air perspective in a complex environment and identify the formation of the drone cluster, which is of great significance for fields such as intelligent security.
[0059] With the development of deep learning algorithms, there has been a great improvement in the fields of target detection and pattern recognition. Deep learning methods represented by convolutional neural networks (CNNs) have shown strong feature extraction capabilities in tasks such as image classification and target localization. Especially in recent years, target detection algorithms based on the YOLO series have achieved a remarkable balance between real-time performance and accuracy through improvement strategies such as optimizing the network structure and introducing attention mechanisms. However, there are still obvious defects in the existing technology for cluster target recognition in complex scenarios:
[0060] Weak environmental adaptability: The existing models have poor robustness to complex environments such as light changes and occlusion interference, which easily lead to missed detection or misjudgment of targets; Lack of formation logical reasoning: Traditional clustering algorithms rely on fixed thresholds to divide clusters and cannot dynamically analyze the topological relationships between drones.
[0061] Refer to Figures 1 to 6 In the specific implementation manner of the present invention, the following technical solutions are adopted: an intelligent recognition model for cluster targets based on an improved YOLOv5 target detection model and a cluster formation recognition algorithm. The improved YOLOv5 target detection model consists of a backbone network, a neck network, and a head network. First, the SPD-Conv module is used to replace the convolution and the SwinTransformer V2 module is introduced into the backbone network to extract features from the scene picture; after replacing the C3 module of the backbone network with SwinTransformer v2, a feature fusion network BiFPN with a BiFormer attention mechanism module added is used to perform multi-scale feature fusion on the picture; target detection is implemented through an improved detection head containing a small target detection layer to screen targets such as rotary-wing drones and fixed-wing drones in the scene picture and obtain their two-dimensional coordinate information; taking the information of the detection results as input, a traditional machine learning clustering algorithm is used to complete the recognition of the cluster formation.
[0062] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.
[0063] Figure 1 This is the overall structure diagram of the cluster target intelligent recognition model based on the improved YOLOv5 target detection model and the cluster formation recognition algorithm in the embodiments of the present invention. Specific implementation manners of the present invention: The improved YOLOv5 target detection model is mainly used for functions such as feature extraction, feature fusion, generating prediction boxes, and predicting categories for scene pictures. A trained model is used to detect the targets and coordinate boxes of scene pictures. Finally, the drone formation is recognized in combination with the cluster recognition algorithm. That is, the cluster target intelligent recognition model based on the improved YOLOv5 target detection model and the cluster formation recognition algorithm includes at least steps S10 to S40.
[0064] Step S10: Use the SPD-Conv module to replace the convolution and introduce the backbone network of the Swin Transformer V2 module to extract features from the information of the scene picture.
[0065] Figure 2 This is the core architecture diagram of STR-V2. The res-post-norm structure is used to place LayerNorm after Attention and FFN to enhance training stability, and scaled cosine attention is introduced to alleviate the problem of attention concentration. The relative position bias is dynamically predicted through the Log-CPB mechanism, where G is a two-layer MLP. This design supports flexible changes in the window size. Finally, combined with the ZeRO-1 optimizer, efficient memory training is achieved. The overall solution significantly improves the training robustness and resolution adaptability of large-scale vision models.
[0066] Figure 3 This is the schematic diagram of the SPD-ConV module. The first step of SPD-Conv is to perform a space-to-depth conversion. In this conversion, the feature map X is divided into multiple sub-feature maps, and each sub-feature map corresponds to different blocks or segments of the original feature map. The pixel size of each sub-feature map is 1 / scale of the original size, where scale is the downsampling ratio;
[0067] Different from traditional downsampling operations, SPD-Conv retains the channel dimension of each sub-feature map, which means that each sub-feature map has the same number of channels as the original feature map and no information is lost;
[0068] Then, these sub-feature maps are concatenated along the channel dimension to form a new feature map X'. The spatial dimension of X' is 1 / scale of the original feature map, and the channel dimension is scale times the original number of channels 2 k times;
[0069] Finally, a convolutional layer with a stride of 1 is applied to X' to further reduce the channel dimension. This convolutional layer reduces the number of channels by learning parameters and generates the final output feature map X".
[0070] Step S20: After replacing the C3 module of the backbone network with Swin Transformer v2, the feature fusion network BiFPN with the BiFormer attention mechanism module is used to achieve multi-scale feature fusion of the image.
[0071] Figure 4 This is a schematic diagram of the Biformer attention mechanism module. First, the feature map is divided into S×S different regions and linearly mapped: K g =gather(K,I r ),V g =gather(V,I r ). Then calculate the attention weight on the coarse-grained Token, and then only take the Topk areas as the relevant areas to participate in the fine-grained operation: A r =Q r (K r ) T , I r =topkIndex(A r Finally, the most relevant Topk coarse-grained regions of each Token are used as keys and values to participate in the final calculation: K g =gather(K,I r ),V g =gather(V,I r ), O=Attention(Q,K g ,V g )+LCE(V).
[0072] Figure 5 This is a schematic diagram of the BiFPN basic structure. It uses a bidirectional fusion method to achieve the fusion of multi-dimensional feature information by reconstructing top-down and bottom-up paths. It uses upsampling and downsampling methods to effectively fuse multi-dimensional feature spaces.
[0073] Step S30: Target detection is performed through an improved detection head including a small target detection layer to screen targets such as rotary-wing UAVs and fixed-wing UAVs in the scene image and obtain their two-dimensional coordinate information.
[0074] In this step, when detecting targets in images of three scales, if the instance size in the image is moderate, the detection effect can be guaranteed. If the target size in the image is too large or too small, it will lead to the inability to obtain semantic features normally. Considering that the background types involved in the UAV dataset images are diverse and extensive, including sky real-scene images at different time periods, and some special environmental categories such as rural and urban areas, there will be various environmental objects such as utility poles and birds, or mutual occlusion between UAVs. In addition, the shooting distance of the UAV dataset is relatively long, the formed image resolution is high, and the pixels occupied by the UAV target are relatively small. Therefore, it is considered to improve the output structure of YOLOv5s by adding a small detection scale, and the anchor box sizes are (5×6), (8×14), and (15×11) respectively, which is more conducive to the detection of small targets. The improved detection structure adds a detection scale, which can better preserve and detect the feature map information of extremely small targets, thus effectively improving the detection ability for small targets.
[0075] The newly added feature map size is 160×160, which contains richer shallow feature information, has a smaller receptive field corresponding to the original image, greatly improves the detection effect, and effectively alleviates the problem of small target missed detection. To add a detection head of 160×160, the feature map of 160×160 in the Backbone needs to be added to the feature map of 160×160 in the Neck. The Neck of the YOLOv5s network does not have a feature map of 160×160, but a feature map of 160×160 can be obtained by upsampling the 80×80 feature map in the Neck again.
[0076] For the large-scale feature map of 160×160, since it contains more position information and has the smallest receptive field, it can be used to detect small targets. Similarly, the large-scale feature map should be paired with small-scale Anchors, and the small-scale feature map should use large-scale Anchors for prediction box regression.
[0077] After collecting real UAV cluster data through optoelectronic acquisition equipment in the field scene, the image set Image is obtained. The image set is labeled with the LabelImage software, and each target is saved in the yolo format (index, cx, cy, w, h) and stored in the annotation set Label. The image set Image and the annotation set Label are put into the dataset Data.
[0078] The dataset is divided into a test set D, a training set T, and a validation set V according to the ratio of test set: training set: validation set = 2:7:1. The training set and the validation set are fed into the model for training, and a well-performing model Model is obtained.
[0079] Input the test set D into the model Model for detection, and the detection results are also output in the yolo format. index represents the index of the label name in the label array, and c x and c y represent the x and y coordinates of the center point of the bounding box, and w and h represent the width and height of the bounding box. The values are all the results after dividing by the width and height of the image.
[0080] Step S40: Use the information of the detection results as input and adopt a traditional machine learning clustering algorithm to complete the recognition of the cluster formation.
[0081] In this step, calculate the absolute coordinate position of the center of the prediction box through the cluster recognition model, remove redundant noise points through the Isolation Forest algorithm, cut out a part of the scatter set, divide this part into N×M sub-blocks of the same size, and represent them with a one-dimensional vector of length N×M. It is recommended to set the values of N and M according to the training results. The sub-blocks with internal scatter points are set to 1, and the rest are set to 0 to obtain the scatter vector. Send the training set T and the validation set into the model for training to obtain the values of N and M. Then send the detection results of the improved YOLOv5 object detection model for the test set D into the model, and the model will perform classification through the KNN clustering algorithm to obtain the category of the formation. This combined model uses the improved YOLOv5 model for object detection, effectively ensuring the accuracy and real-time performance of the detection. At the same time, this model also takes into account the problem of noise, and removing noise effectively ensures that the classification results are not interfered. The classification algorithm uses KNN clustering, which is simple and effectively ensures the accuracy and real-time performance of the results. It has the advantages of strong real-time performance and high accuracy in cluster formation recognition and has a broad market prospect.
[0082] Figure 6 Fig. is the flow chart of the cluster array recognition algorithm. Although there are many types of UAV formations, their basic formations are within the range of straight lines, circles and their combinations. The cluster array recognition algorithm proposed by the present invention uses the sub-block conversion method, the Isolation Forest algorithm and the K-nearest neighbor algorithm to recognize the UAV formation. The sub-block conversion method can effectively convert coordinates into vectors. The Isolation Forest algorithm is a machine learning algorithm based on anomaly detection, which is specifically used to identify outliers. The K-nearest neighbor algorithm is a supervised classical machine learning algorithm in cluster partitioning, and it can obtain the optimal classification corresponding to the initial cluster center vector.
[0083] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principle and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An intelligent recognition model for cluster targets based on an improved YOLOv5 object detection model and a cluster formation recognition algorithm, characterized in that, The recognition model includes a backbone network, a neck network, and a head network; The backbone network is used to extract feature information from the scene picture to obtain high-level feature information; The neck network is used to fuse the high-level feature information to obtain feature maps of different sizes; The head network includes multiple detection heads of different sizes, which are used to receive the feature maps and put them into the detection heads of corresponding sizes, and use the Ensemble Boxes technology to fuse the prediction boxes of multiple detection heads of these sizes; the drone targets in the scene picture are screened out through the cluster formation recognition algorithm and their two-dimensional coordinate information is obtained, and after converting the two-dimensional coordinate information into a clustering vector, the formation recognition is completed through the traditional machine learning clustering algorithm.
2. The intelligent recognition model for cluster targets based on the improved YOLOv5 object detection model and the cluster formation recognition algorithm according to claim 1, characterized in that, The operation process of the backbone network is as follows: The SPD-Conv module is adopted and the SwinTransformer V2 module is introduced. The scene picture is downsampled through the SPD-Conv module to extract features, and the feature extraction ability is enhanced by means of the Swin Transformer V2 module. Finally, multi-scale feature fusion is performed through SPPF to obtain the high-level feature information.
3. The intelligent recognition model for cluster targets based on the improved YOLOv5 object detection model and the cluster formation recognition algorithm according to claim 2, wherein The Swin Transformer V2 module outputs information separately to the neck network to enrich semantic information.
4. The intelligent recognition model for cluster targets based on the improved YOLOv5 object detection model and the cluster formation recognition algorithm according to claim 2, characterized in that, The operation process of the neck network is as follows: Using the Concat module in the BiFPN network, the feature information output by the upsampling module and the feature information output by the Swin Transformer V2 module are fused from bottom to top; Then, the Concat module is used again to perform top-down fusion of the feature information output by the SPD-Conv module during convolutional downsampling and the feature information output by the SPD-Conv module during bottom-up fusion; Then, through the BiFormer attention mechanism module, feature maps of different sizes are finally obtained.
5. The intelligent recognition model for cluster targets based on the improved YOLOv5 object detection model and the cluster formation recognition algorithm according to claim 1, characterized in that, In the traditional machine learning clustering algorithm, the Euclidean distance is selected to measure the similarity between samples. For two sample data x and y, the calculation formula is as follows: where x i and y i are the i-th features of samples x and y respectively, and n is the number of features.
6. The intelligent recognition model for cluster targets based on the improved YOLOv5 object detection model and the cluster formation recognition algorithm according to claim 4, wherein, The operation process of the SPD-Conv module is as follows: First, the scene picture is split into multiple sub-feature maps, and the pixel size of each sub-feature map is 1 / scale of the original size, where scale is the downsampling ratio; then, the sub-feature maps are concatenated along the channel dimension to form a new feature map X'; the spatial dimension of X' is 1 / scale of the original feature map, and the channel dimension is scale times the original number of channels 2 times; Finally, X' is sent into the convolutional layer with a stride of 1 to generate the final output feature map X”.
7. The intelligent recognition model for cluster targets based on the improved YOLOv5 object detection model and the cluster formation recognition algorithm according to claim 4, characterized in that, The calculation formula of the BiFormer attention mechanism module is: Given an input image First, it is divided into S×S different regions, where each region contains feature vectors, that is, X is transformed into Then, Q and K are obtained through linear mapping where: Q = X r W q , K = X r W k , V = X r W v where are the projection weights of query, key, and value respectively; Then use region-to-region routing of the directed graph to find the regions that each given region should participate in by constructing a directed graph; first calculate the average values of Q and K in each region to obtain Then calculate Q r and K r adjacency matrix of the inter-region correlation: A r = Q r (K r ) T Then only the top k connections of each region are retained to prune the relevance graph, and the indices of the top k connections are saved row by row by the routing index matrix Save the indices of the top k connections row by row; I r = topkIndex(A r ) I r The i-th row contains the indices of the top k most relevant regions to the i-th region; Using the region-to-region routing index matrix I r , compute the fine-grained token-to-token attention; for each Query token in region i, the attention focuses on all key-value pairs in k routing regions, whose indices are and gather the tensors of key and value, i.e.: K g = gather(K, I r ), V g = gather(V, I r ) Among them, K g and V g are tensors of the key and value after aggregation, and then an attention operation is applied to the aggregated K-V pairs: O = Attention(Q, K g , V g ) + LCE(V) Here, a local context enhancement term LCE((V)) is introduced, and this function is parameterized using depthwise separable convolution. BiFormer sets the convolution kernel size to 5.
8. The intelligent recognition model for cluster targets based on the improved YOLOv5 object detection model and the cluster formation recognition algorithm according to claim 1, characterized in that The head network consists of four detection heads, and the sizes of the detected feature maps are 20x20, 40x40, 80x80, and 160x160 respectively.
Citation Information
Cited By
YOLO and Transform fused nori culture scene detection method
CN120894666A
A method for detecting a laver cultivation scene by fusing YOLO and a transformer
CN120894666B