Soil Porosity Detection Method Based on Ultrasound and Multi-Scale Feature Extraction

Hang Xing, Z. Zhong, Wenhao Zhang, Yu Jiang, Xinyu Jiang, Xiuli Yang, Weizi Cai, Shuanglong Wu, Long QiSensors 2025 · DOI

TL;DR

This paper introduces a novel method for accurately and rapidly detecting soil porosity using ultrasound and a sophisticated deep learning model (MSRCNN-LSTMATT). By combining multi-scale feature extraction with attention mechanisms, the model achieves near-perfect prediction accuracy, addressing the limitations of existing methods in complex field conditions.

What Problem Does This Paper Address?

Soil porosity is a critical indicator of soil quality, influencing agricultural productivity. However, current methods for detecting soil porosity are often cumbersome, slow, damage soil structure, or lack the precision needed for effective field applications. The "black-box" nature of soil, with its complex and variable physical properties, makes accurate and rapid detection a significant challenge. This paper aims to bridge this gap by developing a non-destructive, high-precision, and fast method for soil porosity detection.

Methods

The core of this research lies in a novel deep learning architecture called MSRCNN-LSTMATT. This model is built upon a multi-scale CNN-LSTM framework designed to handle the long-time series and complex features present in ultrasonic soil signals.

Here's a breakdown of the key methodological components:

  • Multi-Scale Feature Extraction: Instead of using a single-sized convolution kernel, the model employs multiple large convolution kernels of varying sizes. This allows it to capture both local, high-frequency features (e.g., subtle signal changes) and global, low-frequency features (e.g., overall signal trends and structure) from the ultrasonic data. This is crucial because different porosity levels manifest in distinct ultrasonic signal characteristics.
  • CNN-LSTM Integration: The convolutional neural network (CNN) component excels at extracting spatial features, while the Long Short-Term Memory (LSTM) network is adept at modeling sequential data and capturing long-term dependencies. Their combination allows the model to synthesize both spatial and temporal information from the ultrasonic signals.
  • Multi-Head Self-Attention Mechanism: Added at the end of the LSTM layers, this mechanism helps the model infer relationships between different parts of the signal sequence. This is particularly important for mitigating the impact of waveform distortion, which is common in highly porous soils, by allowing the model to infer missing information from surrounding signal segments.
  • Residual Connections: These are incorporated to help alleviate the vanishing gradient problem during deep network training, ensuring more stable learning and preventing performance degradation as the model depth increases.
  • Data Augmentation: To overcome the limitations of a potentially small dataset and improve model robustness, the researchers applied three data augmentation techniques: adding Gaussian white noise, time shift transformation, and random perturbation. This simulates various real-world environmental disturbances.

Datasets

The study utilized a self-constructed dataset of soil samples.

  • Preparation: Standardized soil samples were prepared manually using a ring cutter, simulating field conditions. These samples were derived from wheat tillage soil from Huimin County, Shandong Province, China.
  • Porosity Range: Thirteen soil samples with porosities ranging from 30% to 60% were prepared, covering common porosity sizes found in agricultural soils.
  • Data Augmentation: The initial dataset was significantly expanded through data augmentation, resulting in 3900 ultrasound signal data points for training, validation, and testing.

Key Insights and Ideas

  • Multi-scale is Key for Soil Ultrasound: The research highlights that a single-scale feature extraction approach is insufficient for soil porosity detection. Different porosity levels manifest in distinct frequency components, necessitating a multi-scale approach to capture the full spectrum of information.
  • Attention for Robustness: The inclusion of a multi-head self-attention mechanism proved crucial for handling waveform distortions common in high-porosity soils. This allows the model to "look around" distorted segments and still make accurate predictions, significantly improving robustness.
  • Synergy of CNN and LSTM: The paper demonstrates the power of combining CNNs for local feature extraction and LSTMs for temporal dependency modeling, creating a more comprehensive understanding of the ultrasonic signals.
  • Data Augmentation is Essential: For complex, real-world signals like those from soil, data augmentation is not just beneficial but critical for achieving high accuracy and generalization.

Key Results

The MSRCNN-LSTMATT model achieved outstanding performance:

  • High Accuracy: The model achieved a coefficient of determination (R²) of 0.9990, indicating an extremely strong fit to the data.
  • Low Error: The percentage root mean square error (RMSE) was remarkably low at 0.66%.
  • Superior Performance: The model significantly outperformed other advanced comparative models, including WDCNN, Hierarchical LSTM, 1D-CNN, and 1D-Resnet18, in both R² and RMSE metrics.
  • Ablation Study Findings: Ablation experiments confirmed the critical roles of the residual connection module and, especially, the multi-head self-attention mechanism in enhancing model performance and robustness. Removing the self-attention module led to a substantial increase in error.

Limitations and Future Work

  • Dataset Limitations: The study acknowledges that the datasets were constructed under controlled conditions with a limited range of soil texture types and water contents.
  • Generalizability: The authors suggest that further verification is needed to assess the model's generalization ability to more complex or diverse field soil conditions, including different texture types, water content statuses, and actual field soils.
  • Future Work: Future research should focus on introducing more varied soil sample types and sources to enhance the model's adaptability and usefulness in real-world agricultural settings.

Summary updated

Abstract

Soil porosity, as an essential indicator for assessing soil quality, plays a key role in guiding agricultural production, so it is beneficial to detect soil porosity. However, the currently available methods do not apply to high-precision and rapid detection of soil with a black-box nature in the field, so this paper proposes a soil porosity detection method based on ultrasound and multi-scale CNN-LSTM. Firstly, a series of ring cutter soil samples with different porosities were prepared manually to simulate soil collected in the field using a ring cutter, followed by ultrasonic signal acquisition of the soil samples. The acquired signals were subjected to three kinds of data augmentation processes to enrich the dataset: adding Gaussian white noise, time shift transformation, and random perturbation. Since the collected ultrasonic signals belong to long-time series data and there are different frequency and sequence features, this study constructs a multi-scale CNN-LSTM deep neural network model using large convolution kernels based on the idea of multi-scale feature extraction, which uses multiple large convolution kernels of different sizes to downsize the collected ultra-long time series data and extract local features in the sequences, and combining the ability of LSTM to capture global and long-term dependent features enhances the feature expression ability of the model. The multi-head self-attention mechanism is added at the end of the model to infer the before-and-after relationship of the sequence data to improve the degradation of the model performance caused by waveform distortion. Finally, the model was trained, validated, and tested using ultrasonic signal data collected from soil samples to demonstrate the accuracy of the detection method. The model has a coefficient of determination of 0.9990 for detecting soil porosity, with a percentage root mean square error of only 0.66%. It outperforms other advanced comparative models, making it very promising for application.
BibTeX
@inproceedings{xing2025soil,
  author = {Hang Xing and Z. Zhong and Wenhao Zhang and Yu Jiang and Xinyu Jiang and Xiuli Yang and Weizi Cai and Shuanglong Wu and Long Qi},
  title = {{Soil Porosity Detection Method Based on Ultrasound and Multi-Scale Feature Extraction}},
  booktitle = {Sensors},
  year = {2025},
  doi = {10.3390/s25103223},
}
Figure