A method for detecting and identifying road oil film based on an improved YOLOV8

By improving the YOLOV8 model and utilizing image enhancement and attention mechanisms, the speed and accuracy issues of road surface oil film detection have been resolved, enabling real-time and accurate identification in different environments, which is applicable to intelligent transportation systems and autonomous driving technologies.

CN118366005BActive Publication Date: 2026-05-26CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNIV OF PETROLEUM (EAST CHINA)
Filing Date
2024-04-30
Publication Date
2026-05-26

Smart Images

  • Figure CN118366005B_ABST
    Figure CN118366005B_ABST
Patent Text Reader

Abstract

This invention discloses a method for detecting and recognizing oil film on road surfaces based on the YOLOv8 model. By utilizing deep learning technology, this method not only improves the detection speed and accuracy but also adapts to different environments and lighting conditions, effectively identifying oil film areas on the road surface. Furthermore, the implementation of this method does not rely on high-cost hardware and is easy to deploy in existing road monitoring systems, providing an effective technical means for intelligent traffic safety management. Compared to the original YOLOv8 algorithm, this invention improves the detection of oil film on road surfaces, increasing the average recognition accuracy of the YOLOv8 algorithm for oil film on road surfaces. This invention provides a new approach in the fields of intelligent transportation systems and autonomous driving technology, and is significant for improving the visual perception capabilities of autonomous vehicles and for environmental protection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of oil film detection technology, and in particular to a method for detecting and identifying road oil film based on an improved YOLOV8. Background Technology

[0002] In the fields of intelligent transportation systems and autonomous driving technology, road condition monitoring is a crucial aspect of ensuring road safety. Among these, the detection and identification of oil film on the road surface is of great significance for preventing traffic accidents and improving driving safety. Oil film on the road surface is a common road safety hazard, especially in rainy or slippery conditions. It significantly reduces the coefficient of friction between the tires and the road surface, increasing the risk of skidding during driving.

[0003] Traditional methods for detecting oil film on road surfaces mainly rely on visual observation and simple sensor-based technologies. These methods typically lack accuracy, cannot respond in real time, and are greatly affected by environmental factors. For example, methods that analyze road images captured by cameras are limited by lighting conditions and viewing angles, making it difficult to accurately identify oil film. While chemical sensor-based methods can detect specific chemical substances, they are costly to deploy and difficult to widely apply to real-time road monitoring.

[0004] While current technologies can identify and monitor oil film on road surfaces to some extent, these methods typically suffer from slow detection speed, low accuracy, and high dependence on environmental conditions. Therefore, developing a technology capable of detecting oil film on road surfaces in real time, efficiently, and accurately has become an urgent need. Summary of the Invention

[0005] This invention mainly addresses the technical problems of existing methods for identifying and monitoring road surface oil film, such as slow detection speed, low accuracy, and high dependence on environmental conditions. It proposes a road oil film detection and identification method based on an improved YOLOV8.

[0006] This invention provides a method for detecting and identifying road oil film based on an improved YOLOV8, comprising the following steps:

[0007] S1) Obtain the dataset with road surface oil film, normalize all oil film images in the dataset, and scale all images in the dataset to a specified size;

[0008] S2) The improved YOLOv8 model is used to detect and identify road surface oil film in all images in the dataset processed in step S1);

[0009] The improved YOLOv8 model involves using image enhancement to improve the input image of the original YOLOv8 algorithm;

[0010] In the original YOLOv8 algorithm, the RepNCSPELAN4 module replaces the C2f module in the backbone network.

[0011] In the original YOLOv8 algorithm, a SEAttention attention mechanism is added after the C2f module in the head network of the backbone network.

[0012] The loss function in the original YOLOv8 algorithm is replaced with the SIoU loss function.

[0013] Furthermore, the process of improving the input image of the original YOLOv8 algorithm by image enhancement is as follows: Gaussian filtering, dark channel prior method and contrast enhancement are used to denoise the road surface oil film image and enhance the contrast.

[0014] Furthermore, the RepNCSPELAN4 module includes the following structure:

[0015] RepNet, a repeating network structure, enhances feature extraction capabilities and improves the model's accuracy in recognizing small objects and complex backgrounds by using repeated sub-network structures. The specific process is as follows:

[0016] Let X be the input feature, and f(·) be a subnetwork in a repetitive network structure, repeated N times, which can be represented as:

[0017] f (N) (X)=f(f(…f(X)…))

[0018] Compressed Sensing (CS): This method utilizes compressed sensing theory to reduce redundant information, thereby improving processing speed and efficiency while maintaining the integrity of key features. The specific process is as follows:

[0019] Let S be the original signal and Φ be the measurement matrix. Compressed sensing can be represented as:

[0020] Y = ΦS

