image-multi-detect / README.md
abhi099k's picture
Update README.md
bc2e3ac verified
---
license: mit
metrics:
- accuracy
---
# πŸ–ΌοΈ Image Multi-Label Safety Classifier
**Repo:** `abhi099k/image-multi-detect`
**Framework:** PyTorch + ONNX
**Task:** Multi-label image content classification
**Author:** Abhinav
---
## πŸš€ Overview
This model is a **professional multi-label image classifier** trained to detect multiple safety-related categories simultaneously.
It is optimized for:
- NSFW / adult content detection
- Violence
- Weapons
- Substance categories (smoking, alcohol, drugs)
- Sensitive content
- Hate content
The model supports **8 independent labels**, using **sigmoid (multi-label)** rather than softmax.
---
## 🧠 Labels
| Index | Label | Meaning |
|-------|------------|---------|
| 0 | `nsfw` | Nude/sexual content |
| 1 | `violence` | Physical harm, fighting, blood |
| 2 | `weapon` | Guns, knives, explosives |
| 3 | `smoking` | Cigarettes, vaping, smoking activity |
| 4 | `alcohol` | Alcoholic drinks or consumption |
| 5 | `drugs` | Illegal drugs, pills, paraphernalia |
| 6 | `sensitive` | Sensitive contexts (medical, blood, etc.) |
| 7 | `hate` | Hateful symbols, extremist logos |
---
## πŸ“¦ Files in Repository
| File | Description |
|------|-------------|
| `best.pth` | PyTorch model weights |
| `model.onnx` | ONNX-exported model (recommended for inference) |
| `metrics_test.json` | Evaluation results |
| `history.json` | Training logs |
---
## πŸ”§ Technical Details
### Architecture
- **Backbone:** ResNet-50
- **Head:** Fully connected layer β†’ 8 logits
- **Loss:** `BCEWithLogitsLoss`
- **Optimizer:** AdamW
- **Mixed precision:** Yes
- **Balanced sampling:** WeightedRandomSampler
### Image Size
`224 Γ— 224`
### Training Transformations
- Resize
- Random crop
- Horizontal flip
- Color jitter
- Normalization
---
## πŸ“ˆ Performance
Macro-averaged metrics on test set: