An infrared highway foreign object detection method based on Mamba architecture

Through the infrared highway foreign object detection method based on Mamba architecture, combined with multi-scale feature fusion, knowledge distillation and video frame timing information, the detection problems of existing systems under diversified foreign object types and complex environmental conditions are solved, and high precision is achieved. Real-time and robust foreign object detection effect.

CN119152453BActive Publication Date: 2025-02-18海豚乐智科技(成都)有限责任公司 +1

Patent Information

Application Number
CN202411649348.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-02-18
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

The existing highway foreign object detection system is difficult to balance the diverse foreign object types, complex environmental conditions, and detection speed and accuracy, resulting in low detection accuracy and serious problems of missed detection.

Method used

The infrared highway foreign object detection method based on the Mamba architecture is adopted, and through infrared sensor data acquisition and preprocessing, a student network and teacher network are built, combining multi-scale feature fusion, knowledge distillation and video frame timing information to achieve high-precision foreign object detection.

Benefits of technology

It significantly improves the accuracy and real-time performance of foreign object detection, enhances the robustness of the system in complex environments, reduces false detection and missed detection rates, and can be efficiently deployed on edge devices, reducing computing resources and operating costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152453B_ABST
    Figure CN119152453B_ABST
Patent Text Reader

Abstract

The present invention discloses an infrared highway foreign body detection method based on Mamba architecture, comprising: continuously collecting data of highway scenes under different lighting conditions and different weather conditions through infrared sensors to obtain infrared image data, preprocessing the infrared image data through data augmentation to generate training data, and dividing the training data into training set, test set and verification set in proportion; constructing a detection network based on Mamba architecture, including a student network and a teacher network; training the teacher network through back propagation based on the training set; training the student network based on the results of the teacher network and real data to obtain a target detection network; inputting the image to be identified into the target detection network to obtain the detection result. Rapid and accurate identification of potential dangers is achieved, and the powerful processing capability of the infrared imaging technology and the Mamba framework is combined to ensure high detection accuracy, achieve real-time response to foreign body threats, and significantly improve the efficiency and safety of highway monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of target detection in computer vision, and in particular to an infrared highway foreign body detection method based on a Mamba architecture. Background Art

[0002] Highways are an important part of the transportation network, and ensuring their safety and smooth operation is of key significance. However, foreign objects (such as fallen goods, tire fragments, animals, etc.) may pose a serious threat to driving safety, leading to accidents and even casualties. Therefore, it is crucial to deploy a reliable foreign object detection system. At present, some studies have introduced the Dou-Res residual structure in FasterR-CNN for foreign object detection. This method cannot effectively detect small targets. The improved YOLOv5 algorithm improves the detection problem of small targets by calculating the straight line features in the image and using the CLAHE algorithm to enhance the picture contrast, but there is a problem of low detection accuracy. The foreign object detection system on highways still faces many challenges, which are mainly manifested in the following aspects: 1. Diverse types of foreign objects: The types and sizes of foreign objects vary, from fallen goods, tire fragments to animals, metal objects, etc. Each foreign object has different shapes, materials and colors, which makes it difficult for the detection model to generalize to identify foreign objects of all types and sizes; 2. Complex environmental conditions: The lighting conditions change dramatically from strong light during the day to dim light at night, coupled with weather factors such as rain, snow, fog, etc., as well as reflections from slippery roads. These complex environments will interfere with the detection performance of the sensor and increase the complexity of the task; 3. Detection speed and accuracy: On highways, the system must make accurate detection judgments in a very short time. However, too many false detections will affect the credibility of the system, and missed detections will bring safety hazards. Therefore, it is necessary to strike a balance between real-time performance and detection accuracy. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide an infrared highway foreign body detection method based on the Mamba architecture.

[0004] The objective of the present invention is achieved through the following technical solutions:

[0005] The present invention provides an infrared highway foreign body detection method based on Mamba architecture, comprising the following steps:

[0006] S1. Continuously collect data of highway scenes under different lighting conditions and weather conditions through infrared sensors to obtain infrared image data, pre-process the infrared image data through data augmentation to generate training data, and divide the training data into a training set, a test set, and a validation set in a ratio of 7:2:1;

[0007] S2. Construct a foreign body detection network based on the Mamba architecture, wherein the foreign body detection network includes a student network and a teacher network;

