# Soil Classification Based on Deep Learning Algorithm and Visible Near-Infrared Spectroscopy

Authors: Xueying Li; Pingping Fan; Zongmin Li; Guangyuan Chen; Huimin Qiu; Guangli Hou
Journal: Journal of Spectroscopy
 (2021)

---

## Abstract

Changes in land cover will cause the changes in the climate and environmental characteristics, which has an important influence on the social economy and ecosystem. The main form of land cover is different types of soil. Compared with traditional methods, visible and near-infrared spectroscopy technology can classify different types of soil rapidly, effectively, and nondestructively. Based on the visible near-infrared spectroscopy technology, this paper takes the soil of six different land cover types in Qingdao, China orchards, woodlands, tea plantations, farmlands, bare lands, and grasslands as examples and establishes a convolutional neural network classification model. The classification results of different number of training samples are analyzed and compared with the support vector machine algorithm. Under the condition that Kennard–Stone algorithm divides the calibration set, the classification results of six different soil types and single six soil types by convolutional neural network are better than those by the support vector machine. Under the condition of randomly dividing the calibration set according to the proportion of 1/3 and 1/4, the classification results by convolutional neural network are also better. The aim of this study is to analyze the feasibility of land cover classification with small samples by convolutional neural network and, according to the deep learning algorithm, to explore new methods for rapid, nondestructive, and accurate classification of the land cover.


---

## Body

## 1. Introduction

Land cover is a direct result of the interaction between natural environment and human activities. It mainly focuses on describing the natural properties of the earth’s surface which has specific time and space characteristics. Changes in land cover will cause the changes in the climate and environmental characteristics, which has an important influence on the social economy and ecosystem [1, 2]. The main form of land cover is different types of soil, including cultivated lands, woodlands, grasslands, and bare lands. Therefore, it is of great significance to classify different types of soil quickly and accurately for land cover research, soil investigation, and mapping.The early classification method is the land use topographic map obtained by combining with the actual ground survey. Now the classification technology of the remote sensing image is mostly used to realize the classification of different types of soil [3–5]. Visible and near-infrared spectroscopy technology is a fast, nondestructive measurement method. It has been widely used in medicine, agriculture, oil, and other fields [6–9]. The spectral analysis method indirectly obtains useful information of the substance. Through establishing an effective correction model between the spectrum and the information, the result is obtained [10–12]. The spectral technology is introduced into the classification of soil, the remote sensing image information is replaced by the spectral information, and different types of soil models are established. It can be fast and nondestructive to realize the classification of soil.Deep learning is modeled by simulating the neural structure of the human brain and has made breakthroughs in applications such as image recognition and speech recognition [13, 14]. The commonly used classification method support vector machine (SVM) is a machine learning method based on statistical learning theory. The idea behind SVM is that input samples are projected from low-dimensional feature space to high-dimensional space through nonlinear mapping, which allows data in the low-dimensional space that is not linearly separable to transform into linearly separable data in the high-dimensional space [15, 16]. While deep learning is to transform the original signal layer by layer, transform the feature representation in the original space to the new feature space. And it automatically learns to get the hierarchical feature representation, and the classification result is achieved [17]. Convolution neutral network (CNN) is a network structure in the deep learning, which has a good effect in the classification of images and makes the CNN method widely used in many fields [18, 19]. CNN is a new and nondestructive method for the application of quality monitoring of agricultural products, includes the detection and grading of fruits, vegetables, etc., and has achieved good results [20, 21]. CNN is usually used for classification modeling with large sample size.Based on the visible near-infrared spectroscopy technology, this paper took six different types of soil orchards, woodlands, tea plantations, farmlands, bare land, and grasslands in Qingdao, China, as examples, and established a convolutional neural network classification model. The classification results under the conditions of different label samples were analyzed, and the classification results with the shallow network SVM were compared. In this paper, the aim is to analyze the feasibility of land cover classification with small samples by CNN and explore new methods for rapid, nondestructive, and accurate classification of soil according to the CNN.


## 2. Materials and Methods

### 2.1. Experimental Materials

Ten sampling points were collected from Licang District, Laoshan District, Chengyang District, and Jiaozhou District, Qingdao, China. The sampling points selected are the areas with consistent color and vegetation coverage, and the spatial distribution of each sampling point was relatively uniform. The basic overview of each sampling point is shown in Table1. When sampling, a shovel was used to take 0–20 cm of surface soil, and about 1 kg of each soil sample was collected. Then it was put in a sealed bag and the label was stuck. It was brought back to the lab, air-dried, and ground, and it was passed through 0.45 mm nylon sieve. Finally, it was put into the sealing bag, a number was made, and it was marked for subsequent testing.Table 1
The location and type of soil sampling.
Sample numberTypesTotal samplesLocationVegetationS1Orchards13Chengyang DistrictApricot orchardS2Orchards13Chengyang DistrictCherry orchardS3Woodlands13Laoshan DistrictReed, polygonaceae, willow, and other vegetation are distributedS4Tea plantations13Laoshan DistrictTea plantationS5Woodlands13Laoshan DistrictUnder the poplar forest, there are branches and weedsS6Farmlands13Chengyang DistrictWheat field after harvestS7Bare lands13Jiaozhou DistrictSuaeda salsa with poor growthS8Woodlands60Laoshan DistrictThe forest at the foot of the mountainS9Farmlands60Licang DistrictCorn fieldS10Grasslands60Licang DistrictOvergrown with weedsThe collected soil samples were divided into orchards (S1 and S2), woodlands (S3, S5, and S8), tea plantations (S4), farmlands (S6 and S9), bare lands (S7), and grasslands (S10), as shown in Table 1. There were 26 orchards soil samples, 86 woodlands soil samples, 13 tea plantations soil samples, 73 farmlands soil samples, 13 bare lands soil samples, and 60 grasslands soil samples, totaling 271 soil samples. The contents of total carbon (TN), total phosphorus (TP), and total potassium (TK) in six types of soil were measured. The average contents of TN, TP, and TK in each type of soil are shown in Table 2, and the nutrient contents of each type of soil are different.Table 2
The average contents of soil samples total carbon, total phosphorus, and total potassium.
Soil nutrient (g/kg)OrchardsWoodlandsTea plantationsFarmlandsBare landsGrasslandsTN1.3820.6991.5960.6850.4721.403TP0.5550.3941.7300.3540.2350.996TK19.78515.23429.29014.23612.15419.732TN: total carbon; TP: total phosphorus; TK: total potassium.


### 2.2. Spectrum Acquisition

The spectrum of soil samples was collected by QE-65000 spectrometer of ocean optics. Dh-2000 of ocean optics was used as the light source, and the QE-65000 spectrometer of ocean optics (slit 10µm) was connected by Y-type optical fiber of ocean optics. A set of spectral acquisition system for soil nutrients was built (Figure 1). The contact end of the optical fiber and the sample was fixed by the probe bracket, keeping the incident light 45°. Under the bracket was a self-made sample box, where a spherical sample slot that coincided with the fiber inlet of the bracket was designed to hold approximately 1–2 g soil samples.Figure 1
The schematic diagram of soil samples spectral measurement.Through this spectrum sampling system, the sampling interval of the collected spectrum was 1 nm, and the integration time was 600 ms. The spectrum range was 200–1100 nm. Each soil sample was measured for 5 times, and the average spectral reflectance was taken. Because the noise in the front and back part of the reflection spectrum had a great influence, the spectrum data of 226–975 nm were retained. The average reflection spectrum of the soil samples of orchards, woodlands, tea plantations, farmlands, bare land, and grasslands are shown in Figure2. The overall trend of the six types of soil was consistent, and the reflection spectrum increased with the increase in wavelength. But the reflection spectrum of the six types of soil was different.Figure 2
The average reflection spectrum of 6 types of soils.


