Vision Transform-based asphalt mixture gradation identification method and system
Through the Vision Transformer-based method, the asphalt mixture specimen slice diagram is processed and identified, which solves the problem of inefficient grading detection in the existing technology, and realizes efficient and low-cost intelligent identification.
Patent Information
- Application Number
- CN202411313434.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-02-28
AI Technical Summary
In the prior art, asphalt mixture grading inspection mainly relies on manual screening, is inefficient and requires a lot of manpower, making it difficult to achieve efficient and low-cost intelligent identification.
Using a Vision Transformer-based method, the training and test data sets were constructed by taking, cropping, pre-processing and data amplification of asphalt mixture test pieces, and grading identification was performed using the Vision Transformer network.
It realizes low-cost and high-efficiency intelligent identification of asphalt mixture grading, improves the efficiency and accuracy of traditional methods, and reduces manual intervention.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of road engineering, and in particular relates to a method and system for identifying asphalt mixture gradation based on Vision Transformer. Background Art
[0002] Asphalt mixture is one of the most widely used road pavement materials in modern road construction and maintenance. It is composed of asphalt binder and mineral aggregates. Therefore, the gradation that describes the size and quantity distribution of aggregate particles in the mixture has a direct and important impact on the performance of the mixture. However, if the aggregate gradation does not meet the construction standards, the porosity of the asphalt mixture will increase. This will affect the stress and deformation characteristics of concrete, thereby weakening the concrete's ability to resist deformation. Therefore, it is crucial to detect the gradation to ensure construction quality.
[0003] At present, gradation testing mainly adopts manual screening method. First, a certain amount of samples need to be taken from the mixture, and then they need to be properly processed, including extracting asphalt and drying water. According to the requirements of asphalt mixture gradation design, a series of standard sieves are selected, and the samples are divided into different particle sizes using a sieve shaker, and the gradation curve is drawn. This method requires a lot of manpower and is inefficient. Summary of the invention
[0004] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a method and system for identifying asphalt mixture gradation based on VisionTransformer.
[0005] The present invention adopts the following technical solution: a method for identifying asphalt mixture gradation based on Vision Transformer, comprising the following steps:
[0006] Slices of asphalt mixture specimens are photographed to obtain specimen slice diagrams, and the gradation of each asphalt mixture specimen is recorded;
[0007] Based on the effective part of the specimen slice image, the image is cut and constructed according to a predetermined aspect ratio, and a data sample set is generated; the data sample set is preprocessed and divided into a training set and a test set according to a predetermined ratio;
[0008] Inputting the training set into the Vision Transformer network, and performing training using the classification accuracy as an evaluation index to obtain a trained Vision Transformer network; inputting the test set into the trained Vision Transformer network to test the training effect;
[0009] The trained Vision Transformer network is used to realize the recognition of asphalt mixture level.
[0010] In a further embodiment, the specific steps of performing cropping and construction according to a predetermined aspect ratio are as follows:
[0011] Remove the invalid background in the specimen slice image, define the direction in which the height is greater than the width as the vertical direction; rotate the vertical specimen slice image to the horizontal direction, and obtain the original data set P = {Pic1, Pic2, ..., Pic n}, n is the size of the data set, and the aspect ratio of each slice is calculated
[0012] For each slice Pic i , according to the aspect ratio Use OpenCV image processing library according to the cropping rules to convert Pic i Cut into m i A square sub-image Where m i =f(r i ); f(r i ) is determined according to the balance between the number of sub-graphs cut and the similarity, that is, the number of sub-graphs is made larger while ensuring the similarity between sub-graphs is low;
[0013] After completing the automatic cropping, combine each slice Pic i The grading information G i , construct asphalt mixture gradation identification dataset:
[0014]
[0015] In a further embodiment, the asphalt mixture gradation identification dataset D G The preprocessing includes:
[0016] Adjust the size of the input image to the predetermined size and read the dataset D G All images in D G Here is an example of a brightness matching method:
[0017] In D G Select a reference image R with appropriate brightness, convert it to grayscale and calculate its average brightness L R :
[0018] L R =mean(Σpix R )
[0019] Where N is the total number of pixels in R, pix R is the gray value of the pixel in R.
[0020] For the image I to be brightness matched, calculate the average brightness L according to the above formula I , and calculate the brightness ratio coefficient α = L R / L I ;
[0021] Apply the scaling factor α to all pixel values in image I, that is:
[0022] L′ I =mean(∑α·pix I )
[0023] Right D G Repeat the above steps for all remaining images in the image to match the brightness to the reference image R;
[0024] Use histogram equalization and image denoising to enhance image contrast, remove noise and improve image quality;
[0025] Considering the characteristics of asphalt mixture slice images, that is, the features are evenly distributed in the whole image, CutMix and MixUp data augmentation methods are used.
[0026] In a further embodiment, the training and gradation recognition process of the Vision Transformer network is as follows:
[0027] The dataset is divided into a dataset and a test set at a ratio of 8:2, and the training set is input for training;
[0028] The network divides each image into several patches and flattens them;
[0029] The flattened patches are linearly mapped to a low-dimensional space and position encoding information is added to generate an image sequence. The position encoding is as follows:
[0030]
[0031] Among them, pos is the position index (the location information of the patch after the image is divided into several patches), j is the dimension index (PE (pos,2j) Indicates the encoding of the odd dimensions of the input image, PE (pos,2j+1) represents the encoding of the odd dimensions of the input image), d is the encoding dimension (the total length of the position encoding vector);
[0032] Feed the image sequence into a standard Transformer Encoder to extract features;
[0033] The extracted features are input into the MLP module for classification;
[0034] The classification results are compared with the labels, the cross entropy loss function is calculated, and the network weights are updated by backpropagation until the training is completed.
[0035] In a further embodiment, the calculation formula of the cross entropy loss function is as follows:
[0036]
[0037] Among them, Class is the collection of mixture gradation categories in the data set, c is a category in Class, and y c and are the true value of sample y in the data set and the predicted value of sample y by the network;
[0038] The trained Vision Transformer network is tested using the test set, and the classification accuracy is used as an indicator to measure the performance of the network. If it meets the requirements, the network is used to complete the subsequent asphalt mixture gradation identification task.
[0039] A Vision Transformer-based asphalt mixture gradation recognition system is used to implement the asphalt mixture gradation recognition method as described above, comprising:
[0040] The first module is configured to photograph the slices of the asphalt mixture specimen to obtain a specimen slice diagram and record the gradation of each asphalt mixture specimen;
[0041] The second module is configured to cut and construct based on the effective part of the specimen slice image according to a predetermined aspect ratio, and generate a data sample set; and divide the data sample set into a training set and a test set according to a predetermined ratio after preprocessing the data sample set;
[0042] The third module is configured to input the training set into the Vision Transformer network, train the network with classification accuracy as an evaluation indicator to obtain a trained Vision Transformer network; input the test set into the trained Vision Transformer network to test the training effect;
[0043] The fourth module is configured to use the trained Vision Transformer network to realize asphalt mixture level recognition.
[0044] Compared with the prior art, the present invention has the following technical advantages:
[0045] (1) The present invention proposes a method for identifying asphalt mixture gradation based on Vision Transformer, which can realize low-cost and high-efficiency intelligent identification of asphalt mixture gradation.
[0046] (2) Asphalt mixture slice images taken by high-definition cameras are easier to obtain and process than other types of data.
[0047] (3) The use of data preprocessing methods including brightness matching, image enhancement, and data augmentation helps to expand the size of the dataset and improve the quality of the dataset.
[0048] (4) The Vision Transformer classification network can directly and accurately identify the gradation from asphalt mixture slice images, which greatly improves the limitations of traditional gradation acquisition methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0050] Figure 2 Asphalt mixture slices: (a) taken directly by a high-definition camera (b) after removing the invalid part (c) cut into a square using the OpenCV library;
[0051] Figure 3 This is a schematic diagram of the Vision Transformer network structure;
[0052] Figure 4 Schematic diagram of the Transformer encoder structure.
[0053] Figure 5 The loss function curve for network training
[0054] Figure 6 The identification confusion matrix for the classification network DETAILED DESCRIPTION
[0055] The present invention provides a method for identifying asphalt mixture gradation based on Vision Transformer, comprising the following steps:
[0056] S1. Use a high-resolution camera to photograph slices of asphalt mixture specimens and record the gradation of each specimen;
[0057] S2, using the OpenCV library, cropping and constructing according to the aspect ratio of the effective part of the specimen slice image, and generating a dataset label;
[0058] S3, preprocessing the dataset samples, including size adjustment, brightness matching, image enhancement and data amplification;
[0059] S4. Divide the data set in step S3 into a training set and a test set in a ratio of 8:2. Input the training set into the Vision Transformer network and perform training using the classification accuracy as the evaluation indicator.
[0060] S5. Input the test set into the Vision Transformer network trained in S4 to test the training effect, and use the network to recognize the gradation of asphalt mixture.
[0061] Furthermore, in S1, specifically: lay an A3 printing paper flat on a tray, and place the asphalt mixture specimen horizontally on the paper. Use a high-definition camera and a tripod to photograph each cross section of the specimen from a bird's-eye view. Crop and remove the white background portion of the image, and record the gradation of each specimen.
[0062] Furthermore, S2 specifically includes the following sub-steps:
[0063] S2.1. Remove the invalid background in the specimen slice image, define the direction in which the height is greater than the width as the vertical direction; rotate the vertical specimen slice image to the horizontal direction, and obtain the original data set P = {Pic1, Pic2, ..., Pic n}, n is the size of the data set, and the aspect ratio of each slice is calculated
[0064] For each slice Pic i , according to the aspect ratio Use OpenCV image processing library according to the cropping rules to convert Pic i Cut into m i A square sub-image Where m i =f(r i ); f(r i ) is determined according to the balance between the number of sub-graphs cut and the similarity, that is, the number of sub-graphs is made larger while ensuring the similarity between sub-graphs is low;
[0065] After completing the automatic cropping, combine each slice Pic i Grading information G i , construct asphalt mixture gradation identification dataset:
[0066]
[0067] S2.3. Based on the data set generated in step S2.2 and the gradation recorded in step S1, a data set is established and data set labels are generated. Each label includes the file name of an image and the gradation category to which it belongs.
[0068] Furthermore, S3 specifically includes the following sub-steps:
[0069] Resizing: Due to the structural design of the Vision Transformer classification network, the input image size must be 224×224. Therefore, the image size needs to be adjusted to meet the Vision Transformer's input image size requirements;
[0070] Brightness matching: When taking images of asphalt mixture specimens, slight changes in the camera's exposure value will cause slight changes in the brightness of the captured image, which directly interferes with the accuracy of gradation recognition. To solve this problem, brightness matching is performed on all images of the same gradation in the dataset. Here is an example of a brightness matching method:
[0071] In D G Select a reference image R with appropriate brightness, convert it to grayscale and calculate its average brightness L R :
[0072] L R =mean(∑pix R )
[0073] Where N is the total number of pixels in R, pix R is the gray value of the pixel in R.
[0074] For the image I to be brightness matched, calculate the average brightness L according to the above formula I , and calculate the brightness ratio coefficient α = LR / L I ;
[0075] Apply the scaling factor α to all pixel values in image I, that is:
[0076] L′ I =mean(∑α·pix I )
[0077] Right D G Repeat the above steps for all remaining images in the image to match the brightness to the reference image R;
[0078] Image enhancement: highlighting the differences in visual features of different gradations helps improve the accuracy of gradation identification. In terms of visual features, the differences between different gradations are mainly concentrated in the maximum particle size of coarse aggregate, aggregate color, asphalt color, fine aggregate content, etc. For example, the difference between AC13 and SMA13 is mainly in the fine aggregate content, and the difference between basalt aggregate and limestone aggregate is mainly in the depth of aggregate color. The present invention mainly uses two enhancement methods: histogram equalization and image denoising. Histogram equalization redistributes the pixel values of the image so that the histogram of the image is evenly distributed throughout the grayscale range, thereby enhancing the contrast of the image and helping to highlight the differences in features such as different aggregate colors and asphalt colors; image denoising helps to reduce noise in the image, improve image quality, and reduce the situation where noise points are mistakenly identified as fine aggregate by the network.
[0079] Data augmentation: The dataset is augmented to increase the number of samples. Considering the characteristics of asphalt mixture slices, that is, the features are evenly distributed in the whole image, CutMix and MixUp data augmentation methods are used. The CutMix algorithm randomly cuts a part of the image from the training image, and then cuts the same position in another image to fill the original image to obtain a rich image. The MixUp algorithm randomly extracts two samples from the training sample and performs a simple random weighted summation. At the same time, the labels of the samples are also weighted summed accordingly.
[0080] Furthermore, S4 specifically includes the following sub-steps:
[0081] S4.1, divide the data set into a data set and a test set with a ratio of 8:2, and input the training set for training;
[0082] S4.2, the network divides each image into several patches and flattens them;
[0083] S4.3, linearly map the flattened patches to a low-dimensional space and add position encoding information to generate an image sequence; the encoding method is as follows:
[0084]
[0085] Among them, pos is the position index (the location information of the patch after the image is divided into several patches), j is the dimension index (PE (pos,2j) Represents the encoding of the odd dimensions of the input image, PE (pos,2j+1) represents the encoding of the odd dimensions of the input image), d is the encoding dimension (the total length of the position encoding vector);
[0086] S4.4, send the image sequence to the standard Transformer Encoder to extract features;
[0087] S4.5, input the extracted features into the MLP module for classification;
[0088] S4.6. Compare the classification result with the label, calculate the loss function, and back propagate to update the network weights. The calculation formula of the cross entropy loss function is as follows:
[0089]
[0090] Among them, Class is the collection of mixture gradation categories in the data set, c is a category in Class, and y c and are the true value of sample y in the data set and the predicted value of sample y by the network;
[0091] The trained Vision Transformer network is tested using the test set, and the classification accuracy is used as an indicator to measure the performance of the network. If it meets the requirements, the network is used to complete the subsequent asphalt mixture gradation identification task.
[0092] In general, the present invention discloses a method for identifying the gradation of asphalt mixture based on Vision Transformer, and the specific steps include shooting of asphalt mixture slices and recording of gradation; cropping of slices based on OpenCV and construction of data set; data preprocessing, including resizing, brightness matching, image enhancement and data amplification; training and weight updating of Vision Transformer classification network; and testing of Vision Transformer classification network, which has five parts in total. Use a high-definition camera to shoot the asphalt mixture from a bird's-eye view, crop out the effective area and record the gradation; based on the OpenCV image processing library, automatically crop the slices into several small images according to the aspect ratio, and establish a data set in combination with the gradation information; perform data preprocessing on the data set including resizing, brightness matching, image enhancement and data amplification, so that the data set meets the input requirements of the Vision Transformer network and improves the quality of the data set; divide the data set into a training set and a test set, and use the training set to train the network, and back-propagate to update the weights to complete the training; use the test set to test the trained network, and use this network to realize the gradation identification of asphalt mixture.
[0093] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. Component models, material names, connection structures, control methods, algorithms and other features not clearly described in this technical solution are all considered to be common technical features disclosed in the prior art.
[0094] Example 1
[0095] The asphalt mixture gradation identification method based on Vision Transformer in this invention is shown in Figure 1 , the method includes the following steps:
[0096] S1. Use a high-resolution camera to take pictures of the slices of asphalt mixture specimens and record the gradation of each specimen;
[0097] S2. Use the OpenCV library to crop and construct according to the aspect ratio of the effective part of the specimen slice image and generate dataset labels;
[0098] S3. Preprocess the dataset samples, including size adjustment, brightness matching, image enhancement, and data augmentation;
[0099] S4. Divide the dataset in step S3 into a training set and a test set at a ratio of 8:2. Input the training set into the Vision Transformer network and train it with the classification accuracy as the evaluation index.
[0100] S5. Input the test set into the Vision Transformer network trained in S4 to test the training effect and use this network to realize the identification of the gradation of asphalt mixture.
[0101] Specifically, in implementation, step S1 is specifically: lay an A3 printing paper flat in a tray and place the asphalt mixture specimen horizontally on the paper. Use a high-definition camera and a tripod to take pictures of each cross-section of the specimen from a top-down perspective. Crop and remove the white background part of the image and record the gradation of each specimen.
[0102] Specifically, in implementation, step S2 specifically includes the following sub-steps:
[0103] S2.1. For the images taken and with the white background removed in step S1, use the imread() function of OpenCV to read each image, read the width w and height h of the image and calculate the aspect ratio If r is less than 1, go to step S2.2; otherwise, rotate the image by 90°, recalculate r (at this time r must be greater than 1), and then go to step S2.2;
[0104] S2.2. According to the aspect ratio r of the image, crop the image according to the following logic and use the imwrite() function to save: if 0 < r < 1.8, crop into 1 piece; if 1.8 ≤ r < 2, crop into 2 pieces; if 2 ≤ r < 2.5, crop into 3 pieces; if 2.5 ≤ r < 3, crop into 4 pieces; if r ≥ 3, crop into n + 3 pieces, where n is the integer after taking the integer part of the aspect ratio of length to width;
[0105] S2.3. Based on the data set generated in step S2.2 and the gradation recorded in step S1, a data set is established and data set labels are generated. Each label includes the file name of an image and the gradation category to which it belongs.
[0106] In specific implementation, step S3 specifically includes the following sub-steps:
[0107] S3.1, Image size adjustment: Before inputting the dataset into Vision Transformer, resize each image in the dataset to 224×224 to meet the size requirements of Vision Transformer for input images;
[0108] S3.2, brightness matching: When taking the asphalt mixture specimen image in step S1, a slight change in the camera exposure value will cause a slight change in the brightness of the captured image, which directly interferes with the accuracy of gradation recognition. To solve this problem, brightness matching is performed on all images of the same gradation in the dataset;
[0109] S3.3, Image enhancement: Perform histogram equalization on each sample in the data set, redistribute the pixel values of the image so that the histogram of the image is evenly distributed in the entire grayscale range, thereby enhancing the contrast of the image, and performing denoising to reduce the noise in the image and improve the image quality;
[0110] S3.4, Data augmentation: The dataset is augmented to increase the number of samples. Considering the characteristics of asphalt mixture slices, that is, the features are evenly distributed in the whole image, CutMix and MixUp data augmentation methods are used. The CutMix algorithm randomly cuts a part of the image from the training image, and then cuts the same position in another image to fill the original image to obtain a rich image. The MixUp algorithm randomly extracts two samples from the training sample and performs a simple random weighted summation, and the labels of the samples are also weighted summed accordingly.
[0111] In specific implementation, step S4 specifically includes the following sub-steps:
[0112] S4.1, divide the data set into a data set and a test set with a ratio of 8:2, and input the training set for training;
[0113] S4.2, the network divides each image into several patches and flattens them;
[0114] S4.3, linearly mapping the flattened patches to a low-dimensional space and adding position encoding information to generate an image sequence;
[0115] S4.4, send the image sequence to the standard Transformer Encoder to extract features;
[0116] S4.5. Input the extracted features into the MLP module for classification;
[0117] S4.6. Compare the classification result with the label, calculate the loss function, and backpropagate to update the network weights.
[0118] Application Example 1
[0119] Select 20 specimens of asphalt mixtures with four gradations, namely AC13, RAC13, SMA13, and EA10 (taking small beams as an example). Place the small beams stably on the table, and use a tripod and a high-definition camera to take pictures of the four surfaces of the small beams from a top-down perspective, obtaining a total of 320 images. Manually crop the effective parts (removing invalid parts such as damage and stains), and a total of 320 images are obtained. At the same time, record the gradation information corresponding to each image.
[0120] Use the imread() function of the OpenCV library to read the above 320 images one by one, and read the width w and height h of the image and calculate the aspect ratio If r is less than 1, directly perform cropping; otherwise, rotate the image by 90°, recalculate r (at this time r must be greater than 1) and then perform cropping; according to the aspect ratio r of the image, crop the image according to the following logic and use the imwrite() function to save: if 0 < r < 1.8, crop into 1 piece; if 1.8 ≤ r < 2, crop into 2 pieces; if 2 ≤ r < 2.5, crop into 3 pieces; if 2.5 ≤ r < 3, crop into 4 pieces; if r ≥ 3, crop into n + 3 pieces, where n is the integer after taking the integer part of the aspect ratio. Crop a number of square images as samples according to the above process, and establish a dataset in combination with the recorded gradation information.
[0121] Preprocess the dataset. Adjust the size of each image in the dataset to 224×224 to meet the size requirements of VisionTransformer for input images; perform brightness matching on all images of the same gradation in the dataset to solve the interference caused by slight changes in the exposure value of the camera when taking pictures of small beam images;
[0122] Perform histogram equalization on each sample in the dataset. By redistributing the pixel values of the image, the histogram of the image is evenly distributed within the entire gray range, thereby enhancing the contrast of the image, and perform denoising to reduce the noise in the image and improve the image quality; use the CutMix and MixUp data augmentation methods on the dataset to increase the number of samples and expand the dataset.
[0123] The dataset is divided into a dataset and a test set at an 8:2 ratio, and the training set is input to train the Vision Transformer network. The network divides each image into several patches and flattens them, linearly maps the flattened patches to a low-dimensional space, and adds position encoding information to generate an image sequence. The image sequence is sent to a standard Transformer Encoder to extract features, and the extracted features are input into the MLP module for classification and the classification results are compared with the labels. The loss function is calculated, and the network weights are updated through backpropagation to complete the training.
[0124] Use the test set to test the network, and use the classification accuracy as the evaluation indicator. If it meets the requirements, use the currently trained network for subsequent gradation recognition tasks.
[0125] The above description of the embodiments is to facilitate the understanding and use of the invention by those skilled in the art. It is obvious that those skilled in the art can easily make various modifications to these embodiments and apply the general principles described herein to other embodiments without creative work. Therefore, the present invention is not limited to the above embodiments, and improvements and modifications made by those skilled in the art based on the disclosure of the present invention without departing from the scope of the present invention should be within the scope of protection of the present invention.
Claims
1. A method for identifying asphalt mixture gradation based on Vision Transformer, characterized in that: The following steps are involved: Slices of asphalt mixture specimens are photographed to obtain specimen slice diagrams, and the gradation of each asphalt mixture specimen is recorded; Based on the effective part of the specimen slice image, the image is cut and constructed according to a predetermined aspect ratio, and a data sample set is generated; After preprocessing the data sample set, divide it into a training set and a test set according to a predetermined ratio; Inputting the training set into the Vision Transformer network, and performing training using the classification accuracy as an evaluation index to obtain a trained Vision Transformer network; inputting the test set into the trained Vision Transformer network to test the training effect; The trained Vision Transformer network is used to realize the recognition of asphalt mixture level.
2. The asphalt mixture gradation identification method based on Vision Transformer according to claim 1 is characterized in that: The specific steps for cropping and constructing according to the predetermined aspect ratio are as follows: Remove the invalid background in the specimen slice image, define the direction in which the height is greater than the width as the vertical direction; rotate the vertical specimen slice image to the horizontal direction, and obtain the original data set P = {Pic1, Pic2, ..., Pic n }, n is the size of the data set, and the aspect ratio of each slice is calculated i∈1,2,…,n,r i >1; For each slice Pic i , according to the aspect ratio Use OpenCV image processing library according to the cropping rules to convert Pic i Cut into m i A square sub-image Where m i =f(r i ); f(r i ) is determined according to the balance between the number of sub-graphs cut and the similarity, that is, the number of sub-graphs is made larger while ensuring the similarity between sub-graphs is low; After completing the automatic cropping, combine each slice Pic i Grading information G i , construct asphalt mixture gradation identification dataset:
3. The asphalt mixture gradation identification method based on Vision Transformer according to claim 1 is characterized in that: The asphalt mixture gradation identification dataset D G The preprocessing includes: Adjust the size of the input image to the predetermined size and read the dataset D G All images in D G For each image in , perform brightness matching; Use histogram equalization and image denoising to enhance image contrast, remove noise and improve image quality; Considering the characteristics of asphalt mixture slice images, that is, the features are evenly distributed in the whole image, CutMix and MixUp data augmentation methods are used.
4. The asphalt mixture gradation identification method based on Vision Transformer according to claim 1 is characterized in that: The training and gradation recognition process of the Vision Transformer network is as follows: The dataset is divided into a dataset and a test set at a ratio of 8:2, and the training set is input for training; The network divides each image into several patches and flattens them; The flattened patches are linearly mapped to a low-dimensional space and position encoding information is added to generate an image sequence. The position encoding is as follows: Among them, pos is the position index (the location information of the patch after the image is divided into several patches), j is the dimension index (PE (pos,2j) Represents the encoding of the odd dimensions of the input image, PE (pos,2j+1) represents the encoding of the odd dimensions of the input image), d is the encoding dimension (the total length of the position encoding vector); Feed the image sequence into a standard Transformer Encoder to extract features; The extracted features are input into the MLP module for classification; The classification results are compared with the labels, the cross entropy loss function is calculated, and the network weights are updated by backpropagation until the training is completed.
5. The asphalt mixture gradation identification method based on Vision Transformer according to claim 4 is characterized in that: The calculation formula of the cross entropy loss function is as follows: Among them, Class is the collection of mixture gradation categories in the data set, c is a category in Class, and y c and are the true value of sample y in the data set and the predicted value of sample y by the network; The trained Vision Transformer network is tested using the test set, and the classification accuracy is used as an indicator to measure the performance of the network. If it meets the requirements, the network is used to complete the subsequent asphalt mixture gradation identification task.
6. An asphalt mixture gradation recognition system based on Vision Transformer, used to implement the asphalt mixture gradation recognition method according to any one of claims 1 to 5, characterized in that: include: The first module is configured to photograph the slices of the asphalt mixture specimen to obtain a specimen slice diagram and record the gradation of each asphalt mixture specimen; The second module is configured to cut and construct based on the effective part of the sample slice image according to a predetermined aspect ratio, and generate a data sample set; After preprocessing the data sample set, divide it into a training set and a test set according to a predetermined ratio; The third module is configured to input the training set into the Vision Transformer network, train the network with classification accuracy as an evaluation indicator to obtain a trained Vision Transformer network; input the test set into the trained Vision Transformer network to test the training effect; The fourth module is configured to use the trained Vision Transformer network to realize asphalt mixture level recognition.