Skip to main content

A tool to extract bird images from videos and train custom species classifiers

Project description

๐Ÿฆ Vogel Model Trainer

Languages: ๐Ÿ‡ฌ๐Ÿ‡ง English | ๐Ÿ‡ฉ๐Ÿ‡ช Deutsch | ๐Ÿ‡ฏ๐Ÿ‡ต ๆ—ฅๆœฌ่ชž

PyPI version Python Versions License: MIT PyPI Status Downloads

Train custom bird species classifiers from your own video footage using YOLOv8 and EfficientNet.

A specialized toolkit for creating high-accuracy bird species classifiers tailored to your specific monitoring setup. Extract training data from videos, organize datasets, and train custom models with >96% accuracy.


โœจ Features

  • ๐ŸŽฏ YOLO-based Bird Detection - Automated bird cropping from videos using YOLOv8
  • ๐Ÿค– Three Extraction Modes - Manual labeling, auto-sorting, or standard extraction
  • ๐Ÿ“ Wildcard Support - Batch process multiple videos with glob patterns
  • ๐Ÿ–ผ๏ธ Flexible Image Sizes - 224/384/448px or keep original size
  • ๐Ÿ” Advanced Filtering - Box size, blur detection, confidence thresholds
  • ๐Ÿ”„ Duplicate Detection - Perceptual hashing removes similar images
  • โœ… Quality Check - Find blurry, too-small, corrupted, or badly-exposed images
  • ๐Ÿง  EfficientNet-B0 Training - Lightweight yet powerful classification model
  • ๐ŸŽจ 4-Level Data Augmentation - None/light/medium/heavy intensity options
  • โšก Mixed Precision Training - FP16/BF16 support for faster GPU training
  • ๐Ÿ“Š Advanced Training Options - 13 configurable parameters for fine-tuning
  • ๐Ÿ”ง Dataset Deduplication - Clean existing datasets with perceptual hashing
  • โธ๏ธ Graceful Shutdown - Save model state on Ctrl+C interruption
  • ๐ŸŒ Full i18n Support - English, German, Japanese translations
  • ๐Ÿ“ˆ Per-Species Metrics - Detailed accuracy breakdown by species

๐Ÿค– Pre-trained Models

German Garden Birds Classifier - Ready to use!

We provide a pre-trained model on Hugging Face that can classify 8 common German garden bird species with 100% validation accuracy:

๐Ÿ”— kamera-linux/german-bird-classifier

Supported Species:

  • Blaumeise (Blue Tit)
  • Grรผnling (European Greenfinch)
  • Haussperling (House Sparrow)
  • KernbeiรŸer (Hawfinch)
  • Kleiber (Eurasian Nuthatch)
  • Kohlmeise (Great Tit)
  • Rotkehlchen (European Robin)
  • Sumpfmeise (Marsh Tit)

Usage with extraction:

vogel-trainer extract --folder ~/bird-data \
  --species-model kamera-linux/german-bird-classifier \
  --sample-rate 20 --skip-blurry --deduplicate \
  video.mp4

The model will automatically classify detected birds during extraction!


๐Ÿš€ Quick Start

Installation

Recommended: Using Virtual Environment

# Install venv if needed (Debian/Ubuntu)
sudo apt install python3-venv

# Create virtual environment
python3 -m venv ~/venv-vogel

# Activate it
source ~/venv-vogel/bin/activate  # On Windows: ~/venv-vogel\Scripts\activate

# Install package
pip install vogel-model-trainer

Quick Install

# Install from PyPI
pip install vogel-model-trainer

# Or install from source
git clone https://github.com/kamera-linux/vogel-model-trainer.git
cd vogel-model-trainer
pip install -e .

๐ŸŽฅ Video Tutorials

Learn vogel-model-trainer with step-by-step video guides:

  • Getting Started - Installation and first extraction (5 min)
  • Extracting Birds - Quality filters, deduplication, species classification (10 min)
  • Organizing Datasets - Train/val splits, class balance management (8 min) NEW in v0.1.8
  • Training Models - Custom classifier training and parameters (12 min)
  • Testing & Evaluation - Model testing and performance analysis (7 min)