[0008] S3, training the teacher network based on the training set by back propagation algorithm;

[0009] S4, training the student network based on the results of the teacher network and real data to obtain a target detection network;

[0010] S5. Input the image to be identified into the target detection network to obtain the detection result.

[0011] Furthermore, the step S2 specifically includes the following sub-steps:

[0012] S21, the input layer standardizes and normalizes the data of the input image, adjusts the data of the input image for network processing, and obtains a second image;

[0013] S22, performing multi-scale feature extraction on the second image through a multi-level convolution operation, after the second image is processed by several layers, the resolution of the second image is reduced and the number of channels is increased, so as to obtain a third image of different scales;

[0014] S23, integrating the third images of different scales through a feature fusion module to obtain a fourth image; specifically, the feature fusion module restores the resolution of the third image through an upsampling operation, and combines the features of the third images of different scales together to enhance the model's processing capability for objects of different sizes;

[0015] S24. Perform target detection on the fourth image through the detection head, and generate the final detection result, including the category and position of the target through convolution and full connection; stack the residual module to four layers as a teacher network, and the single-layer shallow network as a student network; the detection head also includes target consistency detection, combined with the timing information of the video frame, to improve the accuracy and robustness of foreign object detection; for targets that only appear briefly in a single frame, the system will perform a secondary confirmation to determine whether it is environmental noise or light reflection.

[0016] Preferably, the step S22 specifically includes: firstly extracting features of the second image through a Mamba Block module, then inputting the second image into a ResNet Block module, and performing deep extraction of features of the second image through the ResNet Block module;

[0017] The Mamba Block module operation includes: firstly extracting the local features of the second image through a conventional convolution operation, then offsetting the spatial information of the second image through an SS2D operation, and then reducing the amount of calculation through a depthwise separable convolution, reducing the parameters while maintaining the efficiency of the model. The Mamba Block also includes BatchNormalization and ReLU activation functions to ensure the stability of the features in each step;

[0018] The ResNet Block module extracts high-level features of the second image through two layers of 3×3 convolution; the two layers of 3×3 convolution also include normalization and ReLU activation functions to ensure the stability of high-level features, and ResNetBlock also includes residual connections to alleviate gradient disappearance.

[0019] Preferably, the step S3 specifically includes the following steps:

[0020] S31, firstly, the input image is standardized and data enhanced for the network to learn diverse scene information, wherein the data enhancement includes rotation, flipping and scaling, which is used to increase the diversity of training data and enable the teacher network to have stronger generalization ability;

[0021] S32, then the input image is forward propagated through the multi-layer Mamba Block and ResNet Block of the teacher network; at each layer, the teacher network extracts local features through convolution operations, and then downsamples layer by layer to extract more global features; the local features and global features are integrated through a multi-scale feature fusion module, so that the network can process targets of different sizes at the same time;

[0022] S33. The high-level features finally extracted enter the detection head, which performs target classification and bounding box regression to generate the category confidence and position of each target.

[0023] Preferably, step S33 further comprises: the teacher network generates soft labels while outputting the results; the soft labels include the predicted value of each category and the probability distribution information between the categories, which are used to provide a more fine-grained learning signal for the student network; the teacher network evaluates the error between its predicted results and the true label by calculating the first loss function; the first loss function includes classification loss and regression loss: ,in is the classification loss, is the weight of the classification loss, is the regression loss, is the weight of the regression loss; the weight of the teacher network is then updated through back propagation; the gradient of the first loss function is passed backward layer by layer from the detection head to the input layer; the network parameters are updated through the selected optimizer, which adjusts the weight of the network according to the gradient of the first loss function to minimize the error;

[0024] During the training process, the validation set data is also used to evaluate the performance of the teacher network. Through the forward propagation of the validation set, the classification accuracy and the average precision mean are calculated to judge the accuracy and robustness of the model. If the performance of the validation set meets the preset requirements, the network training effect is good and training continues until convergence.

[0025] Preferably, the step S4 specifically includes:

