Convolutional Neural Network approach for the prediction of Soil texture properties

Background/Objectives: The main objective is to achieve improved performance of soil properties prediction for hyperspectral data. In this work, convolutional neural network is trained to understand the pattern of hyperspectral data by spatial interpolation.Methods/Statistical analysis: The proposed methodology is used to predict six soil propertiesOrganic Carbon content (OC), Cation Exchange Capacity (CEC), Nitrogen Content (N), pH level in water, Clay particle and Sand Particle. Soil texture which defines the relative content of soil particles is determined by the percentage of clay, sand and silt in the soil. The input to the Convolutional Neural Network (CNN) is the Hyperspectral data in the form of multiple arrays. The statistical evaluation of model performance is evaluated using root-mean-square error and r square. Findings: In this research, deep learning approach is used to capture the pattern hidden in the soil. Deep learning is a kind of neural network which can model complex relationship for representing non-linearity for a scalable data. The main challenge is predicting a soil type, as it involves complex structural characteristics and soil features. Novelty/Improvements: The performance of soil texture prediction is improved by automatic feature learning capability in the proposed CNN model. The average rmse value obtained in proposed method for all the six soil texture properties is 5.68%.


Introduction
Agriculture is one of the most essential economic activity and also plays significant role in social and environmental aspects of the countries that primarily depend on Agriculture. Soil is the most essential aspect that determines the agriculture and cropping patterns. There are different types of soil which can be used for various types of cultivation and hence, predicting the texture of the soil is one of the main criteria https://www.indjst.org/ in agriculture production (1) . Soil texture is one of the most important physical soil properties which allows water retention capacity, soil density, availability of nutrient and reaction of soil. Based on the soil texture, decisions are made for crop selection for better productivity plan.
The distribution of soil particles shows the feature of soil texture and it is characterized as clay, silt and sand. If the particle size is lower than .002 mm then it is classified as clay, if the particle size is from .002 to .053mm it is silt and from .053 to 2mm it is sand (2) . The texture of soil influences the soil's capability to store water and its fertility. Soil texture and organic matter are the two important properties of soil which control the soil water retention capacity. Silt and clay which have smaller particles have a larger surface area and allow soil to hold more water. Sand which has larger particles with a small surface area will hold only less water. The available water capacity by soil texture is shown in Figure 1 (3) . Water capacity by soil texture (3) The complex structural physical and chemical properties involved in the soil texture makes the soil prediction more complex and it is a challenging research topic. The solar reflectance spectra of objects which are obtained from short wave solar radiation, reflects the solid phase of the soil which is covered by organic matter and minerals. These physicochemical properties, with the incident radiation and the reflected radiation is viewed by a sensor, are considered to be the main influences on the reflectance of a soil sample and are used for the soil prediction type. It is measured using hyperspectral sensors which relates to particular absorption features of organic and mineral content. A much effort on preprocessing is required when mapping the reflectance spectra data to the soil texture.

Deep Neural Network for Soil texture
A Neural Network consists of input layers, hidden layers and output layers. When there are multiple hidden layers then it is a deep neural network or deep learning as shown in Figure 2 (4) . The hidden layers captures the non linear relationships between the input and the corresponding output, and the number of hidden layers is based on the complexity of the problem being solved (5) . There are different types of deep learning methods which are intended for different purposes.
Convolutional neural networks(CNN) are special type of Neural networks which work very well with data that is spatially connected. Convolutional Neural Network can automatically learn features with Spatial Relationships. Spatial information refers to information having location-based relation with other information (6,7) . A group of pixel is used for feature prediction instead of using single pixel value. The spatial and translation invariance of convolutional neural network works well for spatially connected data such as soil texture.
https://www.indjst.org/ To capture the pattern hidden in soil texture for hyperspectral data, convolutional neural network is used. Modeling complex relationship and representing nonlinearities from a very large scale data is solved by using deep learning. This research focus on soil texture prediction using deep neural network. Convolutional neural network is used to learn the features of the hyperspectral pattern by mapping spatial information with soil texture.

