|
Download README.md from Smolry/HSRP-classification: direct link, hf CLI and curl.
- Browser
- Download file 5.08 kB
-
https://huggingface.co/Smolry/HSRP-classification/resolve/main/README.md
- Command line
-
hf download hf://Smolry/HSRP-classification/README.md
-
curl -L -o README.md https://huggingface.co/Smolry/HSRP-classification/resolve/main/README.md
5.08 kB
| license: apache-2.0 | |
| datasets: | |
| - Smolry/HSRP_classification_data | |
| language: | |
| - en | |
| metrics: | |
| - name: F1 | |
| type: f1 | |
| value: 0.86 | |
| - name: Precision | |
| type: precision | |
| value: 0.87 | |
| - name: Recall | |
| type: recall | |
| value: 0.85 | |
| - name: Accuracy | |
| type: accuracy | |
| value: 0.87 | |
| base_model: | |
| - google/efficientnet-b0 | |
| pipeline_tag: image-classification | |
| tags: | |
| - computer-vision | |
| - license-plate | |
| - hsrp | |
| - traffic | |
| library_name: pytorch | |
| # HSRP Classification using EfficientNet-B0 | |
| ## Model Overview | |
| This model performs binary classification of vehicle license plate images. | |
| Given a cropped license plate image, the model predicts whether the plate belongs to: | |
| - HSRP | |
| - Non-HSRP | |
| The model forms the classification component of the Smart HSRP Detection and Violation Monitoring System. | |
| --- | |
| ## Problem Statement | |
| Determine whether a detected vehicle license plate is an HSRP plate. | |
| Input: | |
| License Plate Crop | |
| Output: | |
| HSRP Probability | |
| Decision: | |
| HSRP / Non-HSRP | |
| --- | |
| ## Pipeline Role | |
| ```text | |
| Camera Frame | |
| β | |
| Vehicle Detection | |
| β | |
| License Plate Detection | |
| β | |
| Plate Crop | |
| β | |
| ββββββββββββββββββββββββ | |
| β EfficientNet-B0 β | |
| β HSRP Classifier β | |
| ββββββββββββ¬ββββββββββββ | |
| β | |
| HSRP Probability | |
| β | |
| Downstream Logic | |
| ``` | |
| --- | |
| ## Scope | |
| This model performs: | |
| β HSRP Classification | |
| This model does NOT perform: | |
| β Vehicle Detection | |
| β License Plate Detection | |
| β OCR | |
| β License Plate Recognition | |
| β Vehicle Tracking | |
| β Violation Decision Making | |
| --- | |
| ## Model Architecture | |
| ```text | |
| Backbone: | |
| EfficientNet-B0 | |
| Initialization: | |
| ImageNet Pretrained Weights | |
| Classifier Head: | |
| Dropout(0.2) | |
| β | |
| Linear(1280 β 1) | |
| Output: | |
| Binary Classification Logit | |
| Activation: | |
| Sigmoid | |
| Input Size: | |
| 224 Γ 224 RGB | |
| ``` | |
| --- | |
| ## Dataset | |
| Dataset Repository: | |
| [](https://huggingface.co/datasets/Smolry/HSRP_classification_data) | |
| Classes: | |
| 0 β HSRP | |
| 1 β Non-HSRP | |
| --- | |
| ## Training Procedure | |
| ### Preprocessing | |
| Training: | |
| - Resize (224 Γ 224) | |
| - ColorJitter | |
| - RandomRotation (Β±5Β°) | |
| - ImageNet Normalization | |
| Validation / Test: | |
| - Resize (224 Γ 224) | |
| - ImageNet Normalization | |
| --- | |
| ### Phase 1 β Classifier Training | |
| ```text | |
| EfficientNet-B0 | |
| β | |
| Frozen Backbone | |
| β | |
| Train Classifier Only | |
| Optimizer: | |
| Adam | |
| Learning Rate: | |
| 1e-4 | |
| Epochs: | |
| 5 | |
| Scheduler: | |
| ReduceLROnPlateau | |
| ``` | |
| --- | |
| ### Phase 2 β Fine Tuning | |
| ```text | |
| Load Best Phase-1 Checkpoint | |
| β | |
| Unfreeze Final Feature Blocks | |
| β | |
| Fine Tune Model | |
| Optimizer: | |
| Adam | |
| Learning Rate: | |
| 1e-5 | |
| Epochs: | |
| 20 | |
| Scheduler: | |
| ReduceLROnPlateau | |
| ``` | |
| --- | |
| ## Evaluation | |
| ### Test Metrics | |
| | Metric | Score | | |
| |----------|----------| | |
| | Accuracy | 87.47% | | |
| | Precision | 87.92% | | |
| | Recall | 85.85% | | |
| | F1 Score | 86.87% | | |
| Test Samples: | |
| 439 | |
| --- | |
| ## Confusion Matrix | |
|  | |
| --- | |
| ## Training History | |
| The model was trained in two stages: | |
| 1. Classifier training with the EfficientNet-B0 backbone frozen. | |
| 2. Fine-tuning of the final feature blocks. | |
| | Phase 1 Loss | Phase 2 Loss | | |
| | :---: | :---: | | |
| |  |  | | |
| The epoch-level training history is available in | |
| [](https://huggingface.co/Smolry/HSRP-classification/blob/main/training/training_history.json) | |
| --- | |
| ## Observations | |
| Key observations discovered during evaluation: | |
| - Model performs strong binary separation between classes. | |
| - Errors primarily occur in visually ambiguous samples. | |
| - Performance depends heavily on crop quality. | |
| - Explainability analysis should be used to validate focus on plate regions. | |
| --- | |
| ## Limitations | |
| - Binary classification only. | |
| - Not evaluated on every Indian state. | |
| - Performance may degrade on heavily blurred images. | |
| - Sensitive to plate crop quality. | |
| - Domain shift may affect performance. | |
| --- | |
| ## Future Improvements | |
| Potential future work: | |
| - Larger dataset | |
| - Additional state coverage | |
| - CCTV-specific training data | |
| - Hard-negative mining | |
| - Better augmentation | |
| - Threshold optimization | |
| - Calibration analysis | |
| - Lightweight deployment models | |
| --- | |
| ## Files | |
| ```text | |
| model/ | |
| βββ efficientnet_b0_finetuned.pth | |
| evaluation/ | |
| βββ metrics.json | |
| βββ classification_report.txt | |
| βββ confusion_matrix.png | |
| training/ | |
| βββ training_history.json | |
| βββ phase1_loss.png | |
| βββ phase2_loss.png | |
| ``` | |
| --- | |
| ## Project Context | |
| This model is one component of the larger Smart HSRP Detection and Violation Monitoring System. | |
| Its sole responsibility is determining whether a cropped license plate image belongs to an HSRP or Non-HSRP category. | |
| --- | |
| ## Version History | |
| ### v1.0 | |
| - Initial EfficientNet-B0 implementation | |
| - Two-stage training pipeline | |
| - Binary HSRP classification | |
| --- | |