# FF-PCA-LDA: Intelligent Feature Fusion Based PCA-LDA Classification System for Plant Leaf Diseases
## 3 Material and Methods
### Deep Image Feature Extraction  
There are several advantages of deep feature extraction over common methods, such as user intervention not being required to define the kernel size, types, and numbers of features for any types of crop images. In comparison, in conventional feature extraction, user intervention is vital, and it is not necessarily the case that a universal configuration of features will work for all types of images. This encourages us to extract deep features and combine them with handcrafted hybrid features for the improved classification of crop disease detection.  
Deep learning models have the ability to learn hidden patterns of input images at various convolutional and pooling layers. In this research, we have modified the ResNet50 model by employing the transfer learning (TL) concept for feature extraction. TL utilizes the partial weights of the original model and replaces new layers to solve new challenging problems [31]. In case of relatively less annotated data, TL is an effective way of solving classification problems.  
The original ResNet50 was trained for 1000 classes and having the last 3 layers of ResNet50, namely, 'FC_1000', 'FC1000_Softmax', and 'FC_Classification. In the current study, ResNet50 is modified by replacing the mentioned layers with the new layers of 'FC_3', 'FC3_Softmax', and 'Class_output' for our three classes 'Healthy', 'Early', and 'Late Blight'. The 'avg_pool' layer of the TL-ResNet50 has 2048 neurons connected with succeeding layers of 3 neurons, each representing a crop class.  
The pictorial representation of the modified ResNet50 deep feature extraction using the TL concept is shown in Figure 4. The numbers in blue blocks '3, 4, 6, and 3' of Figure 4 show that each block of ResNet50 perform total number of operations in a particular block. For example, 'conv2_x' block has 3 layers of \(1\times 1\), 64; 3 \(\times\) 3, 64; and \(1\times 1\), 256, and these are repeated in total 3 time, so providing 9 layers in total in this part. Similarly, the 'conv3_x', 'conv4_x', and 'conv5_x' blocks have a total of 3 \(\times\) 4 = 12, 3 \(\times\) 6 = 18, and 3 \(\times\) 3 = 9 layers in each part, respectively. Owing to the residual function, ResNet has better learning and generalization ability compared to its competitors.  
Figure 4: Modified ResNet50 architecture for Deep feature extraction.  
The benefit of features extracted using deep learning algorithms is that the network learns image features automatically layer-by-layer. Generally, the last layer of any deep learning network such as ResNet50 produces an output class predication using softmax classification. However, high-level features can be extracted before the FC layers.  
In this research, deep (high-level) features are extracted using TL-ResNet50 model after the fifth residual block (Conv5_x, Figure 4) at the 'avg_pool' layer. This output serves as a deep image feature extractor. The dimension of the deep feature vector is of size 2048. These features are obtained once training of the TL-ResNet50 is completed. Details of the deep feature extraction and utilization for classification can be found in [14]. For better performance, the network hyper-parameter tuning of TL-ResNet50 is set empirically as follows: a learning rate of 0.0001, a batch size of 32, data augmentation of (\(-30\), \(30\)), and the number of epochs is set to 600.