Background Study
Soil texture is one of the important factor for many environmental processes. Riese and Keller (8) in their study, developed and implemented three 1-dimensional (1D) convolutional neural network (CNN): the LucasCNN, the LucasResNet which contains residual network for identification, and the LucasCoordConv with an additional layer for preprocessing. The convolutional neural network approach with the least depth turns out to be the best performing classifier. The LucasCoordConv achieved the best performance regarding the average accuracy.
Soil texture affects the crop selection and regulates the water transmission property and is shown by the authors in (9) . Soil images are processed through the different stages, preprocessing of soil images for image enhancement, extracting the region of interest for segmentation and the texture analysis for feature vector. The feature vector is calculated from the Hue, Saturation, and Value (HSV) histogram, color moments, color auto Correlogram, Gabor wavelets, and discrete wavelet transform. Finally, Support Vector Machine classifier is used to classify the soil images using linear kernel.
Jose et al (10) in their study developed and evaluated convolutional neural network, a type of deep learning algorithm, as a new way to predict soil properties from raw soil spectra. To fully utilize the capacity of the convolutional neural network model, they represented the soil spectral data as a 2-dimensional spectrogram, showing the reflectance as a function of wavelength and frequency. By using varied network architecture, they predicted multiple soil properties in a single network and training process using convolutional neural network. The convolution and max pooling layers learns the structure of the spectrogram and its general representation is directed to six branches to predict six different types of soil property. By using a enhanced CNN structure the model can learn the features effectively by avoiding separate preprocessing.
Topsoil information captured with a smartphone camera are used as input to predict the structure and texture of the soil in (11) . Low level image features such as color and texture are extracted and mapped with geolocation information with the existing land information. A neural network model is used for predicting the soil texture of three types sand, silt and clay. The prediction is also made on the soil structure with the five-point scale and other soil features such as soil density, pH value and drainage categorization of particular soil. Better spatial resolution of the soil mapping is needed in their work to further improve the performance.
Prediction of soil types based on hydrologic groups is presented by the authors (12) using machine learning algorithm. The model is trained to classify four different types of hydrologic groups by taking the features which involves the amount of sand, silt, clay and saturated hydraulic conductivity. Many machine learning models are used for the prediction and the performance of their model is compared and analyzed using per class metrics, micro and macro averages. As a part of future work Deep https://www.indjst.org/ learning methods that makes the classification need to be addressed.

Proposed Methodology
Soil texture is one of the main factors in agricultural production, and its precise prediction is important for the normal use and management of water resources. However, Soil texture involves complex structural characteristics with soil features which is difficult to make a prediction on soil type. Hyperspectral data is used as a feature for the prediction of soil properties. Predicting soil features from hyperspectral data need more preprocessing for better understanding of the soil and for accurate prediction and it is a challenging research task. In the proposed methodology, a Convolutional neural network model is used to train the spatial information mapped to soil texture.
Soil feature prediction is helpful in predicting and understanding various hydrologic processes, such as energy and moisture fluxes, drought and irrigation scheduling. By using spectral data, it is possible to predict different soil features. The main objective is to predict six soil properties organic carbon content (OC), cation exchange capacity (cmol+ kg -1 ), clay particle size fraction (%), sand particle size fraction (%), pH measured in water, and total nitrogen content (N, g kg -1 ). CNN is designed to take data in the form of multiple arrays.
Hyperspectral data is one of the important methods for soil analysis where the classification is performed in pixel level. It consists of many spectral channels which results in higher number of dimensionalities with large spatial variability[x]. Convolutional Neural Network have the capability of learning the correlation that exist between the hyperspectral data and can be mapped with the soil features.

