Views
No views yet
| Metric | Value |
|---|---|
| Accuracy | 87.00% |
| Precision | 80.33% |
| Recall | 98.00% |
| F1 Score | 88.29% |
1from model import DeepSVDDAnomalyDetector
2
3# Load model
4detector = DeepSVDDAnomalyDetector.from_pretrained('.')
5
6# Predict on image
7score, is_anomaly = detector.predict('test.jpg')
8print(f"Anomaly Score: {score:.6f}")
9print(f"Is Anomaly: {is_anomaly}")1from huggingface_hub import snapshot_download
2
3# Download model
4model_path = snapshot_download(repo_id="ash12321/deep-svdd-anomaly-detection")
5
6# Load
7detector = DeepSVDDAnomalyDetector.from_pretrained(model_path)1# Optimal F1 (default, recommended)
2detector.set_threshold('optimal') # threshold = 0.001618
3
4# 95th percentile (balanced)
5detector.set_threshold('95th') # threshold = 0.008501
6
7# 99th percentile (conservative, fewer false positives)
8detector.set_threshold('99th') # threshold = 0.015922| Threshold | Accuracy | Precision | Recall | Use Case |
|---|---|---|---|---|
| Optimal (0.0016) | 87% | 80% | 98% | Recommended - Best F1 |
| 95th (0.0085) | 75% | 95% | 53% | Few false alarms |
| 99th (0.0159) | 68% | 100% | 35% | Zero false alarms |
deepsvdd_model.pth - Model weights and hypersphere parametersthresholds.pkl - All threshold configurationsthresholds.json - Thresholds in JSON formatconfig.json - Model configurationmodel.py - Inference coderequirements.txt - Python dependencies1@misc{deep-svdd-anomaly-detection,
2 title={Deep SVDD Anomaly Detection Model},
3 author={ash12321},
4 year={2024},
5 publisher={Hugging Face},
6 url={https://huggingface.co/ash12321/deep-svdd-anomaly-detection}
7}