# Crop Classification for Agricultural Applications in Hyperspectral Remote Sensing Images
## 2 Materials and Methods
```
Input: \(\text{H}\in\text{R}^{\text{h}\times\text{w}\times\text{d}}\) be the Hyperspectral image Data, R: Red band, G: Green band, thresholds: \(\delta\)1, \(\delta\)2, and \(\delta\)3 Output: \(\text{H}_{\text{BS}}\), finer sub cube with informative and selected bands Step 1: Partition the image H with d bands into three sub cubes based on light properties and biological conditions Step 2: Let the number of bands in each of the sub cubes be d\({}_{1}\), d\({}_{2}\) and d\({}_{3}\) bands respectively from visible, near Infrared, and shortwave infrared regions Step 3: for i:1 to d\({}_{1}\), Compute the entropy, E\({}_{i}\), of each band using Equation (2) Step 4: Generate finer sub cube H\({}_{\text{vis}}\) with \(\text{m}_{1}\) bands for those bands from d\({}_{1}\) whose E\({}_{i}>\delta\)1 Step 5: for i = 1 to d\({}_{2}\), Compute the Normalized Difference Vegetation Index, NDVI\({}_{i}\), using Equation (3) Step 6: Generate finer sub cube H\({}_{\text{NIR}}\) with \(\text{m}_{2}\) bands for those bands from d\({}_{2}\) whose NDVI\({}_{i}>\delta\)2 Step 7: for i = 1 to d\({}_{3}\), Compute the Modified Normalized Difference Water Index, MNDWI\({}_{i}\), using Equation (4) Step 8: Generate finer sub cube H\({}_{\text{SWIR}}\) with \(\text{m}_{3}\) bands for those bands from d\({}_{2}\) whose MNDWI\({}_{i}>\delta\)3 Step 9: Combine the sub cubes H\({}_{\text{vis}}\), H\({}_{\text{NIR}}\) and H\({}_{\text{SWIR}}\) as H\({}_{\text{BS}}=\text{ H}_{\text{vis}}\cup\text{ H}_{\text{NIR}}\cup\text{ H}_{\text{SWIR}}\) which satisfies Equation (5)
```  
**Algorithm 1**Proposed Band Selection Approach for Crop Classification  
There are two modules in the proposed methodology for the band selection task known as Partition and Ranking. The partition module is focused on the Biophysical properties of plants in Visible, NIR, and SWIR regions. These regions are named Partition#1, Partition#2, and Partition#3. In the ranking module, agricultural phenology metrics such as Entropy, NDVI, and MNDWI are computed using Equations (2)-(4) for the three partitions, respectively. Then, the computed values and selected representative bands are ranked using an adaptive threshold for each of the measures. The parameter tunning is shown in the experimental section. Let \(\text{H}_{\text{BS}}\in\text{R}^{\text{h}\times\text{w}\times\text{m}}\) denote hyperspectral data cube after the selection of m spectral bands [30; 31; 32]. This data can be split into two parts. One is for training and the other for testing. Let imagine \(\chi\) as a training vector that will be input to the CNN model. The first layer is the convolution layer which follows according to Equation (6). Here \(\otimes\) denotes convolution operator, filter is denoted \(\Gamma\) and \((\text{i},\text{j})\) denotes the corresponding spatial location. \[\text{CONVOLUTION}_{\text{i},\text{j}}=\sigma((\Gamma\otimes\chi)_{\text{i}, \text{j}}+\text{b}) \tag{6}\]  
Here \(\sigma\) (.) denotes activation function. For better convergence, the ReLU activation function is used in the present model as in Equation (7). This function gives output as same as input or zero. \[\sigma(\text{x})=\text{max}(0,\text{x}) \tag{7}\]  
After a series of convolution layers, the feature vectors are converted into a single Flatten Vector (FV), which will be given as input to Fully Connected (FC) layers. In FC layers, two operations, pre-activation and activation, will be performed at every node. All the FC layers use the ReLU activation function. However, the last layer uses the softmax activation function, as shown in Equation (8). Figure 1:0This function gives output probabilities of each crop, and hence classification is possible. The proposed method performance was tested with state-of-the-art methods (a brief description of the methods is given in Section 4). The experimental works were carried out using MATLAB R 2018b and Python with Google co-laboratory. The hardware utilized for the work was a personal computer with Intel(R) Core(TM) i5-6500 CPU with 3.20 GHz and 8 GB RAM.