Image classification method based on color image pavement covering classification network model
By using the color image pavement cover classification network model in image processing, combined with the feature extraction of RGB and HSV color spaces and the channel attention residual module, the problem of low accuracy and speed of pavement type recognition in the existing technology is solved and achieved. Higher classification accuracy and anti-interference ability.
Patent Information
- Application Number
- CN202410648306.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-08-23
AI Technical Summary
The existing technology is difficult to effectively resist interference when identifying changes in friction coefficient of road surfaces in different environments, resulting in low accuracy and speed of road surface type recognition, affecting driving safety.
A road cover classification network model based on color images is used, and the feature extraction and classification networks of RGB and HSV color spaces are connected in parallel. The channel attention residual module and the one-dimensional signal classification network are combined to extract the road texture, edge and illumination information, and Perform weighting processing to improve classification accuracy.
It significantly improves the accuracy and speed of road cover classification, enhances the anti-interference ability against environmental factors, and improves the generalization of the classification model.
Smart Images

Figure CN118537828A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing and computer vision, and specifically relates to an image classification method based on a color image road covering classification network model. Background Art
[0002] When driving a vehicle, due to the influence of weather, in different environments such as rainy days, snowy days, icy roads or wet roads, under different road covers, the friction coefficient of the road surface is different, so the friction between the tire and the ground is also different, so the driver must drive on different roads at a safe speed to avoid traffic accidents as much as possible. Therefore, the research on the classification technology of road covers has a vital impact.
[0003] At present, most of the research on road surface coverage characteristics classification relies on physical signals such as optics, acoustics and pressure to classify and identify the road surface. Affected by factors such as weather, sensors, and noise, it is difficult to effectively and resistant to interference to identify the road surface type. There is an urgent need for an efficient identification method that can effectively and resistant to interference to identify the road surface type. Summary of the invention
[0004] The main purpose of the present invention is to provide an image classification method based on a color image road cover classification network model, which overcomes the defects of the above classification method, improves the classification accuracy and classification speed, and can effectively overcome the influence of external environmental factors.
[0005] The technical solution to achieve the purpose of the present invention is: an image classification method based on a color image road cover classification network model, the steps are as follows: establish a color image classification network model; construct an image data set; train and verify the color image classification network model; test the color image classification network model. The color image classification network model includes a feature extraction classification network in RGB color space and a feature extraction classification network in HSV color space; the two feature extraction classification networks are connected in parallel, and finally the results of the two are weighted.
[0006] Compared with the prior art, the present invention has the following significant advantages:
[0007] (1) The present invention establishes a color image classification network model, and the accuracy of classifying road coverings is higher than that of existing classification technologies.
[0008] (2) The present invention realizes deep extraction of texture and edge feature information of road coverings by constructing a channel attention residual module, thereby further improving classification accuracy.
[0009] (3) The present invention realizes the extraction of illuminance information features by constructing a one-dimensional signal classification network module for the H component in HSV, and at the same time performs weighted addition processing on the results of the two, so that the network model has better generalization. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 Training process of network model for road cover classification based on color images;
[0011] Figure 2 This is the structure diagram of the network model for color image road cover classification;
[0012] Figure 3 This is the structure diagram of the channel attention residual module;
[0013] Figure 4 The histogram of the H component in HSV for different road covers
[0014] Figure 5 This is the effect diagram of dividing the H component into 32 parts; DETAILED DESCRIPTION
[0015] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0016] An image classification method based on a color image road cover classification network model, the steps are as follows:
[0017] The road surface covering image in RGB color space is input into the feature extraction and classification network in RGB color space improved based on ResNet network, so as to extract the features of edge texture of color image and classify the road surface covering;
[0018] The road covering image in RGB color space is converted to HSV color space, the H component is extracted and scaled to the range of 0 to 255, and then counted into a one-dimensional signal in the form of a histogram;
[0019] The H component is input into the feature extraction and classification network based on the HSV color space improved by VIT to extract the features of the illumination information in the color image and classify the road coverings;
[0020] The output results of the two feature extraction and classification networks are weighted added to obtain the correct road cover classification result.
[0021] The present invention mainly extracts the texture and edge feature information of the road covering through the feature extraction classification network of the RGB color space, and extracts the illumination information feature of the road covering through the feature extraction classification network of the HSV color space. The results of the two are finally weighted and added to ensure the high accuracy of the classification of the road covering. The main steps are as follows:
[0022] The feature extraction and classification network of the RGB color space and the feature extraction and classification network of the HSV color space are connected in parallel, and finally the results of the two are weighted.
[0023] In a further embodiment, the steps of building a feature extraction and classification network in the RGB color space are as follows:
[0024] Step 1.1: Establish a feature extraction and classification network in RGB color space to extract features from edge textures of color images and classify road coverings; the feature extraction and classification network in RGB color space includes four groups of channel attention residual modules.
[0025] Among them, the number of channel attention residual modules in each group is 3, 4, 6, and 3 respectively. The channel attention residual module is composed of the channel attention mechanism inserted into the residual module:
[0026] Step 1.1.1: Establish a residual module to extract deep feature information; the residual module is composed of a 1×1 convolutional layer, a 3×3 convolutional layer, and a 1×1 convolutional layer stacked in sequence, and then jump connected from the side;
[0027] Step 1.1.2: Establish a channel attention residual module to extract feature information between image channels; the channel attention consists of two layers of 1×1 convolutional layers and an adaptive pooling layer, which is inserted after the 3×3 convolutional layer in the residual module, and an adaptive pooling layer is added in the skip connection of the residual module.
[0028] Step 1.1.3: Finally, after passing through two fully connected layers, the neurons of the fully connected layers are 1000 and class-numbers respectively, and the output result size is B×1×class-numbers, where class-numbers is the number of categories of road coverings.
[0029] In a further embodiment, the steps of building a feature extraction classification network for the HSV color space are as follows:
[0030] Step 1.2: Establish a feature extraction and classification network in the HSV color space to extract features from illumination information in color images and classify road coverings; the feature extraction and classification network in the HSV color space specifically includes: a classification vector module, a position encoding module, and an encoder module.
[0031] Step 1.2.1: In the feature extraction classification network of HSV color space, the input needs to convert the color image into HSV color space, extract the H component in the HSV color space, scale it to the range of 0 to 255, and use the statistical histogram method. The final output size is 1×256.
[0032] Step 1.2.2: Establish a classification vector module and add a learnable classification vector to increase the classification attribute. First, the input needs to be divided into 32 parts. The classification vector module uses the concat operation to add a learnable vector size of 1, so that the input feature map size is B×32×8 and the output size is B×33×8.
[0033] Step 1.2.3: Establish a position encoding module to learn the input position information by adding a learnable position vector; the position encoding module adds a learnable position vector of size B×33×8, and the size of the output through the addition operation is B×33×8;
[0034] Step 1.2.4: Establish an encoder module to achieve the learning effect of the global view by fusing the input feature information; the encoder module converts the input feature map through the fully connected layer and learns the global view through the multi-head attention mechanism. The number of heads is 8, and the size of each head vector is B×33×1. The specific expression is:
[0035] Q,K,V=liner(x)
[0036] Where Q, K, and V are the query feature vector, key feature vector, and value feature vector after transformation by the fully connected layer. The size of the three vectors is B×8×33×1, and liner is the fully connected layer.
[0037]
[0038] Where, d k is the dimension of vector Q, K, V, K T is the transpose of K.
[0039] Finally, after passing through a multi-layer perceptron (MLP), the output result is of size B×1×class-numbers.
[0040] The output results of the two feature extraction and classification networks are weighted and added together to obtain the correct road cover classification result:
[0041] Cls=weight r ×R(x)+weight v ×H(h)
[0042] Where x represents the RGB color space image, h represents the H component in the HSV color space, R represents the output result of the feature extraction and classification network in the RGB color space, and H represents the output result of the feature extraction and classification network in the HSV color space.
[0043] Before extracting features using the feature extraction classification network of RGB color space and the feature extraction classification network of HSV color space, the feature extraction classification network of RGB color space and the feature extraction classification network of HSV color space are weighted together to form a road cover classification network. The network model needs to be trained. The specific process is as follows:
[0044] Build an image dataset;
[0045] Obtain a road covering image, perform enhancement processing on the data and then remove dirty data to construct an image data set; the enhancement processing includes rotation processing, flip processing and translation processing; the image data set includes a training set, a validation set and a test set. In this embodiment, the training set, the validation set and the test set are divided according to a ratio of 8:1:1.
[0046] Model training and validation:
[0047] Specifically, the model was trained using CrossEntropy Loss until convergence; the training set, validation set, and test set were divided into 8:1:1 ratios, the initial learning rate was set to 0.0001, and it was decayed to 0.9 of the first 10 rounds after each training round, and iterated 200 times. The road cover classification network was trained. During the training, the road cover classification accuracy was supervised in real time through the validation set.
[0048] Test the model;
[0049] After the model is trained and verified, the images in the test set are input into the road cover classification network model, and the road cover classification of the model is tested and quantitatively evaluated using the accuracy and precision evaluation indicators.
Claims
1. An image classification method based on a color image road cover classification network model, characterized in that: Here are the steps: The road surface covering image in RGB color space is input into the feature extraction and classification network in RGB color space improved based on ResNet network, so as to extract the features of edge texture of color image and classify the road surface covering; The road covering image in RGB color space is converted to HSV color space, the H component is extracted and scaled to the range of 0 to 255, and then counted into a one-dimensional signal in the form of a histogram; The H component is input into the feature extraction and classification network based on the HSV color space improved by VIT to extract the features of the illumination information in the color image and classify the road coverings; The output results of the two feature extraction and classification networks are weighted added to obtain the pavement cover classification result.
2. The image classification method based on the color image road covering classification network model according to claim 1 is characterized in that: The feature extraction classification network of the RGB color space includes four groups of channel attention residual modules, the number of channel attention residual modules in each group is 3, 4, 6, and 3 respectively, and the channel attention residual module is composed of a channel attention mechanism inserted into the residual module: The residual module consists of three types of convolutional layers, which are composed of 1×1 convolutional layer, 3×3 convolutional layer, and 1×1 convolutional layer stacked in sequence, and then skipped from the side to extract deep features of the image; Channel attention consists of a convolutional layer and a pooling layer for extracting channel weights. It consists of two 1×1 convolutional layers and an adaptive pooling layer, which are inserted after the 3×3 convolutional layer in the residual module. At the same time, an adaptive pooling layer is added to the skip connection of the residual module to extract inter-channel features of the image. Finally, two fully connected layers are added after the four groups of channel attention residual modules. The neurons of the fully connected layers are 1000 and class-numbers respectively, and the output size is B×1×class-numbers, where class-numbers is the number of categories of road coverings.
3. The image classification method based on the color image road cover classification network model according to claim 1 is characterized in that: The feature extraction classification network of the HSV color space specifically includes: a classification vector module, a position encoding module, and an encoder module. The input data is evenly divided into 32 parts and input into the classification vector module. The classification attribute is added by using the classification vector module. Through the concat operation, the size of the learnable classification vector is added to be 1; the data output by the classification vector module uses the position encoding module to learn the input position information; the feature map output by the position encoding module is converted by the fully connected layer of the encoder module, and the global vision is learned through the multi-head attention mechanism; Through the multi-layer perceptron, the feature extraction results of the HSV color space are output.
4. The image classification method based on the color image road covering classification network model according to claim 3 is characterized in that: The specific expression of the fully connected layer conversion is: Q, K, V = liner(x) Where Q, K, V are the query feature vector, key feature vector and value feature vector after transformation by the fully connected layer, and liner is the fully connected layer; The relationship of learning the global vision through the multi-head attention mechanism is as follows: Where, d k is the dimension of vector Q, K, V, K T is the transpose of K.
5. The image classification method based on the color image road covering classification network model according to claim 1 is characterized in that: The expression of the color image classification network model is as follows: Cls=weight r ×R(x)+weight v ×H(h) Where x represents the RGB color space image, h represents the H component in the HSV color space, R represents the output result of the feature extraction and classification network in the RGB color space, and H represents the output result of the feature extraction and classification network in the HSV color space.
