Soil texture detection device and method based on microscopic image

Through the soil texture detection device and method based on microscopic images, using a rotary drive mechanism and a microscopic image detection model, the tedious, time-consuming and environmentally harmful problems of traditional soil texture detection are solved, and high-precision and low-cost soil texture detection is achieved.

CN120609822APending Publication Date: 2025-09-09SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510832715.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

Traditional soil texture testing methods need to be carried out in the laboratory. The operation is cumbersome, time-consuming and environmentally harmful. The equipment is expensive and has limited accuracy, making it difficult to popularize on a large scale.

Method used

A soil texture detection device based on microscopic images is used, including a light box, an illumination module, a detection platform and a microscopic detection module. Combined with a rotary drive mechanism and a portable digital microscope, the soil particle composition and distribution are obtained through a microscopic image detection model. The convolutional neural network and the Transformer model are used for feature fusion to output soil texture content parameters.

Benefits of technology

It improves the accuracy and speed of soil texture detection, reduces detection costs, simplifies the operation process, reduces environmental hazards, and is suitable for large-scale application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120609822A_ABST
    Figure CN120609822A_ABST
Patent Text Reader

Abstract

The invention discloses a soil texture detection device and method based on a microscopic image, and the device comprises a light box, and an illumination module, a detection platform and a microscopic detection module which are disposed in the light box. The illumination module comprises a top light source arranged at the top of the light box and a light source driver connected with the top light source; the detection platform comprises a rotating platform and a rotating driving mechanism; the rotating platform is positioned right below the microscopic detection module; a soil container to be detected is placed on the rotating platform; the microscopic detection module is used for acquiring a soil surface microscopic image of the soil sample and transmitting the acquired soil surface microscopic image to the processing terminal; and the processing terminal obtains content parameters of sandy soil, silt and clay in the soil surface microscopic image based on an internal soil microscopic image detection model. According to the soil texture detection device, the soil texture detection precision can be improved, and the detection cost is lower.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of agricultural soil detection, and in particular relates to a soil texture detection device and method based on microscopic images. Background Art

[0002] Soil texture is one of the most important physical properties of soil. It specifically refers to the weight proportion of soil particles with a diameter of less than 2mm, including sand (0.05-2mm), silt (0.002-0.05mm), and clay (less than 0.002mm). Soil texture strongly affects soil water and nutrient retention, heat and air flow, and chemical and biological properties, all of which are closely related to crop growth. Therefore, understanding field soil texture information can help field workers select appropriate crops for planting, thereby achieving higher yields.

[0003] Traditional soil texture testing is often completed in the laboratory. The standard methods include the pipette method and the hydrometer method. Both are based on Stokes' law and determine the particle size distribution of soil particles by measuring the sedimentation rate of soil particles in liquid. Both methods require the use of chemical reagents to remove organic matter in the soil and disperse soil particles. The operation is particularly cumbersome and time-consuming, and the soil samples sent for inspection also have environmental hazards. Subsequent studies have also used ultrasonic, spectroscopy and other equipment to detect soil texture, but they are often limited by equipment prices and accuracy issues, making them difficult to popularize on a large scale. Summary of the Invention

[0004] In order to overcome the deficiencies of the prior art, the present invention provides a soil texture detection device based on microscopic images, which can improve the accuracy of soil texture detection and reduce the detection cost.

[0005] The second object of the present invention is to provide a soil texture detection method based on microscopic images.

[0006] The technical solution of the present invention to solve the above technical problems is:

[0007] A soil texture detection device based on microscopic images comprises a light box, an illumination module, a detection platform, and a microscopic detection module arranged within the light box, wherein the illumination module comprises a top light source arranged on the top of the light box and a light source driver connected to the top light source; the detection platform comprises a rotating platform and a rotating drive mechanism for driving the rotating platform to rotate; the rotating platform is located directly below the microscopic detection module; a soil container to be detected is placed on the rotating platform; the microscopic detection module is used to obtain a microscopic image of the soil surface of a soil sample and transmit the obtained soil surface microscopic image to a processing terminal; the processing terminal obtains the content parameters of sand, silt, and clay in the soil surface microscopic image based on an internal soil microscopic image detection model.

[0008] Preferably, the rotary drive mechanism includes a rotary motor; the main shaft of the rotary motor is connected to the rotary platform.

[0009] Preferably, the microscopic detection module is a portable digital microscope.

[0010] Preferably, a door is provided in the light box.

[0011] A soil texture detection method based on microscopic images comprises the following steps:

[0012] Step 1: Pre-treat the collected soil sample, place the pre-treated soil sample into a soil container, and transfer the soil container to the detection platform;

[0013] Step 2: The brightness of the top light source is adjusted by the light source driver; the soil sample in the soil container is detected by the microscopic detection module to obtain a microscopic image of the soil surface;