[0026] The input image and the corresponding true label are input into the student network for training; the student network obtains the soft label from the teacher network; the input image is forward propagated through the student network, and the feature extraction is performed through the convolution layer, Mamba Block and ResNet Block in sequence; during the training process of the student network, the corresponding second loss function is calculated, which includes the weighted hard label loss and soft label loss: ,in is the hard label loss, is the weight coefficient of hard label loss, is the soft label loss, is the weight coefficient of the soft label loss; the gradient is then calculated through the back-propagation algorithm to update the weight of the student network; if the performance of the student network on the validation set reaches the preset accuracy, the training process ends and the weight of the model is saved. The student network is also lightweight in design, and the student network is used to maintain a balance between efficient computing and high detection accuracy through knowledge distillation.

[0027] Preferably, the step S5 specifically includes: the network predicts the category of each target and generates a category confidence for each detected target, and the network selects the category with the highest confidence as the final prediction result; at the same time, the network also outputs the bounding box position of each target, and avoids repeated detection of the same target by multiple bounding boxes through non-maximum suppression, and finally outputs a set of detection results, each detection result includes the target category, confidence score and bounding box position.

[0028] The beneficial effects of the present invention are:

[0029] 1) The technical solution of the present invention not only overcomes the limitations of existing foreign object detection systems, but also shows significant advantages in many aspects by adopting the new Mamba network architecture, multi-scale feature fusion, knowledge distillation, infrared sensors and video frame timing information. First, the Mamba network architecture combined with multi-scale feature fusion technology can achieve more accurate feature extraction in foreign object detection of different sizes and types, especially when facing small debris and large obstacles on highways, the detection accuracy of the system is significantly improved. Secondly, by introducing knowledge distillation technology, the knowledge in the complex and high-performance teacher model is refined and passed to the lighter student model, which greatly reduces the computational complexity and memory requirements of the model while maintaining detection accuracy. This lightweight design enables the system to be efficiently deployed on edge devices, significantly improving real-time performance and response speed.

[0030] 2) The present invention combines the technology of infrared sensors and video frame timing information, and the system can maintain a stable detection effect in complex environments such as night, low light, strong light reflection, rain and fog. The video frame timing information further reduces the false detection and missed detection problems caused by dynamic background and motion blur by analyzing the continuity between frames, ensuring that the system still has high robustness in complex dynamic scenes. Through lightweight knowledge distillation design, the system no longer relies on high computing resources, and can achieve real-time and efficient foreign object detection on edge devices, and greatly reduce the bandwidth requirements and operating costs of data transmission. Overall, the solution of the present invention is superior to existing technologies in terms of detection accuracy, real-time, environmental adaptability, false detection and missed detection control, and edge device deployment, greatly improving the practicality and commercial value of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A schematic diagram of a flow chart of an infrared highway foreign body detection method based on the Mamba architecture according to an embodiment of the present invention;

[0032] Figure 2 A schematic diagram of a student network structure of an infrared highway foreign body detection method based on Mamba architecture according to an embodiment of the present invention;

[0033] Figure 3 A schematic diagram of the MambaBlock structure of an infrared highway foreign body detection method based on the Mamba architecture according to an embodiment of the present invention;

[0034] Figure 4 A schematic diagram of the ResNet Block structure of an infrared highway foreign body detection method based on the Mamba architecture according to an embodiment of the present invention;

[0035] Figure 5A schematic diagram of a knowledge distillation process of an infrared highway foreign body detection method based on the Mamba architecture according to an embodiment of the present invention;

[0036] Figure 6 This is a schematic diagram of the teacher network structure of an infrared highway foreign object detection method based on the Mamba architecture according to an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0038] The present invention discloses an infrared highway foreign object detection method based on the Mamba architecture, which adopts the new Mamba network architecture, combines infrared sensors, multi-scale feature fusion technology, and introduces the timing information of video frames. This innovative architectural design not only improves the accuracy and real-time performance of foreign object detection, but also enhances the robustness of the system in complex environments (such as lighting changes, bad weather, etc.). Compared with the traditional single-frame detection method, the present invention significantly reduces the false detection and missed detection rates by combining the timing information and multimodal data of video frames. At the same time, it adopts a lightweight design, and through knowledge distillation, the knowledge in the complex and high-precision teacher model is extracted and passed to a smaller student model, thereby greatly reducing the computational complexity and memory requirements of the model. The system can be deployed on edge devices, reducing operating and maintenance costs. The introduction of this core technology enables the entire solution to show higher detection efficiency and stability in practical applications, and is particularly suitable for scenarios with high real-time and high-precision requirements such as highway foreign object detection. The method includes the following steps, and the step flow diagram is shown as follows. Figure 1 shown.

