# Enhanced Convolutional-Neural-Network Architecture for Crop Classification
## 3 Materials and Methods
### Performance Measurements  
The overall accuracy (\(OA\)), average accuracy (\(AA\)) and \(f_{1}\) score (\(f_{1}\)) given by Equations (3) and (4) are the most widely used metrics for evaluating the ability of classifying images into corresponding class.  
\(OA\) quantifies the ratio of correctly classified samples. \(AA\) is the average of each accuracy per class, and \(f_{1}\) quantifies the harmonic mean between precision and recall. \(f_{1}\) is often used when the false negatives and false positives are crucial.  
Precision computes the number of positive predictions divided by the total number of positive class values predicted, whereas recall determines the number of positive predictions divided by the number of positive class values in the test dataset. Following are their corresponding formulas:  
\[OA=\frac{TN+TP}{TP+TN+FP+FN}, \tag{3}\]  
\[f_{1}=\frac{2\times\text{precision}\times\text{recall}}{\text{precision}+\text {recall}},\text{ with} \tag{4}\]  
\[\text{recall}=\frac{TP}{TP+FN},\text{ and} \tag{5}\]  
\[\text{precision}=\frac{TP}{TP+FP}, \tag{6}\]  
\begin{table}
\begin{tabular}{l l l l} \hline \hline
**Parameter** & **Sequence 1** & **Sequence 2** & **Description** \\ \hline Patch size & \(32\times 32\times 35\) & \(32\times 32\times 42\) & Input shape for feeding 2D-CNN architectures \\ Patch size & \(8\times 8\times 35\) & \(8\times 8\times 42\) & Input shape for feeding RNN architecture \\ Training samples & 9 K & 8.1 K & Number of patches to train the DL architectures \\ Validation samples & 1 K & 900 & Number of patches to evaluate the DL architectures \\ Testing samples & 6.69 K & 6.70 K & Number of patches to test the DL architectures \\ Learning rate & 32 & 20 & Control how much to change the model \\ Optimizer & Adadelta & Adadelta & Fit weights \\ Cost function & Entropy & Entropy & Estimates the error \\ Metric & Accuracy & Accuracy & Evaluates the models \\ Activation function 1 & Relu & Relu & Establish the output in hidden layers \\ Activation function 2 & Softmax & Softmax & Establish the o \\ Batch size & 20 & 32 & Number of samples per training iteration \\ Epoch & 30 & 30 & Number of passes over the whole dataset \\ Iterations & 450 & 330 & Maximum number of iterations \\ \hline \hline \end{tabular}
\end{table}
Table 3: Parameter values for all experiments.  
where \(TP\) is the number of patches that are predicted as positive by the model that are actually positive, \(FP\) is the number of patches that are labeled as positive by the model but are actually negative. The number of patches predicted as negative by the model but actually are positive is \(FN\), while the number of patches marked as negative by the model but actually negative is \(TN\), as shown in confusion matrix (see Figure 9).  
The computational complexities of all the compared DL architectures are evaluated in terms of the number of multiply-accumulate operations (\(MACs\)) required in their main classification step. In a fully connected layer, all the inputs are connected to all the outputs. Thus, for a layer with \(I\) input values and \(J\) output values, its weights \(W\) can be stored and computed in the matrix given by Equation (7):  
\[MACf_{cl}=I\times J. \tag{7}\]  
Since the convolutional layers are three-dimensional feature maps of size \(H\times W\times C\) where \(H\) is the height of the feature map, \(W\) the width, and \(C\) the number of channels at each location, for a convolutional layer with kernel size \(K\), the number of \(MACs\) is given by Equation (8):  
\[MAC_{cl}=K\times K\times C_{in}\times H_{out}\times W_{out}\times C_{out}. \tag{8}\]