[0021] Where Y is the compressed signal, and the goal of reconstructing the signal S is to minimize the reconstruction error;

[0022] Pyramid Feature Extraction (PFE): Enhances the model's ability to detect objects of different sizes through multi-scale feature fusion.

[0023] Let X i Given input features at different scales, and g(·) as the feature extraction function, the pyramid feature can be expressed as:

[0024] P i =g(X) i )

[0025] The final feature is a fusion of multi-scale features;

[0026] Lightweight Attention Mechanism (LA): Integrates a lightweight attention module to focus on important features in the image with less computational cost, improving detection accuracy; the specific process is as follows:

[0027] Let N be the input features, and a(·) be the attention weight function, then the weighted feature representation is:

[0028] A=a(N)⊙N

[0029] Where ⊙ represents element-wise multiplication;

[0030] Enhanced Nonlinear Activation (ENA): Employing an efficient nonlinear activation function optimizes the network's expressive power, accelerates convergence, and improves model performance; the specific process is as follows:

[0031] Let M be the input feature and h(·) be the nonlinear activation function, then the activated feature is:

[0032] Z = h(M).

[0033] Furthermore, the SEAttention mechanism comprises two phases:

[0034] Squeeze stage:

[0035] Global average pooling compresses the feature map of each channel into a single value. An input feature map is H×W×C, where H is the height, W is the width, and C is the number of channels. The Squeeze stage then produces a vector of length C, representing the global information for each channel. The specific process is as follows:

[0036] Suppose F represents the input feature map, F sq Let represent the output of the Squeeze phase. The Squeeze phase can then be represented as:

[0037] F sq =GlobalAvgPool(F);

[0038] Excitation stage:

[0039] A small fully connected network is used to learn the weights for each channel to determine the importance of each channel. These weights are then applied to the original feature map to enhance useful information and suppress irrelevant information. The specific process is as follows:

[0040] Assume F ex If the output of the Excitation phase is given, then the Excitation phase can be represented as:

[0041] F ex=σ(FC2(δ(FC1(F) sq ))))

[0042] FC1 and FC2 are fully connected layers, δ is the activation function, and σ is the sigmoid activation function, which is used to ensure that the output range is between [0,1].

[0043] The output F of the entire SEAttention mechanism att This is the product of the outputs of the Squeeze and Excitation stages:

[0044] F att =F ex ·F

[0045] By multiplying the output of the SEAttention attention mechanism with the original feature map, useful information in the feature map can be enhanced and irrelevant information suppressed, thereby improving model performance.

[0046] The beneficial effects of this invention are as follows: This invention provides a method for detecting and recognizing oil film on road surfaces based on the YOLOv8 model. By utilizing deep learning technology, this method not only improves the detection speed and accuracy but also adapts to different environments and lighting conditions, effectively identifying oil film areas on the road surface. Furthermore, the implementation of this method does not rely on high-cost hardware equipment and is easy to deploy in existing road monitoring systems, providing an effective technical means for intelligent traffic safety management. Compared to the original YOLOv8 algorithm, this invention improves the detection of oil film on road surfaces, increasing the average recognition accuracy of the YOLOv8 algorithm for oil film on road surfaces. This invention provides a new approach in the fields of intelligent transportation systems and autonomous driving technology, and is significant for improving the visual perception capabilities of autonomous vehicles and for environmental protection. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the existing YOLOv8 network model structure;

[0048] Figure 2 This is a C2f structure diagram;

[0049] Figure 3 This is a diagram of the RepNCSPELAN4 architecture;

[0050] Figure 4 This is a schematic diagram of the improved YOLOv8 network model structure;

[0051] Figure 5 This is a comparison of image processing using the existing YOLOv8 and the improved YOLOv8 of this invention;

[0052] Figure 6This is a diagram showing the road surface oil film identification results of the road oil film detection and identification method based on the improved YOLOV8 of this invention. Detailed Implementation

[0053] To make the technical problems solved by this invention, the technical solutions adopted, and the technical effects achieved clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings, not all of them.

[0054] like Figures 1 to 4 As shown in the figure, an embodiment of the present invention provides a method for detecting and identifying road oil film based on an improved YOLOv8, comprising the following steps:

[0055] S1) Obtain the dataset containing road surface oil film, normalize all oil film images in the dataset, and scale all images in the dataset to a specified size.

[0056] S2) The improved YOLOv8 model is used to detect and identify the road surface oil film in all images in the dataset after step S1).

[0057] The improved YOLOv8 model employs Gaussian filtering, dark channel prior, and contrast enhancement to denoise and enhance the contrast of the road surface oil film image. In the original YOLOv8 algorithm, the RepNCSPELAN4 module replaces the C2f module in the backbone network. A SEAttention mechanism is added after the C2f module in the head network of the original YOLOv8 algorithm. The loss function in the original YOLOv8 algorithm is replaced with the SIoU loss function.