[0039] S1. Collect data from highway scenes through infrared sensors. Since highway foreign object detection tasks usually face various complex environments (such as lighting changes, bad weather, etc.), it is necessary to continuously collect a large amount of image data from multiple scenes to ensure that the model can be generalized to a variety of practical application scenarios. The collected data includes infrared images under different lighting conditions (such as daytime, night, shadows, etc.), as well as infrared images under different weather conditions such as rainy days and foggy days. At the same time, in order to solve the problem of sample scarcity, this step also includes data augmentation. Data augmentation refers to generating more training data by performing various transformations on existing data, such as rotation, scaling, cropping, flipping, etc.

[0040] Through data collection and data enhancement, we can obtain a rich and diverse training data set to ensure that the model has strong robustness and generalization ability in real environments, and adapt to various foreign body types, sizes, lighting conditions and environmental changes. Finally, we divide all the data into training set, test set and validation set in a ratio of 7:2:1. 70% of the data is used to train the model to help the model learn foreign body detection in different scenarios; 20% of the data is used as a validation set to evaluate the model performance during training and adjust hyperparameters; 10% of the data is used as a test set to ensure the final generalization ability of the model and its performance in real scenarios. This proportional allocation ensures that the model has enough data for evaluation at each stage of training, validation and testing.

[0041] S2. Construct a foreign body detection network based on the Mamba architecture, wherein the detection network includes a student network and a teacher network, specifically including:

[0042] S21. The entire framework starts with the input layer, processes the data of the input image and performs pre-processing operations such as standardization and normalization to obtain the second image. At this stage, the input image will be adjusted to a format suitable for network processing. S22. Next, the second image will enter the feature extraction stage, using a multi-scale feature extraction method. After the second image is processed by several layers, a third image of different scales is obtained. The resolution of the second image gradually decreases, while the number of channels gradually increases. This is achieved by downsampling layer by layer. Each downsampling reduces the spatial resolution, but the extracted features are more global. As the depth of the network increases, the model can capture target features of different scales, including small targets such as debris and large targets such as obstacles. This multi-scale feature extraction is achieved through multi-level convolution operations to ensure that the model can process targets of different sizes at the same time.

[0043] The core module of feature extraction is Mamba Block. The structural diagram of Mamba Block is as follows: Figure 3As shown. In Mamba Block, the local features of the second image are first extracted through conventional convolution operations, and then the spatial information of the second image is offset through SS2D operations to enhance spatial perception. Then, depthwise separable convolution is used to reduce the amount of calculation, while reducing parameters and maintaining the efficiency of the model. In order to ensure the stability of the features in each step, Batch Normalization and ReLU activation functions are also introduced in Mamba Block. Through these operations, Mamba Block can extract feature information with different scales and spatial relationships. After Mamba Block, the second image will be passed to ResNet Block for further deep feature extraction. The specific structure of ResNet Block is shown as follows Figure 4 As shown. ResNet Block extracts high-level semantic features of the second image through two layers of 3×3 convolution. Each layer of convolution operation is followed by batch normalization and ReLU activation function to ensure the stability of the features of the second image. Unlike traditional convolution, ResNet Block alleviates the gradient vanishing problem through residual connections to ensure that the deep network can be stably trained and transmit information. These residual connections enable input features to jump to the output, ensuring that the core information of the input is not lost in the deep convolution. S23. After being processed by multiple layers of Mamba Block and ResNet Block, the third images of different scales are integrated through the feature fusion module. This module gradually restores the low-resolution third image to a higher resolution through upsampling operations, and combines the features of these multi-scale third images to obtain the fourth image. The purpose of this fusion is to enhance the model's processing capabilities for objects of different sizes, so that the final fourth image not only contains fine-grained features, but also captures global scene information. S24. The fused fourth image enters the detection head for object detection.