### 2.3. Kennard–Stone Algorithm

Based on the Euclidean distance between two samples, the Kennard–Stone algorithm (K-S algorithm) realizes the sample partition selection with strong representativeness and uniform distribution range [22, 23]. In this paper, the algorithm is used to classify and select the representative calibration set and test set. The process of Kennard–Stone algorithm is as follows: (1) calculate the Euclidean distance between the two samples, select the samples with the largest Euclidean distance (more than 2); (2) calculate the Euclidean distance between the remaining samples and the selected samples in Step (1); (3) for each remaining sample, select the samples with the shortest distance from the selected samples and then select the samples corresponding to the relative longest distance among the shortest distances; and (4) repeat Step (3) until the number of selected samples is greater than or equal to the set value.


### 2.4. Deep Learning Algorithm

In 2006, the concept of deep learning was first proposed by Hinton [24]. Its main point is that multihidden layer artificial neural network has excellent feature learning ability, which can effectively overcome the training difficulties of deep neural network by layer pretraining “layer wise training” [17]. It is based on the sample data through certain training methods to get the deep network structure of multiple levels. The deep network structure obtained by deep learning contains a large number of single elements (neurons). Each neuron is connected with a large number of other neurons. The connection strength (weight) between neurons modifies and determines the function of the network during the learning process. The deep network structure obtained by deep learning conforms to the characteristics of the neural network. The commonly used deep learning models include deep belief network (DBN) [25, 26], stacked autoencoders (SAE) [27, 28], and convolutional neural network (CNN) [29, 30].The basic structure of CNN is composed of input layer, convolutional layer, pooling layer, full connection layer, and output layer. Generally, several convolution layers and pooling layers are selected. The alternate setting of the convolutional layer and the pooled layer is adopted. It is that one convolutional layer is connected to a pooled layer, and the pool layer is then connected to a convolutional layer. The characteristics of convolutional neural network are that the original signal is directly used as the input of the network, which avoids the complex feature extraction and image reconstruction process in the traditional recognition algorithm. In the convolution stage, the weight sharing structure is used to reduce the number of weights and the complexity of the network model. At the same time, in subsampling stage, we use the principle of local correlation to subsample the feature map, which can effectively reduce the amount of data processing while retaining the useful structure information [29, 30].The convolutional layer can be defined as follows [31]:(1)x1=gω1∗x0+b1,where x0 is the input two-dimensional image, ω1 and b1 represent the filters and bias of the convolutional layer, x1 is the output feature maps of the convolutional layer, ∗ represents the convolutional operator, and g. denotes the rectified linear unit (ReLU) activation function. In this paper, the spectral data of each soil sample are one-dimensional vector, which is converted into two-dimensional matrix. The data band of soil spectrum is 226–975 nm, with a total of 749 wavelength points. The one-dimensional spectrum vector of 749 × 1 is converted into a two-dimensional matrix of 28 × 28. The reflectances corresponding to 28 wavelength points are taken from each column in order until 749 reflectances are all ranked in the two-dimensional matrix of 28 × 28, and the rest positions are filled with 0. That is the input two-dimensional image. Convolution operation is used to transform the spectral image data. The spectral feature information can be extracted more effectively by combining the neighboring information of spectral image. There are two convolutional layers with six 5 × 5 kernels.The pooling layer is behind the convolution layer and used for reducing the computational complexity [31]. The pooling layer can be defined as(2)x2=gdownx1,where x2 is the output feature maps of the pooling layer, g. denotes the ReLU activation function, and down. represents a max-pooling function. In this paper, there are two pooling layers with six 2 × 2 kernels.The fully connected layer is used to extract more deep feature [31]. The fully connected layer can be defined as(3)x3=gω3∗x2+b3.where ω3 and b3 represent the filters and bias of the fully connected layer, x3 is the output feature maps of the fully connected layer, and g. denotes the ReLU activation function. This paper has one fully connected layer. The specific process of CNN is shown in Figure 3. The classifier adopts softmax classifier, and the loss function is mean squared error.Figure 3
The convolutional neural network process for soil classification.C is the convolutional layer, and P is the pooling layer.


### 2.5. Classification Evaluation Standard

The classification evaluation standard uses the number of correct prediction classification sampleYp divided by the number of all soil samples Y. The formula is as follows: c=Yp/Y∗100%. The closer the c is to 100%, the better the classification effect.


## 2.1. Experimental Materials

Ten sampling points were collected from Licang District, Laoshan District, Chengyang District, and Jiaozhou District, Qingdao, China. The sampling points selected are the areas with consistent color and vegetation coverage, and the spatial distribution of each sampling point was relatively uniform. The basic overview of each sampling point is shown in Table1. When sampling, a shovel was used to take 0–20 cm of surface soil, and about 1 kg of each soil sample was collected. Then it was put in a sealed bag and the label was stuck. It was brought back to the lab, air-dried, and ground, and it was passed through 0.45 mm nylon sieve. Finally, it was put into the sealing bag, a number was made, and it was marked for subsequent testing.Table 1
The location and type of soil sampling.
Sample numberTypesTotal samplesLocationVegetationS1Orchards13Chengyang DistrictApricot orchardS2Orchards13Chengyang DistrictCherry orchardS3Woodlands13Laoshan DistrictReed, polygonaceae, willow, and other vegetation are distributedS4Tea plantations13Laoshan DistrictTea plantationS5Woodlands13Laoshan DistrictUnder the poplar forest, there are branches and weedsS6Farmlands13Chengyang DistrictWheat field after harvestS7Bare lands13Jiaozhou DistrictSuaeda salsa with poor growthS8Woodlands60Laoshan DistrictThe forest at the foot of the mountainS9Farmlands60Licang DistrictCorn fieldS10Grasslands60Licang DistrictOvergrown with weedsThe collected soil samples were divided into orchards (S1 and S2), woodlands (S3, S5, and S8), tea plantations (S4), farmlands (S6 and S9), bare lands (S7), and grasslands (S10), as shown in Table 1. There were 26 orchards soil samples, 86 woodlands soil samples, 13 tea plantations soil samples, 73 farmlands soil samples, 13 bare lands soil samples, and 60 grasslands soil samples, totaling 271 soil samples. The contents of total carbon (TN), total phosphorus (TP), and total potassium (TK) in six types of soil were measured. The average contents of TN, TP, and TK in each type of soil are shown in Table 2, and the nutrient contents of each type of soil are different.Table 2
The average contents of soil samples total carbon, total phosphorus, and total potassium.
Soil nutrient (g/kg)OrchardsWoodlandsTea plantationsFarmlandsBare landsGrasslandsTN1.3820.6991.5960.6850.4721.403TP0.5550.3941.7300.3540.2350.996TK19.78515.23429.29014.23612.15419.732TN: total carbon; TP: total phosphorus; TK: total potassium.


## 2.2. Spectrum Acquisition

