
<!-- # Model Trained Using AutoTrain

- Problem type: Image Classification

## Validation Metrics
loss: 0.369663268327713

f1_macro: 0.6843075887364951

f1_micro: 0.858508604206501

f1_weighted: 0.8303295709630173

precision_macro: 0.8204154992433914

precision_micro: 0.858508604206501

precision_weighted: 0.882137838723129

recall_macro: 0.7169578798305077

recall_micro: 0.858508604206501

recall_weighted: 0.858508604206501

accuracy: 0.858508604206501 -->

# Corn Leaf Disease Classification Model Analysis

## Dataset Breakdown

The dataset consists of four classes with the following distribution:

| Class                  | Number of Images |
|------------------------|-------------------|
| Healthy_Leaf           | 3021              |
| Gray_Leaf_Spot         | 2478              |
| Common_Rust            | 2949              |
| Northern_Leaf_Blight   | 3303              |

**Note:** There is a slight class imbalance, with Gray_Leaf_Spot having notably fewer images compared to the other classes.

## Model Performance Metrics

The model was trained using AutoTrain for image classification. Here's a breakdown of the validation metrics:

| Metric                | Value     |
|-----------------------|-----------|
| Loss                  | 0.3697    |
| Accuracy              | 0.8585    |
| F1 (Macro)            | 0.6843    |
| F1 (Micro)            | 0.8585    |
| F1 (Weighted)         | 0.8303    |
| Precision (Macro)     | 0.8204    |
| Precision (Micro)     | 0.8585    |
| Precision (Weighted)  | 0.8821    |
| Recall (Macro)        | 0.7170    |
| Recall (Micro)        | 0.8585    |
| Recall (Weighted)     | 0.8585    |

### Metric Explanations

1. **Loss (0.3697)**: This relatively low value indicates that the model is learning well.

2. **Accuracy (0.8585)**: The model correctly classifies 85.85% of all instances across all classes.

3. **F1 Score**: 
   - Macro (0.6843): The unweighted mean of F1 scores for each class.
   - Micro (0.8585): Calculated globally by counting the total true positives, false negatives, and false positives.
   - Weighted (0.8303): The weighted average of F1 scores for each class, accounting for class imbalance.

4. **Precision**: 
   - Macro (0.8204): The unweighted mean of precision scores for each class.
   - Micro (0.8585): The global precision across all classes.
   - Weighted (0.8821): The weighted average of precision scores for each class.

5. **Recall**: 
   - Macro (0.7170): The unweighted mean of recall scores for each class.
   - Micro (0.8585): The global recall across all classes.
   - Weighted (0.8585): The weighted average of recall scores for each class.

### Analysis

1. **Class Imbalance**: The difference between macro and micro scores suggests class imbalance, which aligns with our dataset breakdown. The Gray_Leaf_Spot class, having fewer images, likely contributes to this imbalance.

2. **Precision vs Recall**: Precision scores are generally higher than recall scores, especially for macro metrics. This suggests the model is more cautious in its predictions, preferring to be correct when it does predict a class.

3. **Performance on Majority vs Minority Classes**: The higher micro and weighted scores compared to macro scores indicate that the model performs better on more frequent classes. This is likely due to the class imbalance, with the model potentially struggling more with the Gray_Leaf_Spot class.

4. **Overall Performance**: With an accuracy of 85.85%, the model shows good overall performance. However, there's room for improvement, especially in handling the class imbalance.
common_rust gray_leaf_spot healthy_leaf northern_leaf_blight