Method, device and system for detecting target part of infrared moving object
By improving the YOLOv5 model and building an AI circuit system, the problem of low recognition rate and high false alarm rate in the detection of infrared moving object target parts has been solved, achieving high-precision and low-latency detection effects, simplifying the hardware implementation, and improving System performance and reliability.
Patent Information
- Application Number
- CN202210051679.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-01-17
AI Technical Summary
The existing technology has problems such as low recognition rate, high false alarm rate, low detection accuracy, large hardware implementation, high power consumption, low performance, and poor reliability in the detection of infrared moving object target parts. It is difficult to meet the needs of high-speed moving aerial infrared targets. real-time detection requirements.
By improving the multi-scale detection structure, backbone feature extraction network, spatial pyramid structure and feature fusion network of the YOLOv5 model, the aspect ratio consistency penalty term and Soft-NMS algorithm were introduced, and the Pytorch deep learning framework was built, combined with the micro-infrared seeker system and AI circuit system, optimize the loss function and feature fusion network structure, and improve detection accuracy and efficiency.
It achieves high-precision and low-latency detection of target parts of infrared moving objects, reduces the amount of model parameters and calculations, simplifies hardware implementation, and improves the miniaturization, low power consumption, high performance and reliability of the detection system.
Smart Images

Figure CN114359258B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target tracking detection technology, and more specifically, to a high-precision and low-delay detection method, device and system for a target part of an infrared moving object. Background Art
[0002] Infrared moving object target part detection is a difficult problem in the field of computer vision, and it has a very wide range of application scenarios. For example, many drone enthusiasts are keen on taking aerial photos of city night scenes at night. When drones fly over airports, they are prone to collide with passenger planes, which may cause serious air crashes. Therefore, the requirements for target detection algorithms are getting higher and higher. Once a moving object in the air is detected, the detection system must be able to detect and lock the position immediately, confirm whether it is an illegal flight through the background, and determine whether to eliminate the threat to it, thereby greatly strengthening the effective control of airspace and greatly reducing some unpredictable air safety accidents.
[0003] When detecting the target part of an infrared moving object, many difficulties are often encountered. In practical applications, the distance between the detector and the moving object is often very far, so the resolution of the moving object is often very low. In addition, due to the influence of factors such as atmospheric interference, optical scattering and diffraction, the contrast between the infrared target and the background is not obvious enough. When detecting infrared moving objects, it is easy to mistakenly detect the background as an infrared target, so the false alarm rate is very high. Since the infrared moving object is too small and lacks shape information and texture feature information, it is easy to be immersed in various random noises during actual detection. It is a very difficult task to detect the target part of an infrared moving object at a long distance.
[0004] At present, there is still a big gap between our country's infrared small target detection technology and that of some developed countries (such as Germany, the United States, etc.). With the rapid development of artificial intelligence technology represented by deep learning, deep learning has shown excellent performance in other target detection fields such as face recognition and vehicle recognition. As a typical algorithm of deep learning, convolutional neural network is the most widely used target detection algorithm. It has strong nonlinear expression and generalization capabilities, and can quickly and accurately complete the recognition of specified types in images.
[0005] However, infrared moving object target part detection has unique application scenarios. First, infrared moving objects usually move at high speed and far away, and they are usually small and not very clear in the image; second, practical applications require high frame rate, high recognition rate, and high detection accuracy for infrared moving objects. Existing target detection algorithms cannot meet these requirements. Therefore, there is an urgent need for a high-precision, low-latency detection method and system for infrared moving object target parts.
[0006] In summary, there are many difficulties to overcome when detecting infrared moving objects. The current target detection algorithm has the defects of low recognition rate, high false alarm rate and low detection accuracy when detecting the target parts of infrared moving objects. In addition, the model parameters of the existing target detection algorithm are large, the memory requirements are high, and more hardware overhead is required. It is impossible to detect high-speed aerial infrared targets in real time. In addition, the target detection algorithm extracts target features by constructing a higher-dimensional computing core, so the amount of calculation is large, and the algorithm model hardware implementation is very difficult. If it is implemented with conventional hardware, it has the defects of large size, high power consumption, low performance and poor reliability. Summary of the invention
[0007] In view of the defects of the prior art, the present invention proposes a high-precision, low-latency detection method, device and system for the target part of an infrared moving object, so as to solve the technical problems of the existing detection methods, such as slow detection speed, low detection accuracy and high requirements on pixel values for the target part of an infrared moving object.
[0008] In order to solve the above problems, in a first aspect, the present application provides a high-precision and low-latency detection method for a target part of an infrared moving object, comprising the following steps:
[0009] S1. After obtaining the moving object pictures, use the data enhancement method to increase the number of pictures;
[0010] S2, marking the target parts of the moving objects in the image, generating a data set, and randomly dividing the data set into a training set and a test set according to a certain ratio;
[0011] S3. Install the CONDA environment management system and build the Pytorch deep learning framework, where the model configuration is completed using the YOLOv5 model;
[0012] S4. Improve the multi-scale detection structure, backbone feature extraction network structure, spatial pyramid structure and feature fusion network structure of the YOLOv5 model;
[0013] S5. Optimize the loss function and introduce an aspect ratio consistency penalty term into the position loss function;
[0014] S6, optimize the NMS non-maximum suppression algorithm to the Soft-NMS algorithm;
[0015] S7, classifying the feature layer output by the feature fusion network structure using a binary cross-loss entropy function to obtain a preliminary detection model;
[0016] S8, using the training set to train the preliminary detection model to obtain a final detection model;
[0017] S9: input the test set into the final training model to obtain a detection result.
[0018] Optionally, the data enhancement method in step S1 includes: rotation transformation, flip transformation, scaling transformation, translation transformation, scale transformation, noise disturbance transformation and contrast transformation.
[0019] Optionally, marking the target part of the moving object in the image in step S2 specifically includes:
[0020] Use the image annotation tool Labelimg to annotate each image in the dataset with a rectangular box. Each image corresponds to a label file in XML format. The label file contains two categories, cabin and engine, as well as the coordinates of the upper left and lower right corners of the rectangular box.
[0021] Optionally, step S4 specifically includes the following processing:
[0022] A feature detection layer for detecting extremely small targets is added to the multi-scale detection structure. By taking advantage of the high resolution of low-level features, the target part is detected when the moving object occupies fewer pixels.
[0023] Add Squeeze-and-Excitation Networks at the end of BottleneckCSP, an important component of the backbone feature extraction network structure, to give different channels in the feature layer weights that can be automatically learned;
[0024] Add the CoordAttention mechanism at the end of the spatial pyramid structure to give the feature layer cross-channel information, direction perception, and position perception information, so that the network model can more accurately locate the target part of the moving object;
[0025] Optimize the BiFPN structure and replace the PANet feature fusion network structure.
[0026] Optionally, the position loss function in step S5 is defined as:
[0027]
[0028]
[0029]
[0030] Among them, IOU represents the intersection-over-union ratio between the predicted box and the real box, b represents the center point of the predicted box, and b gtrepresents the center point of the target box, ρ represents the Euclidean distance, c represents the diagonal distance of the minimum circumscribed rectangle between the intersecting prediction box and the target box, α is a weight coefficient, v represents the parameter of aspect ratio consistency, w is the width of the prediction box, and w gt is the width of the real box, h is the height of the predicted box, and h gt is the height of the actual frame.
[0031] Optionally, the NMS algorithm in step S6 is defined as:
[0032]
[0033] The Soft-NM algorithm is defined as:
[0034]
[0035] Among them, S is the set of prediction boxes, M is the prediction box with the highest score in S, and b i is the remaining prediction box in S except M, N t is a threshold, s i is the prediction box b i The IOU is the intersection-over-union ratio of the predicted box and the true box. When the intersection-over-union ratio of a predicted box and the predicted box with the highest score is large, the predicted box can be correctly detected.
[0036] In a second aspect, the present application provides a high-precision and low-latency detection device for a target part of an infrared moving object, comprising:
[0037] The image data enhancement module is used to increase the number of images using a data enhancement method after obtaining the moving object images;
[0038] A data set generation module is used to mark the target parts of the moving objects in the image, generate a data set, and randomly divide the data set into a training set and a test set according to a certain ratio;
[0039] The deep learning framework building module is used to install the CONDA environment management system and build the Pytorch deep learning framework. The model configuration is completed using the YOLOv5 model.
[0040] Model structure improvement module, used to improve the multi-scale detection structure, backbone feature extraction network structure, spatial pyramid structure and feature fusion network structure of the YOLOv5 model;
[0041] Function optimization module, used to optimize the loss function and introduce aspect ratio consistency penalty term into the position loss function;
[0042] Algorithm optimization module, used to optimize the NMS non-maximum suppression algorithm to the Soft-NMS algorithm;
[0043] A preliminary detection model acquisition module is used to classify the feature layer output by the feature fusion network structure using a binary cross-loss entropy function to obtain a preliminary detection model;
[0044] A final detection model acquisition module, used to train the preliminary detection model using the training set to obtain a final detection model;
[0045] The detection result acquisition module is used to input the test set into the final training model to obtain the detection result.
[0046] Optionally, the data enhancement method adopted by the image data enhancement module includes: rotation transformation, flipping transformation, scaling transformation, translation transformation, scale transformation, noise disturbance transformation and contrast transformation.
[0047] Optionally, the data set generation module labels the target part of the moving object in the picture specifically including:
[0048] Use the image annotation tool Labelimg to annotate each image in the dataset with a rectangular box. Each image corresponds to a label file in XML format. The label file contains two categories, cabin and engine, as well as the coordinates of the upper left and lower right corners of the rectangular box.
[0049] Optionally, the model structure improvement module includes:
[0050] The multi-scale detection structure improvement unit is used to add a feature detection layer for detecting extremely small targets on the multi-scale detection structure, and detect the target part when the moving object occupies fewer pixels by taking advantage of the high resolution of the low-level features;
[0051] The backbone feature extraction network structure improvement unit is used to add Squeeze-and-Excitation Networks at the end of BottleneckCSP, an important component of the backbone feature extraction network structure, to give different channels of the feature layer weights that can be automatically learned;
[0052] The spatial pyramid structure improvement unit is used to add the CoordAttention mechanism at the end of the spatial pyramid structure, giving the feature layer cross-channel information, direction perception and position perception information, so that the network model can more accurately locate the target part of the moving object;
[0053] Feature fusion network structure improvement unit, used to optimize the BiFPN structure and replace the PANet feature fusion network structure.
[0054] In a third aspect, the present application further provides a high-precision, low-latency detection system for a target portion of an infrared moving object, comprising: a miniature infrared seeker system and an AI circuit system for implementing the high-precision, low-latency detection method for a target portion of an infrared moving object described in the first aspect above;
[0055] The micro infrared seeker system comprises: an infrared thermal imaging component, a gyro servo tracking circuit component, a micro servo stabilization platform component and a secondary power supply component; wherein the infrared thermal imaging component is used to provide a clear image to the gyro servo tracking circuit component; the gyro servo tracking circuit component is used to drive the servo stabilization platform to stably track the target; the micro servo stabilization platform is used to achieve the stability of the optical axis of the seeker system in the inertial space, and to achieve target angle preset, search and tracking; the secondary power supply component is used to provide the power required by the various components inside the seeker system;
[0056] The AI circuit system includes: a power supply component, an intelligent information processing component, and a data interaction component connected to the intelligent information processing component and the gyro servo tracking circuit component; wherein:
[0057] The data interaction component is used to receive the infrared image data output from the infrared thermal imaging component and output it to the intelligent information processing component; the intelligent information processing component is used to perform target detection algorithm processing on the infrared image data, calculate target-related information, and output it back to the data interaction component; the data interaction component is also used to transmit the target-related information to the gyro servo tracking circuit component; the power supply component is used to provide the power required by the various components within the AI circuit system.
[0058] Optionally, the infrared thermal imaging component consists of an optical system, a modulator, a detector and subsequent circuits.
[0059] In general, by implementing the technical solution of this application, at least the following technical effects can be achieved:
[0060] (1) Compared with the existing solutions that mostly use the TensorFlow network structure, the solution of this application supports the use of the Pytorch network framework, which is simpler and more convenient to operate.
[0061] (2) The present application scheme has improved and optimized the YOLOv5 model in many aspects. It has added a very small target detection layer to the multi-scale detection structure, so that the model can detect the target part of the moving object from a farther distance and a smaller target pixel area, and the recognition rate is also greatly improved compared with YOLOv5; Squeeze-and-Excitation Networks are added at the end of BottleneckCSP to give different channels of the feature layer weights that can be automatically learned; CoordAttention is added at the end of the spatial pyramid structure to give the feature layer cross-channel information, direction perception and position perception information, so that the network model can more accurately locate the target part of the moving object; the BiFPN structure is optimized and the PANet feature fusion network structure is replaced to give the feature layer more semantic information and high-resolution information, so that for moving objects of any size, the model always maintains excellent performance.
[0062] (3) The model corresponding to the detection method of the present application scheme has greatly reduced parameters and calculation amount while maintaining the detection accuracy, which is convenient for deployment on the hardware system and can achieve high-precision and low-latency detection of the target parts of high-speed moving objects.
[0063] (4) The hardware implementation system of the present application has the advantages of miniaturization, low power consumption, high performance and high reliability. Among them, the micro infrared seeker system improves the imaging quality and resolution of infrared images; the AI circuit system overcomes the shortcomings of the traditional multiple FPGA cluster system architecture, such as high power consumption, large space occupation and low reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0065] Figure 1 A flow chart of a high-precision and low-latency detection method for a target part of an infrared moving object provided by an embodiment of the present invention;
[0066] Figure 2 A schematic diagram of the overall structure of the YOLOv5 model provided in an embodiment of the present invention;
[0067] Figure 3 A schematic diagram of the structure of each submodule of the YOLOv5 model provided in an embodiment of the present invention;
[0068] Figure 4A schematic diagram of the overall structure of the improved YOLOv5 model provided by an embodiment of the present invention;
[0069] Figure 5 A schematic diagram of the structure of each submodule after the improvement of the YOLOv5 model provided by an embodiment of the present invention;
[0070] Figure 6 A schematic diagram of the structure of the CoordAttention collaborative attention mechanism provided in an embodiment of the present invention;
[0071] Figure 7 A schematic diagram of the Squeeze-and-Excitation Networks structure provided by an embodiment of the present invention;
[0072] Figure 8 A Precision-Recall curve diagram of the YOLOv5 model provided in an embodiment of the present invention;
[0073] Fig. 9 A Precision-Recall curve diagram of the improved YOLOv5 model provided in an embodiment of the present invention;
[0074] Fig.10 A schematic diagram of the structure of a high-precision and low-latency detection device for a target part of an infrared moving object provided by an embodiment of the present invention;
[0075] Fig.11 A schematic diagram of the structure of a high-precision and low-latency detection system for a target part of an infrared moving object provided by an embodiment of the present invention;
[0076] Fig.12 A schematic structural diagram of another high-precision and low-latency detection system for a target part of an infrared moving object provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0077] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.
[0078] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".
[0079] The technical solution of the present invention is described in detail below with specific embodiments.
[0080] Embodiment 1
[0081] Please refer to Figure 1 The embodiment of the present invention provides a high-precision and low-latency detection method for a target part of an infrared moving object, comprising the following steps:
[0082] S1. After acquiring the moving object pictures, use a data enhancement method to increase the number of pictures; specifically, the data enhancement method includes: rotation transformation, flip transformation, scaling transformation, translation transformation, scale transformation, noise disturbance transformation and contrast transformation.
[0083] S2, marking the target parts of the moving objects in the image, generating a data set, and randomly dividing the data set into a training set and a test set according to a certain ratio;
[0084] S3. Install the CONDA environment management system and build the Pytorch deep learning framework, where the model configuration is completed using the YOLOv5 model;
[0085] S4. Improve the multi-scale detection structure, backbone feature extraction network structure, spatial pyramid structure and feature fusion network structure of the YOLOv5 model;
[0086] S5. Optimize the loss function and introduce an aspect ratio consistency penalty term into the position loss function;
[0087] S6, optimize the NMS non-maximum suppression algorithm to the Soft-NMS algorithm;
[0088] S7, classifying the feature layer output by the feature fusion network structure using a binary cross-loss entropy function to obtain a preliminary detection model;
[0089] S8, training the preliminary detection model using the training set obtained by executing step S2 to obtain a final detection model;
[0090] S9. Input the test set obtained by executing step S2 into the final training model to obtain a detection result.
[0091] In the specific implementation process, the step S2 of marking the target part of the moving object in the picture specifically includes: using the image annotation tool Labelimg to annotate each picture in the data set with a rectangular box, and each picture corresponds to an XML format label file; wherein the label file contains two categories, cabin and engine, and the coordinates of the upper left corner and lower right corner of the rectangular box.
[0092] In the specific implementation process, the step S4 specifically includes the following processing:
[0093] (1) Add a feature detection layer for detecting extremely small targets to the multi-scale detection structure. By taking advantage of the high resolution of low-level features, the target part can be detected when the moving object occupies fewer pixels.
[0094] (2) Add Squeeze-and-Excitation Networks at the end of BottleneckCSP, an important component of the backbone feature extraction network structure, to give different channels in the feature layer weights that can be automatically learned;
[0095] (3) Adding the CoordAttention mechanism at the end of the spatial pyramid structure gives the feature layer cross-channel information, direction perception, and position perception information, allowing the network model to more accurately locate the target part of the moving object;
[0096] (4) Optimize the BiFPN structure and replace the PANet feature fusion network structure.
[0097] In the specific implementation process, the position loss function in step S5 is defined as:
[0098]
[0099]
[0100]
[0101] Among them, IOU represents the intersection-over-union ratio between the predicted box and the real box, b represents the center point of the predicted box, and b gt represents the center point of the target box, p represents the Euclidean distance, c represents the diagonal distance of the minimum circumscribed rectangle formed by the intersecting prediction box and the target box, α is a weight coefficient, v represents the parameter of aspect ratio consistency, w is the width of the prediction box, and w gt is the width of the real box, h is the height of the predicted box, and h gt is the height of the actual frame.
[0102] The loss function, also known as the cost function, is an important part of neural network design. The loss function is used to characterize the error between the model's predicted value and the true class label. The training of a deep learning model is the process of minimizing the loss function using a gradient-based method. Object detection is generally divided into two processes: training and detection. The loss function belongs to the training process. There are millions of parameters in the YOLOv5 model. When training the model, the input and output are known. Finding the functional relationship f(x) between the input and output is similar to fitting a point on a coordinate plane with a straight line y=ax+b. The role of the loss function is to make the coefficients a and b closest to the true value.
[0103] The NMS algorithm in step S6 is defined as:
[0104]
[0105] The Soft-NM algorithm is defined as:
[0106]
[0107] Among them, S is the set of prediction boxes, M is the prediction box with the highest score in S, and b i is the remaining prediction box in S except M, N t is a threshold, s i is the prediction box b i When the IOU of a prediction box is larger than that of the prediction box with the highest score, the prediction box can be correctly detected.
[0108] As mentioned above, target detection generally includes a training process and a detection process. NMS belongs to the detection process and is the last step of the detection process. When a picture is input into the trained YOLOv5 model, many prediction boxes will be output. The prediction boxes need to be screened. NMS is responsible for screening the prediction boxes, and the screened boxes are the final detection results. The Soft-NMS algorithm is an improvement on the NMS algorithm. It has better detection effects on dense object detection than NMS. The NMS algorithm sorts the prediction boxes by score, then retains the box with the highest score, and deletes other boxes whose overlapping area with the box is greater than a certain proportion.
[0109] In a specific implementation, the complete implementation of the present application is described as follows:
[0110] After obtaining the moving object picture, use the Labelimg annotation tool to annotate each picture in the dataset with a rectangular box. A label file with the same name as the annotated picture will be generated. Each picture corresponds to an XML-formatted label. The label file contains the name of the picture, the name of the category, and the coordinates of the upper left and lower right corners of the annotated rectangular box. The category names include cabin and engine. Use the Python format conversion script to convert the XML-formatted labels into TXT-formatted labels. The TXT-formatted labels have 5 columns. The first column indicates the category to which the target belongs. The second and third columns are the horizontal and vertical coordinates of the center point after normalization, respectively. The fourth and fifth columns are the width and height of the target after normalization.
[0111] Use the Python program to randomly divide the above moving object key data set into a training set train and a test set test according to a certain ratio (such as a ratio of 8:2). The training set train and the test set test directories each contain two subfolders, named images and labels respectively. Images store pictures, and labels store labels.
[0112] Put the above training set train and test set test into the YOLOv5 model based on the Pytorch deep learning framework. Figure 2 and Figure 3 As shown, YOLOv5 extracts multiple feature layers for target detection. A total of three feature layers are extracted. The three extracted feature layers are decoded to obtain three effective feature layers. Each effective feature layer divides the entire image into grids corresponding to its length and width. Each grid point has three prior frames. Because only two categories are detected, each prior frame contains 7 elements, which are the category, the coordinates of the center point of the prediction frame, the width, the height, and the confidence scores of the two categories. Among them, the effective feature layer 20×20×21 is used to detect large targets in the image, 40×40×21 is used to detect medium targets in the image, and 80×80×21 is used to detect small targets in the image. BottleneckCSP is the backbone feature extraction network feature extraction unit, and SPP is spatial pyramid pooling. However, YOLOv5 does not perform well in detecting the target parts of infrared moving objects. Among them, Figure 2Basic modules in it: The SPP module is spatial pyramid pooling, which integrates local features with global features; the Focus module transfers the width and height information of the original image to the channel space, and implements downsampling without losing the original image information, which can reduce the width and height of the feature map to 1 / 2 of the original size; the Bottleneck (True) and Bottleneck (False) modules reduce the number of parameters and calculations of the network model; the BCSPn (True) and BCSPn (False) modules extract features from images input to the network; the upsampling module enlarges the original image, which can enlarge the width and height of the feature map to twice the original size; the Detect module calculates the center coordinates and height and width of the prediction box. Figure 3 Basic modules in: conv0 is a common convolution operation, which is used to extract the features of the input image; BN is batch normalization, which is used to solve the problem of gradient disappearance during network model training; HardSwish and LeakyRelu are two different activation functions that can enable the network to have nonlinear mapping capabilities; add means adding the feature map, and Concat is called stacking, both of which are used to fuse features; slice is a branch structure, which represents the slicing operation in the Focus module, and the role of the slicing operation is to transfer the width and height information of the original image to the channel dimension; it represents the maximum pooling operation in the SPP module, and the role of the maximum pooling is to compress the image and reduce the number of network model parameters; Conv1 is a module composed of conv0, BN, and HardSwish, with a step size of 1. The structure of Conv2 is exactly the same as Conv1, the difference is that its step size is 2; the functions of Conv1 and Conv2 modules are both to extract different features of the input image.
[0113] Now we improve the YOLOv5 model, such as Figures 4 to 7 As shown in the figure, the feature extraction unit BottleneckCSP (BCSP) of the backbone feature extraction network is improved, and Squeeze-and-Excitation Networks (SENet) is added at the end to give different channels of the feature layer weights that can be automatically learned; the spatial pooling pyramid is improved, and the CoordAttention (CA) collaborative attention mechanism is added at the end to give the feature layer cross-channel information, direction perception and position perception information, so that the network model can more accurately locate the target part of the moving object; the original PANet feature fusion network is abandoned and replaced with the improved BiFPN bidirectional feature pyramid network. At this time, the feature layer has 3 inputs when performing the Concat operation, and the output feature layer contains more semantic information and high-resolution information. Among them, Figure 4 The basic module functions are the same as Figure 2 Medium basic module. Figure 5 The basic module functions are the same as Figure 3 Medium basic module. Figure 6 Basic module in the paper: CoordAttention (CA for short) is a collaborative attention mechanism with the following functions: (1) It can not only capture cross-channel information, but also capture direction-aware and position-aware information, which can help the model locate and identify the target of interest more accurately; (2) CoordAttention is a lightweight network that can be easily inserted into the classic module and enhances features by strengthening information representation; CoordAttention consists of the following steps: First, the input feature map passes through the Residual module to obtain a feature map A of size CxHxW; then average pooling operations are performed along the horizontal and vertical coordinate directions to obtain feature maps of CxHx1 and Cx1xW respectively, and the above two feature maps are feature aggregated, and then subjected to convolution operations, batch normalization, and nonlinear activation function operations. At this time, the number of channels of the feature map becomes 1 / r of the original; then it is decomposed into two feature maps along the horizontal and vertical coordinate directions, and the two feature maps are subjected to convolution operations and Sigmoid activation function operations to obtain weights B and C; finally, feature map A is multiplied by weights B and C to obtain the output result. Figure 7 Basic module: SENet is a channel attention mechanism, which is used to give feature channels weights that can be automatically updated. It consists of the following steps: First, the input feature map passes through the Residual module to obtain a feature map of size CxHxW, and then performs a global average pooling operation to obtain a real sequence of length C, so that the feature map on each channel has a global receptive field. The shallow feature map with a small global receptive field can use global information to improve the feature extraction ability of the network and obtain richer image semantic information; then, the real sequence of length C is input into the fully connected layer (FC), and the fully connected layer reduces the sequence dimension to the original 1 / r (r is the scaling factor), and then uses the ReLU activation function to achieve nonlinear fitting, and then the real sequence of length C / r is input into the fully connected layer (FC), and the fully connected layer restores the sequence dimension to C, and then uses the Sigmoid activation function to calculate the channel weight coefficient; then the weight coefficient is multiplied by the corresponding feature channel to update the feature map; finally, the updated feature map is added to the input feature map to obtain the output result.
[0114] Use the above dataset to train the improved YOLOv5 model. Figure 8 and Fig. 9They are the Precision-Recall curves of the YOLOv5 and improved YOLOv5 models. The area under the curve represents the detection accuracy. It can be seen from the figure that the average detection accuracy of the original YOLOv5 model is mAP = 81.0%, while the average detection accuracy of the improved YOLOv5 algorithm is mAP = 87.3%, and the average detection accuracy is improved by 6.3%.
[0115] Find the weight file best.pt with the largest mAP from the training results, and use DeepStream to deploy it to the NVIDIA Jetson AGX Xavier Module. First, use the git command to clone the tensorrtx project, copy tensorrtx / yolov5 / gen_wts.py to the root directory of the yolov5 project, and execute the command to generate the .wts file; also clone a tensorrtx project on the NVIDIA Jetson AGX Xavier Module, put the above .wts file in tensorrtx / yolov5 / , modify tensorrtx / yolov5 / yololayer.h, change the number of types to 2, compile the code in the tensorrtx / yolov5 / directory, and convert the .wts file to a .engine file; install DeepStream, use the git command to clone the Yolov5-in-Deepstream-5.0 project, put the above .engine file in the directory, modify the DeepStream processing flow configuration file, and execute the command to run DeepStream, which can perform target detection on the NVIDIA Jetson AGXXavier Module.
[0116] In general, by implementing the technical solution of this application, at least the following technical effects can be achieved:
[0117] (1) Compared with the existing solution using the TensorFlow network structure, the solution of this application supports the use of the Pytorch network framework, which is simpler and more convenient to operate.
[0118] (2) The present application scheme has improved and optimized the YOLOv5 model in many aspects. It has added a very small target detection layer to the multi-scale detection structure, so that the model can detect the target part of the moving object from a farther distance and a smaller target pixel area, and the recognition rate is also greatly improved compared with YOLOv5; Squeeze-and-Excitation Networks are added at the end of BottleneckCSP to give different channels of the feature layer weights that can be automatically learned; CoordAttention is added at the end of the spatial pyramid structure to give the feature layer cross-channel information, direction perception and position perception information, so that the network model can more accurately locate the target part of the moving object; the BiFPN structure is optimized and the PANet feature fusion network structure is replaced to give the feature layer more semantic information and high-resolution information, so that for moving objects of any size, the model always maintains excellent performance.
[0119] (3) The model corresponding to the detection method of the present application scheme has greatly reduced parameters and calculation amount while maintaining the detection accuracy, which is convenient for deployment on the hardware system and can achieve high-precision and low-latency detection of the target parts of high-speed moving objects.
[0120] Embodiment 2
[0121] Please refer to Fig.10 Based on the same inventive concept, the embodiment of the present application provides a high-precision and low-latency detection device for a target part of an infrared moving object, comprising:
[0122] The picture data enhancement module 1 is used to increase the number of pictures using a data enhancement method after obtaining the moving object pictures;
[0123] The data set generation module 2 is used to mark the target parts of the moving objects in the picture, generate a data set, and randomly divide the data set into a training set and a test set according to a certain ratio;
[0124] Deep learning framework building module 3 is used to install the CONDA environment management system and build the Pytorch deep learning framework, in which the model configuration is completed using the YOLOv5 model;
[0125] Model structure improvement module 4 is used to improve the multi-scale detection structure, backbone feature extraction network structure, spatial pyramid structure and feature fusion network structure of the YOLOv5 model;
[0126] Function optimization module 5, used to optimize the loss function and introduce aspect ratio consistency penalty term into the position loss function;
[0127] Algorithm optimization module 6, used for optimizing the NMS non-maximum suppression algorithm into a Soft-NMS algorithm;
[0128] A preliminary detection model acquisition module 7 is used to classify the feature layer output by the feature fusion network structure using a binary cross-loss entropy function to obtain a preliminary detection model;
[0129] A final detection model acquisition module 8 is used to train the preliminary detection model using the training set to obtain a final detection model;
[0130] The detection result acquisition module 9 is used to input the test set into the final training model to obtain the detection result.
[0131] In the specific implementation process, the data enhancement methods adopted by the image data enhancement module 1 include: rotation transformation, flip transformation, scaling transformation, translation transformation, scale transformation, noise disturbance transformation and contrast transformation.
[0132] Furthermore, the target parts of the moving objects in the image annotated by the dataset generation module 2 specifically include:
[0133] Use the image annotation tool Labelimg to annotate each image in the dataset with a rectangular box. Each image corresponds to a label file in XML format. The label file contains two categories, cabin and engine, as well as the coordinates of the upper left and lower right corners of the rectangular box.
[0134] In the specific implementation process, the model structure improvement module 4 includes:
[0135] The multi-scale detection structure improvement unit is used to add a feature detection layer for detecting extremely small targets on the multi-scale detection structure, and detect the target part when the moving object occupies fewer pixels by taking advantage of the high resolution of the low-level features;
[0136] The backbone feature extraction network structure improvement unit is used to add Squeeze-and-Excitation Networks at the end of BottleneckCSP, an important component of the backbone feature extraction network structure, to give different channels of the feature layer weights that can be automatically learned;
[0137] The spatial pyramid structure improvement unit is used to add the CoordAttention mechanism at the end of the spatial pyramid structure, giving the feature layer cross-channel information, direction perception and position perception information, so that the network model can more accurately locate the target part of the moving object;
[0138] Feature fusion network structure improvement unit, used to optimize the BiFPN structure and replace the PANet feature fusion network structure.
[0139] In the specific implementation process, the position loss function is defined as:
[0140]
[0141]
[0142]
[0143] Among them, IOU represents the intersection-over-union ratio between the predicted box and the real box, b represents the center point of the predicted box, and b gt represents the center point of the target box, ρ represents the Euclidean distance, c represents the diagonal distance of the minimum circumscribed rectangle between the intersecting prediction box and the target box, α is a weight coefficient, v represents the parameter of aspect ratio consistency, w is the width of the prediction box, and w gt is the width of the real box, h is the height of the predicted box, and h gt is the height of the actual frame.
[0144] The NMS algorithm is defined as:
[0145]
[0146] The Soft-NM algorithm is defined as:
[0147]
[0148] Among them, S is the set of prediction boxes, M is the prediction box with the highest score in S, and b i is the remaining prediction box in S except M, N t is a threshold, s i is the prediction box b i When the IOU of a prediction box is larger than that of the prediction box with the highest score, the prediction box can be correctly detected.
[0149] The above-mentioned high-precision and low-latency detection device for the target part of an infrared moving object is used to implement the above-mentioned high-precision and low-latency detection method for the target part of an infrared moving object. Therefore, the device is consistent with one or more embodiments of the above-mentioned method and will not be described in detail here.
[0150] Embodiment 3
[0151] Please refer to Fig.11 , the embodiment of the present application provides a high-precision and low-latency detection system for the target part of an infrared moving object, which is used as a hardware platform to carry the method in the first embodiment of the present application to realize engineering applications. The detection system includes: a micro infrared seeker system 10 and an AI circuit system 20;
[0152] The micro infrared seeker system 10 includes: an infrared thermal imaging component 101, a gyro servo tracking circuit component 102, a micro servo stable platform component 103 and a secondary power supply component 104; wherein the secondary power supply component 104 is used to provide the power required by the components inside the seeker system, and at the same time meet the relevant requirements of power supply adaptability; the infrared thermal imaging component 101 is used to provide a clear image to the gyro servo tracking circuit component 102, so that the seeker system can effectively detect, identify and track the target; the gyro servo tracking circuit component 102 is used to realize the position solution of the target, drive the micro servo stable platform component 103 to stably track the target, and mainly includes modules such as video acquisition, target tracking, video output, and guidance information output. The micro servo stable platform component 103 realizes the stability of the seeker optical axis in the inertial space based on the angular velocity information given by the gyroscope, and has the functions of angle preset, search, tracking, etc. This component is designed to be integrated with the angle measuring sensor, which can reduce the size of the seeker while ensuring the platform servo performance.
[0153] The AI circuit system 20 includes: a power supply component 201, an intelligent information processing component 202, and a data interaction component 203 connected to the intelligent information processing component 202 and the gyro servo tracking circuit component 102; wherein:
[0154] The data interaction component 203 is used to receive the infrared image data output from the infrared thermal imaging component 101 and output it to the intelligent information processing component 202; the intelligent information processing component 202 is used to perform target detection algorithm processing on the infrared image data, calculate target-related information, and output it back to the data interaction component 203; the data interaction component 203 is also used to transmit the target-related information to the gyro servo tracking circuit component 102; the power supply component 201 is used to provide the power required by the internal components of the AI circuit system 20.
[0155] In the specific implementation process, please refer to Fig.11 The infrared thermal imaging component 101 is composed of an optical system 1011, a modulator 1012, a detector 1013 and a subsequent circuit 1014. The miniature infrared thermal imaging component 101 integrates the optical system 1011, the modulator 1012, the detector 1013 and the subsequent circuit 1014, which greatly reduces the space and area required and improves the space utilization.
[0156] In order to ensure the real-time performance of image target detection, under the traditional method, the image detection algorithm processing platform mostly adopts a solution of multiple high-performance FPGA clusters as the computing core of the processing platform, but this method has many shortcomings such as high difficulty in research and development, long cycle, and high power consumption of the platform. Therefore, in view of the high-precision and low-latency detection method of the target part of an infrared moving object proposed in the present invention, a miniaturized and high-performance AI circuit system 20 is designed. It is an AI circuit system suitable for efficient hardware implementation of neural networks based on an FPGA and a SOC with an integrated high-performance neural network core.
[0157] In the specific implementation process, please refer to Fig.12 The core of the data interaction component 203 is planned to use FPGA, and the core of the intelligent information processing component 202 is planned to use Jetson AGX Xavier chip. Both are controlled by clock signals and are provided with multiple communication interfaces to exchange data with external circuits. Among them, the performance of the Jetson AGX Xavier chip is very powerful. Its main functions include: (1) receiving image data sent by the data interaction component 203 through the video interface; (2) running the intelligent target detection and recognition algorithm to calculate the relevant information of the target; (3) outputting the relevant information of the target to the data interaction component 203 through the serial port. The data interaction component 203 receives image data from the video acquisition module of the gyro servo tracking circuit component 102, and sends it to the Jetson AGX Xavier in the intelligent information processing component 202 through the video interface, and then sends the relevant information of the target output by the intelligent information processing component 202 to the gyro servo tracking circuit component 102. The gyro servo tracking circuit component 102 further drives the micro servo stabilization platform to stably track the target part of the infrared moving object.
[0158] In summary, the hardware implementation system of the embodiment of the present application has the advantages of miniaturization, low power consumption, high performance, and high reliability. Among them, the micro infrared seeker system 10 improves the imaging quality and resolution of infrared images; the AI circuit system 20 overcomes the shortcomings of the traditional multiple FPGA cluster system architecture, such as high power consumption, large occupied space, and low reliability.
[0159] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0160] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A high-precision and low-delay detection method for a target part of an infrared moving object, characterized in that: The following steps are involved: S1. After obtaining the moving object pictures, use the data enhancement method to increase the number of pictures; S2, marking the target parts of the moving objects in the image, generating a data set, and randomly dividing the data set into a training set and a test set according to a certain ratio; S3. Install the CONDA environment management system and build the Pytorch deep learning framework, where the model configuration is completed using the YOLOv5 model; S4. Improve the multi-scale detection structure, backbone feature extraction network structure, spatial pyramid structure and feature fusion network structure of the YOLOv5 model; S5. Optimize the loss function and introduce an aspect ratio consistency penalty term into the position loss function; S6, optimize the NMS non-maximum suppression algorithm to the Soft-NMS algorithm; S7, classifying the feature layer output by the feature fusion network structure using a binary cross-loss entropy function to obtain a preliminary detection model; S8, using the training set to train the preliminary detection model to obtain a final detection model; S9: input the test set into the final training model to obtain a detection result.
2. The high-precision and low-delay detection method for the target part of an infrared moving object as claimed in claim 1, characterized in that: The data enhancement method in step S1 includes: rotation transformation, flip transformation, scaling transformation, translation transformation, scale transformation, noise disturbance transformation and contrast transformation.
3. The high-precision and low-delay detection method for the target part of an infrared moving object as claimed in claim 1, characterized in that: The step S2 of marking the target part of the moving object in the picture specifically includes: Use the image annotation tool Labelimg to annotate each image in the dataset with a rectangular box. Each image corresponds to a label file in XML format. The label file contains two categories, cabin and engine, as well as the coordinates of the upper left and lower right corners of the rectangular box.
4. The high-precision and low-delay detection method for the target part of an infrared moving object as claimed in claim 1, characterized in that: The step S4 specifically includes the following processing: A feature detection layer for detecting extremely small targets is added to the multi-scale detection structure. By taking advantage of the high resolution of low-level features, the target part is detected when the moving object occupies fewer pixels. Add Squeeze-and-Excitation Networks at the end of BottleneckCSP, an important component of the backbone feature extraction network structure, to give different channels in the feature layer weights that can be automatically learned; Add the CoordAttention mechanism at the end of the spatial pyramid structure to give the feature layer cross-channel information, direction perception, and position perception information, so that the network model can more accurately locate the target part of the moving object; Optimize the BiFPN structure and replace the PANet feature fusion network structure.
5. The high-precision and low-delay detection method for the target part of an infrared moving object as claimed in claim 1, characterized in that: The position loss function in step S5 is defined as: Among them, IOU represents the intersection-over-union ratio between the predicted box and the real box, b represents the center point of the predicted box, and b gt represents the center point of the target box, ρ represents the Euclidean distance, c represents the diagonal distance of the minimum circumscribed rectangle between the intersecting prediction box and the target box, α is a weight coefficient, v represents the parameter of aspect ratio consistency, w is the width of the prediction box, and w gt is the width of the real box, h is the height of the predicted box, and h gt is the height of the actual frame.
6. The high-precision and low-delay detection method for the target part of an infrared moving object as claimed in claim 1, characterized in that: The NMS algorithm in step S6 is defined as: The Soft-NM algorithm is defined as: Among them, S is the set of prediction boxes, M is the prediction box with the highest score in S, and b i is the remaining prediction box in S except M, N t is a threshold, s i is the prediction box b i The IOU is the intersection-over-union ratio of the predicted box and the true box. When the intersection-over-union ratio of a predicted box and the predicted box with the highest score is large, the predicted box can be correctly detected.
7. A high-precision and low-delay detection device for a target part of an infrared moving object, characterized in that: include: The image data enhancement module is used to increase the number of images using a data enhancement method after obtaining the moving object images; A data set generation module is used to mark the target parts of the moving objects in the image, generate a data set, and randomly divide the data set into a training set and a test set according to a certain ratio; The deep learning framework building module is used to install the CONDA environment management system and build the Pytorch deep learning framework. The model configuration is completed using the YOLOv5 model. Model structure improvement module, used to improve the multi-scale detection structure, backbone feature extraction network structure, spatial pyramid structure and feature fusion network structure of the YOLOv5 model; Function optimization module, used to optimize the loss function and introduce aspect ratio consistency penalty term into the position loss function; Algorithm optimization module, used to optimize the NMS non-maximum suppression algorithm to the Soft-NMS algorithm; A preliminary detection model acquisition module is used to classify the feature layer output by the feature fusion network structure using a binary cross-loss entropy function to obtain a preliminary detection model; A final detection model acquisition module, used to train the preliminary detection model using the training set to obtain a final detection model; The detection result acquisition module is used to input the test set into the final training model to obtain the detection result.
8. The high-precision and low-delay detection device for the target part of an infrared moving object as claimed in claim 7, characterized in that: The data set generation module specifically marks the target parts of moving objects in the picture: Use the image annotation tool Labelimg to annotate each image in the dataset with a rectangular box. Each image corresponds to a label file in XML format. The label file contains two categories, cabin and engine, as well as the coordinates of the upper left and lower right corners of the rectangular box.
9. The high-precision and low-delay detection device for the target part of an infrared moving object as claimed in claim 7, characterized in that: The model structure improvement module includes: The multi-scale detection structure improvement unit is used to add a feature detection layer for detecting extremely small targets on the multi-scale detection structure, and detect the target part when the moving object occupies fewer pixels by taking advantage of the high resolution of the low-level features; The backbone feature extraction network structure improvement unit is used to add Squeeze-and-Excitation Networks at the end of BottleneckCSP, an important component of the backbone feature extraction network structure, to give different channels of the feature layer weights that can be automatically learned; The spatial pyramid structure improvement unit is used to add the CoordAttention mechanism at the end of the spatial pyramid structure, giving the feature layer cross-channel information, direction perception and position perception information, so that the network model can more accurately locate the target part of the moving object; Feature fusion network structure improvement unit, used to optimize the BiFPN structure and replace the PANet feature fusion network structure.
10. A high-precision, low-latency detection system for infrared moving object target parts, characterized in that: include: A miniature infrared seeker system and an AI circuit system for implementing the high-precision and low-latency detection method of the target part of an infrared moving object as described in any of claims 1 to 6 above; The micro infrared seeker system comprises: an infrared thermal imaging component, a gyro servo tracking circuit component, a micro servo stabilization platform component and a secondary power supply component; wherein the infrared thermal imaging component is used to provide a clear image to the gyro servo tracking circuit component; the gyro servo tracking circuit component is used to drive the servo stabilization platform to stably track the target; the micro servo stabilization platform is used to achieve the stability of the optical axis of the seeker system in the inertial space, and to achieve target angle preset, search and tracking; the secondary power supply component is used to provide the power required by the various components inside the seeker system; The AI circuit system includes: a power supply component, an intelligent information processing component, and a data interaction component connected to the intelligent information processing component and the gyro servo tracking circuit component; wherein: The data interaction component is used to receive the infrared image data output from the infrared thermal imaging component and output it to the intelligent information processing component; the intelligent information processing component is used to perform target detection algorithm processing on the infrared image data, calculate target-related information, and output it back to the data interaction component; the data interaction component is also used to transmit the target-related information to the gyro servo tracking circuit component; the power supply component is used to provide the power required by the various components within the AI circuit system.