The spectrum of soil samples was collected by QE-65000 spectrometer of ocean optics. Dh-2000 of ocean optics was used as the light source, and the QE-65000 spectrometer of ocean optics (slit 10µm) was connected by Y-type optical fiber of ocean optics. A set of spectral acquisition system for soil nutrients was built (Figure 1). The contact end of the optical fiber and the sample was fixed by the probe bracket, keeping the incident light 45°. Under the bracket was a self-made sample box, where a spherical sample slot that coincided with the fiber inlet of the bracket was designed to hold approximately 1–2 g soil samples.Figure 1
The schematic diagram of soil samples spectral measurement.Through this spectrum sampling system, the sampling interval of the collected spectrum was 1 nm, and the integration time was 600 ms. The spectrum range was 200–1100 nm. Each soil sample was measured for 5 times, and the average spectral reflectance was taken. Because the noise in the front and back part of the reflection spectrum had a great influence, the spectrum data of 226–975 nm were retained. The average reflection spectrum of the soil samples of orchards, woodlands, tea plantations, farmlands, bare land, and grasslands are shown in Figure2. The overall trend of the six types of soil was consistent, and the reflection spectrum increased with the increase in wavelength. But the reflection spectrum of the six types of soil was different.Figure 2
The average reflection spectrum of 6 types of soils.


## 2.3. Kennard–Stone Algorithm

Based on the Euclidean distance between two samples, the Kennard–Stone algorithm (K-S algorithm) realizes the sample partition selection with strong representativeness and uniform distribution range [22, 23]. In this paper, the algorithm is used to classify and select the representative calibration set and test set. The process of Kennard–Stone algorithm is as follows: (1) calculate the Euclidean distance between the two samples, select the samples with the largest Euclidean distance (more than 2); (2) calculate the Euclidean distance between the remaining samples and the selected samples in Step (1); (3) for each remaining sample, select the samples with the shortest distance from the selected samples and then select the samples corresponding to the relative longest distance among the shortest distances; and (4) repeat Step (3) until the number of selected samples is greater than or equal to the set value.


## 2.4. Deep Learning Algorithm

In 2006, the concept of deep learning was first proposed by Hinton [24]. Its main point is that multihidden layer artificial neural network has excellent feature learning ability, which can effectively overcome the training difficulties of deep neural network by layer pretraining “layer wise training” [17]. It is based on the sample data through certain training methods to get the deep network structure of multiple levels. The deep network structure obtained by deep learning contains a large number of single elements (neurons). Each neuron is connected with a large number of other neurons. The connection strength (weight) between neurons modifies and determines the function of the network during the learning process. The deep network structure obtained by deep learning conforms to the characteristics of the neural network. The commonly used deep learning models include deep belief network (DBN) [25, 26], stacked autoencoders (SAE) [27, 28], and convolutional neural network (CNN) [29, 30].The basic structure of CNN is composed of input layer, convolutional layer, pooling layer, full connection layer, and output layer. Generally, several convolution layers and pooling layers are selected. The alternate setting of the convolutional layer and the pooled layer is adopted. It is that one convolutional layer is connected to a pooled layer, and the pool layer is then connected to a convolutional layer. The characteristics of convolutional neural network are that the original signal is directly used as the input of the network, which avoids the complex feature extraction and image reconstruction process in the traditional recognition algorithm. In the convolution stage, the weight sharing structure is used to reduce the number of weights and the complexity of the network model. At the same time, in subsampling stage, we use the principle of local correlation to subsample the feature map, which can effectively reduce the amount of data processing while retaining the useful structure information [29, 30].The convolutional layer can be defined as follows [31]:(1)x1=gω1∗x0+b1,where x0 is the input two-dimensional image, ω1 and b1 represent the filters and bias of the convolutional layer, x1 is the output feature maps of the convolutional layer, ∗ represents the convolutional operator, and g. denotes the rectified linear unit (ReLU) activation function. In this paper, the spectral data of each soil sample are one-dimensional vector, which is converted into two-dimensional matrix. The data band of soil spectrum is 226–975 nm, with a total of 749 wavelength points. The one-dimensional spectrum vector of 749 × 1 is converted into a two-dimensional matrix of 28 × 28. The reflectances corresponding to 28 wavelength points are taken from each column in order until 749 reflectances are all ranked in the two-dimensional matrix of 28 × 28, and the rest positions are filled with 0. That is the input two-dimensional image. Convolution operation is used to transform the spectral image data. The spectral feature information can be extracted more effectively by combining the neighboring information of spectral image. There are two convolutional layers with six 5 × 5 kernels.The pooling layer is behind the convolution layer and used for reducing the computational complexity [31]. The pooling layer can be defined as(2)x2=gdownx1,where x2 is the output feature maps of the pooling layer, g. denotes the ReLU activation function, and down. represents a max-pooling function. In this paper, there are two pooling layers with six 2 × 2 kernels.The fully connected layer is used to extract more deep feature [31]. The fully connected layer can be defined as(3)x3=gω3∗x2+b3.where ω3 and b3 represent the filters and bias of the fully connected layer, x3 is the output feature maps of the fully connected layer, and g. denotes the ReLU activation function. This paper has one fully connected layer. The specific process of CNN is shown in Figure 3. The classifier adopts softmax classifier, and the loss function is mean squared error.Figure 3
The convolutional neural network process for soil classification.C is the convolutional layer, and P is the pooling layer.


## 2.5. Classification Evaluation Standard

The classification evaluation standard uses the number of correct prediction classification sampleYp divided by the number of all soil samples Y. The formula is as follows: c=Yp/Y∗100%. The closer the c is to 100%, the better the classification effect.


## 3. Results and Discussion

### 3.1. Six Types of Soil Classification Results: Dividing the Calibration Set by Kennard–Stone Algorithm

#### 3.1.1. Dividing Calibration Set and Test Set by Kennard–Stone Algorithm

K-S algorithm was used to divide calibration set and test set of six types of soil. The total number of the calibration set samples ranged from 40 to 150, with an interval of 10, and the rest was test set. The accuracy of classification model in small sample was analyzed. The number of the calibration set samples for each type of soil is shown in Table3.Table 3
The number of the calibration set samples by Kennard–Stone algorithm.
The total number of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslands1502251132813231402050132513191301946132313161201840132013161101835111813151001732111712119014281016121080132681311970102589108609207987505167877404135765


#### 3.1.2. Classification Results of Different Types of Soil Based on Convolutional Neural Network