[0014] Step 3: Preprocessing the obtained soil surface microscopic image;

[0015] Step 4: Construct a soil microscopic image detection model, and send the preprocessed soil surface microscopic image to the trained soil microscopic image detection model, which outputs the content parameters of sand, silt and clay.

[0016] Preferably, in step 1, the pretreatment includes air-drying the soil sample, grinding it, and filtering it through a soil sieve with a pore size of 2 mm.

[0017] Preferably, in step 2, the rotating platform is driven to rotate by a rotating motor, thereby driving the soil container placed on the rotating platform to rotate, thereby prompting the microscopic detection module to continuously capture multiple different microscopic images of the soil surface.

[0018] Preferably, the height between the microscopic detection module and the soil container is 54.5 mm.

[0019] Preferably, in step S4, the soil microscopic image detection model includes a convolutional neural network layer, a Transformer layer, a cross-attention feature fusion layer, and a linear regression layer, wherein:

[0020] The preprocessed soil microscopic images are fed into the convolutional neural network layer and the Transformer layer respectively; wherein the convolutional neural network layer uses the ResNet-50 model to extract the position and content information of large-sized soil particles with clear imaging in the soil microscopic image, and finally outputs four first feature maps containing the local feature information of the original soil microscopic image in different dimensions; the Transformer layer uses the Vision Transformer model, and implements the self-attention mechanism through position encoding and the multi-head attention module in the Transformer Block to model the global image information in the soil microscopic image, obtain the long-distance dependency relationship between different regions in the soil microscopic image, and finally output a second feature map containing the overall position information of the original soil microscopic image;

[0021] The cross-attention feature fusion layer maps the local texture feature information of the first feature map output by the convolutional neural network layer to the overall position relationship map of the second feature map output by the Transformer layer, dynamically calculates and adaptively adjusts the weight of the fusion of the two, deeply fuses the first feature map and the second feature map, and outputs four third feature maps of different sizes that contain the deep fusion of the original soil microscopic images at different dimensions; interpolates the four third feature maps, adds them after aligning the resolution size, and finally fuses the four third feature maps into a fourth feature map;

[0022] The linear regression layer is used to compress and regress the fourth feature map, and finally output the content parameters of sand, silt and clay.

[0023] Preferably, the number of TransformerBlock blocks in the Vison Transformer model for processing soil microscopic images is 3.

[0024] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0025] 1. The soil texture detection device based on microscopic images of the present invention uses a light box with controllable ambient light as a microscopic image acquisition platform to artificially create a sampling and detection environment, reducing the impact of the external environment on the sampling quality. The rotary drive mechanism drives the rotating platform to rotate, thereby driving the soil container placed on the rotating platform to rotate, and then prompting the microscopic detection module to continuously capture multiple different microscopic images of the soil surface, thereby achieving continuity of the detection operation, reducing the operational complexity of large-scale sampling operations, and saving detection time.

[0026] 2. Compared with traditional laboratory detection methods and detection methods such as spectrometers, the soil texture detection device based on microscopic images of the present invention has faster detection speed, simpler operation methods and cheaper detection equipment. In addition, since certain automated designs are added to the soil texture detection device of the present application, namely, the rotation of the rotating platform driven by the rotary drive mechanism and the automatic control of the top light source, it is more convenient to choose whether to quickly detect multiple soil samples or perform multiple rounds of detection on the same soil sample to reduce errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a structural diagram of the soil texture detection device based on microscopic images of the present invention.

[0028] Figure 2 This is the structural diagram of the soil microscopic image detection model.

[0029] Figure 3 This is the sand content prediction result diagram.

[0030] Figure 4 This is the prediction result of silt content.

[0031] Figure 5 This is the clay content prediction result diagram.

[0032] In the figure: 1. Portable digital microscope; 2. Soil container; 3. Rotating motor; 4. Top light source; 5. Light box; 6. Rotating platform; 7. Light source driver; 8. Processing terminal. DETAILED DESCRIPTION

[0033] The present invention will be described in further detail below with reference to the embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0034] See also Figure 1 The soil texture detection device based on microscopic images of the present invention includes a light box and an illumination module, a detection platform and a microscopic detection module arranged in the light box, wherein:

[0035] The light box is a closed structure, and a door is provided in the light box;

[0036] The illumination module includes a top light source disposed on the top of the light box and a light source driver connected to the top light source; the brightness of the top light source is adjusted by the light source driver, thereby facilitating the capture of soil microscopic images under different ambient light conditions;

[0037] The detection platform includes a rotating platform and a rotating drive mechanism for driving the rotating platform to rotate; the rotating platform is located directly below the microscopic detection module; the soil container to be detected is placed on the rotating platform; the rotating drive mechanism includes a rotating motor; the main shaft of the rotating motor is connected to the rotating platform;

