An unmanned aerial vehicle ground small target detection method based on improved YOLOX
By introducing the DW-CBAM attention mechanism and LB-SimOTA strategy into the YOLOX network, the detection accuracy and real-time performance of small targets in UAV aerial images are improved, solving the problem of poor performance of YOLO series methods in complex scenes.
Patent Information
- Application Number
- CN202211467687.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-11-22
AI Technical Summary
Existing YOLO methods have poor performance in detecting small targets in UAV aerial images and lack real-time performance, making it difficult to achieve the optimal balance of performance in complex scenarios.
The DW-CBAM attention mechanism module is added to the YOLOX network to increase the detection head with higher resolution, and the LB-SimOTA label allocation strategy is adopted to improve the feature extraction capability of small targets and the accuracy of predicted bounding box localization.
It improves the detection accuracy and real-time performance of small targets in UAV aerial images, enabling more precise identification of dense small targets and large-area clustered overlapping targets, and has rapid detection capabilities.
Smart Images

Figure CN116189012B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of unmanned aerial vehicles, and relates to an unmanned aerial vehicle ground small target detection method based on an improved YOLOX. BACKGROUND
[0002] With the rapid development of science and technology, unmanned aerial vehicles are widely used in various industries due to their wide field of view and strong flexibility. In the field of unmanned aerial vehicle ground target detection, the images taken by unmanned aerial vehicles from the ground are prone to lose many details due to the overhead perspective, and there are a large number of small targets in the images, which occupy a small number of pixels (less than 32x32) and have low resolution. Therefore, it is difficult to identify the target, and the traditional detection method is often affected by the environment in some complex scenes, making it difficult to extract the characteristics of the target, resulting in serious missed detection and false detection. However, with the significant breakthroughs in deep learning in the field of target detection, the target is identified through a neural network, which greatly improves the detection accuracy and speed compared to traditional target detection methods, and promotes the vigorous development of unmanned aerial vehicle ground target detection. Today, there are two main types of deep learning-based target detection methods: two-stage detection methods and one-stage detection methods. Two-stage detection methods such as Faster-RCNN first generate high-quality candidate boxes through a region proposal network (RPN), and then perform classification and regression on the candidate boxes, thus improving detection accuracy. One-stage target detection methods such as SSD and YOLO use different resolution feature maps to detect targets of different sizes, and this type of method only needs to pass through a feedforward network once, so it has the advantages of faster detection speed and real-time performance, making it more suitable for real-time detection scenarios.
[0003] However, due to different performance evaluation criteria and priorities in different scenarios, the current YOLO series methods cannot achieve the optimal balance of performance, and the detection of small targets is not particularly ideal. Therefore, many researchers have made targeted improvements to enable the YOLO series methods to improve their detection performance in some special application requirements. Some literature indicates that in the detection of occluded pedestrians, a semantic conversion module and a position guidance module are added to improve the detection accuracy of occluded pedestrians through more contextual information and reweighted regression loss. Another literature proposes a YOLOSA model, which applies the decoupling head method in YOLOX to YOLOV5, further improving the model accuracy. However, these target detection models are designed based on natural scene image datasets, and there are significant differences between natural scene images and unmanned aerial vehicle aerial images, resulting in poor detection performance and real-time performance of small targets. SUMMARY
[0004] In view of this, the purpose of the present application is to provide an improved YOLOX-based unmanned aerial vehicle ground small target detection method, which further improves the YOLOX method. The idea is (1) to add the attention mechanism module DW-CBAM to the feature fusion network, which makes the network focus more attention on the small target area, improving the feature extraction capability of the small target (2) adding a detection head with higher resolution to the head layer to detect the tiny target in the image, and in order to prevent the model from being too large, the detection head is lightened. (3) To solve the problem of low positioning accuracy of the prediction box, a label assignment strategy with position guidance (LB-SimOTA) is proposed, which makes the network pay more attention to the boundary box with poor positioning accuracy under the premise of selecting the optimal number of positive samples, and improves the regression accuracy of the boundary box.
[0005] To achieve the above purpose, the present application provides the following technical scheme:
[0006] An improved YOLOX-based unmanned aerial vehicle ground small target detection method, the method comprising the following steps:
[0007] S1: image acquisition: the user uses the unmanned aerial vehicle to collect the image of the target object, and names the collected image according to the format of the Pascal VOC data set, and creates three folders named Annotations, ImageSets, JPEGImages;
[0008] S2: image preprocessing:
[0009] S2-1: image labeling: in the image collected in S1, the target in the image is labeled by using the image labeling tool LabelImg, and the position and category name of the target are labeled;
[0010] S2-2: image augmentation: if the pictures taken by the user in S1 cannot meet the requirement of 3000 pictures for recognizing a single category target, the image is augmented by using the methods of scaling, flipping, translation and Mosaic data enhancement;
[0011] S2-3: divide the data set: divide the augmented images and label files into training set, test set and validation set; wherein the training set, test set and validation set respectively account for 60%, 20% and 20%;
[0012] S3: set the model hyperparameters: according to the computer memory, GPU capability and the recognition effect and training speed required by the user, design the size of the convolutional neural network input image, the number of recognition categories, the number of training times, the learning rate, and the number of network layers;
[0013] S3-1: when the image size of the selected input network is 640*640, the epoch is 200, the training is divided into two parts, the freezing stage and the unfreezing stage, the first 50 epochs are frozen training, the backbone of the model is frozen, the feature extraction network will not change, the occupied memory is small, only the network is fine-tuned, the batch_size is 8, and the learning rate is 0.001; the last 150 epochs are unfreezing training, at this time the backbone of the model is not frozen, the feature extraction network will change, the occupied memory is larger, all the parameters of the network will change, the batch_size is 4, and the learning rate is 0.0001;
[0014] S4: the original YOLOX network structure is improved to obtain an improved YOLOX network structure, and the improvement process is as follows:
[0015] S4-1: a DW-CBAM channel-spatial attention mechanism is added to the feature fusion network of YOLOX, the basic idea of which is that the input feature map is subjected to spatial and channel dimensions to obtain a corresponding weight vector, and the input feature map is divided into different important feature regions according to the value of the weight vector, the greater the weight, the more positive samples the region contains, and the model pays more attention to the region to learn its features, so that the model can make more accurate judgments; DW-CBAM first subjects the feature map to two layers of dilated convolution with a dilated rate of 1, 2 to enhance the receptive field of the input feature map and ensure that the output feature map and the input feature map have the same height and width, so that the receptive field of the input feature map is expanded to a 7*7 region; then the feature map is input into the improved channel attention module W-CAM, at this time the two output feature vectors after pooling have stronger global information and can better distinguish the importance of each channel; secondly, the MLP is replaced by two convolution layers, which can greatly reduce the parameters and increase the inference speed; the feature vectors after the convolution layers are multiplied by their respective weight coefficients before being added, so as to adjust their contribution degree, then the feature vectors multiplied by the weight coefficients are added and activated by a sigmoid function, and then the feature map is multiplied point by point with the first input feature map, then the input spatial attention module SAM is input, the feature vectors after maximum pooling and average pooling are spliced, then convolution is used for feature extraction, and the channel number is integrated to 1, finally the spatial attention vector obtained by sigmoid activation is multiplied point by point with the feature map to obtain the final input feature map; the calculation formula is as follows:
[0016] F'=Dilate_Conv(3×3,r=2,Dilate_Conv(3×3,r=1,F))
[0017] M C(F) = sigmoid(w1MLP(AvgPool(F)) + w2MLP(MaxPool(F)))
[0018]
[0019] M S (F) = sigmoid(Conv(Concat(AvgPool(F") + MaxPool(F"))), 1)
[0020]
[0021] where F ∈ R C H W represents the input feature map, F' ∈ R C H W , F" ∈ R C H W and F'" ∈ R C H W respectively represent the output feature maps obtained by two layers of dilated convolution, channel attention module and spatial attention module; M C ' is the improved channel feature vector calculation function, M S is the spatial feature vector calculation function, w1, w2 are the weight coefficients when added in W-CAM, and the values are 0.7 and 0.3 respectively; M C '(F') ∈ R C 11 , M S (F") ∈ R 1 H W are the channel feature vectors and spatial feature vectors obtained respectively;
[0022] S4-2: Use SIOU for the bounding box loss function, by introducing the vector angle between regressions, so that the predicted box can quickly locate the position and direction of the real box in training, thereby reducing the degree of freedom of regression, speeding up the training speed of the network, and further improving the regression accuracy of the bounding box;
[0023] S4-3: In the LB-simOTA positive sample selection strategy, different weights are assigned to predicted boxes of different quality; for positive samples in training, different weights w i j are assigned to them according to the different IOU sizes of the corresponding real boxes; i j When calculating the regression box loss of each predicted box, those predicted boxes far from GT are given a larger weight, and the predicted boxes close to GT have a relatively small weight, which makes the network pay more attention to those predicted boxes with poor regression accuracy, thereby training the positioning ability of the network and improving the regression accuracy of the predicted box;
[0024] S4-4: In the original YOLOX network structure, a detection branch with a resolution of 160x160 is added, which can retain more position information and detail information through better resolution, and is more conducive to the detection of small targets. The 3x3 convolution layer of the first layer of the detection head is reduced, and the number of channels is adjusted to perform lightweight processing on the detection head;
[0025] S5: Training the network model: set the parameters of the improved YOLOX network configuration file train.py and Classes.txt, put the set Classes.txt file and the improved YOLOX network structure into the computer with a configured environment, and use the labeled pictures in the training set and the verification set for training. During the training process, the pictures divided in the test set are put into the computer for testing to obtain the effect of each stage of training. After the training is completed, the trained network model weight pt is saved;
[0026] S6: Use the trained network model weight for recognition: prepare the image to be detected on the computer, change the configuration file model_path and the path of the image to be detected in detect.py, load the network model weight by executing detect.py, and finally the computer saves the picture of the recognized target result;
[0027] S7: The improved target detection method YOLOX uses average precision AP, recall rate Recall, precision Precision, parameter quantity Params and frame rate FPS as the evaluation indexes of the model performance; wherein T P is the number of correct detections in the positive samples, F P is the number of incorrect detections in the positive samples, and F N is the number of undetected positive samples.
[0028]
[0029]
[0030]
[0031] Optionally, S2 specifically comprises:
[0032] S2-1: Image labeling: in the images collected in S1, the image labeling tool LabelImg is used to label the targets in the images, and the position and category name of the target are labeled;
[0033] S2-2: Image augmentation: if the picture taken by the S1 user cannot meet the requirement of 3000 pictures for identifying a single category target, the image is augmented by using scaling, flipping, translation and Mosaic data enhancement methods;
[0034] S2-3: Divide the data set: divide the augmented images and the label file into a training set, a test set and a validation set; wherein the training set, the test set and the validation set account for 60%, 20% and 20%, respectively.
[0035] Optionally, the S3 is specifically:
[0036] S3-1: when the image size of the selected input network is 640*640, the epoch is 200, the training is divided into two parts, the freezing stage and the unfreezing stage, the first 50 epochs are subjected to the freezing training, the backbone of the model is frozen, the feature extraction network will not change, the occupied memory is small, only the network is fine-tuned, the batch_size is 8, and the learning rate is 0.001; the last 150 epochs are subjected to the unfreezing training, at this time, the backbone of the model is not frozen, the feature extraction network will change, the occupied memory is large, all the parameters of the network will change, the batch_size is 4, and the learning rate is 0.0001.
[0037] The method has the advantages that: the method adds a detection head with higher resolution to detect small targets in the image, and the detection head is lightened to prevent the model from being too large. Secondly, the channel-space attention mechanism module DW-CBAM is added to the feature fusion network, which enables the network to focus more attention on small target areas, improving the feature extraction capability for small targets; and for the problem of low positioning accuracy of the prediction box, the label assignment strategy LB-SimOTA with position guidance is used. Compared with the prior art, the present application has the following advantages:
[0038] (1) When performing target detection, the improved YOLOX network structure is used to train the data set, and the detection model obtained by training has high detection accuracy and small parameter quantity.
[0039] (2) When performing unmanned aerial vehicle aerial image recognition, the improved YOLOX model is used to train the image data set, and the obtained model can more accurately identify dense small targets and accurately identify large-area clustered and overlapped target objects.
[0040] (3) It can be applied to actual unmanned aerial vehicle real-time target detection tasks, and has the characteristics of fast speed and strong real-time performance.
[0041] Additional advantages, objects, and features of the application will be apparent to those skilled in the art upon examination of the following specification. It is intended that the application not be limited by the disclosed implementation, but that it include all such variations and modifications to the full extent allowed by law. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to make the objectives, technical solutions and advantages of the present application clearer, the preferred embodiments of the present application will be described in detail below with reference to the accompanying drawings, in which:
[0043] Fig. 1 Flow chart of the UAV ground small target detection method based on the improved YOLOX method of the present application;
[0044] Fig. 2 DW-CBAM channel-spatial attention mechanism diagram;
[0045] Fig. 3 Lightweight multi-scale detection architecture diagram;
[0046] Fig. 4 LB-simOTA calculation process diagram. DETAILED DESCRIPTION
[0047] The present application can be implemented or applied in other different specific embodiments, and the details in the specification can be modified or changed based on different views and applications without departing from the spirit of the present application. It should be noted that the diagrams provided in the following examples only illustrate the basic concept of the present application in a schematic manner, and the following examples and features in the examples can be combined with each other without conflict.
[0048] The accompanying drawings are only used for illustrative explanation, and the representation is only a schematic diagram, not a physical diagram, and should not be understood as a limitation of the present application; in order to better illustrate the embodiments of the present application, some components in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; it is understandable for those skilled in the art that some known structures and their descriptions in the drawings may be omitted.
[0049] The same or similar reference numerals in the drawings of the embodiments of the present application correspond to the same or similar components; in the description of the present application, it is understood that if the orientations or positional relationships indicated by the terms "upper", "lower", "left", "right", "front", "back" and the like are based on the orientations or positional relationships shown in the drawings, they are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore the terms describing the positional relationship in the drawings are only used for exemplary illustration, and cannot be understood as a limitation on the present application, for those skilled in the art, the specific meanings of the above terms can be understood according to the specific circumstances.
[0050] The present embodiment takes a car (automobile, truck, van, etc. are all classified into one category) and a person as examples, and identifies some representative images with large scene changes from the perspective of a UAV.
[0051] Please refer to Figs. 1-4 , a UAV ground small target detection method based on an improved YOLOX method, comprising the following steps:
[0052] S1, image acquisition: the user uses the UAV to collect images of the target object, and names the collected images according to the format of the Pascal VOC data set, and creates three folders named Annotations, ImageSets, and JPEGImages.
[0053] S2, image preprocessing:
[0054] S2-1, image labeling: in the images collected in step S1, use the image labeling tool LabelImg to label the images, and label the position and category name of the target; in this embodiment, two categories of cars and people are selected, so the following will be described taking these two categories as examples.
[0055] (1) When selecting a person, the label can be named people, and when selecting a car, the label can be named car;
[0056] (2) When selecting a small target with dense clusters and overlapping, select one by one, and manually accurately select the target;
[0057] (3) When selecting a target with more than 95% occlusion, discard the current target;
[0058] S2-2, image augmentation: if the pictures taken by the user in step S1 cannot meet the requirement of 3000 pictures for identifying a single category target, use the methods of scaling, flipping, translation and Mosaic data enhancement to augment the images.
[0059] S2-3, divide the data set: divide the amplified image and the label file into a training set, a test set and a validation set. The training set, the test set and the validation set respectively account for 60%, 20% and 20%.
[0060] S3, set the model hyperparameters: according to the computer memory, GPU capability and the recognition effect and training speed required by the user, design the size of the input image of the convolutional neural network, the number of recognition categories, the training times, the learning rate and the number of network layers.
[0061] S3-1, when the image size of the input network is selected to be 640*640, the epoch is 200, the training is divided into two parts, the freezing stage and the unfreezing stage, the first 50 epochs adopt the freezing training, the main stem of the model is frozen, the feature extraction network will not change, the occupied memory is small, only the network is fine-tuned, the batch_size is 8 and the learning rate is 0.001. The last 150 epochs adopt the unfreezing training, at this time, the main stem of the model is not frozen, the feature extraction network will change, the occupied memory is larger, all the parameters of the network will change, the batch_size is 4 and the learning rate is 0.0001.
[0062] S4, improve the original YOLOX network structure to obtain an improved YOLOX network structure, and the improvement process is as follows:
[0063] S4-1: Add DW-CBAM channel-spatial attention mechanism in the feature fusion network of YOLOX. The basic idea is to get the corresponding weight vector by inputting the feature map through the spatial and channel dimensions, and the input feature map is divided into different important feature regions according to the value of the weight vector. The greater the weight, the more positive samples the region contains, and the model will pay more attention to the region to learn its features, so that the model can make more accurate judgments. DW-CBAM first passes the feature map through two layers of dilated convolution with a dilated rate of 1 and 2 to increase the receptive field of the input feature map and ensure that the height and width of the output feature map are consistent with the input feature map. The receptive field of the feature map is expanded to a 7x7 region on the input feature map. The increase in receptive field makes the mapping area of each feature point larger. Then the feature map is input into the improved channel attention module W-CAM. At this time, the global information of each point of the two output feature vectors after pooling is stronger, and the importance of each channel is better distinguished. Secondly, the MLP is replaced by two convolution layers. Replacing with convolution layers can greatly reduce parameters and increase inference speed. After the convolution layer, the feature vector is multiplied by the weight coefficient before being added to adjust the contribution of each feature vector. Then the feature vector multiplied by the weight coefficient is activated by the sigmoid function after being added, and then multiplied point by point with the first input feature map to get the feature map. Then input the spatial attention module SAM. The feature vectors after maximum pooling and average pooling are spliced, and then the convolution is used for feature extraction, and the channel number is integrated to 1. Finally, the spatial attention vector obtained by the sigmoid activation is multiplied point by point with the feature map to get the final input feature map. The calculation formula is as follows:
[0064] F' = Dilate_Conv(3x3, r=2, Dilate_Conv(3x3, r=1, F))
[0065] M C '(F) = sigmoid(w1MLP(AvgPool(F)) + w2MLP(MaxPool(F)))
[0066]
[0067] M S (F) = sigmoid(Conv(Concat(AvgPool(F'') + MaxPool(F''))), 1)
[0068]
[0069] Where F e R C H W represents the input feature map, F' e R C H W , F'' e R C H W and F''' e RC H W respectively represent the output feature maps obtained by two-layer hollow convolution, channel attention module and spatial attention module; M C is the improved channel feature vector calculation function, M S is the spatial feature vector calculation function, w1 and w2 are the weight coefficients when added in W-CAM, and the values are 0.7 and 0.3 respectively; M C (F')∈R C 11 , M S (F")∈R 1 H W are the channel feature vectors and spatial feature vectors obtained respectively;
[0070] S4-2: Use SIOU for the bounding box loss function, by introducing the vector angle between regressions, so that the predicted box can quickly locate the position and direction of the real box in training, thereby reducing the degree of freedom of regression, speeding up the training speed of the network, and further improving the regression accuracy of the bounding box.
[0071] S4-3: In the LB-simOTA positive sample selection strategy, different weights are assigned to predicted boxes of different quality. For positive samples in training, different weights w i j are assigned to predicted boxes with different IOU sizes with the corresponding real box. i j When calculating the regression box loss of each predicted box, those predicted boxes far from GT are given a larger weight, and the predicted boxes close to GT have a relatively small weight, which makes the network pay more attention to those predicted boxes with poor regression accuracy, thereby training the positioning ability of the network and improving the regression accuracy of the predicted box.
[0072] S4-4: In the original YOLOX network structure, a detection branch with a resolution of 160x160 is added, which can retain more location information and detail information through better resolution, and is more conducive to the detection of small targets. The 3x3 convolution layer of the first layer of the detection head is reduced, and its channel number is adjusted to perform lightweight processing on the detection head.
[0073] S5, training network model: configure the improved YOLOX network configuration file train.py and Classes.txt, place the set Classes.txt file and the improved YOLOX network structure into the computer with a configured environment, and use the labeled pictures in the training set and validation set for training. During the training process, the pictures divided in the test set are placed into the computer for testing to obtain the training effect of each stage. After the training is completed, the trained network model weight pt is saved.
[0074] S6, using the trained network model weight to complete recognition: prepare the image to be detected on the computer, change the configuration file model_path and the picture path to be detected in detect.py, load the network model weight by executing detect.py, and finally save the picture of the recognition target result on the computer.
[0075] S7, the improved target detection method YOLOX uses average precision AP, recall rate Recall, precision Precision, parameter quantity Params and frame rate FPS as the evaluation indexes of the model performance. P T is the number of correct detection in the positive sample, P F is the number of incorrect detection in the positive sample, N is the number of positive samples that are not detected.
[0076]
[0077]
[0078]
[0079] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the purpose and scope of the technical solutions, and they should be covered in the scope of the claims of the present application.
Claims
1. An unmanned aerial vehicle ground small target detection method based on improved YOLOX, characterized by: The method comprises the following steps: S1: image acquisition: the user uses a drone to collect images of a target object, and names the collected images according to the format of the Pascal VOC data set, while creating three folders named Annotations, ImageSets and JPEGImages; S2: image preprocessing: S2-1: image labeling: in the images collected in S1, the target in the image is labeled using the image labeling tool LabelImg, and the position and category name of the target are labeled; S2-2: image augmentation: if the pictures taken by the user in S1 cannot meet the requirement of 3000 pictures for recognizing a single category target, the images are augmented by using the methods of scaling, flipping, translation and Mosaic data enhancement; S2-3: dividing the data set: the augmented images and label files are divided into a training set, a test set and a validation set; wherein the training set, the test set and the validation set respectively account for 60%, 20% and 20%; S3: setting model hyperparameters: according to the computer memory, GPU capability and the recognition effect and training speed required by the user, the size of the input image of the convolutional neural network, the number of recognition categories, the number of training times, the learning rate and the number of network layers are designed; S3-1: when the image size of the input network is selected as 640*640, the epoch is 200, the training is divided into two parts, the freezing stage and the unfreezing stage, the first 50 epochs are frozen training, the main part of the model is frozen, the feature extraction network will not change, the occupied memory is small, only the network is fine-tuned, the batch_size is 8, and the learning rate is 0.001; the last 150 epochs are unfreezing training, at this time the main part of the model is not frozen, the feature extraction network will change, the memory occupied is larger, all the parameters of the network will change, the batch_size is 4, and the learning rate is 0.0001; S4: improve the original YOLOX network structure to obtain an improved YOLOX network structure, and the improvement process is as follows: S4-1: Add DW-CBAM channel-space attention mechanism in the feature fusion network of YOLOX. The basic idea is to obtain the corresponding weight vector by inputting the feature map through space and channel dimensions. The input feature map is divided into different important feature regions according to the value of the weight vector. The greater the weight, the more positive samples the region contains, and the model will pay more attention to the region to learn its features, enabling the model to make more accurate judgments. DW-CBAM first passes the feature map through two layers of dilated convolution with a dilated rate of 1 and 2 to enhance the receptive field of the input feature map and ensure that the output feature map has the same height and width as the input feature map. The receptive field of the input feature map is expanded to a 7x7 region. The enhanced receptive field allows each feature point to have a larger mapping area. Then, the feature map is input into the improved channel attention module W-CAM. At this time, the global information of each point in the two output feature vectors after pooling is stronger, allowing for better differentiation of the importance of each channel. Next, the MLP is replaced with two convolution layers. Replacing the MLP with convolution layers can significantly reduce parameters and increase inference speed. The feature vectors after the convolution layers are multiplied by their respective weight coefficients before being added to adjust their contribution levels. The feature vectors multiplied by the weight coefficients are then added and activated with a sigmoid function before being multiplied point-by-point with the original input feature map to obtain the feature map. The feature map is then input into the spatial attention module SAM. The feature vectors after max-pooling and average-pooling are concatenated, and a convolution is used for feature extraction to integrate the channel number into 1. The spatial attention vector obtained after sigmoid activation is then multiplied point-by-point with the feature map to obtain the final input feature map. The calculation formula is as follows: wherein represent the input feature map, , and respectively represent the output feature map obtained by two layers of cavity convolution, channel attention module and spatial attention module; is the improved channel feature vector calculation function, is the spatial feature vector calculation function, respectively are the weight coefficients when adding in W-CAM, and the values are 0.7 and 0.3 respectively; , are the channel feature vectors and spatial feature vectors respectively obtained thereby; S4-2: Use SIOU for the bounding box loss function. By introducing the vector angle between regressions, the predicted box can quickly locate the position and direction of the real box during training, reducing the degree of freedom of regression and speeding up the training of the network, further improving the regression accuracy of the bounding box. S4-3: In the LB-simOTA positive sample selection strategy, different weights are assigned to different quality prediction boxes; for positive samples in training, different weights are assigned according to the different IOU sizes of the corresponding real boxes , weights When calculating the regression box loss of each prediction box, those prediction boxes far from the GT are given a larger weight, and the prediction boxes close to the GT have a relatively small weight, which makes the network pay more attention to those prediction boxes with poor regression accuracy, so as to train the positioning ability of the network and improve the regression accuracy of the prediction box. S4-4: In the original YOLOX network structure, a detection branch with a resolution of 160x160 is added. By using a better resolution, the feature map retains more location information and detail information, which is more conducive to the detection of small targets. The 3x3 convolution layer in the first layer of the detection head is reduced, and the channel number is adjusted to perform lightweight processing on the detection head. S5: Train the network model. Configure the improved YOLOX network configuration file train.py and Classes.txt. Place the set Classes.txt file and the improved YOLOX network structure in a computer with a configured environment. Use the labeled images in the training and validation sets to train the model. During training, place the divided images in the test set into the computer for testing to obtain the training effect at each stage. After training is complete, save the trained network model weight pt. S6: Use the trained network model weight to identify: Prepare the image to be detected on the computer, change the configuration file model_path and the path of the image to be detected in detect.py, run the network model weight by executing detect.py, and finally save the image of the identified target result on the computer; S7: The average precision AP, recall Recal, precision Precision, parameter quantity Params, and frame rate FPS are used as the evaluation indexes of the model performance for the improved target detection method YOLOX; wherein is the number of correct detections in the positive samples, is the number of incorrect detections in the positive samples, is the number of undetected positive samples; 。