The spectrum of each calibration set of soil sample was transformed into two-dimensional matrix and then was substituted into CNN network for training. The iterations are 2000. The classification results of the calibration set and the test set are shown in Table4. When the total number of the calibration set samples was 150–100, the classification accuracy of the calibration set and the –test set was all 100%. The classification results of six types of soil in 90-40 calibration set, including orchards, woodlands, tea plantations, farmlands, bare land, and grasslands, are shown in Table 5.Table 4
The classification results of the calibration set and the test set based on the different number of samples in the calibration set by convolutional neural network.
The total number of calibration setCalibration setTest set150100.00% (150/150）100.00% (121/121)140100.00% (140/140）100.00% (131/131)130100.00% (130/130）100.00% (141/141)120100.00% (120/150）100.00% (151/151)110100.00% (110/110）100.00% (161/161)100100.00% (100/100）100.00% (171/171)9098.89% (89/90)98.90% (179/181)80100.00% (80/80)100.00% (191/191)70100.00% (70/70)98.51% (198/201)60100.00% (60/60)98.58% (208/211)50100.00% (50/50)94.57% (209/221)40100.00% (40/40)95.24% (220/231)Table 5
The classification results of six types of soil in the test set by convolutional neural network.
The total number of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslands9091.67%100.00%100.00%100.00%0%100.00%(11/12)(58/58)(3/3)(57/57)(0/1)(50/50)80100.00%100.00%100.00%100.00%100.00%100.00%(13/13)(60/60)(5/5)(60/60)(2/2)(51/51)7093.75%100.00%100.00%96.87%100.00%100.00%(15/16)(61/61)(5/5)(62/64)(3/3)(52/52)6088.24%98.48%100.00%100.00%100.00%100.00%(15/17)(65/66)(6/6)(64/64)(5/5)(53/53)5061.90%98.57%83.33%96.92%100.00%100.00%(13/21)(69/70)(5/6)(63/65)(6/6)(53/53)4077.27%97.26%75.00%96.97%100.00%100.00%(17/22)(71/73)(6/8)(64/66)(7/7)(55/55)From Table4, the classification accuracy of the calibration set and the test set was 100% based on CNN, when the total number of the calibration set was from 150 to 100. When the total number of the calibration set was from 90 to 40, the classification result of 90 calibration set samples is 98.89%, and the rest was 100%. The classification accuracy of more than 60 labeled samples in the test set is more than 98%.According to Table5, the general trend of the test set classification results in the type 1 orchards was that the classification results decreased with the decrease of the label samples. When the total number of the calibration set was 60-90, the classification accuracy was more than 88%; when the total number of the calibration set was 50-40, the classification accuracy dropped rapidly, and the number of the wrong samples in the test set was more than 10. The general trend of the test set classification results in the type 2 woodlands was the same with that of the type 1 orchards. When the total number of the calibration set was 90-70, the classification accuracy was 100%; when the total number of the calibration set was 60-40, there were a small number of samples with wrong judgment in the test set, the number of the wrong samples was 1, 1, and 2, respectively. In the type 3 tea plantations, when the total number of the calibration set was 90-60, the classification accuracy rate was 100%; when the total number of the calibration set was 50-40, the samples with wrong judgment of the test set were 1 and 2, respectively. Because the number of the tea plantations samples was less, the classification accuracy rate was lower when the number of the calibration set was 40. In the type 4 farmlands, when the total number of the calibration set was 90-60, the classification accuracy was 100%; when the total number of the calibration set was 50-40, the accuracy was above 96%. In the type 5 bare land, except for the calibration set of 90 samples, there was a wrong sample. And there was no other sample of misjudgment, that is, the accuracy is 100%. When the total number of the calibration set was 90-40 in the type 6 grasslands, the correct rate is 100%.


#### 3.1.3. Classification Results of Different Soil Types Based on Support Vector Machine

The spectrum of each calibration set soil sample transformed into two-dimensional matrix was substituted into SVM for training. The kernel function chose the radial basis function (RBF). The classification results of the calibration set and the test set are shown in Table6. When the total number of samples in the calibration set was 150-100, the classification accuracy of the test set was 100%. Table 7 shows the classification results of six types of soil in the 90-40 samples of the calibration set.Table 6
The classification results of the calibration set and the test set based on the different number of samples in the calibration set by support vector machine.
The total number of calibration setCalibration setTest set15098.00% (147/150)100.00%% (121/121)14097.14% (136/140)100.00%% (131/131)13096.92% (126/130100.00%% (141/141)12096.67% (116/120)100.00%% (151/151)11097.27% (107/110)100.00%% (161/161)10097.00% (97/100)100.00%% (171/171)9098.89% (89/90)98.90% (179/181)8096.25% (77/80)98.43% (188/191)7095.71% (67/70)98.51% (198/201)6095.00% (57/60)98.10% (207/211)5094.00% (47/50)91.86% (203/221)4090.00% (36/40)91.34% (211/231)Table 7
The classification results of six types of soil in the test set by support vector machine.
The total number of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslands9083.33%100.00%100.00%100.00%100.00%100.00%(10/12)(58/58)(3/3)(57/57)(1/1)(50/50)8084.62%100.00%80.00%100.00%100.00%100.00%(11/13)(60/60)(4/5)(60/60)(2/2)(51/51)7081.25%100.00%100.00%100.100%100.00%100.00%(13/16)(61/61)(5/5)(64/64)(3/3)(52/52)6076.47%100.00%100.00%100.00%100.00%100.00%(13/17)(66/66)(6/6)(64/64)(5/5(53/53)5014.29%100.00%100.00%100.00%100.00%100.00%(3/21)(70/70)(6/6)(65/65)(6/6)(53/53)4036.36%100.00%37.50%100.00%85.71%100.00%(8/22)(73/73)(3/8)(66/66)(6/7)(55/55)From Table6 by SVM algorithm, when the total number of calibration set was 150-40, the accuracy of the calibration set decreased with the decrease in the number of the label samples, and all of which were above 90%. Similar to CNN algorithm, when the total number of the calibration set algorithm was 150-100, the classification accuracy of the test set was all 100% by SVM. When the total number of the calibration set was 90-40, the accuracy of classification results in the test set was 98.90%, 98.43%, 98.51%, 98.10%, 91.86%, and 91.34%, respectively. Similar to CNN algorithm, the classification accuracy of more than 60 label samples in the test set was more than 98%. But in the 50-40 label samples, the classification accuracy of the test set dropped sharply, lower than 92%.According to Table7, when the total number of the calibration set in the type 1 orchards was 90-60, the correct rate was more than 75%; when the total number of the calibration set was 50 and 40, the wrong samples were more, and the correct rate of the classification was less than 40%. Most of the type 1 were judged as the type 2, indicating that the spectra of the orchards and woodlands were similar. SVM could not predict the category of the orchards correctly. In the type 3 tea plantations, when the total number of the calibration set was 80 and 40, there were 1 and 5 wrong samples, respectively, and the accuracy of the rest was 100%. In the type 5 bare land, except for the calibration set of 40, there was a wrong sample, and other samples were judged right, i.e., the accuracy was 100%. In the type 2 woodlands, the type 4 farmlands, and the type 6 grasslands, when the total number of the calibration set was 90-40, the accuracy was 100%.


### 3.2. Six Types of Soil Classification Results: Dividing the Calibration Set by Random Method

The number of the soil samples in six types of calibration set had different proportion in their categories by Kennard–Stone algorithm. To further verify the availability of CNN algorithm, the same proportion of soil samples from each type was randomly selected and classified by CNN and SVM algorithm. Table8 shows that 1/3, 1/4, and 1/5 samples of each soil type were taken as the calibration set samples, respectively. Table 9 shows the classification results of different types of soil based on CNN and SVM by random method. Figures 4(a)–4(c), respectively, show the classification results of each type of soil (orchards, woodlands, tea plantations, farmlands, bare land, and grasslands) based on SVM and CNN under the number of different proportion calibration set, which were displayed in the form of histogram.Table 8
The calibration set samples in different proportions by random method.
Proportion of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslandsTotal1/39/2629/864/1324/734/1320/60901/47/2622/863/1318/733/1315/60681/55/2617/863/1315/733/1313/6056Table 9
The classification results of the calibration set and the test set based on the different number of samples in the calibration set by random method.
Proportion of calibration setConvolutional neural networkSupport vector machineCalibration setTest setCalibration setTest set1/3100.00% (90/90)95.58%(173/181)98.89% (89/90)91.16% (165/181)1/4100.00% (68/68)94.09% (191/203)98.53% (67/68)91.13% (185/203)1/5100.00% (56/56)87.91% (189/215)100.00%(56/56)88.37% (190/215)Figure 4
The classification results of six types of soil in the test set based on support vector machine and convolutional neural network by random method (1 orchard, 2 woodlands, 3 tea plantations, 4 farmlands, 5 bare lands, and 6 grasslands): (a) 1/3 proportion, (b) 1/4 proportion, and (c) 1/5 proportion.
(a)(b)(c)According to Table9, the classification accuracy of the calibration set by CNN was 100%. The 1/3 and 1/4 proportion of the calibration set by SVM had a wrong sample, respectively, and the accuracy in the 1/5 proportion was 100%. In the test set, when the proportion was 1/3 and 1/4, the accuracy of CNN was higher than that of SVM; when the proportion was 1/5, the accuracy of SVM was slightly higher than that of CNN, with 88.37% and 87.91%, respectively. In general, when the number of samples was relatively large, the classification results of CNN were better than those of SVM. When the number of samples was small, the SVM had certain advantages.According to Figure4, when the proportion of the calibration set was 1/3 and 1/4, the classification accuracy of six types of soil by CNN was not lower than that by SVM. The classification accuracy of the farmlands, the grasslands, and the woodlands was above 95%, followed by the orchards (88.24%, 84.12%) and the tea plantations (77.78%, 70%). The classification accuracy of the bare land was the worst, which was 66.67% and 60%. When the proportion of the calibration set was 1/5, the classification accuracy by CNN and SVM in the woodlands and the farmlands was the same, with good classification effect (97.1%, 100%). Followed by the grasslands, the classification accuracy was both higher than 85%, and SVM was slightly better than CNN, with 89.36%. The classification results of the orchards were poor, which was about 60%, and the classification accuracy of the bare land was the lowest, which was lower than 50%. In the classification results of six types of soil, CNN was better than SVM in general.The proportions of 1/3, 1/4 and 1/5 soil samples were taken as the calibration set samples, respectively. Table10 shows the classification results of different types of soil based on CNN and SVM by randomly dividing the calibration set 10 times.Table 10
The classification results of soil samples based on convolutional neural network and support vector machine by randomly dividing the calibration set 10 times.
Number of times1/3 proportion1/4 proportion1/5 proportionCNN (%)SVM (%)CNN (%)SVM (%)CNN (%)SVM (%)193.9290.6196.0693.1081.1185.71291.1686.7484.2488.1892.1782.49388.9588.9593.1085.2287.1086.18493.3785.0884.7382.2779.7283.87591.7187.8581.2885.2286.1885.25690.6186.1989.1689.6686.1888.02791.7186.1995.0791.6385.2584.33886.1990.0690.6488.1878.3486.18993.3792.8291.1385.7194.0190.781093.3795.0391.6391.6378.3479.26Average91.4488.9589.7088.0884.8485.21CNN: convolutional neural network; SVM: support vector machine.According to Table10, the classification results of CNN were better than that of SVM in 1/3 proportion and 1/4 proportion, but it was lower than that of SVM in 1/5 proportion. With the reduction of calibration set samples, the classification accuracy of CNN and SVM test set decreased. Compared with SVM, the classification accuracy of CNN decreased more obviously.


## 3.1. Six Types of Soil Classification Results: Dividing the Calibration Set by Kennard–Stone Algorithm

### 3.1.1. Dividing Calibration Set and Test Set by Kennard–Stone Algorithm

K-S algorithm was used to divide calibration set and test set of six types of soil. The total number of the calibration set samples ranged from 40 to 150, with an interval of 10, and the rest was test set. The accuracy of classification model in small sample was analyzed. The number of the calibration set samples for each type of soil is shown in Table3.Table 3
The number of the calibration set samples by Kennard–Stone algorithm.
The total number of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslands1502251132813231402050132513191301946132313161201840132013161101835111813151001732111712119014281016121080132681311970102589108609207987505167877404135765


### 3.1.2. Classification Results of Different Types of Soil Based on Convolutional Neural Network

The spectrum of each calibration set of soil sample was transformed into two-dimensional matrix and then was substituted into CNN network for training. The iterations are 2000. The classification results of the calibration set and the test set are shown in Table4. When the total number of the calibration set samples was 150–100, the classification accuracy of the calibration set and the –test set was all 100%. The classification results of six types of soil in 90-40 calibration set, including orchards, woodlands, tea plantations, farmlands, bare land, and grasslands, are shown in Table 5.Table 4
The classification results of the calibration set and the test set based on the different number of samples in the calibration set by convolutional neural network.
The total number of calibration setCalibration setTest set150100.00% (150/150）100.00% (121/121)140100.00% (140/140）100.00% (131/131)130100.00% (130/130）100.00% (141/141)120100.00% (120/150）100.00% (151/151)110100.00% (110/110）100.00% (161/161)100100.00% (100/100）100.00% (171/171)9098.89% (89/90)98.90% (179/181)80100.00% (80/80)100.00% (191/191)70100.00% (70/70)98.51% (198/201)60100.00% (60/60)98.58% (208/211)50100.00% (50/50)94.57% (209/221)40100.00% (40/40)95.24% (220/231)Table 5
The classification results of six types of soil in the test set by convolutional neural network.
The total number of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslands9091.67%100.00%100.00%100.00%0%100.00%(11/12)(58/58)(3/3)(57/57)(0/1)(50/50)80100.00%100.00%100.00%100.00%100.00%100.00%(13/13)(60/60)(5/5)(60/60)(2/2)(51/51)7093.75%100.00%100.00%96.87%100.00%100.00%(15/16)(61/61)(5/5)(62/64)(3/3)(52/52)6088.24%98.48%100.00%100.00%100.00%100.00%(15/17)(65/66)(6/6)(64/64)(5/5)(53/53)5061.90%98.57%83.33%96.92%100.00%100.00%(13/21)(69/70)(5/6)(63/65)(6/6)(53/53)4077.27%97.26%75.00%96.97%100.00%100.00%(17/22)(71/73)(6/8)(64/66)(7/7)(55/55)From Table4, the classification accuracy of the calibration set and the test set was 100% based on CNN, when the total number of the calibration set was from 150 to 100. When the total number of the calibration set was from 90 to 40, the classification result of 90 calibration set samples is 98.89%, and the rest was 100%. The classification accuracy of more than 60 labeled samples in the test set is more than 98%.According to Table5, the general trend of the test set classification results in the type 1 orchards was that the classification results decreased with the decrease of the label samples. When the total number of the calibration set was 60-90, the classification accuracy was more than 88%; when the total number of the calibration set was 50-40, the classification accuracy dropped rapidly, and the number of the wrong samples in the test set was more than 10. The general trend of the test set classification results in the type 2 woodlands was the same with that of the type 1 orchards. When the total number of the calibration set was 90-70, the classification accuracy was 100%; when the total number of the calibration set was 60-40, there were a small number of samples with wrong judgment in the test set, the number of the wrong samples was 1, 1, and 2, respectively. In the type 3 tea plantations, when the total number of the calibration set was 90-60, the classification accuracy rate was 100%; when the total number of the calibration set was 50-40, the samples with wrong judgment of the test set were 1 and 2, respectively. Because the number of the tea plantations samples was less, the classification accuracy rate was lower when the number of the calibration set was 40. In the type 4 farmlands, when the total number of the calibration set was 90-60, the classification accuracy was 100%; when the total number of the calibration set was 50-40, the accuracy was above 96%. In the type 5 bare land, except for the calibration set of 90 samples, there was a wrong sample. And there was no other sample of misjudgment, that is, the accuracy is 100%. When the total number of the calibration set was 90-40 in the type 6 grasslands, the correct rate is 100%.


### 3.1.3. Classification Results of Different Soil Types Based on Support Vector Machine

The spectrum of each calibration set soil sample transformed into two-dimensional matrix was substituted into SVM for training. The kernel function chose the radial basis function (RBF). The classification results of the calibration set and the test set are shown in Table6. When the total number of samples in the calibration set was 150-100, the classification accuracy of the test set was 100%. Table 7 shows the classification results of six types of soil in the 90-40 samples of the calibration set.Table 6
The classification results of the calibration set and the test set based on the different number of samples in the calibration set by support vector machine.
The total number of calibration setCalibration setTest set15098.00% (147/150)100.00%% (121/121)14097.14% (136/140)100.00%% (131/131)13096.92% (126/130100.00%% (141/141)12096.67% (116/120)100.00%% (151/151)11097.27% (107/110)100.00%% (161/161)10097.00% (97/100)100.00%% (171/171)9098.89% (89/90)98.90% (179/181)8096.25% (77/80)98.43% (188/191)7095.71% (67/70)98.51% (198/201)6095.00% (57/60)98.10% (207/211)5094.00% (47/50)91.86% (203/221)4090.00% (36/40)91.34% (211/231)Table 7
The classification results of six types of soil in the test set by support vector machine.
The total number of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslands9083.33%100.00%100.00%100.00%100.00%100.00%(10/12)(58/58)(3/3)(57/57)(1/1)(50/50)8084.62%100.00%80.00%100.00%100.00%100.00%(11/13)(60/60)(4/5)(60/60)(2/2)(51/51)7081.25%100.00%100.00%100.100%100.00%100.00%(13/16)(61/61)(5/5)(64/64)(3/3)(52/52)6076.47%100.00%100.00%100.00%100.00%100.00%(13/17)(66/66)(6/6)(64/64)(5/5(53/53)5014.29%100.00%100.00%100.00%100.00%100.00%(3/21)(70/70)(6/6)(65/65)(6/6)(53/53)4036.36%100.00%37.50%100.00%85.71%100.00%(8/22)(73/73)(3/8)(66/66)(6/7)(55/55)From Table6 by SVM algorithm, when the total number of calibration set was 150-40, the accuracy of the calibration set decreased with the decrease in the number of the label samples, and all of which were above 90%. Similar to CNN algorithm, when the total number of the calibration set algorithm was 150-100, the classification accuracy of the test set was all 100% by SVM. When the total number of the calibration set was 90-40, the accuracy of classification results in the test set was 98.90%, 98.43%, 98.51%, 98.10%, 91.86%, and 91.34%, respectively. Similar to CNN algorithm, the classification accuracy of more than 60 label samples in the test set was more than 98%. But in the 50-40 label samples, the classification accuracy of the test set dropped sharply, lower than 92%.According to Table7, when the total number of the calibration set in the type 1 orchards was 90-60, the correct rate was more than 75%; when the total number of the calibration set was 50 and 40, the wrong samples were more, and the correct rate of the classification was less than 40%. Most of the type 1 were judged as the type 2, indicating that the spectra of the orchards and woodlands were similar. SVM could not predict the category of the orchards correctly. In the type 3 tea plantations, when the total number of the calibration set was 80 and 40, there were 1 and 5 wrong samples, respectively, and the accuracy of the rest was 100%. In the type 5 bare land, except for the calibration set of 40, there was a wrong sample, and other samples were judged right, i.e., the accuracy was 100%. In the type 2 woodlands, the type 4 farmlands, and the type 6 grasslands, when the total number of the calibration set was 90-40, the accuracy was 100%.


## 3.1.1. Dividing Calibration Set and Test Set by Kennard–Stone Algorithm

K-S algorithm was used to divide calibration set and test set of six types of soil. The total number of the calibration set samples ranged from 40 to 150, with an interval of 10, and the rest was test set. The accuracy of classification model in small sample was analyzed. The number of the calibration set samples for each type of soil is shown in Table3.Table 3
The number of the calibration set samples by Kennard–Stone algorithm.
The total number of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslands1502251132813231402050132513191301946132313161201840132013161101835111813151001732111712119014281016121080132681311970102589108609207987505167877404135765


## 3.1.2. Classification Results of Different Types of Soil Based on Convolutional Neural Network

The spectrum of each calibration set of soil sample was transformed into two-dimensional matrix and then was substituted into CNN network for training. The iterations are 2000. The classification results of the calibration set and the test set are shown in Table4. When the total number of the calibration set samples was 150–100, the classification accuracy of the calibration set and the –test set was all 100%. The classification results of six types of soil in 90-40 calibration set, including orchards, woodlands, tea plantations, farmlands, bare land, and grasslands, are shown in Table 5.Table 4
The classification results of the calibration set and the test set based on the different number of samples in the calibration set by convolutional neural network.
The total number of calibration setCalibration setTest set150100.00% (150/150）100.00% (121/121)140100.00% (140/140）100.00% (131/131)130100.00% (130/130）100.00% (141/141)120100.00% (120/150）100.00% (151/151)110100.00% (110/110）100.00% (161/161)100100.00% (100/100）100.00% (171/171)9098.89% (89/90)98.90% (179/181)80100.00% (80/80)100.00% (191/191)70100.00% (70/70)98.51% (198/201)60100.00% (60/60)98.58% (208/211)50100.00% (50/50)94.57% (209/221)40100.00% (40/40)95.24% (220/231)Table 5
The classification results of six types of soil in the test set by convolutional neural network.
The total number of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslands9091.67%100.00%100.00%100.00%0%100.00%(11/12)(58/58)(3/3)(57/57)(0/1)(50/50)80100.00%100.00%100.00%100.00%100.00%100.00%(13/13)(60/60)(5/5)(60/60)(2/2)(51/51)7093.75%100.00%100.00%96.87%100.00%100.00%(15/16)(61/61)(5/5)(62/64)(3/3)(52/52)6088.24%98.48%100.00%100.00%100.00%100.00%(15/17)(65/66)(6/6)(64/64)(5/5)(53/53)5061.90%98.57%83.33%96.92%100.00%100.00%(13/21)(69/70)(5/6)(63/65)(6/6)(53/53)4077.27%97.26%75.00%96.97%100.00%100.00%(17/22)(71/73)(6/8)(64/66)(7/7)(55/55)From Table4, the classification accuracy of the calibration set and the test set was 100% based on CNN, when the total number of the calibration set was from 150 to 100. When the total number of the calibration set was from 90 to 40, the classification result of 90 calibration set samples is 98.89%, and the rest was 100%. The classification accuracy of more than 60 labeled samples in the test set is more than 98%.According to Table5, the general trend of the test set classification results in the type 1 orchards was that the classification results decreased with the decrease of the label samples. When the total number of the calibration set was 60-90, the classification accuracy was more than 88%; when the total number of the calibration set was 50-40, the classification accuracy dropped rapidly, and the number of the wrong samples in the test set was more than 10. The general trend of the test set classification results in the type 2 woodlands was the same with that of the type 1 orchards. When the total number of the calibration set was 90-70, the classification accuracy was 100%; when the total number of the calibration set was 60-40, there were a small number of samples with wrong judgment in the test set, the number of the wrong samples was 1, 1, and 2, respectively. In the type 3 tea plantations, when the total number of the calibration set was 90-60, the classification accuracy rate was 100%; when the total number of the calibration set was 50-40, the samples with wrong judgment of the test set were 1 and 2, respectively. Because the number of the tea plantations samples was less, the classification accuracy rate was lower when the number of the calibration set was 40. In the type 4 farmlands, when the total number of the calibration set was 90-60, the classification accuracy was 100%; when the total number of the calibration set was 50-40, the accuracy was above 96%. In the type 5 bare land, except for the calibration set of 90 samples, there was a wrong sample. And there was no other sample of misjudgment, that is, the accuracy is 100%. When the total number of the calibration set was 90-40 in the type 6 grasslands, the correct rate is 100%.


## 3.1.3. Classification Results of Different Soil Types Based on Support Vector Machine

The spectrum of each calibration set soil sample transformed into two-dimensional matrix was substituted into SVM for training. The kernel function chose the radial basis function (RBF). The classification results of the calibration set and the test set are shown in Table6. When the total number of samples in the calibration set was 150-100, the classification accuracy of the test set was 100%. Table 7 shows the classification results of six types of soil in the 90-40 samples of the calibration set.Table 6
The classification results of the calibration set and the test set based on the different number of samples in the calibration set by support vector machine.
The total number of calibration setCalibration setTest set15098.00% (147/150)100.00%% (121/121)14097.14% (136/140)100.00%% (131/131)13096.92% (126/130100.00%% (141/141)12096.67% (116/120)100.00%% (151/151)11097.27% (107/110)100.00%% (161/161)10097.00% (97/100)100.00%% (171/171)9098.89% (89/90)98.90% (179/181)8096.25% (77/80)98.43% (188/191)7095.71% (67/70)98.51% (198/201)6095.00% (57/60)98.10% (207/211)5094.00% (47/50)91.86% (203/221)4090.00% (36/40)91.34% (211/231)Table 7
The classification results of six types of soil in the test set by support vector machine.
The total number of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslands9083.33%100.00%100.00%100.00%100.00%100.00%(10/12)(58/58)(3/3)(57/57)(1/1)(50/50)8084.62%100.00%80.00%100.00%100.00%100.00%(11/13)(60/60)(4/5)(60/60)(2/2)(51/51)7081.25%100.00%100.00%100.100%100.00%100.00%(13/16)(61/61)(5/5)(64/64)(3/3)(52/52)6076.47%100.00%100.00%100.00%100.00%100.00%(13/17)(66/66)(6/6)(64/64)(5/5(53/53)5014.29%100.00%100.00%100.00%100.00%100.00%(3/21)(70/70)(6/6)(65/65)(6/6)(53/53)4036.36%100.00%37.50%100.00%85.71%100.00%(8/22)(73/73)(3/8)(66/66)(6/7)(55/55)From Table6 by SVM algorithm, when the total number of calibration set was 150-40, the accuracy of the calibration set decreased with the decrease in the number of the label samples, and all of which were above 90%. Similar to CNN algorithm, when the total number of the calibration set algorithm was 150-100, the classification accuracy of the test set was all 100% by SVM. When the total number of the calibration set was 90-40, the accuracy of classification results in the test set was 98.90%, 98.43%, 98.51%, 98.10%, 91.86%, and 91.34%, respectively. Similar to CNN algorithm, the classification accuracy of more than 60 label samples in the test set was more than 98%. But in the 50-40 label samples, the classification accuracy of the test set dropped sharply, lower than 92%.According to Table7, when the total number of the calibration set in the type 1 orchards was 90-60, the correct rate was more than 75%; when the total number of the calibration set was 50 and 40, the wrong samples were more, and the correct rate of the classification was less than 40%. Most of the type 1 were judged as the type 2, indicating that the spectra of the orchards and woodlands were similar. SVM could not predict the category of the orchards correctly. In the type 3 tea plantations, when the total number of the calibration set was 80 and 40, there were 1 and 5 wrong samples, respectively, and the accuracy of the rest was 100%. In the type 5 bare land, except for the calibration set of 40, there was a wrong sample, and other samples were judged right, i.e., the accuracy was 100%. In the type 2 woodlands, the type 4 farmlands, and the type 6 grasslands, when the total number of the calibration set was 90-40, the accuracy was 100%.


## 3.2. Six Types of Soil Classification Results: Dividing the Calibration Set by Random Method

The number of the soil samples in six types of calibration set had different proportion in their categories by Kennard–Stone algorithm. To further verify the availability of CNN algorithm, the same proportion of soil samples from each type was randomly selected and classified by CNN and SVM algorithm. Table8 shows that 1/3, 1/4, and 1/5 samples of each soil type were taken as the calibration set samples, respectively. Table 9 shows the classification results of different types of soil based on CNN and SVM by random method. Figures 4(a)–4(c), respectively, show the classification results of each type of soil (orchards, woodlands, tea plantations, farmlands, bare land, and grasslands) based on SVM and CNN under the number of different proportion calibration set, which were displayed in the form of histogram.Table 8
The calibration set samples in different proportions by random method.
Proportion of calibration setType 1 orchardsType 2 woodlandsType 3 tea plantationsType 4 farmlandsType 5 bare landsType 6 grasslandsTotal1/39/2629/864/1324/734/1320/60901/47/2622/863/1318/733/1315/60681/55/2617/863/1315/733/1313/6056Table 9
The classification results of the calibration set and the test set based on the different number of samples in the calibration set by random method.
Proportion of calibration setConvolutional neural networkSupport vector machineCalibration setTest setCalibration setTest set1/3100.00% (90/90)95.58%(173/181)98.89% (89/90)91.16% (165/181)1/4100.00% (68/68)94.09% (191/203)98.53% (67/68)91.13% (185/203)1/5100.00% (56/56)87.91% (189/215)100.00%(56/56)88.37% (190/215)Figure 4
The classification results of six types of soil in the test set based on support vector machine and convolutional neural network by random method (1 orchard, 2 woodlands, 3 tea plantations, 4 farmlands, 5 bare lands, and 6 grasslands): (a) 1/3 proportion, (b) 1/4 proportion, and (c) 1/5 proportion.
(a)(b)(c)According to Table9, the classification accuracy of the calibration set by CNN was 100%. The 1/3 and 1/4 proportion of the calibration set by SVM had a wrong sample, respectively, and the accuracy in the 1/5 proportion was 100%. In the test set, when the proportion was 1/3 and 1/4, the accuracy of CNN was higher than that of SVM; when the proportion was 1/5, the accuracy of SVM was slightly higher than that of CNN, with 88.37% and 87.91%, respectively. In general, when the number of samples was relatively large, the classification results of CNN were better than those of SVM. When the number of samples was small, the SVM had certain advantages.According to Figure4, when the proportion of the calibration set was 1/3 and 1/4, the classification accuracy of six types of soil by CNN was not lower than that by SVM. The classification accuracy of the farmlands, the grasslands, and the woodlands was above 95%, followed by the orchards (88.24%, 84.12%) and the tea plantations (77.78%, 70%). The classification accuracy of the bare land was the worst, which was 66.67% and 60%. When the proportion of the calibration set was 1/5, the classification accuracy by CNN and SVM in the woodlands and the farmlands was the same, with good classification effect (97.1%, 100%). Followed by the grasslands, the classification accuracy was both higher than 85%, and SVM was slightly better than CNN, with 89.36%. The classification results of the orchards were poor, which was about 60%, and the classification accuracy of the bare land was the lowest, which was lower than 50%. In the classification results of six types of soil, CNN was better than SVM in general.The proportions of 1/3, 1/4 and 1/5 soil samples were taken as the calibration set samples, respectively. Table10 shows the classification results of different types of soil based on CNN and SVM by randomly dividing the calibration set 10 times.Table 10
The classification results of soil samples based on convolutional neural network and support vector machine by randomly dividing the calibration set 10 times.
Number of times1/3 proportion1/4 proportion1/5 proportionCNN (%)SVM (%)CNN (%)SVM (%)CNN (%)SVM (%)193.9290.6196.0693.1081.1185.71291.1686.7484.2488.1892.1782.49388.9588.9593.1085.2287.1086.18493.3785.0884.7382.2779.7283.87591.7187.8581.2885.2286.1885.25690.6186.1989.1689.6686.1888.02791.7186.1995.0791.6385.2584.33886.1990.0690.6488.1878.3486.18993.3792.8291.1385.7194.0190.781093.3795.0391.6391.6378.3479.26Average91.4488.9589.7088.0884.8485.21CNN: convolutional neural network; SVM: support vector machine.According to Table10, the classification results of CNN were better than that of SVM in 1/3 proportion and 1/4 proportion, but it was lower than that of SVM in 1/5 proportion. With the reduction of calibration set samples, the classification accuracy of CNN and SVM test set decreased. Compared with SVM, the classification accuracy of CNN decreased more obviously.


## 4. Discussion

### 4.1. The Feasibility of Land Cover Classification with Small Samples by Convolutional Neural Network

The essence of CNN is that each convolutional layer contains a certain number of convolution kernels. Compared with the traditional neural network, CNN reduces the number of training weights and computational complexity through weight sharing. CNN is to input the original data directly into the network and conduct network learning in the training data invisibly. It can avoid manual feature extraction and realize automatic classification. CNN is mostly used for the image information classification with a large amount of data, which contains a large number of label samples. But it is seldom used in a small amount of data classification.In this paper, the spectral data are one-dimensional vector. To be suitable for CNN, it is transformed into two-dimensional vector for convolution and other operations, and a better classification effect is obtained. The first reason is that CNN can extract more deep and abstract features of the spectrum, which is conducive to the classification of different types of soil. The second reason is that it takes 2000 iterations to improve the accuracy of the model. SVM is a commonly used classification method, which has a good classification effect in small label samples. In this paper, compared with SVM, CNN not only has a good classification effect in the condition of more training samples but also has a better classification effect in small label samples. However, with the continuous reduction of training samples, SVM has more advantages. Therefore, CNN can be applied to the classification of land cover with small samples, but SVM is still better for the training set with too small samples.


### 4.2. The Advantages of the Kennard–Stone Algorithm

In this paper, different methods are used to divide the samples of the calibration set, and different classification results are obtained. The results by K-S algorithm are good. K-S algorithm is mainly used to select representative samples from the original sample to establish the model. The main idea is to select the spectrum samples with large differences as training samples and uses the samples with relatively close spectrum to predict, so as to avoid the uneven distribution of training samples. However, dividing the calibration set by random method has uncertainty and limited distribution information, so the calibration results by KS classification are better.


### 4.3. The Analysis of the Different Number of Samples in the Calibration Set

In the analysis of the classification results of various types of soil samples, the woodlands, farmlands, and grasslands, all show good classification effects under the different number of samples in the calibration set. However, the classification accuracy of orchards, tea plantations, and bare lands is not stable. More training samples can have a higher classification accuracy, and less training samples have a decline in classification accuracy. The total samples of forest land, farmland, and grassland are more than 60, while the total samples of orchards, tea plantations, and bare lands are less, with 26, 13, and 13, respectively. CNN cannot train enough calibration set samples, so it cannot get a better classification model, and the test set classification prediction is poor.


## 4.1. The Feasibility of Land Cover Classification with Small Samples by Convolutional Neural Network

The essence of CNN is that each convolutional layer contains a certain number of convolution kernels. Compared with the traditional neural network, CNN reduces the number of training weights and computational complexity through weight sharing. CNN is to input the original data directly into the network and conduct network learning in the training data invisibly. It can avoid manual feature extraction and realize automatic classification. CNN is mostly used for the image information classification with a large amount of data, which contains a large number of label samples. But it is seldom used in a small amount of data classification.In this paper, the spectral data are one-dimensional vector. To be suitable for CNN, it is transformed into two-dimensional vector for convolution and other operations, and a better classification effect is obtained. The first reason is that CNN can extract more deep and abstract features of the spectrum, which is conducive to the classification of different types of soil. The second reason is that it takes 2000 iterations to improve the accuracy of the model. SVM is a commonly used classification method, which has a good classification effect in small label samples. In this paper, compared with SVM, CNN not only has a good classification effect in the condition of more training samples but also has a better classification effect in small label samples. However, with the continuous reduction of training samples, SVM has more advantages. Therefore, CNN can be applied to the classification of land cover with small samples, but SVM is still better for the training set with too small samples.


## 4.2. The Advantages of the Kennard–Stone Algorithm

In this paper, different methods are used to divide the samples of the calibration set, and different classification results are obtained. The results by K-S algorithm are good. K-S algorithm is mainly used to select representative samples from the original sample to establish the model. The main idea is to select the spectrum samples with large differences as training samples and uses the samples with relatively close spectrum to predict, so as to avoid the uneven distribution of training samples. However, dividing the calibration set by random method has uncertainty and limited distribution information, so the calibration results by KS classification are better.


## 4.3. The Analysis of the Different Number of Samples in the Calibration Set

In the analysis of the classification results of various types of soil samples, the woodlands, farmlands, and grasslands, all show good classification effects under the different number of samples in the calibration set. However, the classification accuracy of orchards, tea plantations, and bare lands is not stable. More training samples can have a higher classification accuracy, and less training samples have a decline in classification accuracy. The total samples of forest land, farmland, and grassland are more than 60, while the total samples of orchards, tea plantations, and bare lands are less, with 26, 13, and 13, respectively. CNN cannot train enough calibration set samples, so it cannot get a better classification model, and the test set classification prediction is poor.


## 5. Conclusion

Based on the visible near-infrared spectroscopy technology, this paper takes six different types of soil (orchards, woodlands, tea plantations, farmlands, bare land, and grasslands) in Qingdao, China, as examples, and establishes a convolutional neural network classification model. The classification results under the conditions of different number label samples are analyzed, and the classification results with the shallow network SVM are compared. Under the condition that Kennard–Stone algorithm divides the calibration set, the classification results of six different soil types and single six soil types by convolutional neural network are better than those by the support vector machine. The classification accuracy of the test set is above 95%. Under the condition of randomly dividing the calibration set according to the proportion of 1/3 and 1/4, the classification results by convolutional neural network are also better. The classification accuracy of the test set is over 87%. According to the deep learning algorithm, the aim is to explore a new method for rapid, nondestructive, and accurate classification of the land cover. This method has guiding significance for the practical application of soil investigation and mapping.



---

*Source: 1508267-2021-09-03.xml*