## 3 Materials and Methods
### Global System Implementation
The final class that was predicted for a given example \(x\) was (10) the one with the maximum likelihood value, where \(y(x)\) is the predicted class for the example \(x\):  
\[y(x)=argmax_{c}\ p(c\mid x) \tag{10}\]  
In the evaluation part of the meta-classifier, the \(F1\) score (11) can be calculated to note its performance on the given test set:  
\[F1_{meta}=\frac{2\cdot Precision_{meta}\cdot Recall_{meta}}{Precision_{meta }+Recall_{meta}}, \tag{11}\]  
where \(Precision_{meta}\) and \(Recall_{meta}\) are the general metrics for meta-classifier predictions. In the present context, the weight matrix \(W\) represented an essential component. As part of the presented process, it adjusted the contribution of each model to the class prediction based on the performance of the individual, underlying models, as measured by the \(F1\) score. The weighting performed, followed by the _logit_ combination using logistic regression, described an improvement in overall performance, better fitting the defining characteristics of the classes in the dataset. This approach can help to weigh the base model predictions more effectively based on their performance, particularly in a multi-class classification scenario where the \(F1\) score is an important metric. After training the base models, \(F1\) scores for each basic model were calculated and weight predictions were generated. In this step, the \(F1\) scores were used to weigh the predictions from each base model. Higher \(F1\) scores can be given more weight. Finally, the meta-classifier was trained using the weight predictions as features. Figure 2 shows the diagram illustrating the process of training and evaluating base models, computing weighted predictions, and meta-classifier implementation. The meta-classifier works at a higher level of classification. The individual classifiers form the first level. The meta-classifier operates at the second level, taking the predictions of the lower-level classifiers as input. In the present context, the area represented by the meta-classifier was responsible for learning the complex relationships between the base classifiers and weighting the contribution of each to obtain a better final prediction. This was based on a common learning model represented by logistic regression. To note the ensemble deep learning part, the usage example was one of the stacking types (stacked generalization). Each first-level classifier generated predictions that became the input features of the meta-classifier [19]. The meta-model is, in this way, a useful winner-takes-all strategy. These procedures work together to integrate the capabilities of different models, resulting in improved prediction performance. Figure 2: Proposed approach for the ensemble system. The meta-classifier used in this study was a multinomial logistic regression model, implemented via the LogisticRegression class from Scikit-learn (sklearn_linear_model). The model was trained on class-wise weighted and standardized logits from the five ViT base models. Standardization was performed using StandardScaler to zero-mean and unit-variance the features. The logistic regression model was configured with the following parameters: solver = 'lbfgs', multi_class ='multinomial', max_iter = 1000, and the default regularization strength C = 1.0. This setup ensured stable convergence and probabilistic predictions across multiple insect classes. The model output the predicted class with the highest probability, based on SoftMax-transformed logits.