[0058] The RepNCSPELAN4 module includes the following structure:

[0059] Repetitive network structure (RepNet): Enhances feature extraction capabilities by using repeated sub-network structures, improving the model's accuracy in recognizing small objects and complex backgrounds.

[0060] Let X be the input feature, and f(·) be a subnetwork in a repetitive network structure, repeated N times, which can be represented as:

[0061] f (N) (X)=f(f(…f(X)…))

[0062] Compressed sensing (CS): Utilizes compressed sensing theory to reduce redundant information, thereby improving processing speed and efficiency while maintaining the integrity of key features.

[0063] Let S be the original signal and Φ be the measurement matrix. Compressed sensing can be represented as:

[0064] Y = ΦS

[0065] Here, Y is the compressed signal, and the goal of reconstructing the signal S is to minimize the reconstruction error, which is usually solved through an optimization problem.

[0066] Pyramid Feature Extraction (PFE): Enhances the model's ability to detect objects of different sizes through multi-scale feature fusion.

[0067] Let X i Given input features at different scales, and g(·) as the feature extraction function, the pyramid feature can be expressed as:

[0068] P i =g(X) i )

[0069] The final feature is a fusion of multi-scale features.

[0070] Lightweight Attention Mechanism (LA): Integrates a lightweight attention module to focus on important features in an image with less computational cost, thereby improving detection accuracy.

[0071] Let N be the input features, and a(·) be the attention weight function, then the weighted feature representation is:

[0072] A=a(N)⊙N

[0073] Here, ⊙ represents element-wise multiplication.

[0074] Enhanced Nonlinear Activation (ENA): Employs efficient nonlinear activation functions to optimize the network's expressive power, accelerate convergence, and improve model performance.

[0075] Let M be the input feature and h(·) be the nonlinear activation function, then the activated feature is:

[0076] Z = h(M)

[0077] The SEAttention mechanism consists of two phases:

[0078] Squeeze stage:

[0079] In the Squeeze stage, the feature map of each channel is compressed into a single value through global average pooling. If we have an input feature map of length H×W×C, where H is the height, W is the width, and C is the number of channels, the Squeeze stage will produce a vector of length C, representing the global information of each channel.

[0080] Suppose F represents the input feature map, F sq Let represent the output of the Squeeze phase. The Squeeze phase can then be represented as:

[0081] F sq =GlobalAvgPool(F)

[0082] Excitation stage:

[0083] In the excitation phase, we utilize a small fully connected network to learn the weights of each channel in order to determine the importance of each channel.

[0084] These weights are then applied to the original feature map to enhance useful information and suppress irrelevant information.

[0085] Assume F ex If the output of the Excitation phase is given, then the Excitation phase can be represented as:

[0086] F ex =σ(FC2(δ(FC1(F) sq ))))

[0087] FC1 and FC2 are fully connected layers, δ is the activation function, and σ is the Sigmoid activation function, which is used to ensure that the output range is between [0,1].

[0088] The output F of the entire SEAttention mechanism att This is the product of the outputs of the Squeeze and Excitation stages:

[0089] F att =F ex ·F

[0090] In this way, by multiplying the output of the SEAttention attention mechanism with the original feature map, useful information in the feature map can be enhanced and irrelevant information can be suppressed, thereby improving model performance.

[0091] The effect of this embodiment is as follows: Figure 5 and Figure 6 As shown.

[0092]

[0093] Table 1. mAP50 values ​​of the original YOLOv8 and the improved YOLOv8

[0094] Table 1 shows that in the field of object detection, mAP (mean Average Precision) is a commonly used performance evaluation metric to measure the accuracy of a model in detecting different categories of objects. mAP50 refers to the average precision value calculated with a threshold of 0.5. The higher the mAP value, the better the performance of the object detection model. This means that the model can detect and correctly classify objects in the image with higher accuracy.

[0095] In summary, the innovative points of this invention are:

[0096] (1) Improved data preprocessing techniques: Gaussian filtering, dark channel prior method, and contrast enhancement are used, specifically designed to improve the visibility of oil films under different lighting and weather conditions. This includes dynamic range adjustment, contrast enhancement, and filtering techniques for interference factors such as fog.

[0097] (2) Improved feature extraction layer: The YOLOV8 convolutional neural network is modified by adding the RepNCSPELAN4 layer and the SEAttention attention mechanism to extract road surface and oil film features more effectively, thereby enhancing the model’s sensitivity to subtle changes.

[0098] (3) Improved loss function: The SIoU loss function is used for oil film detection scenarios to improve overall performance by balancing detection accuracy and recall.

