Asphalt mixture image classification method and system based on convolutional neural network
By employing a convolutional neural network method with multi-scale feature fusion and multi-head attention mechanism, the problems of insufficient feature adaptability and insufficient attention to multi-dimensional features in existing technologies are solved, achieving efficient and accurate classification of asphalt mixture images and meeting the needs of engineering quality control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 唐山市公路建设管理中心
- Filing Date
- 2025-08-26
- Publication Date
- 2026-04-21
AI Technical Summary
In the current technology for asphalt mixture image classification, the feature fusion of traditional convolutional neural networks and YOLO models often adopts a fixed-level stitching method, which results in weak adaptability to the features of different types of mixtures. Furthermore, the attention mechanism is difficult to focus on multiple key feature dimensions simultaneously, affecting the accuracy of the classification results.
A convolutional neural network-based approach is adopted, which dynamically adjusts the feature fusion weights through a multi-scale feature fusion strategy and a multi-head attention mechanism. Combining the characteristics of asphalt mixtures such as particle distribution density and morphological differences, the multi-head attention mechanism is embedded to strengthen key feature regions, suppress redundant features, and achieve efficient feature fusion and classification.
It significantly improves the efficiency and accuracy of asphalt mixture image classification, meets the engineering requirements for fine classification, provides more reliable quality control support, avoids feature redundancy or loss of key features, and enhances the attention and suppression effect on multi-dimensional key features.
Smart Images

