Moving target detection method based on helmet-mounted infrared image
By enhancing and inter-frame difference processing of the helmet-mounted infrared image, combined with the deep learning network, the YOLOv5 network is optimized, which solves the problems of high image quality requirements and high false detection rate in infrared target detection, and achieves more efficient infrared target detection. .
Patent Information
- Application Number
- CN202410996658.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-09-10
AI Technical Summary
Existing infrared target detection methods have high requirements for infrared image quality, large data requirements, high false detection rates, and poor infrared image feature extraction, making detection difficult.
Using a moving target detection method based on helmet-mounted infrared images, feature extraction and target detection are carried out through the combination of image enhancement processing, inter-frame difference algorithm and deep learning network, including the steps: image enhancement, inter-frame difference, denoising processing, feature Fusion and target detection, optimizing YOLOv5 network to improve detection accuracy.
It effectively makes up for the problem of insufficient features when infrared image quality is low, improves detection accuracy, reduces false detection rates, has a wider scope of application, and is suitable for real-time monitoring needs.
Smart Images

Figure CN118628889A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of infrared image processing and relates to a moving target detection method based on helmet-borne infrared images. Background Art
[0002] In recent years, infrared target detection has been a difficult and hot topic in the field of target detection. Infrared images have low resolution, insufficient texture details, and lack of color information, resulting in blurred target imaging and great difficulty in detection. Infrared target detection systems can be flexibly deployed on different platforms and have important practical value in the fields of infrared early warning and guidance.
[0003] As an important application of infrared imaging, helmet-mounted infrared imaging has a wide range of applications. For example, in the field of firefighting, it can help firefighters find survivors faster and more conveniently for rescue and save more survivors. In the military field, there are also helmet-mounted infrared reconnaissance devices, which are small in size, easy to carry, widely applicable, and can work all-weather. They are indispensable components for single-soldier combat. In addition to these application areas, it can also be used in urban anti-terrorism commandos, night monitoring, industrial inspection and other fields.
[0004] So far, the existing infrared target detection methods can be roughly divided into two categories: single-frame and multi-frame. The single-frame algorithm includes local information single-frame algorithm and non-local information single-frame algorithm, and the multi-frame algorithm includes association verification multi-frame algorithm and direct solution multi-frame algorithm, but the missed detection rate and false detection rate are still very high. Summary of the invention
[0005] The purpose of the present invention is to provide a method for detecting active targets based on helmet-mounted infrared images, which solves the problems of existing infrared target detection algorithms in that they have high requirements for infrared image quality, large data requirements, high false detection rate of infrared target detection, and poor infrared image feature extraction. The technical solutions adopted by the present invention are as follows:
[0006] A method for detecting moving targets based on helmet-mounted infrared images comprises the following steps:
[0007] Step 1: Obtain helmet-mounted infrared images and perform data annotation;
[0008] Step 2: Read the infrared image of the helmet to be detected, perform image enhancement processing, and obtain an enhanced infrared pre-processed image;
[0009] Step 3: Preprocess the image and input it into the target detection network for feature extraction to obtain features of different sizes;
[0010] Step 4: Fuse features of different sizes to obtain richer feature images of different sizes;
[0011] Step 5: Input feature images of different sizes into different target detection heads for target detection;
[0012] Step 6: Perform non-maximum suppression on the target detection result obtained by the detection head to obtain the final target detection effect diagram; further, the step 1 includes the following steps:
[0013] Step 1 is specifically as follows: annotate the helmet-mounted infrared sequence images, obtain the label file information of the human target category, and export it as a text document in YOLO format.
[0014] The details of step 2 are as follows:
[0015] The image enhancement method used for helmet-mounted infrared images is limited contrast histogram equalization. First, the sub-block size and contrast threshold of the input image are set, and then the image is divided into sub-blocks of equal size. Then, the mapping formula of histogram equalization is used to map the grayscale k in each block to grayscale s. k , and obtain the histogram equalized image. The mapping formula is:
[0016] ;
[0017] Where n is the total number of pixels in the image, n j is the number of pixels corresponding to gray level j, and L is the total number of gray levels in the image; then the contrast of each sub-block is calculated, and if the contrast of the sub-block exceeds the previously set threshold, it is limited to the threshold range; finally, all the sub-blocks are spliced together to obtain the final enhanced image.
[0018] The specific steps of step 3 are as follows:
[0019] Step 3.1: Read two consecutive frames of infrared images, and use the two-frame difference algorithm formula to calculate the difference between the current frame and the previous frame to obtain a difference image. The two-frame difference algorithm formula is:
[0020] ;
[0021] Where D(x,y) is the difference image between two consecutive frames, I(t) and I(t-1) are the images at time t and time t-1 respectively, T is the threshold selected when the difference image is binarized, D(x,y)=1 represents the foreground, and D(x,y)=0 represents the background.
[0022] Step 3.2: De-noise the differential image by first corroding and then dilating to obtain the de-noised differential image. The corrosion operation formula is:
[0023] ;
[0024] This formula means that structure A is corroded by structure B. Corrosion can make the target area "smaller". In essence, it causes the boundary of the image to shrink, which can be used to eliminate small and meaningless targets.
[0025] The expansion calculation formula is:
[0026] ;
[0027] This formula indicates that image A is expanded using B, where B is a convolution template or convolution kernel, which can be square or circular in shape. Convolution calculation is performed between template B and image A, and each pixel in the image is scanned. The template elements and binary image elements are ANDed. If both are 0, the target pixel is 0, otherwise it is 1.
[0028] The specific steps of step 4 are as follows:
[0029] Step 4.1: Concatenate the enhanced infrared pre-processed image and the background suppressed image in the channel dimension, and then fill a channel with all 0s to form 3 channels as input;
[0030] Step 4.2: Optimize the classic single-stage target detection network YOLOv5, replace the Conv in the original BackBone with the more lightweight GSConv, reduce model parameters and make feature extraction more effective. At the same time, introduce the attention mechanism in BackBone, extract feature layers of different scales for channel fusion, input the fused feature layers into the BiFPN structure, and add the Detect module in the subsequent downsampling process. At the same time, add a detection head to prevent the loss of infrared targets during the downsampling process, so as to detect targets of different sizes.
[0031] The specific steps of step 5 are as follows:
[0032] Step 5.1: Sort each bounding box in descending order according to its confidence. The bounding box with the highest confidence is considered to be the most likely to have correctly detected the object.
[0033] Step 5.2: Select the bounding box with the highest confidence from the sorted list, mark it as selected, and add it to the final list of detection results.
[0034] Step 5.3: For each remaining bounding box, calculate its IOU with the selected bounding box according to the IOU calculation formula. The bounding box IOU calculation formula is:
[0035] ;
[0036] in, It represents the area where the two boxes A and B intersect. It represents the sum of the areas of boxes A and B minus the area of the intersection of the two boxes.
[0037] Step 5.4: If the IOU between a bounding box and the selected box exceeds the set threshold, it is considered that the two boxes represent the same target, so the bounding box with low confidence is removed according to the principle of low confidence.
[0038] Step 5.5: Repeat steps 5.2-5.4, continue to select the highest confidence among the remaining bounding boxes, and repeat the IOU calculation and elimination process until all bounding boxes have been checked.
[0039] Step 5.6: The remaining bounding box set is the final detection result after non-maximum suppression processing. Each target corresponds to an optimal bounding box, and the final detection result map is obtained.
[0040] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0041] 1. A method for detecting active targets based on helmet-mounted infrared images combines traditional inter-frame difference target detection with the deep learning classic target detection network Yolov5. By using the inter-frame difference algorithm to obtain a background suppression image between two consecutive frames, it not only highlights the target, but also adds the target's temporal and spatial characteristics into the target detection network, effectively making up for the problem of insufficient features of the single-frame target detection algorithm when the infrared image quality is not high.
[0042] 2. In step 2.1 of the present invention, the helmet-mounted infrared image is denoised and pre-processed for image enhancement, thereby improving the image contrast, peak signal-to-noise ratio, etc., and there is no need to have other high requirements on the quality of the helmet-mounted infrared image to be detected, making the method more applicable.
[0043] 3. In step 4.2 of the present invention, the classic target detection YOLOv5 is optimized, and the Conv in BackBone is replaced with a lighter and more efficient GSConv, which is more hardware-friendly. An attention mechanism is also added to BackBone to make the model more focused on key information and features. The BiFPN feature fusion module is introduced into the network to achieve a more efficient feature fusion method and improve the accuracy of target detection. Adding a detection head on the original basis effectively solves the problem of some small infrared targets being lost in downsampling and improves the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a flow chart of a method for detecting moving targets based on helmet-borne infrared red images;
[0045] Figure 2is the helmet-borne infrared image to be detected in the first embodiment of the present invention;
[0046] Figure 3 This is an example of a situation where a dataset is annotated;
[0047] Figure 4 is the image enhancement preprocessing image of the first embodiment of the present invention;
[0048] Figure 5 is the background suppressed image of the first embodiment of the present invention;
[0049] Figure 6 is a structural diagram of GSConv in BackBone of the first embodiment of the present invention;
[0050] Figure 7 This is an overall structural diagram after network optimization in Embodiment 1 of the present invention;
[0051] Figure 8 This is a moving target detection result diagram of the first embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0053] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0055] In the description of the present invention, it should be understood that the terms "upper", "lower", "inside", "outside", "left", "right", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, or are directions or positional relationships in which the product of the invention is usually placed when in use, or are directions or positional relationships commonly understood by those skilled in the art. These directions or positional relationships are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0056] Furthermore, the terms “first”, “second”, etc. are merely used for distinguishing descriptions and should not be understood as indicating or implying relative importance.
[0057] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms such as "setting" and "connection" should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0058] like Figure 1 As shown, a method for detecting active targets based on helmet-mounted infrared includes the following steps:
[0059] Step 1: Obtain helmet-mounted infrared images; perform data annotation. The helmet-mounted infrared data is as follows: Figure 2 The annotation results are as follows Figure 3 As shown;
[0060] The details of step 2 are as follows:
[0061] The image enhancement method used for helmet-mounted infrared images is limited contrast histogram equalization. First, the sub-block size and contrast threshold of the input image are set, and then the image is divided into sub-blocks of equal size. Then, the mapping formula of histogram equalization is used to map the grayscale k in each block to grayscale s. k , and obtain the histogram equalized image. The mapping formula is:
[0062] ;
[0063] Where n is the total number of pixels in the image, n j is the number of pixels corresponding to gray level j, and L is the total number of gray levels in the image; then the contrast of each sub-block is calculated, and if the contrast of the sub-block exceeds the previously set threshold, it is limited to the threshold range. Finally, all sub-blocks are spliced together to obtain the final enhanced image. The infrared enhancement result is shown in Figure 4 shown.
[0064] The specific steps of step 3 are as follows:
[0065] Step 3.1: Read two consecutive frames of infrared images, and use the two-frame difference algorithm formula to calculate the difference between the current frame and the previous frame to obtain a difference image. The two-frame difference algorithm formula is:
[0066] ;
[0067] Where D(x,y) is the difference image between two consecutive frames, I(t) and I(t-1) are the images at time t and time t-1 respectively, T is the threshold selected when the difference image is binarized, D(x,y)=1 represents the foreground, and D(x,y)=0 represents the background.
[0068] Step 3.2: De-noise the differential image by first corroding and then dilating to obtain the de-noised differential image. The corrosion operation formula is: ;
[0069] This formula means that A is corroded by structure B, where B is the defined structure element or convolution kernel, A is the original image, and each pixel of the image is scanned by structure element B. If all pixel values in the area covered by the structure element are 1, the value of the pixel is set to 1. Erosion can make the target area "smaller", which actually causes the boundary of the image to shrink, and can be used to eliminate small and meaningless targets;
[0070] The expansion calculation formula is:
[0071] ;
[0072] This formula indicates that B is used to dilate image A, where B is a convolution template or convolution kernel, which can be square or circular in shape. Template B is used to perform convolution calculation with image A, and each pixel in the image is scanned. The template element and the binary image element are used to perform an "AND" operation. If both are 0, the target pixel is 0, otherwise it is 1. The final background suppression image result is as follows Figure 5 shown.
[0073] The specific steps of step 4 are as follows:
[0074] Step 4.1: Concatenate the infrared enhanced image and the background suppressed image in the channel dimension, and then fill a channel with all 0s to form 3 channels as input;
[0075] Step 4.2: Optimize the classic single-stage target detection network YOLOv5, replace the Conv in the original BackBone with a more lightweight GSConv, reduce model parameters and make feature extraction more effective. At the same time, introduce the attention mechanism in BackBone, derive feature layers of different scales for channel fusion, input the fused feature layers into the BiFPN structure, and add the Detect module in the subsequent downsampling process. At the same time, add a detection head to prevent the loss of infrared targets during the downsampling process, and realize the detection of targets of different sizes. The structure of the lightweight convolution GSConv is as follows Figure 6 As shown, the optimized YOLOv5 network structure is as follows Figure 7 shown.
[0076] The specific steps of step 5 are as follows:
[0077] Step 5.1: Sort each bounding box in descending order according to its confidence. The bounding box with the highest confidence is considered to be the most likely to have correctly detected the object.
[0078] Step 5.2: Select the bounding box with the highest confidence from the sorted list, mark it as selected, and add it to the final list of detection results.
[0079] Step 5.3: For each remaining bounding box, calculate its IOU with the selected bounding box according to the IOU calculation formula. The bounding box IOU calculation formula is:
[0080] ;
[0081] Among them, A and B represent two different rectangular boxes, corresponding to two prediction boxes. It represents the area where the two boxes A and B intersect. It represents the sum of the areas of boxes A and B minus the area of the intersection of the two boxes.
[0082] Step 5.4: If the IOU between a bounding box and the selected box exceeds the set threshold, it is considered that the two boxes represent the same target, so the bounding box with low confidence is removed according to the principle of low confidence.
[0083] Step 5.5: Repeat steps 5.2-5.4, continue to select the highest confidence among the remaining bounding boxes, and repeat the IOU calculation and elimination process until all bounding boxes have been checked.
[0084] Step 5.6: The remaining bounding box set is the final detection result after non-maximum suppression processing. Each target corresponds to an optimal bounding box. The final detection result is shown in the figure below. Figure 8 shown.
[0085] The present invention combines two-frame difference with deep learning target detection, and uses the features of the differential image to make up for the problem of insufficient features of the single-frame target detection network when the infrared image quality is not high. At the same time, the infrared image to be detected is subjected to restricted contrast histogram equalization processing to improve the infrared image signal-to-noise ratio and contrast. The classic single-frame target detection network is optimized to reduce model parameters and improve detection accuracy. The existing detection method solves the problem that the requirements for infrared image quality are high, the amount of calculated data is large, which is not conducive to real-time monitoring, and the probability of false detection is large. The amount of calculated data is reduced, which facilitates better real-time detection. At the same time, the probability of false detection of weak infrared targets is also reduced.
[0086] The technical solution of the present invention is not limited to the above-mentioned specific embodiments. All technical variations made according to the technical solution of the present invention fall within the protection scope of the present invention.
Claims
1. A method for detecting moving targets based on helmet-mounted infrared images, characterized in that: The following steps are involved: Step 1: Obtain helmet-mounted infrared images and perform data annotation; Step 2: Read the infrared image of the helmet to be detected, perform image enhancement processing, and obtain an enhanced infrared pre-processed image; Step 3: Use the inter-frame difference algorithm to process the enhanced infrared pre-processed image to obtain a background suppressed image; Step 4: Concatenate the background suppressed image and the enhanced infrared pre-processed image and input them into the optimized target detection network for training; Step 5: Perform non-maximum suppression on the output of the target detection network to obtain the final detection result graph.
2. The method for detecting moving targets based on helmet-borne infrared images according to claim 1, characterized in that: The specific steps of step 1 are as follows: annotate the obtained sequence of helmet-mounted infrared images, obtain the label file information of the human target category, and export it into a text document in YOLO format.
3. The method for detecting moving targets based on helmet-borne infrared images according to claim 1, characterized in that: Step 2 is as follows: enhance the helmet-mounted infrared image by using the restricted contrast histogram equalization method; first, set the input image sub-block size and contrast threshold, then divide the image into sub-blocks of equal size, and then use the histogram equalization mapping formula to map the grayscale k in each block to grayscale s k , and obtain the histogram equalized image. The mapping formula is: ; Where n is the total number of pixels in the image, n j is the number of pixels corresponding to gray level j, and L is the total number of gray levels in the image; then the contrast of each sub-block is calculated, and if the contrast of the sub-block exceeds the previously set threshold, it is limited to the threshold range; finally, all the sub-blocks are spliced together to obtain the final enhanced image.
4. A method for detecting moving targets based on helmet-borne infrared images according to claim 2 or 3, characterized in that: The specific steps of step 3 are as follows: Step 3.1: Read two consecutive frames of enhanced infrared pre-processed images, and use the two-frame difference algorithm formula to calculate the difference between the current frame and the previous frame to obtain a difference image; the two-frame difference algorithm formula is: ; Where D(x,y) is the difference image between two consecutive frames, I(t) and I(t-1) are the images at time t and time t-1 respectively, T is the threshold selected when the difference image is binarized, D(x,y)=1 represents the foreground, and D(x,y)=0 represents the background; Step 3.2: De-noise the difference image by first corroding and then dilating to obtain a background suppressed image; the corrosion calculation formula is: ; This formula means that A is corroded by structure B, where B is the defined structure element or convolution kernel, A is the original image, and each pixel of the image is scanned by structure element B. If all pixel values in the area covered by the structure element are 1, the value of the pixel is set to 1. Corrosion can make the target area smaller, which actually causes the boundary of the image to shrink, and can be used to eliminate small and meaningless targets. The expansion calculation formula is: ; This formula indicates that image A is expanded using B, where B is a convolution template or convolution kernel, which can be square or circular in shape. Convolution calculation is performed between B and image A, each pixel in the image is scanned, and the template element and the binary image element are ANDed. If both are 0, the target pixel is 0, otherwise it is 1.
5. The method for detecting moving targets based on helmet-borne infrared images according to claim 1, characterized in that: The specific steps of step 4 are as follows: Step 4.1: Concatenate the enhanced infrared pre-processed image and the background suppressed image in the channel dimension, and then fill a channel with all 0s to form 3 channels as input; Step 4.2: Optimize the classic single-stage target detection network YOLOv5, replace the Conv in the original BackBone with the more lightweight GSConv, reduce model parameters and make feature extraction more efficient. At the same time, introduce the attention mechanism in BackBone, derive feature layers of different scales for channel fusion, input the fused feature layers into the BiFPN structure, and add the Detect module in the subsequent downsampling process. At the same time, add a detection head to prevent the loss of infrared targets during the downsampling process, so as to realize the detection of targets of different sizes.
6. The method for detecting moving targets based on helmet-mounted infrared images according to claim 1 is characterized in that: The specific steps of step 5 are as follows: Step 5.1: Sort the bounding boxes in descending order according to their confidence, and the bounding box with the highest confidence is the one that is most likely to detect the target correctly; Step 5.2: Select the bounding box with the highest confidence from the sorted list, mark it as selected, and add it to the final list of detection results; Step 5.3: For each remaining bounding box, calculate its IOU with the selected bounding box according to the IOU calculation formula, and the bounding box IOU calculation formula is: ; Among them, A and B represent two different rectangular boxes, corresponding to two prediction boxes; It represents the area where the two boxes A and B intersect. It means the sum of the areas of the two boxes A and B minus the area of the intersection of the two boxes; Step 5.4: If the IOU between a bounding box and the selected box exceeds the set threshold, it is considered that the two boxes represent the same target, so the bounding box with low confidence is removed according to the principle of low confidence; Step 5.5: Repeat steps 5.2-5.4, continue to select the highest confidence among the remaining bounding boxes, repeat the IOU calculation and elimination process until all bounding boxes have been checked; Step 5.6: The remaining bounding box set is the final detection result after non-maximum suppression processing, and each target corresponds to an optimal bounding box.
