## 4 Framework
### HPA-C Framework
Leaky ReLU was also tested but did not offer any advantage in classification accuracy. The combination of \(3\times 3\) and \(1\times 1\) convolutions enhances feature extraction while keeping the parameter count low. Batch normalization stabilized training, and dropout prevented overfitting. The Adam optimizer with a learning rate of 0.001 was selected for fast convergence. Softmax activation in the final layer enables probabilistic multi-class classification. This design ensures that the custom CNN effectively complements HPA-C by focusing on the most relevant features without excessive computational cost. ### Complete Pipeline

The complete pipeline is shown in Figure 3. The performance of HPA-C depends on key hyperparameters. These are the number of wolves (\(N\)), the maximum number of iterations (\(T\)), step size (\(a\)), and learning rate (\(\eta\)). To ensure optimal performance, we tried different ranges of hyperparameters and conducted sensitivity analysis. Table 4 shows the tested ranges for the used hyperparameters. The step-size parameter (\(a\)) is particularly important because it is linearly decreased from an initial value of 2 to 0

Figure 2: Customized CNN architecture used with HPA-C.

over the iterations. This helps in controlling the exploration-exploitation trade-off. The selected hyperparameters are presented in Table 5.

Based on sensitivity analysis, we selected hyperparameters that balanced accuracy and computational efficiency. The chosen values are summarized in Table 5. \begin{table}
\begin{tabular}{c c} \hline \hline
**Hyperparameter** & **Explored Range** \\ \hline Number of wolves (\(N\)) & 5 to 30 \\ Maximum iterations (\(T\)) & 10 to 150 \\ Step size (\(a\)) & Decreasing from 2 to 0 \\ Learning rate (\(\eta\)) & 0.0005 to 0.005 \\ Optimizers & Adam, SGDM, RMSProp \\ Execution environment & CPU, GPU \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Explored ranges of hyperparameters. Figure 3: Complete pipeline of the research work. \begin{table}
\begin{tabular}{c c} \hline \hline
**Hyperparameter** & **Selected Value** \\ \hline Number of wolves (\(N\)) & 20 \\ Maximum iterations (\(T\)) & 100 \\ Step size (\(a\)) & Decreases from 2 to 0 \\ Learning rate (\(\eta\)) & 0.001 \\ Optimizer & Adam \\ Execution environment & GPU \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Final selected hyperparameters. Hyperparameter selection was based on empirical results. Sensitivity analysis showed that increasing \(N\) beyond 20 or \(T\) beyond 100 resulted in negligible accuracy gains but significantly increased computational cost. The step size (_a_) follows a decreasing pattern from 2 to 0, ensuring a smooth transition from exploration to exploitation. The Adam optimizer demonstrated superior convergence properties and improved accuracy. The GPU-based implementation provided faster execution compared to the CPU. MATLAB was used to access and preprocess the datasets utilized in this study in order to guarantee the best possible performance on classification tasks. Histogram equalization, data augmentation, and data separation are the three main processes in the preprocessing pipeline. The datasets used in this work were divided into training (80%) and testing (20%) subsets, a widely adopted practice to maintain a balance between training robustness and unbiased model evaluation. Histogram equalization was used to improve image contrast, making it easier to identify feature-rich areas. This is especially useful in agricultural datasets, where lighting conditions often vary. To further enhance dataset diversity, reduce the chance of overfitting, and improve the model's generalization capacity, data augmentation techniques including rotation, flipping, and scaling were used. In our proposed pipeline, data augmentation was applied consistently across all datasets, regardless of their class distribution. The used augmentation techniques, such as rotation, flipping, and scaling, were selected to enhance model generalization and robustness rather than to address class imbalance.