๐Ÿ“บ Video tutorials coming soon!

Basic Workflow

# 1. Extract bird images from videos
vogel-trainer extract video.mp4 --folder ~/training-data/ --bird kohlmeise

# 2. Organize into train/validation split
vogel-trainer organize ~/training-data/ -o ~/organized-data/

# 3. Train custom classifier
vogel-trainer train ~/organized-data/ -o ~/models/my-classifier/

# 4. Test the trained model
vogel-trainer test ~/models/my-classifier/ -d ~/organized-data/

๐Ÿ“– Usage Guide

Using as a Library (New in v0.1.2)

All core functions can now be used programmatically in your Python code:

from vogel_model_trainer.core import extractor, organizer, trainer, tester

# Extract birds from video
extractor.extract_birds_from_video(
    video_path="video.mp4",
    output_dir="output/",
    bird_species="great-tit",
    detection_model="yolov8n.pt",
    species_model=None,
    threshold=0.5,
    sample_rate=3,
    resize_to_target=True
)

# Organize into train/val splits
organizer.organize_dataset(
    source_dir="output/",
    output_dir="dataset/",
    train_ratio=0.8
)

# Train model
trainer.train_model(
    data_dir="dataset/",
    output_dir="models/",
    model_name="google/efficientnet-b0",
    batch_size=16,
    num_epochs=50,
    learning_rate=3e-4
)

# Test model
results = tester.test_model(
    model_path="models/bird_classifier/",
    data_dir="dataset/"
)
print(f"Accuracy: {results['accuracy']:.2%}")

1. Extract Training Images

Manual Mode (Recommended for Initial Collection)

When you know the species in your video:

vogel-trainer extract ~/Videos/great-tit.mp4 \
  --folder ~/training-data/ \
  --bird great-tit \
  --threshold 0.5 \
  --sample-rate 3

Auto-Sort Mode (For Iterative Training)

Use an existing model to automatically classify and sort:

vogel-trainer extract ~/Videos/mixed.mp4 \
  --folder ~/training-data/ \
  --species-model ~/models/classifier/final/ \
  --threshold 0.5

Batch Processing with Wildcards

# Process all videos in a directory
vogel-trainer extract "~/Videos/*.mp4" --folder ~/data/ --bird blue-tit

# Recursive directory search
vogel-trainer extract ~/Videos/ \
  --folder ~/data/ \
  --bird amsel \
  --recursive

Parameters:

  • --folder: Base directory for extracted images (required)
  • --bird: Manual species label (creates subdirectory)
  • --species-model: Path to trained model for auto-classification
  • --species-threshold: Minimum confidence for species classification (e.g., 0.85 for 85%)
  • --threshold: YOLO confidence threshold (default: 0.5)
  • --sample-rate: Process every Nth frame (default: 3)
  • --detection-model: YOLO model path (default: yolov8n.pt)
  • --image-size: Target image size in pixels (default: 224, use 0 for original size)
  • --max-detections: Maximum detections per frame (default: 10)
  • --min-box-size: Minimum bounding box size in pixels (default: 50)
  • --max-box-size: Maximum bounding box size in pixels (default: 800)
  • --quality: JPEG quality 1-100 (default: 95)
  • --skip-blurry: Skip blurry/out-of-focus images (experimental)
  • --deduplicate: Skip duplicate/similar images using perceptual hashing
  • --similarity-threshold: Similarity threshold for duplicates - Hamming distance 0-64 (default: 5)
  • --min-sharpness: NEW v0.1.9 - Minimum sharpness score (Laplacian variance, typical: 100-300)
  • --min-edge-quality: NEW v0.1.9 - Minimum edge quality (Sobel gradient, typical: 50-150)
  • --save-quality-report: NEW v0.1.9 - Generate detailed quality statistics report
  • --remove-background: ๐Ÿงช EXPERIMENTAL v0.1.11 - Remove background using AI (rembg)
  • --bg-color [white|black|gray]: ๐Ÿงช EXPERIMENTAL v0.1.11 - Background color (default: white)
  • --bg-model [u2net|u2netp|isnet-general-use]: ๐Ÿงช EXPERIMENTAL v0.1.11 - AI model for background removal (default: u2net)
  • --recursive, -r: Search directories recursively
  • --log: Save console output to log file (/var/log/vogel-kamera-linux/YYYY/KWXX/)