[0044] The detection head is the output module of the entire network, responsible for object classification and bounding box prediction based on the fused features. Through convolution and full connection operations, the detection head generates the final detection results, including the category and location of the object. In the detection head, we introduced a target consistency detection mechanism to combine the temporal information of the video frame to improve the accuracy and robustness of foreign object detection. Specifically, the detection head compares the detection results of the current frame with those of the previous frames to ensure that the detected objects are consistent in time series. If a new object is detected in the current frame, but the corresponding features are not found in the previous frames, the system will delay the confirmation of the object to avoid false detection. At the same time, for objects that only appear briefly in a single frame, the system will perform a second confirmation to determine whether it is an interference factor such as environmental noise or light reflection. Through this fusion of temporal information and target consistency detection, the system can more effectively detect foreign objects that really exist in continuous frames, significantly reducing the occurrence of false alarms and missed detections, especially in dynamic environments with high-speed driving. Finally, the residual module is stacked to four layers as a teacher network, and a single-layer shallow network is used as a student network.

[0045] S3. Design the teacher network training module. The teacher network structure diagram is as follows: Figure 6 As shown, S31. During the training process of the teacher network, the input image is first standardized and data enhanced to ensure that the network can learn diverse scene information; data enhancement operations include rotation, flipping, scaling, etc., which increase the diversity of training data and enable the teacher network to have stronger generalization capabilities. S32. The image is then forward propagated through the multi-layer Mamba Block and ResNet Block of the teacher network. At each layer, the teacher network extracts local features through convolution operations, and then downsamples layer by layer to extract more global features; these features are integrated through a multi-scale feature fusion module to ensure that the network can simultaneously process targets of different sizes. S33. The high-level features finally extracted enter the detection head, which is responsible for target classification (category prediction) and bounding box regression (position prediction), generating the category confidence and position of each target.

[0046] At the same time as the teacher network outputs the results, it also generates soft labels. These soft labels contain not only the predicted values ​​for each category, but also the probability distribution information between the categories, providing a more fine-grained learning signal for the student network. The soft labels can capture the uncertainty of the teacher network's predictions for each category through the probability output of the network, which helps the student network better learn the relationship between different categories, rather than relying solely on the explicit category information of the hard labels. Next, the teacher network evaluates the error between its predictions and the true labels by calculating the first loss function. The first loss function includes classification loss (using cross entropy loss to calculate the difference between the category probability predicted by the network and the true label) and regression loss (using L1). These two losses are weighted to form the first loss function: ,in is the classification loss, The weight of the classification loss, is the regression loss, is the weight of the regression loss; after each loss calculation, the weight of the teacher network is updated through the back-propagation algorithm. The gradient of the first loss function is passed backward layer by layer from the detection head layer to the input layer. The network parameters are updated by the selected optimizer, which adjusts the weight of the network according to the gradient of the first loss function to minimize the error. During the training process, the validation set is also used regularly to evaluate the network. The validation set data will not be involved in the weight update, but is used to evaluate the performance of the teacher network. Through the forward propagation of the validation set, the classification accuracy, mean average precision (mAP) and other indicators are calculated to judge the accuracy and robustness of the model. If the performance of the validation set meets the expected requirements, it can be considered that the network training effect is good, and the training continues until convergence.

[0047] Once the teacher network performs well on the validation set, the model weights are saved for subsequent use. The training goal of the teacher network is not only to be directly applied to the detection task, but more importantly to provide high-quality soft labels for the student network. The trained teacher network is used to infer new data sets and generate soft labels. These soft labels contain information about the probability distribution of the target category, which is much richer than the single category information provided by the hard label.

[0048] S4. Design the student network training module. The structural diagram of the student network is as follows: Figure 2As shown in the figure, the data input is consistent with the teacher network, and the image and the corresponding true label are input to the student network for training. In addition, the student network also obtains soft labels from the teacher network. These soft labels are probability distributions generated by inference of the teacher network, containing fine-grained understanding of each category. The input image is usually standardized, normalized and data augmented to enhance the student network's learning ability for diverse scenarios. Next, the image passes through the forward propagation of the student network, and passes through the convolution layer, Mamba Block and ResNet Block in sequence for feature extraction. During the training of the student network, the second loss function is calculated by hard labels and soft labels. Hard labels are used for standard classification and regression tasks, and the error of category prediction is calculated by cross entropy loss, and the accuracy of bounding box regression is evaluated by L2 loss. On the other hand, soft labels are generated by the output of the teacher network, and the student network learns the high-level feature expression of the teacher network by minimizing the difference with the soft labels. The soft label loss is usually calculated by KL divergence, which measures the difference between the probability distribution of the output of the teacher network and the student network. Finally, the second loss function of the student network is a weighted combination of hard label loss and soft label loss, which can be expressed as: ,in is the hard label loss, is the weight coefficient of hard label loss, is the soft label loss, is the weight coefficient of the soft label loss. By adjusting the weight coefficients of the two losses, the learning balance of the student network for hard labels and soft labels can be controlled. Once the second loss function is calculated, the back propagation algorithm is used to calculate the gradient and update the weight of the student network. Since the student network is lightweight, the amount of calculation during the update process is low, which is suitable for scenarios with limited resources such as edge computing. The optimizer adjusts the network weights based on the calculated gradients so that the network gradually approaches the optimal state.