[0038] The microscopic detection module is used to obtain a microscopic image of the soil surface of the soil sample and transmit the obtained microscopic image of the soil surface to the processing terminal. The microscopic detection module is a portable digital microscope. Since a portable digital microscope is used to capture the microscopic image of the soil surface, a clearer feature presentation of the soil surface can be obtained, and the soil texture, that is, the composition and distribution of soil particles with a diameter of less than 2 mm, can be better displayed. At the same time, a deep learning feature fusion model (i.e., a soil microscopic image detection model) is specifically proposed to better learn the feature information of the soil surface microscopic image and perform rapid prediction, so that the overall task has a more accurate detection result.

[0039] The processing terminal obtains content parameters of sand, silt and clay in the soil surface microscopic image based on an internal soil microscopic image detection model.

[0040] See also Figure 2-Figure 5 ,The soil texture detection method based on microscopic images includes the following steps:

[0041] Step 1: Pre-treat the collected soil sample, place the pre-treated soil sample into a soil container, and transfer the soil container to the detection platform; wherein,

[0042] The pretreatment includes air-drying, grinding and filtering the soil samples through a soil sieve with a pore size of 2 mm.

[0043] Step 2: The brightness of the top light source is adjusted by the light source driver; the soil sample in the soil container is detected by the microscopic detection module to obtain a microscopic image of the soil surface;

[0044] In this embodiment, to ensure the continuity of the detection process, a rotating motor drives the rotating platform to rotate, thereby driving the soil container placed on the rotating platform to rotate, thereby prompting the microscopic detection module to continuously capture multiple different soil surface microscopic images, thereby improving operational convenience while also providing more images for detection. In addition, the magnification of the portable digital microscope is adjusted to 40 times, which is considered to have the highest detection accuracy in preliminary experiments. Secondly, the height of the portable digital microscope from the soil container is set to 54.5 mm, which is the most suitable focal length for imaging and can provide the clearest image.

[0045] Step 3: Preprocessing the obtained soil surface microscopic image;

[0046] Step 4: Construct a soil microscopic image detection model, and feed the pre-processed soil surface microscopic image into the trained soil microscopic image detection model, which outputs the content parameters of sand, silt, and clay; wherein,

[0047] The soil microscopic image detection model is based on a dual-branch feature fusion neural network of convolutional neural network (CNN) and Transformer. It extracts local features and global features of soil microscopic images respectively, and performs multi-scale deep fusion of the two features through a cross-attention fusion module. The soil microscopic image detection model includes a convolutional neural network layer, a Transformer layer, a cross-attention feature fusion layer, and a linear regression layer.

[0048] The preprocessed soil microscopic images are fed into the convolutional neural network layer and the Transformer layer respectively;

[0049] The convolutional neural network layer adopts four processing layers in the ResNet-50 classic model. These four processing layers have powerful local feature extraction capabilities and can extract the position and content information of large-sized soil particles with clear imaging in soil microscopic images. In addition, average pooling operations are used multiple times within each processing layer to reduce the scale of the feature map, which greatly reduces the amount of computation required for overall processing. By splitting and extracting the four processing layers of the convolutional neural network layer, four groups of first feature maps output after processing by each processing layer can be obtained respectively. These four groups of first feature maps contain local feature information of the original soil microscopic image in different dimensions, that is, the convolutional neural network layer ultimately outputs four first feature maps containing local feature information of the original soil microscopic image in different dimensions.

[0050] The Transformer layer uses the Vision Transformer model, which implements a self-attention mechanism through unique position encoding and the multi-head attention module in the Transformer Block to model the global image information in the soil microscopic image, obtain the long-range dependency relationship between different regions in the soil microscopic image, and finally output a second feature map containing the overall position information of the original soil microscopic image;

[0051] In addition, the Transformer layer reduces the number of transform blocks used by the original Vision Transformer model to process images to 3, and also performs lightweight operations on the entire model, thereby reducing the computing power required.

[0052] The cross-attention feature fusion layer maps the local texture feature information of the first feature map output by the convolutional neural network layer to the overall position relationship map of the second feature map output by the Transformer layer, dynamically calculates and adaptively adjusts the weight of the fusion of the two, deeply fuses the first feature map and the second feature map, and outputs four third feature maps of different sizes that contain the deep fusion of the original soil microscopic images at different dimensions; interpolates the four third feature maps, adds them after aligning the resolution size, and finally fuses the four third feature maps into a fourth feature map;

[0053] The linear regression layer is used to compress and regress the fourth feature map, and finally output the content parameters of sand, silt and clay.

[0054] The soil microscopic image detection model used in this invention has been trained with a large amount of soil sample data. All of this soil sample data is divided into two parts. One part is sent to a professional soil testing agency to detect the true value of the soil texture, and the other part is used for microscopic image shooting after pre-processing, and subsequently used to train the soil microscopic image detection model. A total of 1,800 images are used for training.