Figure CN121074491B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of asphalt mixture image classification, and more particularly to an asphalt mixture image classification method and system based on convolutional neural networks. Background Technology
[0002] In highway construction and maintenance, asphalt mixtures, as the core road building material, directly determine the structural strength and service life of the road through their type, particle size distribution, and asphalt content. Accurate classification is a crucial aspect of quality control. Traditional classification methods rely on manual visual observation and physical performance testing of mixture samples. This not only requires long hours of operation by professionals but also suffers from inconsistent classification results due to differences in personnel experience, failing to meet the demands of rapid testing of large numbers of samples on-site. With the penetration of deep learning and computer vision technologies into industrial inspection, image-based automated classification methods have become a breakthrough. By analyzing particle morphology, gap characteristics, and asphalt film coverage in asphalt mixture images, the classification process can be made more efficient and standardized, providing technical support for quality control in road engineering.
[0003] Currently, existing technologies are exploring various directions for asphalt mixture image classification: some schemes use convolutional neural networks to extract detailed features such as edges and textures, as well as deep semantic features in images through the synergistic effect of convolutional layers and pooling layers; some technologies introduce YOLO series models, using feature pyramid structures to fuse features at different levels, improving the ability to recognize particles of different sizes and achieving target detection and preliminary classification; at the same time, attention mechanisms have also been applied to this field, strengthening the features of key regions in the image that are relevant to classification and reducing interference from irrelevant information. These technologies provide diverse technical paths for asphalt mixture image classification and promote the automation of the classification process.
[0004] Existing technologies have two significant shortcomings: First, traditional convolutional neural networks and YOLO models often use a fixed-level stitching method for feature fusion, failing to dynamically adjust the fusion weights based on specific features such as particle distribution density and morphological differences in asphalt mixture images. This results in weak adaptability of the model to features of different types of mixtures, making it prone to key features being masked by redundant information or important details being lost. Second, the attention mechanisms in existing solutions are mostly single-head structures, making it difficult to simultaneously focus on multiple key feature dimensions such as particle gaps and asphalt film coverage in asphalt mixture images. The suppression effect on redundant features such as background noise is limited, ultimately affecting the accuracy of classification results and failing to meet the requirements of engineering for fine classification of mixtures. Summary of the Invention
[0005] To overcome the shortcomings and deficiencies of existing technologies, this invention provides an image classification method and system for asphalt mixtures based on convolutional neural networks.
[0006] The technical solution adopted in this invention is an asphalt mixture image classification method based on convolutional neural networks, comprising the following steps:
[0007] Step S1: Collect asphalt mixture sample images. Input the sample images into a preset image acquisition module to perform image data acquisition operations and obtain raw image data including asphalt mixture particle morphology, particle distribution density, particle gap characteristics, and asphalt film coverage status.
[0008] Step S2: Input the original image data into a feature extraction network constructed based on a convolutional neural network. Perform multi-scale feature mapping operation on the original image data through the convolutional layer in the feature extraction network. Use the convolutional kernel to perform sliding window calculation on the original image data to generate an initial feature map. Then, use the pooling layer to downsample the initial feature map to retain the calibration feature information and reduce the feature dimension, thereby obtaining the primary feature set of the asphalt mixture image.
[0009] Step S3: Input the primary feature set into the feature fusion module of the improved YOLOv5 model. The feature fusion module adopts a multi-scale feature fusion strategy, performs channel dimension splicing and spatial dimension alignment operations on primary features at different levels, and fuses the shallow detail features and deep semantic features in the primary feature set through the feature pyramid structure to generate a fused feature set.
[0010] Step S4: Embed a multi-head attention mechanism module in the improved YOLOv5 model, input the fused feature set into the multi-head attention mechanism module, calculate the weight allocation of different feature channels in the fused feature set through multiple parallel attention heads, enhance the attention of the classification-related calibration feature regions in the asphalt mixture image, suppress irrelevant redundant features, and output the enhanced feature set.
[0011] Step S5: Input the enhanced feature set into the detection head module of the improved YOLOv5 model. The detection head module performs dimensionality transformation on the enhanced feature set through a fully connected layer, maps the enhanced feature set to a preset asphalt mixture classification category space, and calculates the category probability of the mapped feature vector through a classifier to obtain the category probability distribution corresponding to the asphalt mixture image.
[0012] Step S6: Determine the classification result of the asphalt mixture image based on the category probability distribution. The classification result includes the asphalt mixture type, particle size distribution grade, and asphalt content grade, thus completing the asphalt mixture image classification operation.
[0013] Furthermore, in the feature fusion module of step S3, a feature fusion weight calculation model is used to dynamically adjust the fusion weights of primary features at different levels. The formula for the feature fusion weight calculation model is as follows: Among them, W i,j Let F represent the fusion weights of the i-th level primary features and the j-th level primary features, where α and β are the contribution coefficients of the convolutional features and the feature similarity, respectively, and both range from [0.1, 0.8]. i F j ) represents the initial feature F of the i-th level. i With the primary feature F of level j j Feature association values obtained by performing convolution operations; Sim(F i F j ) represents F i With F j The feature similarity is calculated using cosine similarity; n represents the total number of primary feature levels participating in the fusion.
[0014] Furthermore, in the multi-head attention mechanism module of step S4, a multi-head attention weight calculation model is used to assign weights to the output features of each attention head. The formula for the multi-head attention weight calculation model is as follows: Among them, A m d represents the output feature of the m-th attention head, where m ranges from [1, M] and M is the total number of attention heads, ranging from 4 to 8; k This represents the dimension of the query vector and the key vector, with values ranging from 64 to 256; Q m K m V m Let represent the query matrix, key matrix, and value matrix of the m-th attention head, respectively, obtained from the fused feature set through linear transformation; σ represents the discrete coefficient of asphalt mixture characteristics, with a value range of [0.05, 0.2]; D m γ represents the feature distance matrix corresponding to the m-th attention head, calculated using Euclidean distance; γ represents the smoothing coefficient, with a value of 0.01.
[0015] Furthermore, in the detection head module of step S5, the initial class probability is optimized using a class probability correction model, and the formula for the class probability correction model is: Among them, P c P represents the corrected probability of class c asphalt mixture, where c ranges from [1, C] and C is the total number of asphalt mixture classification categories, ranging from 3 to 8; c0 G represents the initial class probability; λ represents the feature contribution correction coefficient, with a value range of [0.02, 0.1]; cThe calibration feature matching degree corresponding to the c-th type of asphalt mixture is obtained by calculating the feature vector related to the c-th type in the enhanced feature set.
[0016] Furthermore, in the feature extraction network of step S2, a dynamic kernel size adjustment model is used to determine the kernel size of the convolutional layer. The formula for the dynamic kernel size adjustment model is as follows: Among them, S conv represents the kernel size, with values of 3, 5, 7, or 9; Size(I) represents the pixel size of the original image data; ρ represents the average proportion coefficient of asphalt mixture particles, with a value range of [0.3, 0.7]; δ represents the image feature complexity coefficient, calculated from the gray-level variance of the original image data, with a value range of [0.2, 0.9]. This indicates the floor function.
[0017] Furthermore, in the feature pyramid structure of step S3, the number of levels in the feature pyramid is determined using a feature pyramid level adjustment model. The formula for the feature pyramid level adjustment model is: Among them, L pyramid Res(I) represents the number of levels in the feature pyramid, ranging from 3 to 5; Res(I) represents the resolution of the original image data; Res(min) represents the preset resolution of the minimum feature map, ranging from 16×16 to 64×64 pixels; ε represents the resolution compression coefficient, ranging from [0.4, 0.6]. This indicates the rounding up operation.
[0018] Furthermore, step S3 includes the following sub-steps:
[0019] S31: Perform hierarchical division on the primary feature set obtained in step S2. Based on the feature dimension and semantic information of the primary feature set, divide the primary feature set into shallow feature subset, medium feature subset and deep feature subset. The shallow feature subset corresponds to the edge and texture detail features of the original image data, the medium feature subset corresponds to the local morphological features of asphalt mixture particles, and the deep feature subset corresponds to the overall structural features of asphalt mixture.
[0020] S32: Construct a feature pyramid structure, which includes a top-down feature transfer path and a bottom-up feature enhancement path. The top-down path upsamples the deep feature subset to the same spatial dimension as the middle and shallow feature subsets through upsampling operations. The bottom-up path enhances the feature representation capability of the shallow feature subset through convolution operations and then transfers it to the middle and deep feature subsets.
[0021] S33: Perform channel splicing operation on feature subsets of different levels, stack the shallow feature subsets, middle feature subsets and deep feature subsets that have been aligned in spatial dimension in channel dimension to form an initial fused feature matrix, and then compress the initial fused feature matrix in channel dimension through a 1×1 convolutional layer to reduce feature redundancy.
[0022] S34: Perform feature optimization processing on the compressed initial fusion feature matrix. Use batch normalization to standardize the eigenvalues of the initial fusion feature matrix to eliminate the numerical differences between features at different levels. Then, use an activation function to perform a nonlinear transformation on the standardized feature matrix to enhance the nonlinear expressive power of the features and obtain the fusion feature set.
[0023] Furthermore, step S4 includes the following sub-steps:
[0024] S41: Perform linear transformation on the fused feature set obtained in step S3. The fused feature set is mapped to a query matrix Q, a key matrix K and a value matrix V through three independent fully connected layers. The query matrix Q is used to capture the features of interest in the fused feature set, the key matrix K is used to describe the attribute information of each feature in the fused feature set, and the value matrix V is used to store the specific feature content in the fused feature set.
[0025] S42: Construct multiple parallel attention heads, each of which processes the query matrix Q, key matrix K, and value matrix V using different linear transformation parameters to obtain the query submatrix Q corresponding to each attention head. m Key matrix K m And value submatrix V m , where m is the attention head number, and its value ranges from [1, M];
[0026] S43: Perform attention calculation for each attention head and calculate the query submatrix Q. m With key matrix K m The similarity between the transpose matrices is normalized using the Softmax function to obtain the attention weight matrix. Then, the attention weight matrix is compared with the submatrix V. m Perform matrix multiplication to obtain the output feature A of each attention head. m ;
[0027] S44: Fuse the output features of all attention heads, and combine the output features A of multiple attention heads. m The feature matrix is concatenated along the channel dimension, and the dimensions of the concatenated feature matrix are adjusted by a fully connected layer to make the adjusted feature dimensions consistent with the feature dimensions of the fused feature set, thus obtaining the enhanced feature set.
[0028] Furthermore, step S5 includes the following sub-steps:
[0029] S51: Perform dimensional transformation on the enhanced feature set obtained in step S4. Map the enhanced feature set from the high-dimensional feature space to the low-dimensional feature space through a fully connected layer to obtain the feature vector. The dimension of the low-dimensional feature space is consistent with the total number of asphalt mixture classification categories.
[0030] S52: Perform preliminary calculation of category probabilities on the mapped feature vector. Use the Softmax function to process each element in the feature vector and convert the elements in the feature vector into probability values between [0, 1]. Each probability value corresponds to the initial probability of an asphalt mixture category, thus obtaining the initial category probability distribution.
[0031] S53: Correct the initial category probability distribution by adjusting the initial probability based on the matching degree of the calibration features of the asphalt mixture image, enhancing the probability value of categories with high matching degree of calibration features, and suppressing the probability value of categories with low matching degree of calibration features, thus obtaining the corrected category probability distribution.
[0032] S54: Verify the validity of the corrected category probability distribution, and determine whether the maximum probability value in the probability distribution is greater than the preset probability threshold. If the maximum probability value is greater than the preset probability threshold, then determine that the category corresponding to the maximum probability value is the preliminary classification result of the asphalt mixture image; if the maximum probability value is less than or equal to the preset probability threshold, then return to step S4 to re-perform attention enhancement processing.
[0033] An asphalt mixture image classification system based on convolutional neural networks, comprising:
[0034] The asphalt mixture image multi-dimensional data acquisition unit is used to acquire raw image data including asphalt mixture particle morphology, particle distribution density, particle gap characteristics and asphalt film coverage state. The output end of this unit is connected to the input end of the convolutional neural network feature extraction processing unit.
[0035] A convolutional neural network feature extraction processing unit is used to perform multi-scale feature mapping and downsampling processing on the original image data to generate a primary feature set. The output of this unit is connected to the input of the improved YOLOv5 model feature fusion operation unit.
[0036] An improved YOLOv5 model feature fusion operation unit is used to perform multi-scale feature fusion processing on the primary feature set to generate a fused feature set. The output of this unit is connected to the input of the multi-head attention mechanism feature enhancement unit.
[0037] A multi-head attention mechanism feature enhancement unit is used to perform attention weight allocation and feature enhancement processing on the fused feature set to generate an enhanced feature set. The output of this unit is connected to the input of the improved YOLOv5 model detection head classification operation unit.
[0038] An improved YOLOv5 model detection head classification operation unit is used to calculate the category probability of the enhanced feature set and generate the category probability distribution. The output of this unit is connected to the input of the asphalt mixture classification result determination unit.
[0039] The asphalt mixture classification result determination unit is used to determine the classification result of the asphalt mixture image based on the category probability distribution. The output of this unit is used to output the classification result including the asphalt mixture type, particle size distribution grade, and asphalt content grade.
[0040] Beneficial Effects: This invention proposes an image classification method and system for asphalt mixtures based on convolutional neural networks. In terms of classification efficiency and accuracy, it collects multi-dimensional raw image data of asphalt mixtures, extracts multi-scale primary features using a convolutional neural network, and then employs a multi-scale feature fusion strategy using the feature fusion module of an improved YOLOv5 model to fuse shallow details and deep semantic features. Simultaneously, a multi-head attention mechanism is embedded to strengthen key feature regions and suppress redundant features. Finally, the detection head module calculates the class probability and determines the classification result, significantly improving classification efficiency and accuracy. Batch classification can be achieved without manual intervention, solving the problem of high latency associated with traditional manual classification. Addressing the issues of time-consuming, labor-intensive, and highly dependent on experience, and considering the insufficient adaptability of existing feature fusion technologies, this system dynamically processes features at different levels within the feature fusion module. It adjusts the fusion method based on features such as asphalt mixture particle morphology and density, avoiding feature redundancy or loss of key features caused by fixed-level splicing. Furthermore, addressing the limitations of existing single-head attention mechanisms, a multi-head attention mechanism can simultaneously and effectively focus on multiple key feature dimensions such as particle spacing and asphalt film coverage, enhancing the suppression of irrelevant redundant features, improving classification accuracy, meeting the needs of fine asphalt mixture classification in engineering projects, and providing more reliable technical support for road engineering quality control. Attached Figure Description
[0041] Figure 1 This is a flowchart of the method steps of the present invention;
[0042] Figure 2 This is a diagram showing the system unit composition of the present invention. Detailed Implementation
[0043] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0044] like Figure 1 As shown, the asphalt mixture image classification method based on convolutional neural networks includes the following steps:
[0045] Step S1: Collect asphalt mixture sample images. Input the sample images into a preset image acquisition module to perform image data acquisition operations and obtain raw image data including asphalt mixture particle morphology, particle distribution density, particle gap characteristics, and asphalt film coverage status.
[0046] Specifically, step S1, as the initial data input stage of the entire asphalt mixture image classification method, plays a crucial role in acquiring high-quality, multi-dimensional raw image data to provide a reliable data foundation for subsequent feature extraction and classification operations. This step directly determines the input quality of all subsequent technical stages. If the raw image data fails to fully contain the key feature information of the asphalt mixture, it will lead to problems such as incomplete feature extraction and classification deviations. In highway engineering scenarios, the particle morphology, particle distribution density, particle gap characteristics, and asphalt film coverage of the asphalt mixture are the core visual information for distinguishing different types of mixtures and determining their quality levels. Therefore, step S1 needs to specifically collect image data containing this information to avoid affecting classification accuracy due to missing or distorted data. At the same time, this step must ensure that the collected image data maintains consistency in resolution, lighting conditions, and shooting angle to reduce the interference of external environmental factors on subsequent classification results, laying the foundation for the stability and reliability of the entire classification process.
[0047] The specific implementation process of step S1 needs to be completed through a preset image acquisition module, which includes a high-definition industrial camera, a light source control system, and an image storage unit. The resolution of the high-definition industrial camera is set between 2048×1536 pixels and 4096×3072 pixels. This resolution range can clearly capture the detailed features of asphalt mixture particles, avoiding feature blurring caused by low resolution and preventing excessively high resolution from increasing the data processing load. The camera's focal length is adjusted to 8mm to 16mm to ensure that when the shooting distance is 50cm to 80cm, the coverage area of the asphalt mixture sample in the image reaches 70% to 80% of the image, focusing on the sample itself rather than the background area. The light source control system uses a ring-shaped supplementary light source, with the light intensity adjusted to 800lux to 1200lux, and the light uniformity controlled above 90% to avoid shadows caused by uneven lighting, which would affect the identification of particle gaps and asphalt film coverage. A vertical overhead shooting angle is used during shooting to ensure that the distribution of asphalt mixture particles in the image is consistent with the actual sample, without perspective distortion. After image acquisition is completed, the original image data is saved in a lossless format through the image storage unit. The storage format is TIFF or BMP to avoid the loss of feature information caused by compression. At the same time, metadata such as acquisition time, sample number, and shooting parameters are added to each original image to facilitate subsequent data traceability and process control. The entire acquisition process requires at least three repeated acquisitions for each batch of samples, and clear, noise-free images are taken as the final original image data.
[0048] Step S2: Input the original image data into a feature extraction network constructed based on a convolutional neural network. Perform multi-scale feature mapping operation on the original image data through the convolutional layer in the feature extraction network. Use the convolutional kernel to perform sliding window calculation on the original image data to generate an initial feature map. Then, use the pooling layer to downsample the initial feature map to retain the calibration feature information and reduce the feature dimension, thereby obtaining the primary feature set of the asphalt mixture image.
[0049] Specifically, step S2 is the core step of feature extraction based on convolutional neural networks. Its main purpose is to separate and extract feature information related to asphalt mixture classification from the original image data, converting the original image data into machine-recognizable feature vectors, providing a basic feature set for subsequent feature fusion and attention enhancement. Convolutional neural networks have powerful multi-scale feature extraction capabilities. Through the synergistic effect of convolutional layers and pooling layers, they can gradually extract shallow detail features such as edges and textures, as well as deep semantic features such as particle combination morphology and overall structure from the original image. These features are the key basis for distinguishing different types of asphalt mixtures. In this step, it is necessary to reasonably design the hierarchical structure and parameters of the convolutional neural network to ensure that the extracted primary feature set contains sufficient detail information, and that the feature dimensionality can be reduced through downsampling to reduce the complexity of subsequent calculations. This avoids problems such as model overfitting or low computational efficiency caused by excessively high feature dimensionality. At the same time, it is necessary to preserve the integrity of the features to prevent the loss of key classification features during the extraction process.
[0050] The specific implementation process of step S2 requires constructing a convolutional neural network feature extraction network containing an input layer, convolutional layers, pooling layers, and activation layers. The input layer receives the original image data obtained in step S1 and converts the pixel values of the image into a standardized numerical matrix with the same matrix dimension as the original image resolution. Three to five convolutional layers are set, with the number of convolutional kernels in each layer gradually increasing from 64 to 256. The kernel size is set to 3×3, 5×5, or 7×7 depending on the original image resolution and feature extraction requirements. Shallow convolutional layers use smaller kernels (3×3) to extract detailed features such as the edges and textures of asphalt mixture particles, while deeper convolutional layers use larger kernels (5×5 or 7×7) to extract semantic features such as particle distribution and overall structure. Each convolutional layer is followed by a batch normalization layer to standardize the feature values output by the convolution, controlling the mean of the feature values to be near 0 and the variance to be near 1, thereby accelerating the network training convergence speed and avoiding the gradient vanishing problem. After convolution, the initial feature map is downsampled using pooling layers. Max pooling is employed with a 2×2 kernel size and a stride of 2. Each pooling operation reduces the spatial dimension of the feature map to half its original size, preserving key feature information while reducing the feature dimension from thousands to hundreds, generating a primary feature set with dimensions ranging from 256 to 1024. Each pooling layer is followed by a ReLU activation function to perform a non-linear transformation on the pooling output feature values, enhancing the network's ability to express complex features and filtering out invalid feature values. Throughout the feature extraction process, the network's training learning rate is set to 0.001 to 0.01, and a stochastic gradient descent optimization algorithm is used. Through iterative training with multiple batches of original image data, the network gradually masters the extraction rules of asphalt mixture features, ensuring that the output primary feature set accurately reflects the key classification information in the original image.
[0051] Step S3: Input the primary feature set into the feature fusion module of the improved YOLOv5 model. The feature fusion module adopts a multi-scale feature fusion strategy, performs channel dimension splicing and spatial dimension alignment operations on primary features at different levels, and fuses the shallow detail features and deep semantic features in the primary feature set through the feature pyramid structure to generate a fused feature set.
[0052] Specifically, step S3 is a crucial step in feature fusion based on the improved YOLOv5 model. Its core function is to integrate the primary features extracted in step S2 from different levels, addressing the insufficient expressive power of single-level features, and generating a fused feature set containing both shallow details and deep semantics. This provides more comprehensive feature support for subsequent attention enhancement and classification operations. In asphalt mixture image classification, shallow features (such as particle edges and local textures) can be used to identify morphological differences in fine particles, while deep features (such as overall particle distribution and structural type) can be used to determine the overall category of the mixture. Relying solely on single-level features can easily lead to classification bias. For example, using only shallow features may fail to distinguish mixtures with similar particle gradations but different overall structures, while using only deep features may ignore the influence of fine particle morphology on classification. Therefore, step S3 needs to combine the advantages of different levels of features through a feature fusion strategy to achieve complementary feature information, improve the adaptability of the feature set to asphalt mixture classification, and optimize the multi-scale expression of features through a feature pyramid structure to ensure effective capture of features of particles of different sizes.
[0053] The specific implementation process of step S3 requires building a feature fusion module in the improved YOLOv5 model. This module includes a feature pyramid structure and a feature concatenation unit. First, the primary feature set output from step S2 is divided into shallow feature subsets (corresponding to the outputs of the first two convolutional layers of the convolutional neural network), mid-level feature subsets (corresponding to the outputs of the middle two convolutional layers), and deep feature subsets (corresponding to the output of the last convolutional layer). The dimensions of the shallow feature subsets range from 512×512×64 to 1024×1024×128, the mid-level feature subsets range from 256×256×128 to 512×512×256, and the deep feature subsets range from 128×128×256 to 256×256×512. The feature pyramid structure employs a bidirectional fusion path combining top-down and bottom-up approaches. In the top-down approach, deep feature subsets undergo bilinear interpolation upsampling to gradually increase their spatial dimensions to match those of the mid- and shallow feature subsets. The upsampling factors are 2x (to the mid-level dimension) and 4x (to the shallow-level dimension), respectively. During the upsampling process, a 1×1 convolutional layer is used to adjust the number of channels to match the corresponding level of feature subsets, avoiding channel dimension mismatch. In the bottom-up approach, shallow feature subsets are enhanced with 3×3 convolutional layers to improve their feature representation capabilities. Then, they are passed to the mid- and deep feature subsets in a spatial dimension alignment manner and superimposed with the upsampled deep features. The feature stitching unit stitches the aligned feature subsets of different levels along the channel dimension. For example, it stitches the shallow feature subset (512×512×128), the upsampled middle feature subset (512×512×128), and the upsampled deep feature subset (512×512×128) into an initial fusion feature matrix of 512×512×384. Then, it compresses the number of channels to 256 through a 1×1 convolutional layer to reduce feature redundancy. Finally, it processes the feature set with dimensions of 256×256×256 to 512×512×256 through batch normalization and ReLU activation function. The operation step size of the entire feature fusion process is controlled at 1 to ensure that the spatial location information of the features is not lost. The fused feature set needs to pass feature consistency verification to ensure that the semantic correlation of features at different levels meets the requirements of asphalt mixture classification.
[0054] Step S4: Embed a multi-head attention mechanism module in the improved YOLOv5 model, input the fused feature set into the multi-head attention mechanism module, calculate the weight allocation of different feature channels in the fused feature set through multiple parallel attention heads, enhance the attention of the classification-related calibration feature regions in the asphalt mixture image, suppress irrelevant redundant features, and output the enhanced feature set.
[0055] Specifically, step S4 is the core step in embedding a multi-head attention mechanism for feature enhancement. Its main purpose is to select and enhance the feature regions that play a key role in asphalt mixture classification from the fused feature set generated in step S3, while suppressing irrelevant and redundant features (such as background noise and image edge interference), improving the relevance and effectiveness of the feature set, and providing a high-quality enhanced feature set for subsequent classification operations. In asphalt mixture images, different regions contribute significantly to classification. For example, the features of densely populated areas and areas with uniform asphalt film coverage are crucial for determining the mixture type and asphalt content grade, while background areas and areas affected by light and shadow interference during image capture are redundant information. If these information are not distinguished, the classification model will focus on irrelevant features, reducing classification accuracy. The multi-head attention mechanism, through the synergistic effect of multiple parallel attention heads, can simultaneously assign weights to the fused features from different feature dimensions (such as particle morphology, distribution density, and gap features), achieving synchronous enhancement of multi-dimensional key features. This solves the problem that traditional single-head attention mechanisms cannot comprehensively focus on multiple key features, further improving the accuracy of feature processing.
[0056] The specific implementation process of step S4 requires building a multi-head attention mechanism module in the improved YOLOv5 model. This module includes a linear transformation unit, a multi-attention head operation unit, and a feature fusion unit. First, the linear transformation unit receives the fused feature set (dimensions ranging from 256×256×256 to 512×512×256) output from step S3. It then maps the fused feature set into a query matrix, a key matrix, and a value matrix through three independent fully connected layers. The dimensions of the three matrices are consistent, all being (feature space size × feature space size) × 256. The query matrix is used to capture the features of interest in the fused features, the key matrix is used to describe the attribute information of the features, and the value matrix is used to store the specific content of the features. The weight parameters of the linear transformation are iteratively optimized through a pre-trained dataset to ensure that the mapped matrices accurately reflect the key information of the fused features. The multi-attention head processing unit consists of 4 to 8 parallel attention heads. Each attention head uses different linear transformation parameters to perform a secondary mapping on the query, key, and value matrices, resulting in a query submatrix, key submatrix, and value submatrix corresponding to each attention head. The dimensions of the submatrix range from (feature space size × feature space size) × 64 to (feature space size × feature space size) × 128. Each attention head calculates the similarity between the transpose of the query submatrix and the key matrix (using dot product similarity calculation) to obtain a similarity matrix. The similarity matrix is then normalized using the Softmax function, converting the similarity values into attention weights between 0 and 1. Higher weight values indicate a greater contribution of the corresponding feature region to the classification. Subsequently, the attention weight matrix and the value submatrix are multiplied to obtain the output features of each attention head, with the output feature dimensions consistent with the value submatrix. The feature fusion unit concatenates the output features of all attention heads according to the channel dimension. For example, 8 attention heads (each with an output dimension of (256×256)×64) are concatenated into a feature matrix of (256×256)×512. Then, a fully connected layer is used to adjust the number of channels to be consistent with the fused feature set (256), resulting in an enhanced feature set with dimensions ranging from 256×256×256 to 512×512×256. Throughout the process, the calculation of attention weights needs to take into account the special characteristics of asphalt mixtures. Higher weights are assigned to feature regions corresponding to particle morphology, distribution density, gap features, and asphalt film coverage, while lower weights are assigned to background regions (usually controlled below 0.1). After the enhanced feature set is generated, it needs to be tested for feature difference to ensure that the enhancement effect of key feature regions meets the preset standard (the enhanced feature value is more than 30% higher than the original fused feature value).
[0057] Step S5: Input the enhanced feature set into the detection head module of the improved YOLOv5 model. The detection head module performs dimensionality transformation on the enhanced feature set through a fully connected layer, maps the enhanced feature set to a preset asphalt mixture classification category space, and calculates the category probability of the mapped feature vector through a classifier to obtain the category probability distribution corresponding to the asphalt mixture image.
[0058] Specifically, step S5 is the core step of calculating category probabilities based on the improved YOLOv5 model detection head module. Its core function is to convert the enhanced feature set generated in step S4 into the category probability distribution required for asphalt mixture classification, providing a quantitative basis for subsequent classification results. This step requires dimensional transformation of the fully connected layer and probability calculation of the classifier to map the high-dimensional enhanced features to the preset classification category space, realizing the transformation from feature information to category probability. In the asphalt mixture classification scenario, the preset classification category space includes multiple dimensions such as mixture type (e.g., AC type, SMA type, OGFC type), particle size distribution grade (e.g., coarse-grained, medium-grained, fine-grained), and asphalt content grade (e.g., high content, medium content, low content), each dimension containing 3 to 8 specific categories. Therefore, step S5 must ensure that the probability calculation covers all preset categories, and that the probability value of each category accurately reflects the degree of matching between the enhanced features and the category. At the same time, this step needs to use probability calculation optimization strategies to avoid probability distribution imbalance caused by feature bias, ensuring the rationality and reliability of the probability values, and providing support for the accurate judgment of subsequent classification results.
[0059] The specific implementation process of step S5 requires building a detection head module in the improved YOLOv5 model. This module includes a dimension transformation unit, a category probability calculation unit, and a probability correction unit. First, the dimension transformation unit receives the enhanced feature set (dimensions from 256×256×256 to 512×512×256) output from step S4. It then gradually maps the high-dimensional features to the low-dimensional category space through 2 to 3 fully connected layers. The first fully connected layer compresses the feature dimension from 256×256×256 to 4096, the second fully connected layer compresses it to 1024, and the third fully connected layer (if set) compresses it to the same as the total number of categories (usually 9 to 24, corresponding to 3 dimensions × 3 to 8 categories), resulting in a feature vector with dimension (total number of categories). Each vector element corresponds to the feature mapping value of a category. The category probability calculation unit uses the Softmax function to process the feature vector, converting the mapping value of each element into a probability value between 0 and 1. The sum of the probability values of all categories is 1, resulting in the initial category probability distribution. The temperature parameter of the Softmax function is set to 0.8 to 1.2. A temperature parameter less than 1 can enhance the discriminative power of the probability distribution, while a temperature parameter greater than 1 can reduce the discriminative power. The temperature parameter is adjusted according to the degree of difference between the asphalt mixture classification categories. A smaller temperature parameter (0.8 to 1.0) is used when the difference between categories is small, and a larger temperature parameter (1.0 to 1.2) is used when the difference between categories is large. The probability correction unit optimizes the initial probability distribution based on the matching degree of key features of asphalt mixtures. It calculates the matching degree between the enhanced feature set and the key features corresponding to each category (e.g., continuous gradation features of AC type mixtures, skeleton compaction features of SMA type mixtures). Categories with high matching degrees are increased (by 10% to 20%), while categories with low matching degrees are decreased (by 5% to 15%). The corrected probability values need to be re-normalized to ensure the sum is still 1. Simultaneously, a probability threshold is set (usually 0.5 to 0.7). If the maximum probability value in the corrected probability distribution is greater than the threshold, the probability distribution is directly output; otherwise, it returns to step S4 for re-attention enhancement processing to ensure the output category probability distribution has sufficient reliability. The entire probability calculation process records the probability value and key feature matching degree for each category to facilitate the traceability and verification of subsequent classification results.
[0060] Step S6: Determine the classification result of the asphalt mixture image based on the category probability distribution. The classification result includes the asphalt mixture type, particle size distribution grade, and asphalt content grade, thus completing the asphalt mixture image classification operation.
[0061] Specifically, step S6, as the final step in the asphalt mixture image classification method, bears the core function of transforming abstract probability distributions into concrete classification results and providing direct decision-making basis for engineering applications. Its accuracy and completeness directly determine the practical value of the entire classification method. In highway engineering quality control scenarios, engineers need to quickly determine whether asphalt mixtures meet construction design standards based on the classification results. Therefore, step S6 not only needs to select the category combination with the optimal probability but also needs to verify the results through multi-dimensional validation to ensure reliability and avoid misjudgments caused by probability bias in a single dimension. This step needs to cover three core evaluation dimensions: mixture type, particle size distribution grade, and asphalt content grade. The classification results for each dimension correspond to clear engineering quality indicators. For example, the mixture type determines the adaptability of the pavement structure, the particle size distribution grade affects the pavement's load-bearing capacity, and the asphalt content grade is related to the pavement's durability. Simultaneously, step S6 needs to establish a standardized result output system, presenting the classification results in a standardized format to ensure that engineers can directly read key information without additional processing, thereby meeting the needs of rapid application of classification results in road engineering sites and achieving effective connection from technical calculations to engineering practice.
[0062] The specific implementation process of step S6 includes a classification result screening unit, a result verification unit, and a result output unit. Each unit operates collaboratively according to the process and has clearly defined parameter standards. The classification result screening unit first receives the category probability distribution output from step S5. This distribution needs to cover three preset core dimensions: the mixture type dimension includes 3 to 8 categories (such as AC type, SMA type, OGFC type, etc.); the particle size distribution grade dimension includes 3 to 5 categories (such as extra-coarse, coarse, medium, fine, and extra-fine); and the asphalt content grade dimension includes 3 to 4 categories (such as low content, medium content, high content, and ultra-high content). The screening unit adopts the principle of "independent dimension screening," extracting the category with the highest probability value for each dimension as the preliminary result for that dimension. During the screening process, the difference between the highest and second-highest probability values for each dimension needs to be recorded. The difference data is used for subsequent verification. The results verification unit employs a dual verification standard: the first is probability threshold verification, setting differentiated thresholds for different dimensions. For the mixture type dimension, which has a significant impact on engineering due to category distinctions, the threshold is set to 0.6 to 0.7. For the particle size distribution and asphalt content dimensions, the threshold is set to 0.5 to 0.6. If the maximum probability value for a certain dimension falls below the corresponding threshold, a reclassification process is triggered, returning to step S4 for attention enhancement processing again. The second is probability difference verification, calculating the difference between the maximum and second-highest probability values for each dimension. The difference for the mixture type dimension must be no less than 0.2, and the difference for the particle size distribution and asphalt content dimensions must be no less than 0.15. If the difference does not meet the standard, the process returns to the previous optimization step. After successful verification, the results output unit generates a classification report in a standardized format. The report includes the main classification results (final categories for the three dimensions), probability values for each dimension (retaining three decimal places), verification results (threshold compliance and difference data), classification timestamp, and sample number. The output format supports both PDF and Excel, facilitating archiving by engineers and subsequent quality traceability. In addition, the output unit needs to be equipped with an abnormal result warning mechanism. If more than 10% of the classification results in a batch of samples trigger the reclassification process, a batch warning message should be automatically generated to prompt the checking of the preceding image acquisition parameters (such as resolution and light intensity) or model parameters (such as the number of attention heads and feature fusion weights) to ensure the stable operation of the entire classification system. The generation time of each classification result should be controlled within 0.5 seconds to meet the needs of rapid batch sample processing in engineering sites. The storage size of a single classification result should be controlled between 10KB and 20KB to avoid occupying too much storage resources.
[0063] Preferably, in the feature fusion module of step S3, a feature fusion weight calculation model is used to dynamically adjust the fusion weights of primary features at different levels. The formula for the feature fusion weight calculation model is: Among them, W i,jLet F represent the fusion weights of the i-th level primary features and the j-th level primary features, where α and β are the contribution coefficients of the convolutional features and the feature similarity, respectively, and both range from [0.1, 0.8]. i F j ) represents the initial feature F of the i-th level. i With the primary feature F of level j j Feature association values obtained by performing convolution operations; Sim(F i F j ) represents F i With F j The feature similarity is calculated using cosine similarity; n represents the total number of primary feature levels participating in the fusion.
[0064] Specifically, based on the feature fusion module in step S3, a feature fusion weight calculation model is introduced to dynamically adjust the fusion weights of primary features at different levels. This solves the problem that traditional fixed-weight fusion methods cannot adapt to the differences in asphalt mixture image features, thus improving the targeting and effectiveness of feature fusion. The implementation of this model requires first clarifying the technical definitions and value ranges of each parameter. The fusion weight is used to quantify the contribution of primary features at different levels during the fusion process, ensuring that levels with a higher proportion of key classification features are assigned higher weights. The convolution feature contribution coefficient and feature similarity contribution coefficient are used as adjustment parameters to control the influence of the feature association value obtained from convolution and feature similarity in weight calculation, respectively. Both are set to a range of 0.1 to 0.8 and can be adjusted according to the complexity of the asphalt mixture image features. When the particle distribution in the image is uniform and the feature differences are small, the convolution feature contribution coefficient is appropriately increased to strengthen feature association; when the particle morphology in the image is diverse and the feature similarity differences are large, the feature similarity contribution coefficient is appropriately increased to highlight feature differences. In the implementation process, the primary features obtained in step S2 are first paired up, and the convolutional correlation value and cosine similarity of each pair of features are calculated. These two values are then multiplied by their corresponding coefficients and summed to obtain the comprehensive contribution value of the feature pair. Subsequently, the comprehensive contribution values of all pairs paired with the target level features are exponentially calculated and then divided by the sum of the exponentially calculated comprehensive contribution values of all paired features to obtain the fusion weight of each pair of features. The weights calculated by this model are dynamically adaptive, adjusting the contribution ratio according to the actual correlation and similarity of features at different levels. This avoids the problem of some key features being weakened due to fixed weights, ensuring that the fused feature set can more comprehensively and accurately reflect the core attributes of asphalt mixtures, providing a better feature foundation for subsequent attention enhancement and classification operations. The entire weight calculation process needs to be completed in the preprocessing stage of the feature fusion module, with the calculation time controlled within 0.3 seconds to avoid affecting the overall classification efficiency. Simultaneously, the calculated weights need to be validated for rationality, ensuring that the sum of the weights of all pairs paired with the same target level features is 1, conforming to the probability distribution law. If weight anomalies occur, the coefficient values are readjusted and the calculation is recalculated.
[0065] Preferably, in the multi-head attention mechanism module of step S4, a multi-head attention weight calculation model is used to assign weights to the output features of each attention head. The formula for the multi-head attention weight calculation model is as follows: Among them, A m d represents the output feature of the m-th attention head, where m ranges from [1, M] and M is the total number of attention heads, ranging from 4 to 8; k This represents the dimension of the query vector and the key vector, with values ranging from 64 to 256; Q m K m V mLet represent the query matrix, key matrix, and value matrix of the m-th attention head, respectively, obtained from the fused feature set through linear transformation; σ represents the discrete coefficient of asphalt mixture characteristics, with a value range of [0.05, 0.2]; D m γ represents the feature distance matrix corresponding to the m-th attention head, calculated using Euclidean distance; γ represents the smoothing coefficient, with a value of 0.01.
[0066] Specifically, in the multi-head attention mechanism module of step S4, a multi-head attention weight calculation model is constructed to achieve precise weight allocation for the output features of each attention head. This overcomes the limitation of traditional single-head attention mechanisms in not being able to simultaneously focus on multiple key features, and improves the ability to capture multiple key information such as particle morphology and gap features in asphalt mixture images. When implementing this model, the technical connotation and value standards of each parameter need to be clearly defined. The total number of attention heads determines the number of feature dimensions that the model can focus on simultaneously, with a value of 4 to 8. Too few attention heads will not be able to cover all key feature dimensions, while too many will increase the computational load. In practical applications, the number of feature dimensions to be focused on is determined according to the asphalt mixture classification. For example, when it is necessary to focus on four types of information simultaneously, namely particle morphology, distribution density, gap features, and asphalt film coverage, the total number of attention heads is set to 4. The dimensions of the query vector and key vector determine the level of detail in the feature description, with a value of 64 to 256. The higher the dimension, the more detailed the feature description, but the greater the computational load. Combining the classification accuracy requirements with computational efficiency, it is usually set to 128. The asphalt mixture feature dispersion coefficient is used to quantify the dispersion of mixture particle features. Its value ranges from 0.05 to 0.2. A smaller value is used when the mixture particles are uniform in size and the features are concentrated, while a larger value is used when the particle size varies greatly and the features are dispersed, to avoid attention weight bias caused by feature dispersion. The feature distance matrix is calculated using Euclidean distance to describe the spatial differences between different feature regions. The smoothing coefficient is set to 0.01 to avoid abnormal weight calculations caused by excessively small feature distances. In the implementation process, the fused feature set obtained in step S3 is first transformed linearly to generate three matrices: query, key, and value. Then, the three matrices are divided into a corresponding number of sub-matrices according to the number of attention heads. For each attention head, the similarity between its query sub-matrix and the transpose of its key sub-matrix is calculated. The similarity is scaled by dividing by the square root of the query vector dimension, then divided by the product of the feature dispersion coefficient and the feature distance matrix plus the sum of the smoothing coefficient. After normalization using the Softmax function, the weight matrix of that attention head is obtained. Finally, the weight matrix is multiplied by the value sub-matrix to obtain the output features of each attention head. This model, through parallel computation of multiple attention heads and differentiated parameter settings, can simultaneously assign weights to key features in multiple dimensions, strengthen feature regions related to classification, suppress redundant information, and output an enhanced feature set that can more accurately reflect the key classification information of asphalt mixtures. The computation process of each attention head is carried out independently, and the overall computation time is controlled within 0.4 seconds to ensure that it does not affect the overall efficiency of the classification process. At the same time, the consistency of the output features of each attention head needs to be checked to ensure that the feature dimensions of different attention heads are consistent, which facilitates subsequent fusion processing.
[0067] Preferably, in the detection head module of step S5, a category probability correction model is used to optimize the initial category probability. The formula for the category probability correction model is: Among them, P c P represents the corrected probability of class c asphalt mixture, where c ranges from [1, C] and C is the total number of asphalt mixture classification categories, ranging from 3 to 8; c0 G represents the initial class probability; λ represents the feature contribution correction coefficient, with a value range of [0.02, 0.1]; c The calibration feature matching degree corresponding to the c-th type of asphalt mixture is obtained by calculating the feature vector related to the c-th type in the enhanced feature set.
[0068] Specifically, in the detection head module of step S5, a category probability correction model is introduced to optimize the initial category probability, which solves the problem of inaccurate probability distribution caused by feature deviation in the initial probability calculation process and improves the reliability of asphalt mixture classification results. The implementation of this model requires clear technical definitions and value ranges for each parameter. The corrected category probability is the direct basis for the final classification result and must accurately reflect the matching degree between the enhanced features and the corresponding category. The total number of asphalt mixture classification categories is set according to actual engineering needs, ranging from 3 to 8, covering specific categories in dimensions such as mixture type, particle size distribution, and asphalt content. The total number of categories must be consistent with the output dimension of the detection head module. The initial category probability is calculated by the Softmax function, reflecting the feature matching situation before correction. The feature contribution correction coefficient is used to adjust the influence of the key feature matching degree on the initial probability, with a value range of 0.02 to 0.1. If the coefficient is too large, it will lead to excessive probability correction, and if the coefficient is too small, it will not play an effective correction role. In practical applications, it should be adjusted according to the degree of difference between classification categories. When the difference between inter-class features is small, the coefficient should be increased appropriately, and when the difference between inter-class features is large, the coefficient should be decreased appropriately. The key feature matching degree is calculated by comparing the degree of agreement between the enhanced feature set and the preset key features of each category, with a value range of 0 to 1. The higher the matching degree, the better the enhanced feature matches the corresponding category. In the implementation process, the enhanced feature set obtained in step S4 is first mapped to generate feature vectors through a fully connected layer, and the initial category probability distribution is calculated using the Softmax function. Then, for each category, preset key features in asphalt mixture classification (such as particle size distribution features corresponding to a specific particle size distribution, and asphalt film thickness features corresponding to a specific asphalt content) are extracted, and the matching degree between the enhanced feature set and these key features is calculated. The initial probability of each category is multiplied by 1 and the product of the feature contribution correction coefficient and the matching degree of the key features of that category is added to obtain the corrected temporary probability value. Finally, the temporary probability values of all categories are divided by the sum of the temporary probability values to obtain the normalized corrected category probability distribution. This model effectively compensates for probability deviations caused by single feature mapping by dynamically correcting the initial probability in conjunction with the key feature matching degree. For example, when the initial probability of a category is high but the key feature matching degree is low, its probability value is reduced through correction to avoid misjudgment; when the initial probability of a category is low but the key feature matching degree is high, its probability value is increased through correction to ensure that key features are given sufficient attention. The entire correction process must be completed during the probability calculation phase of the detection head module, with the calculation time controlled within 0.2 seconds. At the same time, the corrected probability distribution must be verified to ensure that the sum of the probability values of all categories is 1 and that each probability value is between 0 and 1. If any abnormality occurs, the feature contribution correction coefficient must be readjusted and recalculated.
[0069] Preferably, in the feature extraction network of step S2, a dynamic kernel size adjustment model is used to determine the kernel size of the convolutional layer. The formula for the dynamic kernel size adjustment model is: Among them, S conv represents the kernel size, with values of 3, 5, 7, or 9; Size(I) represents the pixel size of the original image data; ρ represents the average proportion coefficient of asphalt mixture particles, with a value range of [0.3, 0.7]; δ represents the image feature complexity coefficient, calculated from the gray-level variance of the original image data, with a value range of [0.2, 0.9]. This indicates the floor function.
[0070] Specifically, in the feature extraction network of step S2, the convolution kernel size of the convolutional layer is determined by dynamically adjusting the convolution kernel size model. This solves the problem that traditional fixed convolution kernel sizes cannot adapt to the image features of different asphalt mixtures, improving the targeting and efficiency of feature extraction. When implementing this model, the technical meaning and value standards of each parameter need to be clearly defined. The convolution kernel size directly determines the range of image features captured by the convolutional layer. Values are odd numbers such as 3, 5, 7, or 9. Smaller convolution kernel sizes (3, 5) are suitable for capturing detailed features such as particle edges and local textures, while larger convolution kernel sizes (7, 9) are suitable for capturing macroscopic features such as the overall shape and distribution patterns of particles. The pixel size of the original image data is determined according to the parameters of the image acquisition module, typically ranging from 2048×1536 pixels to 4096×3072 pixels. The average proportion coefficient of asphalt mixture particles is used to quantify the area occupied by particle regions in the image. The aspect ratio of the image, ranging from 0.3 to 0.7, is calculated by the ratio of the number of pixel particles to the total number of pixels in the image. A high proportion of particles indicates dense features in the image, requiring a reduction in the convolution kernel size to capture details. Conversely, a low proportion of particles requires a larger convolution kernel size to cover more feature areas. The image feature complexity coefficient is calculated using the gray-level variance of the original image data, ranging from 0.2 to 0.9. A large gray-level variance indicates significant differences in brightness and high feature complexity, requiring a larger convolution kernel to integrate features. A small gray-level variance indicates relatively simple image features, allowing for the extraction of details using a smaller convolution kernel. During implementation, the pixel dimensions of the original image data collected in step S1 are first obtained, and the average particle proportion coefficient and feature complexity coefficient of the image are calculated. The pixel dimensions, average particle proportion coefficient, and feature complexity coefficient are multiplied together, the logarithm to base 2 is multiplied by 2, the result is rounded down, and then 1 is added to obtain the calculated convolution kernel size. If the calculated value is not within the preset range of 3, 5, 7, or 9, it is adjusted to the closest preset size according to the principle of proximity; for example, a calculated value of 2 is adjusted to 3, and a calculated value of 10 is adjusted to 9. The convolution kernel size determined by this model can dynamically adapt to the actual features of the original image. For example, for high-resolution, high-particle-proportion, low-complexity asphalt mixture images, a small convolution kernel of 3 or 5 can be determined to accurately extract detailed features such as particle edges and textures; for low-resolution, low-particle-proportion, high-complexity images, a large convolution kernel of 7 or 9 can be determined to comprehensively capture macroscopic features such as particle distribution and overall structure. The computation process of this model needs to be completed during the feature extraction network initialization stage. The kernel size of each convolutional layer needs to be calculated and determined separately to ensure that each convolutional layer can adapt to the feature extraction requirements of the corresponding stage. At the same time, the calculation process and parameter values of the kernel size of each convolutional layer need to be recorded to facilitate subsequent model optimization and problem tracing.
[0071] Preferably, in the feature pyramid structure of step S3, the number of levels of the feature pyramid is determined using a feature pyramid level adjustment model, and the formula for the feature pyramid level adjustment model is: Among them, L pyramid Res(I) represents the number of levels in the feature pyramid, ranging from 3 to 5; Res(I) represents the resolution of the original image data; Res(min) represents the preset resolution of the minimum feature map, ranging from 16×16 to 64×64 pixels; ε represents the resolution compression coefficient, ranging from [0.4, 0.6]. This indicates the rounding up operation.
[0072] Specifically, in the feature pyramid structure of step S3, the number of feature pyramid levels is determined by the feature pyramid level adjustment model. This solves the problem that traditional feature pyramids with a fixed number of levels cannot adapt to asphalt mixture images of different resolutions, and ensures that all key feature levels from shallow to deep can be effectively covered during feature fusion. The implementation of this model requires a clear definition of the technical specifications and value ranges of each parameter. The number of levels in the feature pyramid determines the scale range of feature fusion, with a value of 3 to 5. Too few levels will not be able to fully fuse features at different scales, while too many levels will increase computational complexity and redundancy. The resolution of the original image data, i.e., the pixel size of the image, directly affects the basic scale of the feature pyramid. High-resolution images can support more levels of feature pyramids, while low-resolution images need to have fewer levels to avoid excessive feature compression. The preset resolution of the minimum feature map is used to determine the size of the top feature map of the feature pyramid, with a value of 16×16 to 64×64 pixels. This size needs to be set according to the classification model's requirements for feature accuracy. A larger size is used when the classification accuracy requirement is high, and a smaller size is used when the requirement is low. The resolution compression coefficient is used to control the resolution compression ratio between each level of the feature pyramid, with a value range of 0.4 to 0.6. The smaller the coefficient, the greater the difference in resolution between each level, and the larger the coefficient, the smaller the difference. It needs to be adjusted according to the difference between the resolution of the original image and the resolution of the minimum feature map. During implementation, firstly, the resolution (in pixels, such as 2048×1536) of the original image data collected in step S1 is obtained, and the preset resolution of the minimum feature map (such as 32×32) and the resolution compression factor (such as 0.5) are determined. The long side of the original image resolution is divided by the long side of the minimum feature map resolution, and then divided by the resolution compression factor. The result is taken as the logarithm to the base 2, and the logarithm result is rounded up to obtain the calculated value of the number of feature pyramid levels. If the calculated value is not within the preset range of 3 to 5, it is adjusted to the closest preset value. For example, if the calculated value is 2, it is adjusted to 3, and if the calculated value is 6, it is adjusted to 5. The number of layers determined by this model can be dynamically adapted to the resolution of the original image. For example, for a high-resolution image of 4096×3072, if the minimum feature map is preset to 32×32 and the compression coefficient is 0.5, the number of layers calculated can be 5, which can fully integrate all features from the original image scale to the 32×32 scale. For a medium-resolution image of 2048×1536, the number of layers calculated under the same preset parameters can be 4, which reduces the computational load while ensuring the feature fusion effect.The calculation of this model needs to be completed before the feature pyramid structure is built. The determined number of levels will directly determine the design of the top-down and bottom-up feature transfer paths in the feature fusion module. The feature map size of each level needs to be adjusted step by step according to the resolution compression factor. For example, when the compression factor is 0.5, the size ratio of the feature maps of adjacent levels is 2:1 to ensure that the features of each level can be effectively aligned and fused. At the same time, the validity of the determined number of levels needs to be verified, and the size of the feature maps of each level needs to be checked to see if it is within the range supported by the model operation. If there is an abnormal size, the minimum feature map resolution or compression factor should be readjusted and the calculation should be recalculated.
[0073] Preferably, step S3 includes the following sub-steps:
[0074] S31: Perform hierarchical division on the primary feature set obtained in step S2. Based on the feature dimension and semantic information of the primary feature set, divide the primary feature set into shallow feature subset, medium feature subset and deep feature subset. The shallow feature subset corresponds to the edge and texture detail features of the original image data, the medium feature subset corresponds to the local morphological features of asphalt mixture particles, and the deep feature subset corresponds to the overall structural features of asphalt mixture.
[0075] S32: Construct a feature pyramid structure, which includes a top-down feature transfer path and a bottom-up feature enhancement path. The top-down path upsamples the deep feature subset to the same spatial dimension as the middle and shallow feature subsets through upsampling operations. The bottom-up path enhances the feature representation capability of the shallow feature subset through convolution operations and then transfers it to the middle and deep feature subsets.
[0076] S33: Perform channel splicing operation on feature subsets of different levels, stack the shallow feature subsets, middle feature subsets and deep feature subsets that have been aligned in spatial dimension in channel dimension to form an initial fused feature matrix, and then compress the initial fused feature matrix in channel dimension through a 1×1 convolutional layer to reduce feature redundancy.
[0077] S34: Perform feature optimization processing on the compressed initial fusion feature matrix. Use batch normalization to standardize the eigenvalues of the initial fusion feature matrix to eliminate the numerical differences between features at different levels. Then, use an activation function to perform a nonlinear transformation on the standardized feature matrix to enhance the nonlinear expressive power of the features and obtain the fusion feature set.
[0078] Specifically, step S3 refines the implementation process of the feature fusion module by dividing it into four sub-steps, resolving the ambiguity of the feature fusion operation in step S3, ensuring the orderliness and accuracy of multi-scale feature fusion, and providing a high-quality fused feature set for subsequent attention enhancement. During implementation, the technical parameters and operational standards for each sub-step must be clearly defined. In the hierarchical division of S31, the division should be based on the feature dimensions of the primary feature set (shallow feature subset dimensions are typically 512×512×64 to 1024×1024×128, middle layer is 256×256×128 to 512×512×256, and deep layer is 128×128×256 to 256×256×512) and semantic information differences, ensuring that the shallow layer corresponds to details such as edge texture, the middle layer corresponds to local particle morphology, and the deep layer corresponds to the overall structure; S32 constructs the feature pyramid. For the tower structure, the upsampling factor of the top-down path needs to be set to 2 or 4 times depending on the level difference. The convolutional layer of the bottom-up path uses a 3×3 convolutional kernel to enhance feature expression. In the channel splicing operation of S33, the spatial dimensions of the feature subsets of different levels need to be aligned first (the error is controlled within 1 pixel). Then, the number of channels of the initial fused feature matrix is compressed from 384 after splicing to 256 through a 1×1 convolutional layer to reduce redundancy. In the feature optimization of S34, the batch normalization needs to standardize the feature values to a mean of 0 and a variance of 1. The activation function is ReLU to enhance nonlinear expression. The implementation process proceeds step by step: S31 First, perform dimensionality analysis and semantic annotation on the primary feature set to clarify the mixed material information type corresponding to each level of features and complete subset partitioning; S32 Build a bidirectional feature transfer path, using bilinear interpolation for upsampling and max pooling for downsampling to ensure feature scale matching; S33 Before channel splicing, adjust the feature space size through interpolation or clipping, and after splicing, compress the channels through 1×1 convolution while monitoring the feature information retention rate (which must be no less than 90%); S34 First, perform batch normalization to eliminate numerical differences, then filter invalid feature values through the ReLU function, and finally generate the fused feature set. The computation time of each sub-step needs to be controlled throughout the process. S31 to S34 should be controlled within 0.1 seconds, 0.2 seconds, 0.15 seconds, and 0.15 seconds respectively. After each sub-step is completed, feature validity verification is required. For example, after S33, check whether the feature matrix dimension meets the preset requirements. After S34, verify whether the nonlinear expression capability of the feature meets the standard. If it does not meet the standard, backtrack and adjust the parameters of the previous steps to ensure that the fused feature set can fully reflect the multi-scale characteristics of asphalt mixture.
[0079] Preferably, step S4 includes the following sub-steps:
[0080] S41: Perform linear transformation on the fused feature set obtained in step S3. The fused feature set is mapped to a query matrix Q, a key matrix K and a value matrix V through three independent fully connected layers. The query matrix Q is used to capture the features of interest in the fused feature set, the key matrix K is used to describe the attribute information of each feature in the fused feature set, and the value matrix V is used to store the specific feature content in the fused feature set.
[0081] S42: Construct multiple parallel attention heads, each of which processes the query matrix Q, key matrix K, and value matrix V using different linear transformation parameters to obtain the query submatrix Q corresponding to each attention head. m Key matrix K m And value submatrix V m , where m is the attention head number, and its value ranges from [1, M];
[0082] S43: Perform attention calculation for each attention head and calculate the query submatrix Q. m With key matrix K m The similarity between the transpose matrices is normalized using the Softmax function to obtain the attention weight matrix. Then, the attention weight matrix is compared with the submatrix V. m Perform matrix multiplication to obtain the output feature A of each attention head. m ;
[0083] S44: Fuse the output features of all attention heads, and combine the output features A of multiple attention heads. m The feature matrix is concatenated along the channel dimension, and the dimensions of the concatenated feature matrix are adjusted by a fully connected layer to make the adjusted feature dimensions consistent with the feature dimensions of the fused feature set, thus obtaining the enhanced feature set.
[0084] Specifically, step S4 clarifies the operation process of the multi-head attention mechanism module through four sub-steps, solves the problem of disorder in the attention enhancement process in step S4, ensures that multiple attention heads work together, accurately enhances key features, suppresses redundant information, and improves the quality of the enhanced feature set. During implementation, the technical parameters and operating procedures for each step need to be determined. In the linear transformation of S41, the weight parameters of the fully connected layer need to be optimized through pre-training to ensure that the dimensions of the mapped query, key, and value matrices are consistent (all are (feature space size × feature space size) × 256) and can accurately reflect the key information of the fused features. In S42, the number of attention heads is set to 4 to 8, and the linear transformation parameters of each attention head need to be set differently to avoid duplicate feature extraction. The sub-matrix dimension is allocated according to the total dimension and the number of attention heads, usually (feature space size × feature space size) × 64 to 128. In the attention calculation of S43, the similarity is calculated using the dot product method, and the temperature parameter of the Softmax function is set to 1.0 to ensure the rationality of weight allocation. When multiplying the weight matrix and the value sub-matrix, it is necessary to ensure that the matrix dimensions match. In the feature fusion of S44, after channel concatenation, the dimension needs to be adjusted back to 256 consistent with the fused feature set through the fully connected layer to ensure compatibility of subsequent processing. The implementation process is strictly carried out step by step: S41 First, the data format of the fused feature set is converted, and then a linear transformation is completed through three independent fully connected layers to generate three core matrices; S42 Divide the matrix according to the set number, assign a dedicated sub-matrix to each attention head, and load differential parameters; In S43, each attention head independently calculates similarity and normalizes to obtain a weight matrix, and then performs operations with the value sub-matrix to generate output features, while monitoring the weight distribution (the weight of key feature regions must not be less than 0.6); S44 Concatenate all output features according to the channel dimension, complete the dimension adjustment through a fully connected layer, and generate an enhanced feature set. Each sub-step requires controlled computational efficiency. Steps S41 to S44 should be controlled within 0.1 seconds, 0.15 seconds, 0.1 seconds, and 0.05 seconds, respectively. Each sub-step must be validated. For example, after S43, check whether the output features of each attention head meet the expected dimensions. After S44, verify the dimensionality consistency between the enhanced feature set and the fused feature set. If dimensional deviation or feature quality is not up to standard, the linear transformation parameters or the number of attention heads need to be readjusted to ensure that the enhanced feature set can accurately focus on the key classification features of asphalt mixtures.
[0085] Preferably, step S5 includes the following sub-steps:
[0086] S51: Perform dimensional transformation on the enhanced feature set obtained in step S4. Map the enhanced feature set from the high-dimensional feature space to the low-dimensional feature space through a fully connected layer to obtain the feature vector. The dimension of the low-dimensional feature space is consistent with the total number of asphalt mixture classification categories.
[0087] S52: Perform preliminary calculation of category probabilities on the mapped feature vector. Use the Softmax function to process each element in the feature vector and convert the elements in the feature vector into probability values between [0, 1]. Each probability value corresponds to the initial probability of an asphalt mixture category, thus obtaining the initial category probability distribution.
[0088] S53: Correct the initial category probability distribution by adjusting the initial probability based on the matching degree of the calibration features of the asphalt mixture image, enhancing the probability value of categories with high matching degree of calibration features, and suppressing the probability value of categories with low matching degree of calibration features, thus obtaining the corrected category probability distribution.
[0089] S54: Verify the validity of the corrected category probability distribution, and determine whether the maximum probability value in the probability distribution is greater than the preset probability threshold. If the maximum probability value is greater than the preset probability threshold, then determine that the category corresponding to the maximum probability value is the preliminary classification result of the asphalt mixture image; if the maximum probability value is less than or equal to the preset probability threshold, then return to step S4 to re-perform attention enhancement processing.
[0090] Specifically, step S5 standardizes the category probability calculation process of the detection head module through four sub-steps, solves the problem of non-standardization in probability calculation and result verification in step S5, ensures the accuracy and reliability of category probability distribution, and provides a solid basis for the final classification result. During implementation, the technical parameters and judgment criteria for each step need to be clearly defined. In the dimensionality transformation of S51, the number of fully connected layers is set to 2 to 3, gradually compressing the enhanced feature set from high dimension (256×256×256 to 512×512×256) to low dimension (consistent with the total number of classification categories, usually 9 to 24). During the compression process, the feature information loss rate must be kept below 10%. In the preliminary probability calculation of S52, the temperature parameter of the Softmax function is set to 0.8 to 1.2 according to the degree of category difference to ensure that the probability distribution can effectively distinguish different categories. In the probability correction of S53, the calculation of the key feature matching degree needs to be based on the preset key features of each category (such as the continuous gradation feature of AC type mixture). The matching degree value ranges from 0 to 1, and the correction range is controlled between 5% and 20% to avoid over-correction. In the validity verification of S54, the preset probability threshold is set to 0.5 to 0.7. The threshold size is adjusted according to the classification accuracy requirements. If the accuracy requirement is high, the threshold value is larger. The implementation process proceeds in an orderly manner through steps: S51 compresses the feature dimension step by step through fully connected layers, and checks the integrity of the feature vector after each compression to ensure that no key information is lost; S52 inputs the compressed feature vector into the Softmax function to generate an initial category probability distribution, and records the initial probability value of each category at the same time; S53 calculates the matching degree according to the preset key features, adjusts the probability value of the corresponding category according to the matching degree, and re-normalizes after adjustment to ensure that the sum of probabilities is 1; S54 compares the maximum probability value with the preset threshold to determine whether to output the probability distribution or backtrack for optimization. Each sub-step requires controlled computation time. S51 to S54 should be controlled within 0.1 seconds, 0.05 seconds, 0.1 seconds, and 0.05 seconds respectively. Each sub-step also requires quality verification. For example, after S52, check if the initial probability sum is 1. After S53, verify if the corrected probability distribution better matches the key features. After S54, confirm the rationality of the judgment result. If probability anomalies or threshold failures occur, the fully connected layer parameters, Softmax temperature parameters, or key feature matching degree calculation standards need to be readjusted to ensure that the output category probability distribution can accurately reflect the actual category attributes of the asphalt mixture.
[0091] The convolutional neural network (CNN) in this invention is the core network structure for primary feature extraction of asphalt mixture images. Essentially, it transforms the original image data into a primary feature set containing key visual features through multiple layers of convolution, pooling, and activation operations, providing basic feature support for subsequent classification processes. Specifically, the CNN includes an input layer, convolutional layers, pooling layers, activation layers, and an output layer. The input layer receives the original image data (typically with a resolution of 2048×1536 pixels to 4096×3072 pixels) acquired in step S1, containing information such as the morphology and distribution density of asphalt mixture particles. Three to five convolutional layers are set, with the number of convolutional kernels in each layer gradually increasing from 64 to 256. The kernel size is dynamically adjusted to 3, 5, 7, or 9 (calculated based on the original image pixel size, average particle proportion coefficient (0.3 to 0.7), and feature complexity coefficient (0.2 to 0.9)). Multi-scale feature extraction of the original image is performed using a sliding window operation. The feature mapping process generates an initial feature map containing details such as edges and textures. Each convolutional layer is followed by a batch normalization layer to standardize the feature values to a mean of 0 and a variance of 1, avoiding gradient vanishing. The pooling layer uses 2×2 max pooling with a stride of 2 to downsample the initial feature map, reducing the feature dimension from thousands to hundreds while retaining key features. The activation layer uses the ReLU function to perform a non-linear transformation on the pooled features, enhancing the network's ability to express complex features. The output layer ultimately outputs a primary feature set with dimensions ranging from 512×512×64 to 256×256×512, which is semantically divided into shallow (detailed features), medium (local morphological features), and deep (overall structural features) subsets. Its function is to accurately extract key visual features from asphalt mixture images, remove irrelevant background noise, and transform image data that is difficult to process directly into machine-recognizable feature vectors. In terms of significance, this convolutional neural network solves the problems of low efficiency and strong subjectivity in traditional manual feature extraction. Through automated and multi-scale feature extraction, it ensures the integrity and consistency of the primary feature set, laying a reliable foundation for feature fusion and feature enhancement of the YOLOv5 model and multi-head attention mechanism. It is the core technical prerequisite for realizing automatic classification of asphalt mixture images.
[0092] The YOLOv5 model in this invention is an improved core model for feature fusion and class probability calculation. Based on the standard YOLOv5, it optimizes the feature pyramid structure and detection head module, focusing on multi-scale fusion of the primary feature set and classification operations on the enhanced feature set. It is a crucial link connecting feature extraction and classification result output. The specific implementation consists of two parts: feature fusion and classification operations. In feature fusion (step S3), the model constructs a bidirectional feature pyramid structure. From top to bottom, through 2x or 4x bilinear interpolation, it upsamples the deep feature subset (128×128×256 to 256×256×512) to be consistent with the middle layer (256×256×128 to 512×512×256) and shallow layer (512×512×64 to 1024×1024×128) feature subsets. In the spatial dimension, the bottom-up path enhances shallow features through 3×3 convolutions and then passes them to deeper layers. Different levels of features are then stacked into an initial fusion matrix (e.g., 512×512×384) through channel concatenation, compressed to 256 channels by 1×1 convolutions, generating a fusion feature set. The number of feature pyramid levels is determined by a dynamic model to be 3 to 5 (calculated based on the original image resolution, the minimum feature map preset resolution (16×16 to 64×64 pixels), and the compression coefficient (0.4 to 0.6)). In the classification operation (step S5), the detection head module contains 2 to 3 fully connected layers, progressively compressing the enhanced feature set (256×256×256 to 512×512×256) to a low-dimensional feature vector consistent with the total number of classification categories (9 to 24). The initial probability distribution is calculated using the Softmax function (temperature parameter 0.8 to 1.2), and then the probability is corrected by combining the key feature matching degree (0 to 1) to generate the final category probability distribution. Its function is to achieve effective fusion of multi-scale features, solve the problem of insufficient expression of single-level features, and accurately complete the conversion of features into category probabilities. Its significance lies in the fact that the improved YOLOv5 model breaks through the limitation of poor adaptability of traditional models to fixed-scale features. Through dynamic feature fusion and probability correction, it improves the ability to capture the features of asphalt mixture particles of different sizes and the accuracy of classification probabilities, providing core technical support for the reliability of the final classification results and ensuring that the classification results can meet the engineering requirements for judging mixture type, particle size distribution and asphalt content grade.
[0093] The multi-head attention mechanism in this invention is a key technology embedded in the YOLOv5 model for feature enhancement. Its principle is to assign weights to key features of different dimensions in the fused feature set using multiple parallel attention heads, thereby strengthening classification-related feature regions, suppressing redundant information, and improving the relevance and effectiveness of the feature set. The specific implementation involves three stages (step S4): linear transformation, multi-attention head operation, and feature fusion. First, the fused feature set (256×256×256 to 512×512×256) is linearly transformed into query, key, and value matrices of consistent dimensions (all (feature space size × feature space size) × 256) through three independent fully connected layers. The matrix parameters are pre-trained and optimized to ensure the accuracy of feature mapping. Then, 4 to 8 parallel attention heads are constructed. Each attention head divides the three matrices into sub-matrices (dimensions (feature space size × feature space size)) using differentiated linear parameters. The dot product similarity between the query submatrix and the transpose of the key submatrix is calculated (64 to 128). The attention weight matrix is obtained by normalization using the Softmax function (temperature parameter 1.0). The weight allocation is optimized by combining the asphalt mixture feature dispersion coefficient (0.05 to 0.2) and the feature distance matrix (Euclidean distance calculation). The weight is then multiplied by the value submatrix to generate the output feature of each attention head (the weight of the key feature region must be no less than 0.6). Finally, all attention head output features are concatenated by channel and the dimension is adjusted to be consistent with the fused feature set (256 channels) through a fully connected layer to generate the enhanced feature set. Its function is to accurately filter out key features (such as particle gaps and asphalt film coverage) in asphalt mixture images, reduce redundant information such as background noise and light and shadow interference, and enable subsequent classification operations to focus on core features. The significance is that this mechanism solves the limitation of traditional single-head attention that cannot simultaneously focus on multiple key features. By working collaboratively with multiple attention heads, it achieves simultaneous enhancement of multiple key features of asphalt mixtures, significantly improves the quality of feature sets and classification accuracy, and ensures that even in scenarios with complex image features and many interference factors, it can still accurately extract key classification information, providing an important guarantee for the accuracy of the final classification results.
[0094] like Figure 2 As shown, an asphalt mixture image classification system based on a convolutional neural network includes:
[0095] The asphalt mixture image multi-dimensional data acquisition unit is used to acquire raw image data including asphalt mixture particle morphology, particle distribution density, particle gap characteristics and asphalt film coverage state. The output end of this unit is connected to the input end of the convolutional neural network feature extraction processing unit.
[0096] A convolutional neural network feature extraction processing unit is used to perform multi-scale feature mapping and downsampling processing on the original image data to generate a primary feature set. The output of this unit is connected to the input of the improved YOLOv5 model feature fusion operation unit.
[0097] An improved YOLOv5 model feature fusion operation unit is used to perform multi-scale feature fusion processing on the primary feature set to generate a fused feature set. The output of this unit is connected to the input of the multi-head attention mechanism feature enhancement unit.
[0098] A multi-head attention mechanism feature enhancement unit is used to perform attention weight allocation and feature enhancement processing on the fused feature set to generate an enhanced feature set. The output of this unit is connected to the input of the improved YOLOv5 model detection head classification operation unit.
[0099] An improved YOLOv5 model detection head classification operation unit is used to calculate the category probability of the enhanced feature set and generate the category probability distribution. The output of this unit is connected to the input of the asphalt mixture classification result determination unit.
[0100] The asphalt mixture classification result determination unit is used to determine the classification result of the asphalt mixture image based on the category probability distribution. The output of this unit is used to output the classification result including the asphalt mixture type, particle size distribution grade, and asphalt content grade.
[0101] This paper presents a method and system for classifying asphalt mixture images based on convolutional neural networks. This method and system completely eliminates the reliance on professional experience in traditional manual classification, achieving fully automated asphalt mixture image classification through a complete technical process. From the acquisition of multi-dimensional raw image data of asphalt mixtures, to the extraction of multi-scale primary features by convolutional neural networks, to the fusion of features at different levels by the improved YOLOv5 model feature fusion module, followed by the strengthening of key features and suppression of redundant features through a multi-head attention mechanism, and finally the calculation of class probabilities and determination of classification results by the detection head module, the entire process can complete batch image classification without manual intervention. Compared with traditional methods of manual observation and physical experiments, this method not only significantly reduces classification time but also avoids the instability of classification results caused by differences in human experience. It can quickly respond to the classification needs of a large number of asphalt mixture samples in engineering sites, significantly improving classification efficiency and ease of operation.
[0102] This method and system demonstrate outstanding accuracy in feature extraction and optimization. Convolutional neural networks, through multi-scale feature mapping and downsampling, can fully preserve key details such as particle morphology and density in asphalt mixture images, while effectively reducing feature dimensionality to minimize redundancy. The improved YOLOv5 model's feature fusion module employs a multi-scale feature fusion strategy, moving beyond simple fixed-level feature stitching. Instead, it combines the actual characteristics of asphalt mixture image features to selectively fuse shallow detail features with deep semantic features, ensuring the fused feature set comprehensively reflects the core attributes of the mixture. The embedded multi-head attention mechanism further optimizes for different feature dimensions, simultaneously enhancing multiple key feature regions such as particle gaps and asphalt film coverage, accurately suppressing irrelevant background noise and redundant features. This allows subsequent classification operations to focus on feature information crucial to the classification result, providing solid support for classification accuracy.
[0103] The classification results of this method and system accurately match the actual needs of engineering quality control. The classification results include core indicators such as asphalt mixture type, particle size distribution grade, and asphalt content grade. These indicators directly correspond to key parameters for evaluating asphalt mixture quality in road engineering, providing engineers with accurate evidence to determine whether the mixture meets construction standards. Furthermore, the technical design fully considers adaptability to different scenarios. For example, the feature fusion module can dynamically adjust the fusion method based on the differences in image features of different asphalt mixture samples. The number of attention heads and weight allocation logic of the multi-head attention mechanism can adapt to asphalt mixture images of different resolutions and shooting environments. The category probability calculation and verification steps of the detection head module further ensure the reliability of the classification results, avoiding misjudgments caused by single feature bias. This high degree of practicality and adaptability allows the method and system to be stably applied in different highway engineering scenarios, providing more reliable and valuable technical support for road engineering quality control.
[0104] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," "link," and "fix" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0105] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An image classification method for asphalt mixtures based on convolutional neural networks, characterized in that, Includes the following steps: Step S1: Collect asphalt mixture sample images. Input the sample images into a preset image acquisition module to perform image data acquisition operations and obtain raw image data including asphalt mixture particle morphology, particle distribution density, particle gap characteristics, and asphalt film coverage status. Step S2: Input the original image data into a feature extraction network constructed based on a convolutional neural network. Perform multi-scale feature mapping operation on the original image data through the convolutional layer in the feature extraction network. Use the convolutional kernel to perform sliding window calculation on the original image data to generate an initial feature map. Then, use the pooling layer to downsample the initial feature map to retain the calibration feature information and reduce the feature dimension, thereby obtaining the primary feature set of the asphalt mixture image. Step S3: Input the primary feature set into the feature fusion module of the improved YOLOv5 model. The feature fusion module adopts a multi-scale feature fusion strategy, performs channel dimension splicing and spatial dimension alignment operations on primary features at different levels, and fuses the shallow detail features and deep semantic features in the primary feature set through the feature pyramid structure to generate a fused feature set. Step S4: Embed a multi-head attention mechanism module in the improved YOLOv5 model, input the fused feature set into the multi-head attention mechanism module, calculate the weight allocation of different feature channels in the fused feature set through multiple parallel attention heads, enhance the attention of the classification-related calibration feature regions in the asphalt mixture image, suppress irrelevant redundant features, and output the enhanced feature set. Step S5: Input the enhanced feature set into the detection head module of the improved YOLOv5 model. The detection head module performs dimensionality transformation on the enhanced feature set through a fully connected layer, maps the enhanced feature set to a preset asphalt mixture classification category space, and calculates the category probability of the mapped feature vector through a classifier to obtain the category probability distribution corresponding to the asphalt mixture image. Step S6: Determine the classification result of the asphalt mixture image based on the category probability distribution. The classification result includes the asphalt mixture type, particle size distribution grade, and asphalt content grade, thus completing the asphalt mixture image classification operation. In the feature fusion module of step S3, the fusion weights of primary features at different levels are dynamically adjusted using a feature fusion weight calculation model. The formula for the feature fusion weight calculation model is as follows: ,in, This represents the fusion weight between the primary features of level i and level j. These are the contribution coefficients of convolutional features and feature similarity, respectively, with values ranging from [value range missing]. This represents the primary features at level i. With the j-th level primary features Feature association values obtained by performing convolution operations; express and The feature similarity is calculated using cosine similarity; n represents the total number of primary feature levels involved in the fusion. In the multi-head attention mechanism module of step S4, a multi-head attention weight calculation model is used to assign weights to the output features of each attention head. The formula for the multi-head attention weight calculation model is as follows: Where m takes values ranging from 1 to 10. The total number of attention points, with a value between 4 and 8; This indicates the dimensions of the query vector and the key vector, with values ranging from 64 to 256. Let represent the query matrix, key matrix, and value matrix of the m-th attention head, respectively, which are obtained from the fused feature set through linear transformation; The coefficient of variation represents the characteristic dispersion of asphalt mixtures, and its value ranges from 1 to 2. This represents the feature distance matrix corresponding to the m-th attention head, calculated using Euclidean distance. This represents the smoothing coefficient, with a value of 0.
01.
2. The asphalt mixture image classification method based on convolutional neural networks according to claim 1, characterized in that, In the detection head module of step S5, the initial class probability is optimized using a class probability correction model. The formula for the class probability correction model is: ,in, This represents the corrected probability of class c asphalt mixture, where c ranges from 1 to 1. This represents the total number of asphalt mixture classification categories, with a value ranging from 3 to 8. Represents the initial class probability; This represents the feature contribution correction coefficient, with a value range of [value range missing]. The calibration feature matching degree corresponding to the c-th type of asphalt mixture is obtained by calculating the feature vector related to the c-th type in the enhanced feature set.
3. The asphalt mixture image classification method based on convolutional neural networks according to claim 1, characterized in that, In the feature extraction network of step S2, the kernel size of the convolutional layer is determined using a dynamic kernel size adjustment model. The formula for the dynamic kernel size adjustment model is as follows: ,in, This indicates the kernel size, with values of 3, 5, 7, or 9. This represents the pixel dimensions of the original image data; This represents the average proportion coefficient of asphalt mixture particles, with a value range of [value range missing]. The image feature complexity coefficient is calculated from the gray-level variance of the original image data, and its value ranges from [value range missing]. This indicates the floor function.
4. The asphalt mixture image classification method based on convolutional neural networks according to claim 1, characterized in that, In the feature pyramid structure of step S3, the number of levels in the feature pyramid is determined using a feature pyramid level adjustment model. The formula for the feature pyramid level adjustment model is as follows: ,in, This indicates the number of levels in the feature pyramid, with a value ranging from 3 to 5. Indicates the resolution of the original image data; This represents the preset resolution of the minimum feature map, with a value of [value to be filled in]. Pixel; This represents the resolution compression factor, with a value range of [value range missing]. This indicates the rounding up operation.
5. The asphalt mixture image classification method based on convolutional neural networks according to claim 1, characterized in that, Step S3 includes the following sub-steps: S31: Perform hierarchical division on the primary feature set obtained in step S2. Based on the feature dimension and semantic information of the primary feature set, divide the primary feature set into shallow feature subset, medium feature subset and deep feature subset. The shallow feature subset corresponds to the edge and texture detail features of the original image data, the medium feature subset corresponds to the local morphological features of asphalt mixture particles, and the deep feature subset corresponds to the overall structural features of asphalt mixture. S32: Construct a feature pyramid structure, which includes a top-down feature transfer path and a bottom-up feature enhancement path. The top-down path upsamples the deep feature subset to the same spatial dimension as the middle and shallow feature subsets through upsampling operations. The bottom-up path enhances the feature representation capability of the shallow feature subset through convolution operations and then transfers it to the middle and deep feature subsets. S33: Perform channel splicing operation on feature subsets of different levels, stack the shallow feature subsets, middle feature subsets and deep feature subsets that have been aligned in spatial dimension in channel dimension to form an initial fused feature matrix, and then compress the initial fused feature matrix in channel dimension through a 1×1 convolutional layer to reduce feature redundancy. S34: Perform feature optimization processing on the compressed initial fusion feature matrix. Use batch normalization to standardize the eigenvalues of the initial fusion feature matrix to eliminate the numerical differences between features at different levels. Then, use an activation function to perform a nonlinear transformation on the standardized feature matrix to enhance the nonlinear expressive power of the features and obtain the fusion feature set.
6. The asphalt mixture image classification method based on convolutional neural networks according to claim 1, characterized in that, Step S4 includes the following sub-steps: S41: Perform linear transformation on the fused feature set obtained in step S3. The fused feature set is mapped to a query matrix Q, a key matrix K and a value matrix V through three independent fully connected layers. The query matrix Q is used to capture the features of interest in the fused feature set, the key matrix K is used to describe the attribute information of each feature in the fused feature set, and the value matrix V is used to store the specific feature content in the fused feature set. S42: Construct multiple parallel attention heads, each of which processes the query matrix Q, key matrix K, and value matrix V using different linear transformation parameters to obtain the query submatrix corresponding to each attention head. Key matrix and value submatrix , where m is the attention head number, and its value ranges from [1, M]; S43: Perform attention calculation for each attention head and compute the query submatrix. With key matrix The similarity between the transpose matrices is normalized using the Softmax function to obtain the attention weight matrix. Then, the attention weight matrix is compared with the submatrix. Perform matrix multiplication to obtain the output features of each attention head. ; S44: Fuse the output features of all attention heads, combining the output features of multiple attention heads. The feature matrix is concatenated along the channel dimension, and the dimensions of the concatenated feature matrix are adjusted by a fully connected layer to make the adjusted feature dimensions consistent with the feature dimensions of the fused feature set, thus obtaining the enhanced feature set.
7. The asphalt mixture image classification method based on convolutional neural networks according to claim 1, characterized in that, Step S5 includes the following sub-steps: S51: Perform dimensional transformation on the enhanced feature set obtained in step S4. Map the enhanced feature set from the high-dimensional feature space to the low-dimensional feature space through a fully connected layer to obtain the feature vector. The dimension of the low-dimensional feature space is consistent with the total number of asphalt mixture classification categories. S52: Perform preliminary calculation of category probabilities on the mapped feature vector. Use the Softmax function to process each element in the feature vector and convert the elements in the feature vector into probability values between [0, 1]. Each probability value corresponds to the initial probability of an asphalt mixture category, thus obtaining the initial category probability distribution. S53: Correct the initial category probability distribution by adjusting the initial probability based on the matching degree of the calibration features of the asphalt mixture image, enhancing the probability value of categories with high matching degree of calibration features, and suppressing the probability value of categories with low matching degree of calibration features, thus obtaining the corrected category probability distribution. S54: Verify the validity of the corrected category probability distribution, and determine whether the maximum probability value in the probability distribution is greater than the preset probability threshold. If the maximum probability value is greater than the preset probability threshold, then determine that the category corresponding to the maximum probability value is the preliminary classification result of the asphalt mixture image; if the maximum probability value is less than or equal to the preset probability threshold, then return to step S4 to re-perform attention enhancement processing.
8. An asphalt mixture image classification system based on convolutional neural networks, characterized in that, This system is applied to the asphalt mixture image classification method based on convolutional neural networks as described in claim 1, comprising: The asphalt mixture image multi-dimensional data acquisition unit is used to acquire raw image data including asphalt mixture particle morphology, particle distribution density, particle gap characteristics and asphalt film coverage state. The output end of this unit is connected to the input end of the convolutional neural network feature extraction processing unit. A convolutional neural network feature extraction processing unit is used to perform multi-scale feature mapping and downsampling processing on the original image data to generate a primary feature set. The output of this unit is connected to the input of the improved YOLOv5 model feature fusion operation unit. An improved YOLOv5 model feature fusion operation unit is used to perform multi-scale feature fusion processing on the primary feature set to generate a fused feature set. The output of this unit is connected to the input of the multi-head attention mechanism feature enhancement unit. A multi-head attention mechanism feature enhancement unit is used to perform attention weight allocation and feature enhancement processing on the fused feature set to generate an enhanced feature set. The output of this unit is connected to the input of the improved YOLOv5 model detection head classification operation unit. An improved YOLOv5 model detection head classification operation unit is used to calculate the category probability of the enhanced feature set and generate the category probability distribution. The output of this unit is connected to the input of the asphalt mixture classification result determination unit. The asphalt mixture classification result determination unit is used to determine the classification result of the asphalt mixture image based on the category probability distribution. The output of this unit is used to output the classification result including the asphalt mixture type, particle size distribution grade, and asphalt content grade.
Citation Information
Patent Citations
Metal surface defect detection method and device based on improved YOLO model
CN116977294A
Method for detecting pavement cracks by joint cutter based on YOLOv5-CSS model
CN119919791A