[0049] When the student network achieves the expected accuracy on the validation set, the training process can be terminated and the model weights can be saved. Since the student network is lightweight, it can run efficiently in actual deployment and is particularly suitable for use in scenarios with limited computing resources, such as edge devices or embedded systems. The knowledge distillation process ensures that the student network can maintain a balance between efficient computing and high detection accuracy, giving it better performance and robustness in practical applications. The flow chart of knowledge distillation is shown below. Figure 5 shown.

[0050] S5, object detection module, in the final step of the student network, the network will output the detection results of the target based on the learned knowledge. First, the network predicts the category of each target and generates a category confidence for each detected target, indicating the probability that the target belongs to a certain category. The network selects the category with the highest confidence as the final prediction result. At the same time, the network also outputs the bounding box position of each target.

[0051] In order to avoid multiple bounding boxes repeatedly detecting the same object, the network applies non-maximum suppression (NMS). This technique calculates the overlap of the detection boxes, retains the boxes with the highest confidence, and removes those detection results with high overlap and low confidence. After this step, the network finally outputs a set of detection results, each of which contains the target category, confidence score, and bounding box location.

[0052] In summary, the present invention proposes an infrared highway foreign body detection method based on the Mamba architecture, which improves road safety through a systematic approach and realizes rapid and accurate identification of potential dangers. The method combines advanced infrared imaging technology with the powerful processing power of the Mamba framework, not only ensuring high detection accuracy, but also achieving real-time response to foreign body threats. This innovative method is expected to significantly improve the efficiency and safety of highway monitoring. Based on the new Mamba architecture, the present invention combines infrared sensors, multi-scale fusion technology and video frame timing information, and through lightweight design, uses knowledge distillation technology to propose a foreign body detection method that can be deployed on edge devices. It not only has the advantages of strong real-time performance and high detection accuracy, but also can operate stably in complex environments, solving the detection problems caused by diverse foreign body types and size differences. Its lightweight architecture further reduces the demand for computing resources, enabling the system to run efficiently on resource-limited edge devices, reducing deployment and maintenance costs.

[0053] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not deviate from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.

Claims

