A soil strength identification method and system based on image analysis and machine learning
Through image analysis and machine learning methods, the shear strength of soil is quickly and accurately identified, solving the time-consuming and labor-intensive problem of traditional detection methods, and achieving efficient and accurate detection of soil strength.
Patent Information
- Application Number
- CN202310357845.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2043-03-31
AI Technical Summary
Traditional soil shear strength detection methods are time-consuming and labor-intensive, resulting in inefficiency.
Using an image analysis and machine learning method, the surface image and spectral image of the soil are obtained, the particle size, mineral composition and moisture content are identified, and the shear intensity of the soil is determined by combining the trained intensity recognition model.
It realizes rapid and accurate analysis of soil shear strength, saves time and effort, and comprehensively considers the moisture content, particle grading and mineral composition content of soil, improves detection accuracy.
Smart Images

Figure CN116593457B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of soil strength testing, and in particular to a soil strength identification method and system based on image analysis and machine learning. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Particle size distribution, moisture content, and mineral composition are important factors affecting the shear strength of soil. In practical engineering, the shear strength of soil is often determined by obtaining the particle size distribution, moisture content, and mineral composition of the soil.
[0004] Traditional particle grading testing involves manual screening or using a shaking sieve to screen soil particles, and then manually calculating the grading curve. Although this method is technically mature, it is time-consuming and labor-intensive.
[0005] Currently, commonly used methods for measuring soil moisture content include mass method, radiation method, dielectric method, remote sensing method, ground penetrating radar method, etc. These methods take at least 8 hours to measure moisture content.
[0006] Since obtaining particle grading and moisture content is time-consuming and labor-intensive, the efficiency of obtaining soil shear strength is very low. Summary of the Invention
[0007] In order to solve the above problems, the present invention proposes a soil strength identification method and system based on image analysis and machine learning. By acquiring the surface image and spectral image of the soil, the shear strength of the soil can be analyzed, saving time and effort.
[0008] To achieve the above object, the present invention adopts the following technical solutions:
[0009] First, a soil strength identification method based on image analysis and machine learning is proposed, including:
[0010] Obtain surface images and spectral images of soil;
[0011] Identify particles in the surface image and obtain particle size;
[0012] Determine the particle size distribution of the soil based on the particle size;
[0013] Get the RGB mean of the surface image;
[0014] Determine the soil moisture content based on the RGB mean;
[0015] Identify the spectral image and obtain the mineral composition and content in the image;
[0016] The shear strength of the soil is determined based on its particle grading, moisture content, mineral composition and content, and the trained strength identification model.
[0017] Secondly, a soil strength identification system based on image analysis and machine learning is proposed, including:
[0018] An image acquisition module is used to acquire surface images and spectral images of soil;
[0019] The particle gradation acquisition module is used to identify particles in the surface image and obtain particle size; the particle gradation of the soil is determined based on the particle size;
[0020] The soil moisture content determination module is used to obtain the RGB mean of the surface image and determine the soil moisture content based on the RGB mean;
[0021] The mineral composition determination module is used to identify the spectral image and obtain the mineral composition and content in the image;
[0022] The soil strength determination module is used to determine the shear strength of the soil based on the particle gradation, moisture content, mineral composition and content of the soil and the trained strength identification model.
[0023] In a third aspect, an electronic device is proposed, comprising a memory and a processor, and computer instructions stored in the memory and running on the processor. When the computer instructions are run by the processor, the steps of a soil strength identification method based on image analysis and machine learning are completed.
[0024] In a fourth aspect, a computer-readable storage medium is proposed for storing computer instructions. When the computer instructions are executed by a processor, the steps of a soil strength identification method based on image analysis and machine learning are completed.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] 1. The present invention can analyze the shear strength of soil by acquiring the surface image and spectral image of the soil, saving time and effort.
[0027] 2. The present invention obtains the surface image and spectral image of the soil and identifies the images to obtain the moisture content, particle gradation and mineral content of the soil. The moisture content, particle gradation and mineral content of the soil are identified through a machine learning algorithm to determine the shear strength of the soil. When determining the shear strength of the soil, the moisture content, particle gradation and mineral content of the soil are comprehensively considered, making the obtained soil shear strength more accurate.
[0028] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings in the specification, which constitute a part of this application, are used to provide further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute improper limitations on this application.
[0030] Figure 1 This is a flow chart of the method disclosed in Example 1. DETAILED DESCRIPTION
[0031] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0032] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present application belongs.
[0033] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0034] Example 1
[0035] In order to achieve rapid and accurate identification of soil shear strength, in this embodiment, a soil strength identification method based on image analysis and machine learning is disclosed. Figure 1 Shown, including:
[0036] S1: Obtain the surface image and spectral image of the soil.
[0037] The surface image of the soil body is acquired by an image acquisition device, and a standard light source is set for the image acquisition device. When the image acquisition device acquires the surface image of the soil body, the standard light source provides illumination for the image acquisition device.
[0038] The image acquisition device is a digital camera, a video camera or an industrial camera, etc. The lens of the image acquisition device is vertically aligned with the surface of the soil to be measured to obtain the surface image of the soil.
[0039] The spectral image of the soil is obtained through the infrared spectrum sampling device.
[0040] S2: Identify particles in the surface image and obtain particle size; determine the particle gradation of the soil based on the particle size.
[0041] The process of identifying particles in the surface image and obtaining the particle size is as follows:
[0042] S211: Convert the surface image into a grayscale image and generate a binary image of the grayscale image.
[0043] Specifically:
[0044] Perform grayscale equalization on the surface image, process the surface image into a grayscale image with uniform histogram distribution, and enhance the contrast of the grayscale image to improve the clarity of the grayscale image;
[0045] Apply a bilateral filter to the grayscale balanced image to remove image noise while preserving image edges and removing interference caused by dust and uneven lighting.
[0046] The image after bilateral filter processing is thresholded, and the OTSU and local double-window threshold optimization methods are used to distinguish the target and background of the image and generate a binary image.
[0047] S212: Mark the target boundary of the binary image and generate a distance grayscale image of the target.
[0048] Specifically: perform eight-chain code processing on the binary image, find connected areas, fill target holes, remove internal noise from the binary image, and mark the target boundary. The target holes are soil pores.
[0049] The binary image with the target boundary marked is subjected to distance transformation processing, and the foreground target of the binary image is grayed out so that the R, G, and B values of the grayed out image are equal to the largest of the three values before transformation, that is: R=G=B=max(R, G, B), so that the image appears as a three-dimensional mountain peak and the distance grayscale image of the target is obtained.
[0050] S213: Reconstruct the distance grayscale image.
[0051] Specifically, the over-segmentation caused by the redundant peaks formed by the distance transformation in the target's range grayscale image is removed.
[0052] S214: performing watershed segmentation on the reconstructed distance grayscale image using an edge detection algorithm to obtain a particle image in the image. The particle image is a particle recognition result obtained when performing particle recognition on the surface image; and obtaining particle sizes based on the particle image.
[0053] In the specific implementation, the image edge detection algorithm based on morphological gradient is used to perform watershed segmentation on the reconstructed distance grayscale image.
[0054] The process of obtaining particle size based on particle image is as follows:
[0055] According to the particle image, the particle geometric characteristic area and perimeter are obtained;
[0056] The particle size is determined based on the particle's geometric characteristic area and perimeter.
[0057] After identifying the particles from the surface image, the characteristic size of the particles in each particle image is calculated by the number of pixels and the length represented by a single pixel, including the particle geometric characteristic area and perimeter.
[0058] According to the particle geometric characteristic area S and perimeter C, the major axis x and minor axis y of the circumscribed matching ellipse of the particle area are determined; according to the major axis x and minor axis y, the particle size d is determined. Specifically:
[0059]
[0060]
[0061]
[0062] The specific process of determining the particle size distribution of soil according to particle size is as follows:
[0063] S221: Classify the particle size levels according to the particle size.
[0064] The particle shape is assumed to be an ellipsoid, and the particle size d is used as the size that can be sieved in the corresponding screening test. The particle size grades are divided according to the particle size d.
[0065] S222: Count the number of particles in each particle size level and calculate the volume of each particle.
[0066] During specific implementation, the volume of each particle is calculated according to the ellipsoid volume calculation formula.
[0067] S223: Determine the mass of each particle based on the volume of each particle.
[0068] Assuming that the density of all particles is the same, the mass of each particle is determined based on the density of the particles and the volume of each particle.
[0069] S224: Determine the total mass of particles in each particle size level based on the number of particles in each particle size level and the mass of a single particle in the corresponding level.
[0070] In specific implementation, for a certain particle size level, the number of particles in the particle size level and the mass of a single particle in the particle size level are multiplied to obtain the total mass of the particles in the particle size level.
[0071] S225: The sum of the masses of all particles is the total mass of soil particles.
[0072] S226: Calculate the percentage of the total mass of particles of each particle size level to the total mass of soil particles, obtain the particle gradation of the soil, and then draw a particle gradation curve of the soil.
[0073] S3: Obtain the RGB mean of the surface image and determine the soil moisture content based on the RGB mean, including:
[0074] The pixel values of each color of the surface image are calculated, and the RGB mean of the surface image is determined based on the pixel values of each color. The soil moisture content is determined based on the RGB mean of the surface image and the corresponding relationship between the RGB mean and the moisture content.
[0075] Among them, the process of obtaining the corresponding relationship between RGB mean and moisture content is as follows:
[0076] Photograph multiple groups of soils with different moisture contents to be tested, and obtain surface images of the different soils to be tested. The moisture content of the soils to be tested is known. When photographing the soils to be tested, adjust and maintain the positions of the image acquisition instrument and the standard light source, as well as their operating parameters, to obtain digital images with consistent illumination and stable quality.
[0077] The color analysis program is used to process the surface images of the different soil bodies to be tested that are collected and stored to obtain the RGB mean μ that can better represent the color information. L ;
[0078] According to the RGB mean value and the corresponding moisture content of the soil image to be tested, the corresponding relationship between the RGB mean value and the moisture content is determined.
[0079] S4: Identify the spectral image and obtain the mineral composition and content in the image.
[0080] Spectral analysis is used to determine and analyze the mineral composition and content in the soil. The mineral components in the soil mainly include clay minerals and non-clay minerals. Clay minerals include kaolinite, montmorillonite and illite, and non-clay minerals include feldspar and quartz.
[0081] By identifying the spectral image, the numerical value of the mineral component content is calculated.
[0082] Through ultraviolet and visible light spectral analysis, we can conduct multi-faceted research on rocks and minerals and obtain rock and mineral related data. The values obtained using this method have the advantages of being fast and accurate.
[0083] S5: Determine the shear strength of the soil based on its particle size distribution, moisture content, mineral composition and content, and the trained strength identification model.
[0084] Among them, the intensity recognition model is constructed based on the back propagation neural network.
[0085] The constructed strength identification model takes the particle gradation, moisture content and mineral content of the soil as input, and the shear strength of the soil as output. The activation function of the strength identification model adopts the linear rectification function. The linear rectification function converges faster than the Sigmoid and tanh functions, and there is no gradient saturation, making the calculation more efficient.
[0086] The process of obtaining a trained intensity recognition model is:
[0087] Investigate data, determine the soil for training, and obtain the shear strength of the soil for training;
[0088] Acquire surface images and spectral images of training soil;
[0089] Identify particles in the surface image of the training soil, determine the geometric characteristic area and perimeter of the particles, determine the particle size based on the geometric characteristic area and perimeter of the particles, and determine the particle gradation of the training soil based on the particle size;
[0090] Obtaining the RGB mean value of the surface image of the training soil, and determining the moisture content of the training soil according to the RGB mean value;
[0091] Identify the spectral image of the training soil to obtain the mineral composition and content of the training soil;
[0092] The particle size distribution, moisture content, mineral composition and content of the training soil are used as input data for the strength recognition model, and the shear strength of the training soil is used as a label to construct a training dataset.
[0093] 70% of the data in the training data set is used as a training set, and 30% of the data is used as a test set to train the intensity recognition model. When the training is completed, a trained intensity recognition model is obtained.
[0094] The data in the training set and test set are randomly selected.
[0095] The hidden layer parameters in the intensity recognition model were set to 8, 10, 16, 18, 20, and 18, respectively, and the data were fitted.
[0096] The learning rate affects the amount of weight change that occurs during training. To ensure the stability of the model, a smaller learning rate is used. The learning rate selection range is 0.01 to 0.8.
[0097] The fitting determination coefficient R2 is selected to characterize the fitting effect of the strength recognition model. The closer the R2 value is to 1, the better the effect.
[0098] The mean absolute error (MAE) is selected to represent the average difference between the predicted value and the true value. The smaller the value, the better.
[0099] The mean square error (MSE) was selected to evaluate the degree of data variation; the smaller the MSE value, the better the accuracy of the prediction model in describing the experimental data.
[0100] Before training and testing the model, the values of moisture content, particle size distribution, mineral content and shear strength were normalized using the normalization formula to ensure that the model has a good fitting effect.
[0101] The particle size distribution, moisture content and mineral content of the soil obtained by S2, S3 and S4 are input into the trained strength identification model to obtain the shear strength of the soil.
[0102] The method disclosed in this embodiment can analyze the shear strength of soil by acquiring the surface image and spectral image of the soil, saving time and effort.
[0103] Furthermore, this embodiment comprehensively considers the moisture content, particle size distribution, and mineral content of the soil when determining the shear strength of the soil, so that the obtained shear strength of the soil is more accurate.
[0104] Example 2
[0105] In this embodiment, a soil strength identification system based on image analysis and machine learning is disclosed, including:
[0106] An image acquisition module is used to acquire surface images and spectral images of soil;
[0107] The particle gradation acquisition module is used to identify particles in the surface image and obtain the geometric characteristic area and perimeter of the particles; determine the particle size based on the geometric characteristic area and perimeter of the particles; and determine the particle gradation of the soil based on the particle size;
[0108] The soil moisture content determination module is used to obtain the RGB mean of the surface image and determine the soil moisture content based on the RGB mean;
[0109] The mineral composition determination module is used to identify the spectral image and obtain the mineral composition and content in the image;
[0110] The soil strength determination module is used to determine the shear strength of the soil based on the particle gradation, moisture content, mineral composition and content of the soil and the trained strength identification model.
[0111] Example 3
[0112] In this embodiment, an electronic device is disclosed, including a memory and a processor, and computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, the steps described in the soil strength identification method based on image analysis and machine learning disclosed in Example 1 are completed.
[0113] Example 4
[0114] In this embodiment, a computer-readable storage medium is disclosed for storing computer instructions. When the computer instructions are executed by a processor, the steps described in the soil strength identification method based on image analysis and machine learning disclosed in Example 1 are completed.
[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A soil strength identification method based on image analysis and machine learning, characterized in that: include: Obtain surface images and spectral images of soil; Identify particles in the surface image and obtain particle size; Determine the particle size distribution of the soil based on the particle size; Obtain the RGB mean of the surface image and determine the soil moisture content based on the RGB mean; Identify the spectral image and obtain the mineral composition and content in the image; The shear strength of the soil is determined based on its particle grading, moisture content, mineral composition and content, and the trained strength identification model.
2. The soil strength identification method based on image analysis and machine learning according to claim 1, characterized in that: The process of identifying particles in the surface image and obtaining the particle size is as follows: Converting the surface image into a grayscale image and generating a binary image of the grayscale image; Mark the target boundary of the binary image and generate the target's distance grayscale image; Reconstruct the distance grayscale image; Perform watershed segmentation on the reconstructed distance grayscale image according to the edge detection algorithm to obtain the particle image in the image; The particle size is obtained based on the particle image.
3. The soil strength identification method based on image analysis and machine learning according to claim 1, characterized in that: The process of obtaining particle size based on particle image is as follows: According to the particle image, the particle geometric characteristic area and perimeter are obtained; The particle size is determined based on the particle's geometric characteristic area and perimeter.
4. The soil strength identification method based on image analysis and machine learning according to claim 1, characterized in that: The particle size classes are divided according to the particle size; Count the number of particles in each size class and calculate the volume of each particle; Based on the volume of each particle, determine the mass of each particle; Determine the total mass of particles in each size class based on the number of particles in each size class and the mass of a single particle in the corresponding class; The sum of the masses of all particles is the total mass of soil particles; Calculate the percentage of the total mass of particles of each particle size level to the total mass of soil particles to obtain the particle gradation of the soil.
5. The soil strength identification method based on image analysis and machine learning according to claim 1, characterized in that: Calculate the pixel value of each color of the surface image, and determine the RGB mean of the surface image based on the pixel value of each color.
6. The soil strength identification method based on image analysis and machine learning according to claim 1, characterized in that: The soil moisture content is determined based on the RGB mean of the surface image and the corresponding relationship between the RGB mean and the moisture content.
7. The soil strength identification method based on image analysis and machine learning according to claim 1, characterized in that: The strength identification model takes the particle size distribution, moisture content and mineral content of the soil as input and the shear strength of the soil as output, and is constructed using a back-propagation neural network.
8. A soil strength identification system based on image analysis and machine learning, characterized in that: include: An image acquisition module is used to acquire surface images and spectral images of soil; Particle gradation acquisition module, used to identify particles in the surface image and obtain particle size; Determine the particle size distribution of the soil based on the particle size; The soil moisture content determination module is used to obtain the RGB mean of the surface image and determine the soil moisture content based on the RGB mean; The mineral composition determination module is used to identify the spectral image and obtain the mineral composition and content in the image; The soil strength determination module is used to determine the shear strength of the soil based on the particle gradation, moisture content, mineral composition and content of the soil and the trained strength identification model.
9. An electronic device, characterized in that: The invention comprises a memory and a processor and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of the soil strength identification method based on image analysis and machine learning as described in any one of claims 1 to 7 are completed.
10. A computer-readable storage medium, characterized in that Used to store computer instructions, which, when executed by a processor, complete the steps of a soil strength identification method based on image analysis and machine learning as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method of testing soil surface water content based on image RGB value and device
CN109932324A
Online ore granularity detection method based on image recognition technology
CN112330653A