[0055] The accuracy of the proposed soil microscopic image detection model was tested and verified. 32 additional soil samples were selected and photographed four times respectively. The predicted results were compared with the actual detection results. The results are as follows: Figure 3 、 Figure 4 as well as Figure 5 As shown,

[0056] The model fitting coefficient of the sand soil prediction result is 0.971, and the root mean square error is 3.789%;

[0057] The model fitting coefficient of the silt prediction result is 0.954, and the root mean square error is 2.842%;

[0058] The model fitting coefficient of the clay prediction results is 0.931, and the root mean square error is 2.780%.

[0059] The above is a preferred embodiment of the present invention, but the embodiment of the present invention is not limited to the above content. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A soil texture detection device based on microscopic images, characterized in that: The invention comprises a light box and an illumination module, a detection platform and a microscopic detection module arranged in the light box, wherein the illumination module comprises a top light source arranged on the top of the light box and a light source driver connected to the top light source; the detection platform comprises a rotating platform and a rotating drive mechanism for driving the rotating platform to rotate; the rotating platform is located directly below the microscopic detection module; a soil container to be detected is placed on the rotating platform; the microscopic detection module is used to obtain a soil surface microscopic image of a soil sample and transmit the obtained soil surface microscopic image to a processing terminal; the processing terminal obtains the content parameters of sand, silt and clay in the soil surface microscopic image based on an internal soil microscopic image detection model.

2. The soil texture detection device based on microscopic images according to claim 1, characterized in that: The rotary drive mechanism includes a rotary motor; the main shaft of the rotary motor is connected to the rotary platform.

3. The soil texture detection device based on microscopic images according to claim 1, characterized in that: The microscopic detection module is a portable digital microscope.

4. The soil texture detection device based on microscopic images according to claim 1, characterized in that: The light box is provided with a box door.

5. A soil texture detection method using the soil texture detection device based on microscopic images according to any one of claims 1 to 4, characterized in that: The following steps are involved: Step 1: Pre-treat the collected soil sample, place the pre-treated soil sample into a soil container, and transfer the soil container to the detection platform; Step 2: The brightness of the top light source is adjusted by the light source driver; the soil sample in the soil container is detected by the microscopic detection module to obtain a microscopic image of the soil surface; Step 3: Preprocessing the obtained soil surface microscopic image; Step 4: Construct a soil microscopic image detection model, and send the preprocessed soil surface microscopic image to the trained soil microscopic image detection model, which outputs the content parameters of sand, silt and clay.

6. The soil texture detection method according to claim 5, characterized in that: In step 1, the pretreatment includes air-drying, grinding and filtering the soil sample through a soil sieve with a pore size of 2 mm.

7. The soil texture detection method according to claim 5, characterized in that: In step 2, the rotating platform is driven to rotate by the rotating motor, thereby driving the soil container placed on the rotating platform to rotate, thereby prompting the microscopic detection module to continuously capture multiple different microscopic images of the soil surface.

8. The soil texture detection method according to claim 6, characterized in that: The height between the microscopic detection module and the soil container is 54.5 mm.

9. The soil texture detection method according to claim 5, characterized in that: In step S4, the soil microscopic image detection model includes a convolutional neural network layer, a Transformer layer, a cross-attention feature fusion layer, and a linear regression layer, wherein: The preprocessed soil microscopic images are fed into the convolutional neural network layer and the Transformer layer respectively; wherein the convolutional neural network layer uses the ResNet-50 model to extract the position and content information of large-sized soil particles with clear imaging in the soil microscopic image, and finally outputs four first feature maps containing the local feature information of the original soil microscopic image in different dimensions; the Transformer layer uses the Vision Transformer model, and implements the self-attention mechanism through position encoding and the multi-head attention module in the Transformer Block to model the global image information in the soil microscopic image, obtain the long-distance dependency relationship between different regions in the soil microscopic image, and finally output a second feature map containing the overall position information of the original soil microscopic image; The cross-attention feature fusion layer maps the local texture feature information of the first feature map output by the convolutional neural network layer to the overall position relationship map of the second feature map output by the Transformer layer, dynamically calculates and adaptively adjusts the weight of the fusion of the two, deeply fuses the first feature map and the second feature map, and outputs four third feature maps of different sizes that contain the deep fusion of the original soil microscopic images at different dimensions; interpolates the four third feature maps, adds them after aligning the resolution size, and finally fuses the four third feature maps into a fourth feature map; The linear regression layer is used to compress and regress the fourth feature map, and finally output the content parameters of sand, silt and clay.

10. The soil texture detection method according to claim 5, characterized in that: The number of Transformer Blocks in the Vison Transformer model for processing soil microscopic images is 3.