Road surface classification method for moving path of movable precision equipment
Through the pavement classification method of brightness compensation and texture feature embedding, the problems of insufficient lighting influence and feature extraction are solved, and high-precision and efficient pavement classification are achieved, which is suitable for the stable operation of movable precision equipment.
Patent Information
- Application Number
- CN202510618958.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-08-12
AI Technical Summary
The existing pavement classification technology is insufficient in handling non-paved and mixed pavements, the lighting conditions affect the classification accuracy, the feature extraction is insufficient, the calculation complexity is high, and the real-time requirements of movable precision equipment cannot be met.
The brightness compensation strategy is used to balance the image brightness through linear interpolation, combined with bilinear interpolation downsampling and grayscale processing, and the residual convolution network is used to extract features, calculate the difference value of adjacent pixels and high-frequency features, enhance texture features, and optimize the model through cross-entropy loss.
The adaptability and classification accuracy of the model under different lighting conditions is improved, the calculation complexity is reduced, and the efficient pavement classification is achieved, which meets the real-time requirements of movable precision equipment, with a classification accuracy of 99.17%.
Smart Images

Figure CN120472233A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of active stabilization systems, in particular to a road surface classification method for a travel path of movable precision equipment. Background Art
[0002] Mobile precision equipment is increasingly used in modern industry and scientific research. However, such equipment faces significant challenges during mobile operations due to complex road conditions. High-precision equipment requires extremely stable operating environments. Vibrations caused by road conditions can severely disrupt equipment operation, affecting its accuracy and reliability. This interference is particularly pronounced on unpaved surfaces. For example, in field geological exploration and construction, equipment frequently encounters complex road surfaces such as dirt roads and grassy areas. This can lead to operational difficulties, measurement data deviations, and reduced precision machining accuracy. This not only reduces work efficiency but can also damage equipment, increasing maintenance costs and causing financial losses.
[0003] Current road surface classification technology has many shortcomings when it comes to meeting the needs of mobile precision equipment. Most vision-based road surface classification methods focus on the identification of urban paved roads, and are seriously lacking in adaptability when dealing with unpaved and mixed roads. Traditional methods mainly rely on traditional image processing or deep learning models, where lighting conditions are a key factor affecting classification accuracy. Due to the uneven lighting conditions when collecting existing datasets, such as day and night differences and weather changes, the data distribution cannot cover the lighting diversity in real scenes. In practical applications, the classification performance of the model drops significantly under complex lighting conditions, and the generalization ability is insufficient. For example, in the early morning or evening when the light is weak and the angle is special, the model's classification accuracy of the road surface is significantly reduced.
[0004] In addition, existing models also have defects in feature extraction. On the one hand, they tend to over-rely on brightness information and learn global brightness differences in images caused by lighting changes as important features, which can lead to misjudgments. On the other hand, the model suffers from insufficient feature representation and inter-class overlap when classifying mixed-type and single-type roads. Traditional models have difficulty fully extracting the subtle features of mixed-type roads. The strong discriminative features of single-type roads will also mask the weak discriminative features of mixed-type roads, causing the two types of samples to be confused in the feature space. Moreover, existing models generally suffer from high computational complexity and a large number of parameters. They use high-resolution multi-channel images as input and adopt complex multi-level convolutional structures. The inference time is long and cannot meet the real-time requirements of mobile precision equipment. Summary of the Invention
[0005] In order to overcome the shortcomings and deficiencies of the prior art, the present invention provides a road surface classification method for the travel path of a movable precision equipment.
[0006] A road surface classification method for a travel path of a movable precision device comprises the following steps: S1: Data acquisition and preprocessing: collecting image data and corresponding illumination data of six types of roads, including asphalt roads, cement roads, dirt roads, grasslands, grassland-gravel roads, and grassland-dirt roads, and establishing a matching relationship between images and illumination data; S2: Image brightness compensation: Calculate the brightness compensation value of the image sample based on the illumination data of the image sample, and use the compensation value to adjust the pixel values of the image sample to perform image brightness compensation. When calculating the brightness compensation value, linear interpolation is used to map the illumination data of the image sample to the specified compensation range to obtain the compensation value. The compensation value is added to the pixel values of the image sample, while ensuring that the adjusted pixel values are within the specified range. S3: Downsample the image to obtain a grayscale image. Use the bilinear interpolation function to perform weighted averaging on the pixel values of the brightness-compensated image samples, reduce the image size to obtain the downsampled image samples, and then perform weighted summation on the pixel values of the RGB channels of the downsampled image samples to obtain a single-channel grayscale image sample. S4: Calculate the difference between adjacent pixels and perform the first convolution on the grayscale image sample. Calculate the square difference between each pixel in the image sample and the surrounding pixels using a convolution kernel with a specific size and weight setting. Then, perform the second convolution on the obtained square difference matrix and calculate the pixel difference image between the central pixel and the adjacent pixels using a convolution kernel with a specific size and weight setting. S5: High-frequency feature modulation further enhances texture features. A mean filter is applied to the grayscale image sample to obtain a low-frequency image. The low-frequency information in the grayscale image sample is removed with the help of the low-frequency image to obtain a high-frequency image. The high-frequency image is multiplied with the pixel difference image and added to the grayscale image sample. S6: Backbone network extracts features. The residual convolutional network is selected as the backbone network. The image samples after high-frequency feature modulation and the down-sampled image samples are superimposed in the channel dimension and put into the residual convolutional network for feature extraction. S7: The classifier performs the road classification task, passing the extracted features into the classifier composed of linear layers to obtain the score of each category; S8: Calculate the loss value, calculate the cross entropy loss value between the true label of the image sample and the score of each category obtained by the classifier, update the model parameters based on the loss value, repeat the above steps until the model training cycle reaches the preset value, and finally obtain the model prediction category.
[0007] Furthermore, in step S2, the brightness compensation value is calculated. The formula is ,in, and Represents the lowest brightness value and the highest brightness value respectively, which are hyper parameters. and To specify the lower and upper limits of the compensation range; the formula for adjusting the pixel value is express Middle Channel, Row, No. Pixel value of the column, superscript Indicates that brightness compensation has been performed.
[0008] Furthermore, in step S3, a bilinear interpolation function is used For downsampling, assume that the image size is from Downsample to , for the coordinates in the downsampled image The pixel value at , and its calculation formula is ,in, is the bilinear interpolation weight function, which is determined by the image coordinate relationship before and after downsampling; the grayscale image formula is calculated middle, and Respectively The pixel matrix of the RGB three channels.
[0009] Furthermore, in step S4, the first convolution kernel size Set to , at this time there are convolution kernels, the weight of the center position of the convolution kernel is -1, each convolution kernel has only one position of 1, the other positions are 0, and the position of "1" in all convolution kernels is not repeated; the first operation formula is Represents the square matrix of the difference between the central pixel and the surrounding fixed position pixels; the second convolution kernel size is , the weight is 1, and the second operation formula is Represents a pixel difference image.
[0010] Furthermore, in step S5, the mean filter use The mean filter kernel, the element values in the kernel are , the formula for calculating the low-frequency image is ,in, is the current pixel coordinate; the formula for calculating the high-frequency image is ; The formula for enhancing texture features is .
[0011] Furthermore, in step S6, the selected residual convolutional network is ResNet, which contains multiple residual blocks. Each residual block consists of a convolution layer, a batch normalization layer and a ReLU activation function. The input image first passes through a Convolution layer, stride 2, number of convolution kernels is 64, followed by maximum pooling layer, pooling kernel size is , with a step size of 2; subsequently, feature extraction is performed through residual blocks with different numbers of convolution kernels and step sizes, and finally the feature vector is obtained through the global average pooling layer. , the calculation formula is expressed as Represents the ResNet backbone network.
[0012] Furthermore, in step S7, the classifier consists of a linear layer, assuming that the input feature vector dimension is , the output dimension of the first linear layer is , the weight matrix is , the bias is , then the output of the first linear layer ; The output dimension of the second linear layer is , the weight matrix is , the bias is , the final classifier output , It is the score of each category.
[0013] Furthermore, in step S8, the formula for calculating the cross entropy loss value is: ,in, The model predicts The probability of the categories, is the number of categories, The true label of the image sample corresponds to When updating the TF-ResNet model parameters, the learning rate The initial value is set to 0.001, and the learning rate update formula is , the model parameter update formula is , , superscript and Indicates the number of training rounds.
[0014] Furthermore, in the step of obtaining the model prediction category, the brightness compensation module is downsampled to obtain , the texture feature embedding module obtains , pass it into the trained network to extract features , and its calculation formula is The trained ResNet backbone network is used; the scores of each category are obtained by the classifier, and the category corresponding to the highest score is taken as the predicted category , the formula is , Represents a classifier operation.
[0015] Beneficial Effects: This invention proposes a road surface classification method for the path of mobile precision equipment. This method provides a decision-making basis for active stabilization systems and presents an innovative solution. This method significantly improves classification accuracy. By incorporating a brightness compensation strategy and utilizing ambient light data collected by on-board sensors to balance image brightness, this method effectively compensates for brightness shifts caused by illumination, avoids classification bias caused by varying lighting conditions, and eliminates redundant brightness features, significantly improving the model's adaptability and accuracy under varying lighting conditions. Furthermore, a texture feature embedding mechanism calculates the difference between adjacent pixels to highlight high-frequency components of the image. This high-frequency feature modulation further enhances road surface texture characteristics and mitigates the effects of noise. This enables the model to better distinguish between mixed and single-type roads, accurately capturing the unique characteristics of each type. On a dataset containing multiple road surface types, classification accuracy reached 99.17%. This method also excels in improving computational efficiency. The brightness compensation strategy allows the model to focus more on the road surface's inherent characteristics, simplifying the model structure, reducing unnecessary computation, and lowering the number of parameters and computational complexity. Furthermore, efficient computation of texture feature embedding is achieved through PyTorch's GPU acceleration. After testing, its computing speed is twice that of the MobileNet model and 1.25 times that of the traditional ResNet-34 model. It can meet real-time requirements and quickly provide a basis for road classification decisions for the stabilization system of mobile precision equipment, effectively ensuring the stable operation of the equipment in diverse operating environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a flow chart of the steps of the method of the present invention; Figure 2 A data flow diagram showing the method of the present invention; Figure 3 The method of the present invention The weight distribution of each convolution kernel in . DETAILED DESCRIPTION
[0017] It should be noted that, unless there is a conflict, the embodiments in this application and the features described in the embodiments can be combined with each other. The application is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0018] like Figure 1 and Figure 2 As shown, a road surface classification method for a travel path of a movable precision equipment includes the following steps: S1: Data acquisition and preprocessing: collecting image data and corresponding illumination data of six types of roads, including asphalt roads, cement roads, dirt roads, grasslands, grassland-gravel roads, and grassland-dirt roads, and establishing a matching relationship between images and illumination data; Specifically, data collection and preprocessing are the foundation of the entire road surface classification method, providing high-quality data for subsequent model training. First, we need to collect image data for six different road types: asphalt, concrete, dirt, grass, grass-gravel, and grass-dirt. These different road types have unique textures, colors, and light reflection characteristics, providing critical information for model classification. For example, asphalt roads are typically smooth, dark in color, and reflect light evenly; grass, on the other hand, is emerald green, has a complex texture, and reflects light unevenly.
[0019] To more fully simulate real-world conditions, we also collected illumination data corresponding to these road surface images and established a matching relationship between the images and illumination data. Lighting conditions significantly influence the image's feature representation. Different lighting intensities and angles can cause the same road surface to appear different in an image. For example, under strong sunlight, road shadows become more pronounced and colors more vivid; on cloudy days or at night, the road surface's colors become duller and its texture less distinct. By collecting illumination data, we can perform illumination compensation on the images during subsequent processing, reducing the impact of illumination on classification results.
[0020] During the data preprocessing phase, we clean and organize the collected images and lighting data, removing noise and invalid data to ensure data quality and consistency. We also annotate the images, labeling each image with its corresponding road surface type so that the model can learn the correct classification information during training.
[0021] S2: Image brightness compensation: First, calculate the brightness compensation value of the image sample based on the illumination data of the image sample, and then use the compensation value to adjust the pixel values of the image sample to achieve image brightness compensation. When calculating the brightness compensation value, linear interpolation is used to map the illumination data of the image sample to the specified compensation range to obtain the compensation value. Then, the compensation value is added to the pixel values of the image sample, while ensuring that the adjusted pixel values are within the specified range. Specifically, image brightness compensation is designed to eliminate the effects of lighting conditions on image features, enabling the model to more accurately identify road surface types. Because varying light intensities and angles can cause variations in image brightness and contrast, this can lead to misclassification. For example, road images captured in bright light may be overexposed, resulting in a loss of texture and detail; whereas images captured in low light may be too dark, making road features difficult to discern.
[0022] To achieve image brightness compensation, we first calculate the brightness compensation value based on the illumination data of the image sample. Specifically, we use linear interpolation to map the illumination data of the image sample to a specified compensation range to obtain the corresponding compensation value. This compensation range is determined based on extensive experiments and data analysis, and can ensure good compensation results under different lighting conditions. For example, if the illumination data of an image is low, we will calculate a positive compensation value and add it to each pixel value in the image to brighten the image; conversely, if the illumination data of the image is high, we will calculate a negative compensation value and subtract it from the pixel value of the image to darken the image.
[0023] After calculating the brightness compensation value, we apply it to each pixel in the image sample to adjust the pixel value. To ensure that the adjusted pixel value is within a reasonable range (usually between 0 and 255), we truncate the pixel value to avoid overflow or underflow. Image brightness compensation can make road images under different lighting conditions more consistent in brightness and contrast, improving the model's ability to recognize road features.
[0024] S3: Downsample the image to obtain a grayscale image. Use the bilinear interpolation function to perform weighted averaging on the pixel values of the brightness-compensated image samples, reduce the image size to obtain the downsampled image samples, and then perform weighted summation on the pixel values of the RGB channels of the downsampled image samples to obtain a single-channel grayscale image sample. Specifically, image downsampling and grayscale processing are designed to reduce data volume, improve model computational efficiency, and highlight road texture features. In practical applications, captured images are typically high-resolution and contain a large amount of pixel information. However, this information can contain significant redundancy, which doesn't significantly improve model classification performance. Therefore, we need to downsample the images to reduce resolution and data size.
[0025] We use bilinear interpolation to downsample the brightness-compensated image samples. Bilinear interpolation is a commonly used image scaling method that calculates the value of a new pixel by taking a weighted average of surrounding pixels, preserving image detail to a certain extent. For example, suppose we want to downsample a 1920×1200 image to 256×256. The bilinear interpolation function calculates the value of each new pixel based on the position and distance of surrounding pixels, making the downsampled image visually similar to the original image but with three-quarters less data.
[0026] After downsampling, we convert the image to grayscale. This reduces the data dimension and model complexity while also highlighting the road's texture. In many cases, road texture is crucial for distinguishing different road types, while color information can be affected by lighting and other factors. For example, when distinguishing between asphalt and concrete roads, their colors may vary due to lighting and wear, but their texture characteristics are relatively stable. Converting the image to grayscale allows us to better capture these texture features and improve the model's classification accuracy.
[0027] S4: Calculate the difference between adjacent pixels and perform the first convolution on the grayscale image sample. Calculate the square difference between each pixel in the image sample and the surrounding pixels using a convolution kernel with a specific size and weight setting. Then, perform the second convolution on the obtained square difference matrix and calculate the pixel difference image between the central pixel and the adjacent pixels using a convolution kernel with a specific size and weight setting. Specifically, calculating the difference between adjacent pixels is designed to highlight the texture characteristics of the road surface, enabling the model to better discern the differences between different road surface types. The texture characteristics of a road surface are determined by its surface microstructure, and different road types exhibit distinct texture patterns. For example, asphalt roads typically have a smooth texture, while dirt roads have a rougher texture. By calculating the difference between adjacent pixels, we can capture these variations in texture characteristics and use them as an important basis for classification.
[0028] We perform two convolution operations on the grayscale image sample to calculate the difference between adjacent pixels. The first convolution uses a convolution kernel of a specific size and weight setting to calculate the square of the difference between each pixel in the image sample and the surrounding pixels. The center position weight of this convolution kernel is -1, and each convolution kernel has only one position that is 1, and the rest are 0, and the positions of "1" in all convolution kernels are not repeated. This design allows the convolution operation to calculate the difference between the center pixel and the surrounding pixels at different positions. For example, for a 3x3 convolution kernel, it can calculate the difference between the center pixel and the surrounding 8 pixels. By squaring these differences, we can highlight the size of the difference and make the texture features more obvious.
[0029] The second convolution processes the squared difference matrix obtained from the first convolution, using a 1x1 kernel with a weight of 1. This convolution aims to sum the squared difference matrices to produce a matrix of differences between the center pixel and its adjacent pixels. These two convolutions yield a difference image that reflects the road texture characteristics, providing important information for subsequent feature extraction and classification.
[0030] S5: High-frequency feature modulation further enhances texture features. A mean filter is applied to the grayscale image sample to obtain a low-frequency image. The low-frequency information in the grayscale image sample is removed with the help of the low-frequency image to obtain a high-frequency image. The high-frequency image is multiplied with the pixel difference image and added to the grayscale image sample. Specifically, high-frequency feature modulation is designed to further enhance the road surface's texture characteristics while simultaneously reducing the impact of noise and increasing the model's sensitivity to texture. In an image, high-frequency information typically includes features such as edges, details, and texture, while low-frequency information includes overall image brightness and color. By modulating high-frequency features, we can highlight the road surface's texture characteristics, making it easier for the model to discern differences between different road surface types.
[0031] We first apply a mean filter to the grayscale image sample to obtain a low-frequency image. A mean filter is a simple linear filter that smooths the image by averaging the surrounding pixels, removing high-frequency noise. For example, a 3x3 mean filter uses the average of the nine pixels surrounding the center pixel as the new pixel value. By using mean filtering, we can obtain the low-frequency portion of the image.
[0032] Next, we subtract the low-frequency image from the grayscale image sample to obtain a high-frequency image. The high-frequency image contains image features such as edges, details, and texture. Next, we multiply the high-frequency image with the pixel difference image and add it to the grayscale image sample. The purpose of this is to modulate the pixel difference image with the high-frequency image to enhance the expression of texture features. For example, if the texture features of a certain area in the high-frequency image are more prominent, then after adding the original grayscale image, the texture features of this area will be more prominent. By modulating the high-frequency features, we can further improve the model's ability to recognize road texture features and reduce the impact of noise on classification results.
[0033] S6: Backbone network extracts features. The residual convolutional network is selected as the backbone network. The image samples after high-frequency feature modulation and the down-sampled image samples are superimposed in the channel dimension and put into the residual convolutional network for feature extraction. Specifically, feature extraction from the backbone network is a core step in the entire road surface classification method. It is responsible for extracting representative features from the processed image, providing a foundation for subsequent classification tasks. We chose the Residual Convolutional Network (ResNet) as the backbone network. ResNet is a deep convolutional neural network that addresses the vanishing and exploding gradient problems in deep neural networks by introducing residual blocks. This allows for efficient training of deeper networks, thereby extracting richer and more advanced features.
[0034] After superimposing the image samples processed with high-frequency feature modulation and the downsampled image samples in the channel dimension, we input them into ResNet for feature extraction. ResNet contains multiple residual blocks, each consisting of a convolutional layer, a batch normalization layer, and a Reluctant Unit (ReLU) activation function. The convolutional layer is used to extract local features of the image, the batch normalization layer is used to accelerate the network training process and improve the model's stability, and the Reluctant Unit (ReLU) activation function is used to introduce nonlinear factors and enhance the model's expressiveness.
[0035] For example, the input image first passes through a 7x7 convolutional layer with a stride of 2 and 64 kernels. This convolutional layer performs preliminary feature extraction on the image, reducing its resolution. The image then passes through a maximum pooling layer with a 3x3 kernel size and a stride of 2, further reducing its resolution. Next, the image is passed through multiple residual blocks with different numbers of kernels and stride settings for feature extraction. Each residual block can learn features at different levels. Finally, a global average pooling layer converts the feature map into a feature vector, which contains the global feature information of the image and can represent its overall characteristics.
[0036] S7: The classifier performs the road classification task, passing the extracted features into the classifier composed of linear layers to obtain the score of each category; Specifically, the road surface classification task involves predicting and classifying the road surface type based on the features extracted by the backbone network. We use a classifier consisting of linear layers, which take the feature vector extracted by the backbone network as input and output a score for each category. The linear layer is a simple yet effective classifier that performs a linear transformation on the input features to produce a score for each category.
[0037] For example, suppose the dimension of the input feature vector is , the output dimension of the first linear layer is , the weight matrix is , the bias is , then the output of the first linear layer is ,in is the input feature vector. The output dimension of the second linear layer is , the weight matrix is , the bias is , the final classifier output is , is the score for each category.
[0038] The classifier's output score represents the likelihood that the input image belongs to each category. A higher score indicates a greater likelihood that the input image belongs to that category. By comparing the scores for each category, we can select the category with the highest score as the prediction. For example, if the input image is of asphalt road, and the classifier outputs the highest score for the asphalt road category, we classify the image as asphalt road.
[0039] S8: Calculate the loss value. Calculate the cross-entropy loss value between the true label (one-hot encoding) of the image sample and the score of each category obtained by the classifier. Update the model parameters based on the loss value. Repeat the above steps until the model training cycle reaches the preset value, and finally obtain the model prediction category.
[0040] Specifically, the loss value is calculated to evaluate the classification performance of the model and to update the model parameters based on the loss value, so that the model can continuously learn and optimize. We use the cross-entropy loss function to calculate the loss value. The cross-entropy loss function is a commonly used classification loss function that measures the difference between the model's prediction results and the true label.
[0041] Specifically, we compare the true label (one-hot encoding) of the image sample with the scores for each category obtained by the classifier and calculate the cross-entropy loss. One-hot encoding converts category labels into vectors, where each category corresponds to a vector with only one element set to 1 and all other elements set to 0. For example, if there are six categories, the one-hot encoding of asphalt road might be [1, 0, 0, 0, 0], while the one-hot encoding of cement road might be [0, 1, 0, 0, 0, 0].
[0042] Based on the calculation results of the cross entropy loss function, we can know the classification performance of the model under the current parameters. If the loss value is large, it means that the difference between the model's prediction results and the true labels is large, and the model's classification performance is poor; if the loss value is small, it means that the difference between the model's prediction results and the true labels is small, and the model's classification performance is good.
[0043] Based on the calculated loss value, we use an optimization algorithm to update the model parameters. Based on the gradient of the loss value, the optimization algorithm adjusts the model parameters to gradually reduce the loss value. We repeat the above steps, training the model until the training cycle reaches the preset value. Ultimately, we obtain a trained model that can accurately classify the road surface type along the path of the mobile precision equipment.
[0044] Preferably, in step S2, in the picture brightness compensation, the brightness compensation value is calculated The formula is ,in, and Represents the lowest brightness value and the highest brightness value respectively, which are hyper parameters. and To specify the lower and upper limits of the compensation range; the formula for adjusting the pixel value is express Middle Channel, Row, No. The pixel value of the column, the superscript + indicates that it has been brightness compensated.
[0045] Preferably, in step S3, a bilinear interpolation function is used For downsampling, assume that the image size is from Downsample to , for the coordinates in the downsampled image The pixel value at , and its calculation formula is ,in, is the bilinear interpolation weight function, which is determined by the image coordinate relationship before and after downsampling; the grayscale image formula is calculated middle, and Respectively The pixel matrix of the RGB three channels.
[0046] Preferably, Figure 3 As shown, in step S4, the first convolution kernel size Set to , at this time there are convolution kernels, the weight of the center position of the convolution kernel is -1, each convolution kernel has only one position of 1, the other positions are 0, and the position of "1" in all convolution kernels is not repeated; the first operation formula is , Represents the square matrix of the difference between the central pixel and the surrounding fixed position pixels; the second convolution kernel size is , the weight is 1, and the second operation formula is Represents a pixel difference image.
[0047] Preferably, in step S5, the mean filter use The mean filter kernel, the element values in the kernel are , the formula for calculating the low-frequency image is ,in, is the current pixel coordinate; the formula for calculating the high-frequency image is ; The formula for enhancing texture features is .
[0048] Preferably, in step S6, the selected residual convolutional network is ResNet, which contains multiple residual blocks, each of which is composed of a convolutional layer, a batch normalization layer and a ReLU activation function. The input image first passes through a Convolution layer, stride 2, number of convolution kernels is 64, followed by maximum pooling layer, pooling kernel size is , with a step size of 2; subsequently, feature extraction is performed through residual blocks with different numbers of convolution kernels and step sizes, and finally the feature vector is obtained through the global average pooling layer. , and its calculation formula can be expressed as Represents the ResNet backbone network.
[0049] Preferably, in step S7, the classifier consists of a linear layer, assuming that the input feature vector dimension is , the output dimension of the first linear layer is , the weight matrix is , the bias is , then the output of the first linear layer ; The output dimension of the second linear layer is , the weight matrix is , the bias is , the final classifier output , It is the score of each category.
[0050] Preferably, in step S8, the formula for calculating the cross entropy loss value is: ,in, The model predicts The probability of the categories, is the number of categories, is the true label of the image sample (one-hot encoding) corresponding to the When updating the TF-ResNet model parameters, the learning rate The initial value is set to 0.001, and the learning rate update formula is , the model parameter update formula is , , superscript and Indicates the number of training rounds.
[0051] Preferably, in the step of obtaining the model prediction category, the brightness compensation module is downsampled to obtain , the texture feature embedding module obtains , pass it into the trained network to extract features , and its calculation formula is The trained ResNet backbone network is used; the scores of each category are obtained by the classifier, and the category corresponding to the highest score is taken as the predicted category , the formula is , Represents a classifier operation.
[0052] A road surface classification method for the travel path of mobile precision equipment shows significant advantages in many aspects and effectively overcomes the shortcomings of existing technologies, providing strong support for the stable operation of mobile precision equipment under complex road conditions.
[0053] This method offers significant advantages in classification accuracy, successfully overcoming the challenges of illumination and feature representation in existing technologies. Existing technologies are affected by illumination conditions, and data biases lead to reduced classification performance under complex lighting conditions. This method, however, employs a brightness compensation strategy, leveraging ambient illumination data acquired by onboard sensors and applying a linear interpolation function to balance image brightness. This not only compensates for illumination-induced brightness shifts but also eliminates redundant brightness features, significantly improving the model's adaptability to varying lighting conditions. Regarding feature representation, existing technologies suffer from overlap between road surface classes and insufficient feature representation, making it difficult for traditional models to extract subtle features of mixed-type roads. This method incorporates a texture feature embedding mechanism, calculating the difference between adjacent pixels to highlight high-frequency components. High-frequency feature modulation is then used to further enhance texture features and reduce noise intensity. This enables the model to accurately capture discriminative information about various road types, effectively distinguishing between mixed and single-type roads. On a dataset containing multiple road types, the model achieves a classification accuracy of 99.17%, significantly outperforming existing methods.
[0054] This method also excels in computational efficiency, resolving the high computational complexity of existing technologies. Existing models, in pursuit of deep information from high-resolution images, employ complex multi-level convolutional structures, resulting in a large number of parameters and long inference times, making them unable to meet the real-time requirements of mobile precision equipment. This method, however, reduces the interference of illumination changes on the classification task through a brightness compensation strategy, allowing the model to focus more on extracting features from the road surface itself, thereby simplifying the model structure and reducing the number of parameters and computational complexity. At the same time, combined with PyTorch's built-in GPU acceleration capabilities, efficient computation of texture feature embedding is achieved. Experimental results show that its computational speed is twice that of the MobileNet model and 1.25 times that of the traditional ResNet-34 model. It can quickly provide a basis for road surface classification decisions for the stabilization system of mobile precision equipment, ensuring stable operation of the equipment in diverse operating environments.
[0055] This method, based on deep learning, has excellent generalization and adaptability, overcoming the limitations of existing technologies in their application scenarios. Existing vision-based road classification methods primarily focus on identifying urban paved roads, with insufficient research on their adaptability to unpaved and mixed roads. The TF-ResNet model proposed in this method, which integrates a brightness compensation strategy with a texture feature embedding mechanism, can effectively handle road classification tasks in a variety of complex scenarios. Whether on urban roads or in complex off-road conditions, it can accurately identify road surface types, providing reliable guarantees for the stable operation of mobile precision equipment in various operating environments.
[0056] While embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A road surface classification method for the travel path of a mobile precision equipment, characterized in that: The following steps are involved: S1: Data acquisition and preprocessing: collecting image data and corresponding illumination data of six types of roads, including asphalt roads, cement roads, dirt roads, grasslands, grassland-gravel roads, and grassland-dirt roads, and establishing a matching relationship between images and illumination data; S2: Image brightness compensation: Calculate the brightness compensation value of the image sample based on the illumination data of the image sample, and use the compensation value to adjust the pixel values of the image sample to perform image brightness compensation. When calculating the brightness compensation value, linear interpolation is used to map the illumination data of the image sample to the specified compensation range to obtain the compensation value. The compensation value is added to the pixel values of the image sample, while ensuring that the adjusted pixel values are within the specified range. S3: Downsample the image to obtain a grayscale image. Use the bilinear interpolation function to perform weighted averaging on the pixel values of the brightness-compensated image samples, reduce the image size to obtain the downsampled image samples, and then perform weighted summation on the pixel values of the RGB channels of the downsampled image samples to obtain a single-channel grayscale image sample. S4: Calculate the difference between adjacent pixels and perform the first convolution on the grayscale image sample. Calculate the square difference between each pixel in the image sample and the surrounding pixels using a convolution kernel with a specific size and weight setting. Then, perform the second convolution on the obtained square difference matrix and calculate the pixel difference image between the central pixel and the adjacent pixels using a convolution kernel with a specific size and weight setting. S5: High-frequency feature modulation further enhances texture features. A mean filter is applied to the grayscale image sample to obtain a low-frequency image. The low-frequency information in the grayscale image sample is removed with the help of the low-frequency image to obtain a high-frequency image. The high-frequency image is multiplied with the pixel difference image and added to the grayscale image sample. S6: Backbone network extracts features. The residual convolutional network is selected as the backbone network. The image samples after high-frequency feature modulation and the down-sampled image samples are superimposed in the channel dimension and put into the residual convolutional network for feature extraction. S7: The classifier performs the road classification task, passing the extracted features into the classifier composed of linear layers to obtain the score of each category; S8: Calculate the loss value, calculate the cross entropy loss value between the true label of the image sample and the score of each category obtained by the classifier, update the model parameters based on the loss value, repeat the above steps until the model training cycle reaches the preset value, and finally obtain the model prediction category.
2. A road surface classification method for a travel path of a mobile precision equipment according to claim 1, characterized in that: In step S2, the brightness compensation value is calculated. The formula is ,in, and Represents the lowest brightness value and the highest brightness value respectively, which are hyper parameters. and To specify the lower and upper limits of the compensation range; the formula for adjusting the pixel value is , express Middle Channel, Row, No. Pixel value of the column, superscript Indicates that brightness compensation has been performed.
3. The method for road surface classification for a travel path of a mobile precision equipment according to claim 1, characterized in that: In step S3, the bilinear interpolation function is used For downsampling, assume that the image size is from Downsample to , for the coordinates in the downsampled image The pixel value at , and its calculation formula is ,in, is the bilinear interpolation weight function, which is determined by the image coordinate relationship before and after downsampling; the grayscale image formula is calculated middle, and Respectively The pixel matrix of the RGB three channels.
4. The method for road surface classification for a travel path of a mobile precision equipment according to claim 1, characterized in that: In step S4, the first convolution kernel size Set to , at this time there are convolution kernels, the weight of the center position of the convolution kernel is -1, each convolution kernel has only one position of 1, the other positions are 0, and the position of "1" in all convolution kernels is not repeated; the first operation formula is Represents the square matrix of the difference between the central pixel and the surrounding pixels at a fixed position; The second convolution kernel size is , the weight is 1, and the second operation formula is Represents a pixel difference image.
5. The method for road surface classification for a travel path of a mobile precision equipment according to claim 1, characterized in that: In step S5, the mean filter use The mean filter kernel, the element values in the kernel are , the formula for calculating the low-frequency image is ,in, is the current pixel coordinate; the formula for calculating the high-frequency image is ; The formula for enhancing texture features is .
6. The method for road surface classification for a travel path of a mobile precision equipment according to claim 1, characterized in that: In step S6, the selected residual convolutional network is ResNet, which contains multiple residual blocks. Each residual block consists of a convolution layer, a batch normalization layer and a ReLU activation function. The input image first passes through a Convolution layer, stride 2, number of convolution kernels is 64, followed by maximum pooling layer, pooling kernel size is , with a step size of 2; subsequently, feature extraction is performed through residual blocks with different numbers of convolution kernels and step sizes, and finally the feature vector is obtained through the global average pooling layer. , the calculation formula is expressed as , Represents the ResNet backbone network.
7. The method for road surface classification for a travel path of a mobile precision equipment according to claim 1, characterized in that: In step S7, the classifier consists of a linear layer, assuming that the input feature vector dimension is , the output dimension of the first linear layer is , the weight matrix is , the bias is , then the output of the first linear layer ; The output dimension of the second linear layer is , the weight matrix is , the bias is , the final classifier output , It is the score of each category.
8. The method for road surface classification for a travel path of a mobile precision equipment according to claim 1, characterized in that: In step S8, the formula for calculating the cross entropy loss value is: ,in, The model predicts The probability of the categories, is the number of categories, The true label of the image sample corresponds to When updating the TF-ResNet model parameters, the learning rate The initial value is set to 0.001, and the learning rate update formula is , the model parameter update formula is , , superscript and Indicates the number of training rounds.
9. The method for road surface classification for a travel path of a mobile precision equipment according to claim 1, characterized in that: In the step of obtaining the model prediction category, the brightness compensation module is downsampled to obtain , the texture feature embedding module obtains , pass it into the trained network to extract features , and its calculation formula is The trained ResNet backbone network is used; the scores of each category are obtained by the classifier, and the category corresponding to the highest score is taken as the predicted category , the formula is Represents a classifier operation.