1. An infrared highway foreign body detection method based on Mamba architecture, characterized in that: The following steps are involved: S1. Continuously collect data of highway scenes under different lighting conditions and weather conditions through infrared sensors to obtain infrared image data, pre-process the infrared image data through data augmentation to generate training data, and divide the training data into a training set, a test set, and a validation set in a ratio of 7:2:1; S2. Construct a foreign body detection network based on the Mamba architecture, wherein the foreign body detection network includes a student network and a teacher network; S3, training the teacher network based on the training set by back propagation algorithm; S4, training the student network based on the results of the teacher network and real data to obtain a target detection network; S5, input the image to be identified into the target detection network to obtain the detection result; The step S2 specifically includes the following sub-steps: S21, the input layer standardizes and normalizes the data of the input image, adjusts the data of the input image for network processing, and obtains a second image; S22, performing multi-scale feature extraction on the second image through a multi-level convolution operation, after the second image is processed by several layers, the resolution of the second image is reduced and the number of channels is increased, so as to obtain a third image of different scales; S23, integrating the third images of different scales through a feature fusion module to obtain a fourth image; specifically, the feature fusion module restores the resolution of the third image through an upsampling operation, and combines the features of the third images of different scales together to enhance the model's processing capability for objects of different sizes; S24, performing target detection on the fourth image through the detection head, and generating the final detection result including the category and position of the target through convolution and full connection; stacking the residual module to four layers as a teacher network, and the single-layer shallow network as a student network; the detection head also includes target consistency detection, which combines the timing information of the video frame to improve the accuracy and robustness of foreign body detection; for targets that only appear briefly in a single frame, the system will perform a secondary confirmation to determine whether it is environmental noise or light reflection; The step S22 specifically includes: firstly extracting features of the second image through the Mamba Block module, then inputting the second image into the ResNet Block module, and performing deep extraction of features of the second image through the ResNet Block module; The Mamba Block module operation includes: firstly extracting the local features of the second image through a conventional convolution operation, then offsetting the spatial information of the second image through an SS2D operation, and then reducing the amount of calculation through a depthwise separable convolution, reducing the parameters while maintaining the efficiency of the model. The Mamba Block also includes BatchNormalization and ReLU activation functions to ensure the stability of the features in each step; The ResNet Block module extracts high-level features of the second image through two layers of 3×3 convolution; the two layers of 3×3 convolution also include normalization and ReLU activation functions to ensure the stability of high-level features, and the ResNet Block also includes residual connections to alleviate gradient disappearance; The step S3 specifically comprises the following steps: S31, firstly, the input image is standardized and data enhanced for the network to learn diverse scene information, wherein the data enhancement includes rotation, flipping and scaling, which is used to increase the diversity of training data and enable the teacher network to have stronger generalization ability; S32, then the input image is forward propagated through the multi-layer Mamba Block and ResNet Block of the teacher network; at each layer, the teacher network extracts local features through convolution operations, and then downsamples layer by layer to extract more global features; the local features and global features are integrated through a multi-scale feature fusion module, so that the network can process targets of different sizes at the same time; S33, the high-level features finally extracted enter the detection head, which performs target classification and bounding box regression to generate the category confidence and position of each target; The step S33 further includes: generating soft labels while the teacher network outputs the results; the soft labels include the predicted value of each category and the probability distribution information between the categories, which is used to provide a more fine-grained learning signal for the student network; The teacher network evaluates the error between its prediction results and the true label by calculating the first loss function; the first loss function includes classification loss and regression loss: ,in is the classification loss, where is the classification loss, is the weight of the classification loss, is the regression loss, is the weight of the regression loss; The weights of the teacher network are then updated through back propagation; the gradient of the first loss function is passed backwards layer by layer starting from the detection head until the input layer; the network parameters are updated through the selected optimizer, which adjusts the weights of the network according to the gradient of the first loss function to minimize the error; During the training process, the validation set data is also used to evaluate the performance of the teacher network. Through the forward propagation of the validation set, the classification accuracy and average precision mean are calculated to judge the accuracy and robustness of the model. If the performance of the validation set meets the preset requirements, the network training effect is good and training continues until convergence. The step S4 specifically includes: The input image and the corresponding true label are input into the student network for training; the student network obtains the soft label from the teacher network; the input image is forward propagated through the student network, and the feature extraction is performed through the convolution layer, Mamba Block and ResNet Block in sequence; during the training process of the student network, the corresponding second loss function is calculated, which includes the weighted hard label loss and soft label loss: ,in is the hard label loss, is the weight coefficient of hard label loss, is the soft label loss, is the weight coefficient of the soft label loss; the gradient is then calculated through the back-propagation algorithm to update the weight of the student network; if the performance of the student network on the validation set reaches the preset accuracy, the training process ends and the weight of the model is saved. The student network is also lightweight in design, and the student network is used to maintain a balance between efficient computing and high detection accuracy through knowledge distillation.

2. According to the Mamba architecture-based infrared highway foreign body detection method of claim 1, it is characterized in that: The step S5 specifically includes: the network predicts the category of each target and generates a category confidence for each detected target. The network selects the category with the highest confidence as the final prediction result; at the same time, the network also outputs the bounding box position of each target, and avoids repeated detection of the same target by multiple bounding boxes through non-maximum suppression, and finally outputs a set of detection results, each of which contains the target category, confidence score and bounding box position.

Citation Information

Patent Citations

  • Intelligent detection and maintenance system for foreign matters on highway pavement

    CN116758470A

Cited By

  • Expressway foreign matter small target detection method, system and device and medium

    CN121191077A