# Research Findings

**Run**: 01-code-improvements
**Date**: 2026-03-28

## Current State Analysis

### Training Pipeline
- Uses `yolo11m.yaml` (architecture-only config, trains from scratch)
- External augmentation via `albumentations` library in `src/augmentation.py`
- Two-step process: augment → form dataset → train
- Dataset formation copies files with `shutil.copy()`, duplicating ~8x storage

### Configuration
- Two config files: `config.yaml` (root) and `src/annotation-queue/config.yaml`
- Annotation queue handler parses YAML manually instead of using shared `Config` model
- Config drift risk between the two files

## YOLO 26 Model Update

Ultralytics YOLO26 is the latest model family. The medium variant `yolo26m.pt` replaces `yolo11m.yaml`:
- Uses pretrained weights (`.pt`) rather than architecture-only (`.yaml`)
- Faster convergence with transfer learning
- Improved accuracy on detection benchmarks

## Built-in Augmentation Parameters

YOLO's `model.train()` supports the following augmentation parameters that replace the external `albumentations` pipeline:

| Parameter | Default | Equivalent to current external aug |
|-----------|---------|-----------------------------------|
| `hsv_h` | 0.015 | HueSaturationValue(hue_shift_limit=10) |
| `hsv_s` | 0.7 | HueSaturationValue(sat_shift_limit=10) |
| `hsv_v` | 0.4 | RandomBrightnessContrast + HSV |
| `degrees` | 0.0 | Affine(rotate=(-35,35)) → set to 35.0 |
| `translate` | 0.1 | Default is sufficient |
| `scale` | 0.5 | Affine(scale=(0.8,1.2)) → default covers this |
| `shear` | 0.0 | Affine(shear=(-10,10)) → set to 10.0 |
| `fliplr` | 0.5 | HorizontalFlip(p=0.6) → set to 0.6 |
| `flipud` | 0.0 | Not used currently |
| `mosaic` | 1.0 | New — YOLO built-in |
| `mixup` | 0.0 | New — optional |

## Hard Symlinks

`os.link()` creates hard links sharing the same inode. Benefits:
- Zero additional disk usage for dataset splits
- Same read performance as regular files
- Works on same filesystem (which is the case here — all under `/azaion/`)
- Fallback to `shutil.copy()` for cross-filesystem edge cases
