Sandstone detection method based on ResNet18 deep convolutional neural network
Through the sand and gravel detection method based on ResNet18 deep convolutional neural network, the problem of manual identification in the existing technology cannot meet the industry needs is solved, and fast and accurate sand and gravel classification is achieved, saving labor costs and improving the reliability of the detection results.
Patent Information
- Application Number
- CN202311202955.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-18
- Publication Date
- 2025-03-18
AI Technical Summary
The existing technology can no longer meet the development needs of the industry and can achieve rapid and accurate classification of sand and gravel by relying on manual experience and naked eye identification.
The sand and gravel detection method based on ResNet18 deep convolutional neural network is adopted to obtain sand and gravel materials images through shooting equipment, image preprocessing and defogging processing are performed, and finally input the ResNet18 network model to obtain classification results.
It realizes fast, accurate and manual participation in sand and gravel classification, saves labor costs, avoids the impact of human factors on the test results, and improves the reliability of the test results.
Smart Images

Figure CN119649079A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of sand and gravel classification, and specifically, relates to a sand and gravel detection method based on a ResNet18 deep convolutional neural network. Background Art
[0002] Sand and gravel are the main force in infrastructure construction. As an important structural material for construction projects, sand and gravel have made important contributions to the construction of my country's infrastructure and various types of construction projects. Sand and gravel are the general term for construction sand and construction stone. According to relevant national standards, construction sand is divided into natural sand, machine-made sand and mixed sand according to the source of production; construction stone is divided into pebbles and crushed stone. Crushed stone is classified according to particle size. The current mainstream actual classification involves the following five categories, including stone powder, machine-made sand, rice stone (also known as 0-1 crushed stone), 1-2 crushed stone and 1-3 crushed stone. Rice stone has a smaller particle size, 1-2 crushed stone has a moderate particle size, and 1-3 crushed stone has a larger particle size than 1-2 crushed stone, and the particle shape is more regular, fuller and more uniform.
[0003] When the sand and gravel manufacturer delivers the goods to the delivery location designated by the buyer, it is very important to classify and accept the sand and gravel. Different product classifications not only involve the price of the goods, but also affect the effect of the product in subsequent use scenarios. Therefore, accurate inspection and classification of sand and gravel is a key link. At present, when Party A delivers the goods to Party B, Party B will specially arrange staff to inspect and accept them. Specifically, Party A will hand over the delivery note to Party B, and Party B will take photos of the materials through monitoring equipment and check them with the information on the delivery note to complete the receipt of the goods and confirm the classification of the products.
[0004] At present, sand and gravel detection based on manual experience and visual identification can no longer meet the development needs of the industry. Summary of the invention
[0005] In view of the problem that the existing technology of sand and gravel detection relying on manual experience and naked eye recognition can no longer meet the development needs of the industry, the present invention provides a sand and gravel detection method based on ResNet18 deep convolutional neural network.
[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is as follows:
[0007] A sand and gravel detection method based on ResNet18 deep convolutional neural network, comprising the steps of:
[0008] S1. Acquire images of sand and gravel materials through a photographing device;
[0009] S2, performing image preprocessing on the sand and gravel material image;
[0010] S3, introducing an image defogging method based on dark channel prior to remove dust interference from the pre-processed sand and gravel material image;
[0011] S4. Input the ResNet18 network model to obtain the classification results.
[0012] Furthermore, the detailed steps of image preprocessing in step S2 include:
[0013] S21, enlarging the image of sand and gravel materials;
[0014] S22, intercepting a central area image of the sand and gravel material image;
[0015] S23, scaling the image size of the central area to a multiple of 32.
[0016] Furthermore, the detailed steps of removing dust interference in step S3 are as follows:
[0017] S31, estimation of atmospheric light intensity: using the brightness of the dark channel of the image to estimate the overall atmospheric light intensity;
[0018] S32, calculating the rough transmittance: calculating the transmittance according to the dark channel priori formula;
[0019] S33. Image restoration: The restored fog-free image is obtained by calculating the atmospheric light intensity and transmittance in the R, G, and B channels of the image respectively.
[0020] Furthermore, the atmospheric light intensity is estimated by:
[0021] First, take the brightest pixel of the dark channel image at one thousandth;
[0022] Then find the corresponding positions of these pixels in the original color image;
[0023] Finally, find the point with the highest brightness among these positions in the original color image as the estimated value of the atmospheric light intensity.
[0024] Furthermore, in step S4, the conveyor belt for transporting sand and gravel materials or the canvas on the conveyor belt needs to be added as a separate category to the ResNet18 network model for training; and the background in the picture is determined to be sand and gravel materials or canvas.
[0025] Furthermore, the ResNet18 network model includes a training stage and a prediction stage; in the training stage, the center of the image is cropped and enlarged to a size of 1212×1212, and then trained with the ResNet18 network to obtain the ResNet18 network model; in the prediction stage, the center of the image is cropped, and after removing dust interference with a dehazing algorithm based on a dark channel prior, the image is enlarged to a size of 1212×1212, and finally the classification result is predicted by the trained ResNet18 network.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] By collecting the center image of sand and gravel in the unmanned weighing system of the gravel field for preprocessing, removing dust interference and inputting the ResNet18 network model, the sand and gravel classification can be detected quickly, accurately and conveniently without human intervention, thus saving labor costs and avoiding the influence of human factors on the detection results, making the detection results more reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is an overall flow chart of a sand and gravel detection method based on a ResNet18 deep convolutional neural network in an embodiment of the present invention;
[0029] Figure 2 This is the flow chart of the ResNet18 network model training phase;
[0030] Figure 3 This is the flow chart of the prediction phase of the ResNet18 network model;
[0031] Figure 4 Schematic diagram of the size of gravel model 1-2 stone;
[0032] Figure 5 Schematic diagram of the size of gravel model 1-3 stones;
[0033] Figure 6 Data comparison chart after dehazing and dust removal. DETAILED DESCRIPTION
[0034] In order to facilitate the understanding of those skilled in the art, the present invention is further described below in conjunction with embodiments and drawings. The contents mentioned in the implementation modes are not intended to limit the present invention.
[0035] like Figure 1 As shown, this embodiment provides a sand and gravel detection method based on ResNet18 deep convolutional neural network, including the steps of:
[0036] S1. Acquire images of sand and gravel materials through a photographing device;
[0037] S2, performing image preprocessing on the sand and gravel material image;
[0038] S3, introducing an image defogging method based on dark channel prior to remove dust interference from the pre-processed sand and gravel material image;
[0039] S4. Input the ResNet18 network model to obtain the classification results.
[0040] like Figure 4 and 5 As shown, Figure 4 1-2 stone, Figure 5 1-3 stone. There are four types of materials to be classified: machine-made sand, 0-1 stone, 1-2 stone, and 1-3 stone. Among them, except for 1-2 stone and 1-3 stone, which are similar and difficult to distinguish, the other materials are relatively easy to distinguish. Through analysis, it is not difficult to conclude that the biggest difference between 1-2 stone and 1-3 stone is the size, but the image scale obtained at different shooting distances is not the same, which weakens the size difference between the two. The 1-3 stone photographed at a farther distance is easy to be classified as 1-2 stone, while the 1-2 stone photographed at a closer distance is easy to be identified as 1-3 stone. However, another important feature of 1-2 stone and 1-3 stone is that 1-3 stone is basically all relatively large stones. Compared with 1-2 gravel, it has a larger particle size, a more regular, fuller and more uniform particle shape, while 1-2 stone has large and small sizes. For example Figure 2 and 3 As shown, the detailed steps of image preprocessing in step S2 include:
[0041] S21, enlarging the image of sand and gravel materials;
[0042] S22, intercepting a central area image of the sand and gravel material image;
[0043] S23, scaling the image size of the central area to a multiple of 32.
[0044] Considering that the target is a small target, the image is enlarged by 1 times and detected at a larger scale.
[0045] Considering the computing speed and the fact that the entire image is not required for classification, a sub-image of the central area is first captured and then enlarged.
[0046] The size of the intercepted center area is 600×600. This parameter can ensure that the intercepted area contains the target rather than the external area of the vehicle. The size after enlargement is 1216. Enlargement by 1 times is a suitable multiple for the current dataset. The input image size of the network ResNet used must be a multiple of 32.
[0047] Detailed steps for removing dust interference in step S3:
[0048] S31, estimation of atmospheric light intensity: using the brightness of the dark channel of the image to estimate the overall atmospheric light intensity;
[0049] S32, calculating the rough transmittance: calculating the transmittance according to the dark channel priori formula;
[0050] The atmospheric scattering model is deformed as follows:
[0051]
[0052] Assume that in the region Ω(x), the transmittance t(x) is a constant, denoted by Perform two minimum value filters on both ends of the above equation. The first filter takes the minimum value of the three channels R, G, and B at both ends of the equation. The second filter takes the minimum value in the square area centered on the target pixel as the value of the pixel. The formula is as follows:
[0053]
[0054] According to the dark channel prior theory:
[0055]
[0056] Substituting (3) into (2) we can obtain the transmittance:
[0057]
[0058] S33. Image restoration: The restored fog-free image is obtained by calculating the atmospheric light intensity and transmittance in the R, G, and B channels of the image respectively.
[0059]
[0060] The transmittance t(x) is a value between 0 and 1. When a certain value of t(x) is 0, according to the above formula, the pixel value of the corresponding point in the image tends to infinity, which is what we do not want to see. Therefore, in order to avoid this situation, we introduce the parameter t0 that limits the transmittance threshold to control the lower limit of the transmittance. The corrected expression is:
[0061]
[0062] Estimation method of atmospheric light intensity:
[0063] First, take the brightest pixel of the dark channel image at one thousandth;
[0064] Then find the corresponding positions of these pixels in the original color image;
[0065] Finally, find the point with the highest brightness among these positions in the original color image as the estimated value of the atmospheric light intensity.
[0066] In real application scenarios, due to the special environment of the gravel field, the collected images are often disturbed by dust, which reduces the image quality and thus reduces the network recognition accuracy. To this end, the present invention introduces an image defogging method based on dark channel prior to remove dust interference in the scene. At the same time, in order to make the trained model have a certain adaptability to the situation where there is dust in the scene, the present invention does not remove dust in the training stage, but only removes dust in the testing stage.
[0067] In step S4, the conveyor belt for transporting sand and gravel materials or the canvas on the conveyor belt also needs to be added as a separate category to the ResNet18 network model for training; and the background in the picture is judged to be sand and gravel materials or canvas. In practical applications, in order to prevent aggregate goods from being wetted by rain or falling due to shaking during transportation, trucks transporting aggregates will be equipped with canvas. When the captured picture is a canvas, the network cannot output the correct result. To address this problem, the present invention adds canvas as a separate category to the training, so that it can be judged whether it is cargo or canvas. In the later test system, when the model detects that the current category is canvas, a prompt to open the canvas can be input to detect the cargo.
[0068] The ResNet18 network model includes a training stage and a prediction stage. In the training stage, the center of the image is cropped and enlarged to a size of 1212×1212, and then trained with the ResNet18 network to obtain the ResNet18 network model. In the prediction stage, the center of the image is cropped, and after removing dust interference with a dehazing algorithm based on a dark channel prior, the image is enlarged to a size of 1212×1212, and finally the classification result is predicted by the trained ResNet18 network.
[0069] Dataset: The data set for this training was collected from Longjida and is divided into four categories: machine-made sand, 0-1 stone, 1-2 stone, and 1-3 stone, with a total of 1912 images. The data distribution is shown in Table 1:
[0070] Machine-made sand 0-1 stone 1-2 stone 1-3 stones total Training set 417 286 404 260 1367 Validation set 172 107 176 90 545 total 589 393 580 350 1912
[0071] The misidentification of the validation set is as follows:
[0072] Identifying Error Conditions Identify the number of errors 0-1 stone is identified as machine-made sand 1 0-1 stone is recognized as 12 stone 1 1-2 stones are identified as 13 stones 5 1-2 stones are identified as 01 stone 1 1-2 stones are identified as machine-made sand 1 1-3 stones are identified as 12 stones 1
[0073] The ResNet model can be used to realize the material recognition currently faced;
[0074] The model can adapt to distance changes within a certain scale range: Since the data source for this training was installed with different camera focal length settings, it is equivalent to having two sets of images with different scales. This shows that the model can adapt to distance changes within a certain scale range.
[0075] Compared with the prior art, the present invention has the following beneficial effects:
[0076] By collecting the center image of sand and gravel in the unmanned weighing system of the gravel field for preprocessing, removing dust interference and inputting the ResNet18 network model, the sand and gravel classification can be detected quickly, accurately and conveniently without human intervention, thus saving labor costs and avoiding the influence of human factors on the detection results, making the detection results more reliable.
[0077] The above is a detailed introduction to a sand and gravel detection method based on the ResNet18 deep convolutional neural network provided by the present application. The description of the specific embodiment is only used to help understand the method and its core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A sand and gravel detection method based on ResNet18 deep convolutional neural network, characterized in that: Includes steps: S1. Acquire images of sand and gravel materials through a photographing device; S2, performing image preprocessing on the sand and gravel material image; S3, introducing an image defogging method based on dark channel prior to remove dust interference from the pre-processed sand and gravel material image; S4. Input the ResNet18 network model to obtain the classification results.
2. According to claim 1, a sand and gravel detection method based on ResNet18 deep convolutional neural network is characterized in that: The detailed steps of image preprocessing in step S2 include: S21, enlarging the image of sand and gravel materials; S22, intercepting a central area image of the sand and gravel material image; S23, scaling the image size of the central area to a multiple of 32.
3. According to claim 2, a sand and gravel detection method based on ResNet18 deep convolutional neural network is characterized in that: Detailed steps for removing dust interference in step S3: S31, estimation of atmospheric light intensity: using the brightness of the dark channel of the image to estimate the overall atmospheric light intensity; S32, calculating the rough transmittance: calculating the transmittance according to the dark channel priori formula; S33. Image restoration: The restored fog-free image is obtained by calculating the atmospheric light intensity and transmittance in the R, G, and B channels of the image respectively.
4. According to claim 3, a sand and gravel detection method based on ResNet18 deep convolutional neural network is characterized in that: Estimation method of atmospheric light intensity: First, take the brightest pixel of the dark channel image at one thousandth; Then find the corresponding positions of these pixels in the original color image; Finally, find the point with the highest brightness among these positions in the original color image as the estimated value of the atmospheric light intensity.
5. According to claim 4, a sand and gravel detection method based on ResNet18 deep convolutional neural network is characterized in that: In step S4, the conveyor belt for transporting sand and gravel materials or the canvas on the conveyor belt needs to be added as a separate category to the ResNet18 network model for training; and the background in the picture is determined to be sand and gravel materials or canvas.
6. According to claim 5, a sand and gravel detection method based on ResNet18 deep convolutional neural network is characterized in that: The ResNet18 network model includes a training phase and a prediction phase. In the training phase, the center of the image is cropped and enlarged to a size of 1212×1212, and then trained with the ResNet18 network to obtain the ResNet18 network model. In the prediction stage, the center of the image is cropped, and after the dust interference is removed by the dehazing algorithm based on the dark channel prior, it is enlarged to a size of 1212×1212, and finally the classification result is predicted by the trained ResNet18 network.