File size: 1,999 Bytes
ad803c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
edf6a86
 
 
ad803c0
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Release v1.0.0

**Date:** September 19, 2026

## What's New

Initial release of Dog Emotion Detector — a mobile-first classifier for detecting dog emotions from images.

### Features

- **5-class emotion classification:** alert, angry, frown, happy, relax
- **Transfer learning:** EfficientNetV2B0 backbone with ImageNet weights
- **TFLite export:** 24 MB model with ~22ms CPU inference
- **Full pipeline:** data loading → augmentation → training → evaluation → export
- **Configurable:** YAML-based configuration for model, training, and export

### Performance

| Metric | Value |
|--------|-------|
| Accuracy | 69.9% |
| Macro F1 | 69.2% |
| Model size | 24 MB |
| Inference latency | ~22ms (CPU) |

### Per-class Results

| Class | F1 Score |
|-------|----------|
| happy | 0.89 |
| relax | 0.79 |
| frown | 0.61 |
| angry | 0.53 |
| alert | 0.58 |

## Installation

```bash
pip install -e .
```

## Usage

```bash
python main.py train --config configs/config.yaml
```

## Model Architecture

- Backbone: EfficientNetV2B0 (ImageNet pretrained)
- Head: GlobalAveragePooling2D → Dense(256, relu) → Dropout(0.5) → Dense(5, softmax)
- Optimizer: Adam (lr=0.0003)
- Loss: Categorical crossentropy with label smoothing (0.1)
- Regularization: Early stopping (patience=20), reduce-LR-on-plateau (patience=8, factor=0.5)

## Dataset

- Total images: 9,325
- Classes: 5 (alert, angry, frown, happy, relax)
- Images per class: ~1,865
- Split: 80% train / 10% validation / 10% test

## Known Limitations

- Angry/alert/frown classes have lower F1 due to subjective visual similarity
- Performance is limited by dataset size (~1.8K images per class)
- Further improvement requires more data or advanced augmentation (CutMix/Mixup)

## Future Improvements

- CutMix/Mixup augmentation for better generalization
- Test-time augmentation for inference boost
- Ensemble methods for production deployment
- Larger training dataset (50K+ images)

## License

MIT

---
license: apache-2.0
---