Advanced Filtering Examples:

# High-quality extraction with all filters (v0.1.11)
vogel-trainer extract video.mp4 \
  --folder data/ \
  --bird rotkehlchen \
  --threshold 0.6 \
  --min-box-size 80 \
  --max-box-size 600 \
  --min-sharpness 150 \
  --min-edge-quality 80 \
  --skip-blurry \
  --deduplicate \
  --save-quality-report \
  --remove-background \
  --bg-color white \
  --bg-model u2net

# Background removal with black background for contrast
vogel-trainer extract video.mp4 \
  --folder data/ \
  --bird blaumeise \
  --remove-background \
  --bg-color black \
  --bg-model isnet-general-use

๐Ÿงช Background Removal (EXPERIMENTAL v0.1.11, Enhanced v0.1.12):

The --remove-background feature uses AI-powered rembg library to automatically segment birds from backgrounds.

NEW in v0.1.12: Transparent background is now the DEFAULT! Images are saved as PNG with alpha channel.

  • Models:

    • u2net (default): Best overall quality, ~180MB download
    • u2netp: Faster, smaller model for quick processing
    • isnet-general-use: Best edge quality for detailed feathers
  • Transparency (NEW DEFAULT v0.1.12):

    • --bg-transparent (DEFAULT): Creates PNG with alpha channel
    • --no-bg-transparent: Use colored background instead (white/black/gray)
    • --bg-fill-black (DEFAULT): Makes black box areas transparent too
    • --no-bg-fill-black: Keep black padding areas opaque
  • Background Colors (when using --no-bg-transparent):

    • white (default): Clean white background (#FFFFFF)
    • black: High contrast black background (#000000)
    • gray: Neutral gray background (#808080)
    • green-screen: Chroma key green (#00FF00)
    • blue-screen: Chroma key blue (#0000FF)
  • Features:

    • AI-based Uยฒ-Net segmentation for accurate bird isolation
    • Alpha matting for smooth, professional edges
    • Post-processing with morphological operations
    • Handles complex backgrounds (branches, leaves, buildings)
    • Works with varied bird plumage and fine feather details
    • Automatically saves as PNG (transparent) or JPEG (opaque)
  • Note: First use downloads ~180MB model (cached afterward), requires rembg>=2.0.50 dependency --remove-background
    --quality 98

Extract with duplicate detection (prevents similar images)

vogel-trainer extract ~/Videos/*.mp4
--folder data/
--bird kohlmeise
--deduplicate
--similarity-threshold 3 # Stricter duplicate detection

Large image size for high-detail training

vogel-trainer extract video.mp4
--folder data/
--bird amsel
--image-size 384 # Larger images for better quality

Auto-sort with confidence filter (only high-confidence classifications)

vogel-trainer extract video.mp4
--folder data/
--species-model ~/models/classifier/
--species-threshold 0.90
--deduplicate


**Logging Example:**

```bash
# Save output to log file
vogel-trainer extract ~/Videos/great-tit.mp4 \
  --folder ~/data/ \
  --bird great-tit \
  --log

# Log file path: /var/log/vogel-kamera-linux/2025/KW45/20251109_160000_extract.log

1b. Clean Transparent Images (NEW v0.1.12) ๐Ÿงน

After extracting with --remove-background, use clean-transparent to remove fragmented or incomplete birds:

# Safe mode: Report only (no files modified)
vogel-trainer clean-transparent ~/training-data/ --mode report

# Move invalid images to invalid_transparent/ folder
vogel-trainer clean-transparent ~/training-data/ --mode move

# Permanently delete invalid images
vogel-trainer clean-transparent ~/training-data/ --mode delete

# Recursive scan through all subdirectories
vogel-trainer clean-transparent ~/training-data/ --mode move --recursive

# Custom thresholds
vogel-trainer clean-transparent ~/training-data/ \
  --min-pixels 1000 \
  --max-transparency 0.90 \
  --min-region 200 \
  --mode move

Detection Criteria:

  • Min Visible Pixels (--min-pixels, default: 500): Minimum non-transparent pixels
  • Max Transparency (--max-transparency, default: 0.95): Maximum 95% transparency allowed
  • Min Region Size (--min-region, default: 100): Minimum size of largest connected object

Use Cases:

  • Remove tiny fragments after background removal
  • Clean up partial detections (bird flew out of frame)
  • Eliminate images with >95% transparency
  • Find disconnected/scattered pixel groups

2. Organize Dataset

# Basic organization (80/20 split)
vogel-trainer organize ~/training-data/ -o ~/organized-data/

# With class balance control (NEW in v0.1.8)
vogel-trainer organize ~/training-data/ -o ~/organized-data/ \
  --max-images-per-class 100 \
  --tolerance 15.0

Class Balance Features:

  • --max-images-per-class N: Limit to N images per class, delete excess
  • --tolerance N: Maximum allowed imbalance % (default: 15)
    • < 10%: โœ… Perfect
    • 10-15%: โš ๏ธ Warning
    • 15%: โŒ Error with recommendations

Creates an 80/20 train/validation split:

organized/
โ”œโ”€โ”€ train/
โ”‚   โ”œโ”€โ”€ great-tit/
โ”‚   โ”œโ”€โ”€ blue-tit/
โ”‚   โ””โ”€โ”€ robin/
โ””โ”€โ”€ val/
    โ”œโ”€โ”€ great-tit/
    โ”œโ”€โ”€ blue-tit/
    โ””โ”€โ”€ robin/

3. Train Classifier

vogel-trainer train ~/organized-data/ -o ~/models/my-classifier/

Training Parameters:

  • --batch-size: Training batch size (default: 16)
  • --epochs: Number of training epochs (default: 50)
  • --learning-rate: Learning rate (default: 2e-4)
  • --early-stopping-patience: Early stopping patience in epochs (default: 5, 0 to disable)
  • --weight-decay: Weight decay for regularization (default: 0.01)
  • --warmup-ratio: Learning rate warmup ratio (default: 0.1)
  • --label-smoothing: Label smoothing factor (default: 0.1, 0 to disable)
  • --save-total-limit: Maximum checkpoints to keep (default: 3)
  • --augmentation-strength: Data augmentation intensity: none, light, medium (default), heavy
  • --image-size: Input image size in pixels (default: 224, supports 224/384/448)
  • --scheduler: Learning rate scheduler: cosine (default), linear, constant
  • --seed: Random seed for reproducibility (default: 42)
  • --resume-from-checkpoint: Path to checkpoint to resume training
  • --gradient-accumulation-steps: Gradient accumulation steps (default: 1)
  • --mixed-precision: Mixed precision training: no (default), fp16, bf16
  • --push-to-hub: Push model to HuggingFace Hub (default: False)
  • --log: Save console output to log file

Augmentation Strength Levels:

  • none: No augmentation (only normalization)
  • light: Small rotations (ยฑ10ยฐ), minimal color jitter
  • medium (default): Moderate rotations (ยฑ20ยฐ), affine transforms, color jitter, gaussian blur
  • heavy: Strong rotations (ยฑ30ยฐ), aggressive transforms, strong color variations

Advanced Training Examples:

# High-accuracy training with large images and heavy augmentation
vogel-trainer train ~/organized-data/ \
  -o ~/models/high-accuracy/ \
  --image-size 384 \
  --augmentation-strength heavy \
  --epochs 100 \
  --early-stopping-patience 10 \
  --batch-size 8

# Fast training with mixed precision (requires GPU)
vogel-trainer train ~/organized-data/ \
  -o ~/models/fast/ \
  --mixed-precision fp16 \
  --batch-size 32 \
  --gradient-accumulation-steps 2

# Reproducible training with fixed seed
vogel-trainer train ~/organized-data/ \
  -o ~/models/reproducible/ \
  --seed 12345 \
  --augmentation-strength light

# Resume interrupted training
vogel-trainer train ~/organized-data/ \
  -o ~/models/continued/ \
  --resume-from-checkpoint ~/models/my-classifier/checkpoints/checkpoint-1000

# Training with logging
vogel-trainer train ~/organized-data/ \
  -o ~/models/logged/ \
  --log

Training Configuration:

  • Base Model: google/efficientnet-b0 (8.5M parameters)
  • Optimizer: AdamW with configurable LR schedule
  • Augmentation: 4 intensity levels (none/light/medium/heavy)
  • Regularization: Weight decay, label smoothing, early stopping
  • Mixed Precision: FP16/BF16 support for faster training on GPU

Output:

~/models/my-classifier/
โ”œโ”€โ”€ checkpoints/     # Intermediate checkpoints
โ”œโ”€โ”€ logs/           # TensorBoard logs
โ””โ”€โ”€ final/          # Final trained model
    โ”œโ”€โ”€ config.json
    โ”œโ”€โ”€ model.safetensors
    โ””โ”€โ”€ preprocessor_config.json

4. Deduplicate Dataset

Remove duplicate or very similar images from your dataset to improve training quality:

# Report duplicates without deleting
vogel-trainer deduplicate ~/training-data/ --recursive

# Delete duplicates (keep first occurrence)
vogel-trainer deduplicate ~/training-data/ \
  --mode delete \
  --recursive

# Move duplicates to separate folder
vogel-trainer deduplicate ~/training-data/ \
  --mode move \
  --recursive

# Stricter duplicate detection
vogel-trainer deduplicate ~/training-data/ \
  --threshold 3 \
  --recursive

# Keep largest file instead of first
vogel-trainer deduplicate ~/training-data/ \
  --mode delete \
  --keep largest \
  --recursive

Deduplication Parameters:

  • --threshold: Similarity threshold - Hamming distance 0-64, lower=stricter (default: 5)
  • --method: Hash method: phash (default, recommended), dhash, whash, average_hash
  • --mode: Action: report (show only, default), delete (remove), move (to duplicates/)
  • --keep: Which duplicate to keep: first (chronological, default) or largest (file size)
  • --recursive, -r: Search recursively through subdirectories

How it works:

  • Uses perceptual hashing (pHash) to detect visually similar images
  • Robust against resizing, cropping, and minor color changes
  • Threshold of 5 = very similar, 10 = similar, >15 = different
  • Safe default: report mode prevents accidental deletion

5. Quality Check Dataset (New!)

Check your dataset for low-quality images (blurry, too small, corrupted, brightness issues):

# Report quality issues without deleting
vogel-trainer quality-check ~/training-data/ --recursive

# Delete low-quality images
vogel-trainer quality-check ~/training-data/ \
  --mode delete \
  --recursive

# Move low-quality images to separate folder
vogel-trainer quality-check ~/training-data/ \
  --mode move \
  --recursive

# Stricter blur detection
vogel-trainer quality-check ~/training-data/ \
  --blur-threshold 150.0 \
  --recursive

# Check for brightness/contrast issues
vogel-trainer quality-check ~/training-data/ \
  --check-brightness \
  --recursive

# Comprehensive quality check with custom thresholds
vogel-trainer quality-check ~/training-data/ \
  --blur-threshold 120.0 \
  --min-resolution 100 \
  --min-filesize 2048 \
  --check-brightness \
  --mode move \
  --recursive

Quality Check Parameters:

  • --blur-threshold: Minimum blur score (Laplacian variance), lower=more blurry (default: 100.0)
  • --min-resolution: Minimum image width/height in pixels (default: 50)
  • --min-filesize: Minimum file size in bytes (default: 1024)
  • --check-brightness: Also check for brightness/contrast issues (too dark or overexposed)
  • --mode: Action: report (show only, default), delete (remove), move (to low_quality/)
  • --recursive, -r: Search recursively through subdirectories

โš ๏ธ WARNING - Delete Mode:

  • The --mode delete option permanently removes files without backup
  • Always run --mode report first to preview what will be deleted
  • Backup your dataset before using delete mode
  • Consider using --mode move instead (keeps files in low_quality/ folder)

What is checked:

  • โœ… Sharpness: Detects blurry/out-of-focus images using Laplacian variance
  • โœ… Resolution: Filters out too-small images that hurt training
  • โœ… File size: Detects corrupted or empty files
  • โœ… Readability: Checks if images can be opened and processed
  • โœ… Brightness (optional): Detects too-dark or overexposed images

Typical thresholds:

  • Blur: 100.0 (default) = moderate, 150.0 = stricter, 50.0 = more lenient
  • Resolution: 50px (default) = very permissive, 100px = recommended, 224px = strict
  • Filesize: 1024 bytes (default) = catches corrupted files

Recommended workflow:

# 1. Preview issues first (safe)
vogel-trainer quality-check ~/data/ --mode report --recursive

# 2. Move problematic images (reversible)
vogel-trainer quality-check ~/data/ --mode move --recursive

# 3. Review moved files in low_quality/ folder
# 4. Delete manually if satisfied: rm -rf ~/data/low_quality/

6. Test Model

# Test on validation dataset
vogel-trainer test ~/models/my-classifier/ -d ~/organized-data/

# Output:
# ๐Ÿงช Testing model on validation set...
#    ๐Ÿฆ Predicted: great-tit (98.5% confidence)

๐Ÿ”„ Iterative Training Workflow

Improve your model accuracy through iterative refinement using auto-classification:

flowchart TD
    Start([๐Ÿ“‹ Phase 1: Initial Model<br/>Manual Labeling]) --> Extract1[1๏ธโƒฃ Extract with manual labels<br/><code>vogel-trainer extract video.mp4<br/>--folder data/ --bird kohlmeise</code>]
    
    Extract1 --> Organize1[2๏ธโƒฃ Organize dataset 80/20 split<br/><code>vogel-trainer organize data/<br/>-o organized/</code>]
    
    Organize1 --> Train1[3๏ธโƒฃ Train initial model<br/><code>vogel-trainer train organized/<br/>-o models/v1/</code><br/>โœ… <b>Result: 92% accuracy</b>]
    
    Train1 --> Phase2([๐Ÿ”„ Phase 2: Model Improvement<br/>Auto-Classification])
    
    Phase2 --> Extract2[4๏ธโƒฃ Auto-extract with trained model<br/><code>vogel-trainer extract new-videos/<br/>--folder data-v2/<br/>--species-model models/v1/final/<br/>--species-threshold 0.85</code><br/>๐ŸŽฏ <b>Automatically sorted by species!</b>]
    
    Extract2 --> Review[5๏ธโƒฃ Manual review & corrections<br/>โ€ข Check auto-classifications<br/>โ€ข Move misclassified images<br/>โ€ข Merge with previous dataset]
    
    Review --> Train2[6๏ธโƒฃ Retrain with expanded dataset<br/><code>vogel-trainer organize data-v2/<br/>-o organized-v2/<br/>vogel-trainer train organized-v2/<br/>-o models/v2/</code><br/>๐ŸŽ‰ <b>Result: 96% accuracy!</b>]
    
    Train2 --> Repeat{โ™ป๏ธ Continue<br/>improving?}
    Repeat -->|Yes| Extract2
    Repeat -->|No| End([โœ… Final Model])
    
    style Start fill:#e1f5ff,stroke:#0066cc,stroke-width:3px
    style Phase2 fill:#e1f5ff,stroke:#0066cc,stroke-width:3px
    style Train1 fill:#d4edda,stroke:#28a745,stroke-width:2px
    style Train2 fill:#d4edda,stroke:#28a745,stroke-width:2px
    style End fill:#d4edda,stroke:#28a745,stroke-width:3px
    style Extract2 fill:#fff3cd,stroke:#ffc107,stroke-width:2px
    style Review fill:#f8d7da,stroke:#dc3545,stroke-width:2px

Key Benefits:

  • ๐Ÿš€ Faster labeling: Auto-classification saves manual work
  • ๐Ÿ“ˆ Better accuracy: More training data = better model
  • ๐ŸŽฏ Quality control: --species-threshold filters uncertain predictions
  • ๐Ÿ”„ Continuous improvement: Each iteration improves the model

Example Commands:

# Phase 1: Manual training (initial dataset)
vogel-trainer extract ~/Videos/batch1/*.mp4 --folder ~/data/ --bird great-tit
vogel-trainer organize ~/data/ -o ~/data/organized/
vogel-trainer train ~/data/organized/ -o ~/models/v1/

# Phase 2: Auto-classification with trained model
vogel-trainer extract ~/Videos/batch2/*.mp4 \
  --folder ~/data-v2/ \
  --species-model ~/models/v1/final/ \
  --species-threshold 0.85

# Review classifications in ~/data-v2/<species>/ folders
# Move any misclassified images to correct species folders

# Merge datasets and retrain
cp -r ~/data-v2/* ~/data/
vogel-trainer organize ~/data/ -o ~/data/organized-v2/
vogel-trainer train ~/data/organized-v2/ -o ~/models/v2/

Performance & Best Practices

Dataset Size Recommendations

Quality Images per Species Expected Accuracy
Minimum 20-30 ~85-90%
Good 50-100 ~92-96%
Optimal 100+ >96%

Tips for Better Results

  1. Dataset Diversity

    • Include various lighting conditions
    • Capture different poses (side, front, back)
    • Cover different seasons (plumage changes)
  2. Class Balance

    • Aim for similar image counts per species
    • Avoid having one dominant class
  3. Quality Over Quantity

    • Use threshold 0.5-0.6 for clear detections
    • Manual review of auto-sorted images improves quality
  4. Monitor Training

    • Check per-class accuracy for weak species
    • Use confusion matrix to identify similar species
    • Add more data for low-performing classes

๐Ÿ”— Integration with vogel-video-analyzer

Use your trained model for species identification:

vogel-analyze --identify-species \
  --species-model ~/models/final/ \
  --species-threshold 0.3 \
  video.mp4

๐Ÿ› ๏ธ Development

# Clone repository
git clone https://github.com/kamera-linux/vogel-model-trainer.git
cd vogel-model-trainer

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest tests/

๐Ÿ“ License

MIT License - see LICENSE for details.


๐Ÿ™ Credits


๐Ÿ“ฎ Support & Contributing


Made with โค๏ธ for bird watching enthusiasts ๐Ÿฆ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vogel_model_trainer-0.1.12.tar.gz (117.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vogel_model_trainer-0.1.12-py3-none-any.whl (58.4 kB view details)

Uploaded Python 3

File details

Details for the file vogel_model_trainer-0.1.12.tar.gz.

File metadata

  • Download URL: vogel_model_trainer-0.1.12.tar.gz
  • Upload date:
  • Size: 117.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for vogel_model_trainer-0.1.12.tar.gz
Algorithm Hash digest
SHA256 4294049f70aa2e6bc4dfa706154f35f531ceeaecea4c94ce9abd7f561021c2a3
MD5 a99cea705b74d13f7feaaf2333430f97
BLAKE2b-256 1f8c9a6c482980fd24bd07de7bf33eb4ba524036d9fc6030270a4b348b775b27

See more details on using hashes here.

File details

Details for the file vogel_model_trainer-0.1.12-py3-none-any.whl.

File metadata

File hashes

Hashes for vogel_model_trainer-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 ab5940802a6ebd3f94e0664c8de31bb51c73adf807e4e40c17341fd52f94a0b4
MD5 0365d19a214ecce6f49e73e47c992892
BLAKE2b-256 dbcec222621d56572c0a562f238054b39c2179114c5c242aef50bde2d2cef741

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page