The proposed CNN Model
The proposed CNN Architecture is shown in Figure 3 and the description of the layer is shown in Table 1.
• In Convolutional layer, filters are used as feature detectors of the input image. The filter size used in this model is 3*3 which maps the local region of the input image and exploits the spatial relationship between the pixels. Spatial relationship refers to location based information with the neighboring pixels. • Independent processing of each feature map is performed in pooling layer. It is used after the convolutional layer. Max pooling layer with size 3x3 is used in this model. • After many hidden layers of convolutional and pooling, six middle level branching is used to avoid separate preprocessing steps followed by convolutional layer and fully connected layer for each branching layer. • The final output layer is the regression value of six soil properties.
Hyperspectral data is sent as input to the convolutional and pooling layers of the CNN model. The data is passed to the series of convolutional and pooling layers where it learns the features of input data. The general representation of the data is learned in the first few layers and the network is branched to learn the six soil properties OC, CEC, clay, sand, pH, N. Each branch learns the specific properties and passed to deeper convolutional layer. Finally, it is passed to the fully connected layer where it is flattened to one dimensional data and then to the output layer.

Development environment
Convolutional Neural Network architecture is implemented using Tensor flow and Keras with python as the programming language. Tensorflow is a free and open source library, mainly used for deep learning applications. Keras is a open source neural network library which can run on top of Tensorflow and it is designed to be fast and easy to use.

Dataset
The dataset used for the evaluation of the proposed method is the LUCAS dataset, which consists of about 22,000 data points that include physical properties like the percentage of coarse fragments, the particle size distributions clay, sand and silt, the pH value, the organic carbon content, the carbonate content, the total nitrogen content, the extractable potassium content, the phosphorus content, the cation exchange capacity and metals. Additionally, this dataset includes continuous reflectance spectra from 400 nm to 2500 nm, referred to as hyperspectral data (13)(14)(15) . The spectral resolution of the applied sensor is 0.5 nm.

Experimental evaluation
The proposed model is trained with a large dataset. The data is sent in batches. The complete data is trained for 30 epochs. The model is optimized for better performance and the hyper parameter used in the proposed network model is shown in Table 2. One of the commonly used optimization algorithm is the gradient descent algorithm which can optimize deep learning model. ADAM (Adaptive Moment Estimation) is the extension of stochastic gradient descent which calculates adaptive learning rates for each weight. In the proposed methodology the optimizer used is ADAM and the loss function is the Mean Absolute Error. The Lucas dataset is separated into a training, validation and test dataset with 60% as training data, 20 % of validation data and remaining 20% of test data. Test data is used to evaluate the performance of the model. The model is evaluated using various performance metrics which evaluates how well the predicted value matches the actual value by understanding the pattern between the independent features and the dependent target variable. The performance parameter used to estimate the model are Root Mean Square Error (RMSE), RSquare Error.

Mean Squared Error (MSE)
The MSE is similar to the MAE, but rather than taking the average of the difference between the predicted and the actual results, it takes the square of the difference instead. Using the squared values, the larger errors become more prominent in comparison to smaller errors resulting in a model that can better focus on the prediction error of larger errors. However, if a certain prediction turns out to be very bad the overall model error will be skewed towards being worse than what may actually https://www.indjst.org/ be true. The MSE is calculated through:

Root Mean Squared Error (RMSE)
RMSE is simply the root of MSE. The introduction of the square-root scales the error to be the same scale as the targets.
The major difference between MSE and RMSE is the flow over the gradients. Travelling along the gradient of the MSE is equal to traveling along the gradient of the RMSE times a flow variable that depends on the MSE score. RMSE gives a relatively high weight to large errors.

RSquare error
It is the proportion of the variance in the target variable that is predictable from the independent features. The results of the proposed model are compared with the existing model and is shown in Tables 3, 4, 5, 6, 7 and 8 for training, validation and test data set. The result shows that the proposed model performs better than the existing model (10) for all the six target variables.