[0099] Advantages of this invention:

[0100] (1) High real-time performance: The YOLOv8 model is known for its ability to quickly process images and achieve real-time object detection. For oil film detection on road surfaces, it can instantly identify potential skidding hazards, providing crucial information for preventing traffic accidents.

[0101] (2) High accuracy: The YOLOv8 network structure has been improved, which has increased the accuracy of identifying road surface oil film.

[0102] (3) Low resource consumption: YOLOv8 can run with low hardware resources without sacrificing accuracy. This is especially important for applications that require road surface oil film detection on edge devices.

[0103] (4) Strong generalization ability: YOLOv8 has good generalization ability and can accurately detect targets under different environments and conditions. For pavement oil film detection, this ability allows the model to adapt to different pavement conditions, lighting conditions and weather conditions.

[0104] Easy to integrate: The YOLOv8 model is easy to integrate with other systems, such as traffic monitoring systems or autonomous driving assistance systems, providing them with real-time road condition analysis.

[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications to the technical solutions described in the foregoing embodiments, or equivalent substitutions for some or all of the technical features, do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting and identifying road oil film based on an improved YOLOv8, characterized in that, Includes the following steps: S1) Obtain the dataset with road surface oil film, normalize all oil film images in the dataset, and scale all images in the dataset to a specified size; S2) Use the improved YOLOv8 model to detect and identify road surface oil film in all images in the dataset processed in step S1); The improved YOLOv8 model involves using image enhancement to improve the input image of the original YOLOv8 algorithm; In the original YOLOv8 algorithm, the C2f module in the backbone network is replaced by the RepNCSPELAN4 module; the RepNCSPELAN4 module includes the following structure: RepNet, a repeating network structure, enhances feature extraction capabilities and improves the model's accuracy in recognizing small objects and complex backgrounds by using repeated sub-network structures. The specific process is as follows: set up As input features, As a subnetwork in a repeating network structure, repeating This is represented as: ; Compressed Sensing (CS): This method utilizes compressed sensing theory to reduce redundant information, thereby improving processing speed and efficiency while maintaining the integrity of key features. The specific process is as follows: set up The original signal, For the measurement matrix, compressed sensing represents it as: ; in, It is the compressed signal, while the reconstructed signal The goal is to minimize the reconstruction error; Pyramid Feature Extraction (PFE): Enhances the model's ability to detect objects of different sizes through multi-scale feature fusion; the specific process is as follows: set up Input features at different scales, If is the feature extraction function, then the pyramid feature representation is: ; The final feature is a fusion of multi-scale features; Lightweight Attention Mechanism (LA): Integrates a lightweight attention module to focus on important features in the image with less computational cost, improving detection accuracy; the specific process is as follows: set up As input features, Let the attention weight function be used, then the weighted feature representation is: ; in, Indicates element-wise multiplication; Enhanced Nonlinear Activation (ENA): Employing an efficient nonlinear activation function optimizes the network's expressive power, accelerates convergence, and improves model performance; the specific process is as follows: set up As input features, If the activation function is non-linear, then the activated features are: ; In the original YOLOv8 algorithm, a SEAttention attention mechanism is added after the C2f module in the head network of the backbone network. The loss function in the original YOLOv8 algorithm is replaced with the SIoU loss function.

2. The method for detecting and identifying road oil film based on the improved YOLOv8 according to claim 1, characterized in that, The process of improving the input image of the original YOLOv8 algorithm by image enhancement is as follows: Gaussian filtering, dark channel prior method and contrast enhancement are used to denoise and enhance the contrast of the road surface oil film image.

3. The method for detecting and identifying road oil film based on the improved YOLOv8 according to claim 1, characterized in that, The SEAttention mechanism consists of two phases: Squeeze stage: Global average pooling is used to compress the feature map of each channel into a single value. An input feature map is... ,in It's about height. It's the width. If the channel number is [number], then the Squeeze stage will generate a [length] [value]. A vector representing global information for each channel; The specific process is as follows: Assumption Indicates the input feature map, Let represent the output of the Squeeze phase. The Squeeze phase can then be represented as: ; Excitation stage: A small fully connected network is used to learn the weights for each channel to determine the importance of each channel. These weights are then applied to the original feature map to enhance useful information and suppress irrelevant information. The specific process is as follows: Assumption If the output of the Excitation phase is given, then the Excitation phase can be represented as: ; in and It is a fully connected layer. It is an activation function. It is the Sigmoid activation function, used to ensure that the output range is between [0,1]. The output of the entire SEAttention mechanism This is the product of the outputs of the Squeeze and Excitation stages: ; By multiplying the output of the SEAttention attention mechanism with the original feature map, useful information in the feature map is enhanced and irrelevant information is suppressed, thereby improving model performance.