Downloads · 30 days
32
58% of all-time downloads
thenukegun10x/TinyFox-2.0
TinyFox-2.0 is a object detection model from thenukegun10x. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as agpl-3.0.
TinyFox-2 is an ultra-fast, edge-optimized 12-class object detection model specialized for nocturnal infrared (IR) camera-traps and perimeter pest/predator monitoring.
Downloads · 30 days
32
58% of all-time downloads
All-time downloads
55
Public
Repo size
40.3 MB
Likes
0
Public
Click a slice to open those files.
.onnx17.6 MB · 43%
From the Hugging Face model README
TinyFox-2 is an ultra-fast, edge-optimized 12-class object detection model specialized for nocturnal infrared (IR) camera-traps and perimeter pest/predator monitoring.
Built on the lightweight YOLO26n architecture (2.38M parameters, 5.2 GFLOPs), TinyFox-2 was specifically engineered to solve the historical failure modes of night wildlife detectors: false fires on empty backgrounds, fox-vs-canid confusion, and loss of small quadruped recall.
TinyFox-2.pt)TinyFox-2_fp16.onnx)TinyFox-2 is a complete architectural and algorithmic overhaul compared to the original TinyFox 1.0. Where TinyFox 1.0 was a proof-of-concept single-class detector prone to background false alarms and species confusion, TinyFox-2 is a robust, production-grade 12-class nocturnal wildlife vision model.
| Metric / Dimension | TinyFox 1.0 (Legacy) | TinyFox-2 (Current Release) | Real-World Impact |
|---|---|---|---|
| Architecture | Custom NanoDet-Plus Head | YOLO26n (Anchor-Free, Multi-Scale) | Modern backbone with superior feature extraction and gradient stability |
| Taxonomy & Classes | 1 class (red_fox on HF) / 3-class early prototype (fox/cat/dog) | 12 distinct biological classes | Full contextual awareness; distinguishes foxes from cats, dogs, mustelids, and marsupials |
| Fox Recall on IR Video | ~38.0% of frames | 88.2% of frames | >2.3× improvement in detection continuity across video sequences |
| Rival Canid Confusion | Severe (stolen by raccoons/dogs) | 0.0% rival fires (@ conf 0.40) | Splitting dingo, raccoondog, and domestic_dog completely eliminates misclassifications |
| False Alarm Rate | 5.8% on clean night frames | 0.0% (0 / 225 verified negatives) | True zero false-alarm operation on empty infrared scenes |
| Median Detection Confidence | 0.71 | 0.89 | Higher confidence separation between true targets and background clutter |
| Dataset & Annotation Quality | 2,281 images (pseudo-labeled noise, leaking split) | 14,627 images (human-verified VOC/COCO, 0-leak stratified split) | Clean ground truth eliminates conflicting loss gradients |
| Edge Footprint (INT8) | ~2.5 MB (experimental) | 2.60 MB calibrated via YOLO-Quantizer | 72.5% compression with <0.7 px box shift and 100% class match |
fox, cat, dog), cat was actually wild Asian Leopard Cat and dog was Raccoon Dog, lacking domestic species and confusing distinct canids. TinyFox-2 establishes 12 honest, biology-grounded categories.canid/dog bucket created a decision boundary too loose to separate from foxes. TinyFox-2 explicitly splits dingo, raccoondog, and domestic_dog, which drove rival canid misclassifications on deployment video from 36.5% down to 0.0%.Releasing an edge AI model trained from heterogeneous wildlife datasets and modern vision frameworks involves multiple legal and intellectual property factors. TinyFox-2 is released under the GNU Affero General Public License v3.0 (AGPL-3.0) with full upstream attribution.
┌────────────────────────────────────────┐
│ TinyFox-2 Release License │
│ AGPL-3.0 │
└───────────────────┬────────────────────┘
│
┌───────────────────────────────┴───────────────────────────────┐
▼ ▼
┌───────────────────────────────┐ ┌───────────────────────────────┐
│ Model Architecture & │ │ Upstream Datasets & │
│ Base Weights │ │ Academic Sources │
├───────────────────────────────┤ ├───────────────────────────────┤
│ • Framework: Ultralytics YOLO │ │ • NTLNP (Beijing Normal Univ) │
│ • Pretrained: yolo26n.pt │ │ Academic / Research Open │
│ • License: AGPL-3.0 │ │ • UNSW Predators / Dryland │
│ • Commercial: Requires │ │ Academic Non-Commercial │
│ Enterprise License from │ │ • ENA24 / LILA BC │
│ Ultralytics Inc. │ │ CDLA-Permissive-1.0 / CC-BY │
│ │ │ • Deploy IR Negatives │
│ │ │ User Contributed │
└───────────────────────────────┘ └───────────────────────────────┘
TinyFox-2 is built with the Ultralytics YOLO framework and fine-tuned from yolo26n.pt.
TinyFox-2 was trained on a leak-free, stratified corpus of 14,627 nocturnal IR images compiled from:
[!NOTE] Due to the inclusion of academic camera-trap research sets (NTLNP, UNSW), users deploying TinyFox-2 in commercial operations should ensure compliance with upstream academic and non-commercial research terms or retrain exclusively on permissively licensed/owned data (e.g. ENA24 and private footage).
Limitation of Liability & No Warranty (AGPL-3.0 §§ 15–16): TinyFox-2 is provided "AS IS", without warranty of any kind. While TinyFox-2 demonstrates high empirical detection rates (0.983 [email protected] on fox), no autonomous computer vision system is 100% infallible. Do not rely solely on this software for life-critical, commercial livestock protection, or security-critical perimeter defence.
TinyFox-2 recognizes 12 distinct animal classes.
The breakthrough from v3/v4 to v5/TinyFox-2 was splitting the generic canid class into separate biological categories (dingo, raccoondog, domestic_dog). Lumping distinct canids caused the detector to learn overly loose decision boundaries that overlapped with foxes. Separating them completely eliminated fox-vs-canid misclassifications.
| Class ID | Class Name | Training Instances | Val Instances | Val [email protected] | Val [email protected]–0.95 |
|---|---|---|---|---|---|
| 0 | fox (target) | 1,254 | 159 | 0.983 | 0.795 |
| 1 | bear | 369 | 72 | 0.978 | 0.817 |
| 2 | bigcat | 871 | 121 | 0.995 | 0.892 |
| 3 | cat | 787 | 145 | 0.972 | 0.804 |
| 4 | dingo | 836 | 115 | 0.956 | 0.857 |
| 5 | domestic_dog | 96 | 29 | 0.693 | 0.565 |
| 6 | lagomorph | 1,061 | 300 | 0.983 | 0.850 |
| 7 | mustelid | 1,295 | 241 | 0.960 | 0.747 |
| 8 | possum | 1,842 | 310 | 0.983 | 0.915 |
| 9 | quoll | 590 | 96 | 0.949 | 0.844 |
| 10 | raccoondog | 1,085 | 159 | 0.971 | 0.806 |
| 11 | ungulate | 2,749 | 423 | 0.976 | 0.852 |
| All | Macro Average | 12,835 | 2,194 | 0.950 | 0.812 |
(Note: domestic_dog has a low validation sample count in this split. The non-dog classes average 0.973 [email protected]).
Evaluated on 1,443 continuous nocturnal IR frames from camera-trap footage under realistic working distance and low-light noise:
| Metric | TinyFox 1.0 (NanoDet) | v3 (dog lumped) | v4 (canid lumped) | TinyFox-2 (v5 Split) |
|---|---|---|---|---|
| Fox Top Prediction Rate (@0.40) | ~38.0% | 45.7% | 79.9% | 88.2% |
| Rival Top Prediction Rate | N/A (1-class) | 36.5% | 4.6% | 0.0% |
| Same-Object Dual-Class Fire | N/A | 12.1% | 0.5% | 0.0% |
| Median Fox Confidence | 0.71 | 0.87 | 0.85 | 0.89 |
| False Fires on 225 Clean Negatives | 13 (5.8%) | 2 (0.9%) | 4 (1.8%) | 0 (0.0%) |
conf = 0.40): Optimum balance for automated alerts. Delivers 88.2% fox capture with zero rival canid false triggers.conf = 0.25): Captures 88.5% of frames with minimal low-confidence background noise.conf = 0.50): Zero false positives across any lighting condition with ~78% frame capture.TinyFox-2 includes INT8 calibrated weights generated with YOLO-Quantizer (per-channel Conv weight quantization with sensitivity analysis).
| Format | File | Size | Reduction | Mean Box Delta | Class Agreement |
|---|---|---|---|---|---|
| PyTorch (FP32) | TinyFox-2.pt | 5.39 MB | — | Baseline | 100% |
| ONNX (FP32) | TinyFox-2.onnx | 9.48 MB | — | Baseline | 100% |
| ONNX (FP16) | TinyFox-2_fp16.onnx | 4.75 MB | 50.0% | < 0.05 px | 100% |
| ONNX (INT8) | TinyFox-2_int8.onnx | 2.60 MB | 72.5% | 0.68 px | 100% |
On validation images, the INT8 model matches the FP32 model with an average bounding box shift of less than 0.7 pixels on a 640×640 grid and 100% class match.
TinyFox-2/
├── README.md # Model Card & Documentation
├── LICENSE # GNU AGPL-3.0 + Attribution Notice
├── config.json # Architecture & class metadata
├── TinyFox-2.pt # PyTorch model checkpoint (Ultralytics)
├── TinyFox-2_last.pt # Resume training checkpoint
├── TinyFox-2.onnx # FP32 ONNX model (opset 20, 640x640)
├── TinyFox-2_fp16.onnx # FP16 ONNX model (for GPU/NPU)
├── TinyFox-2_int8.onnx # Calibrated INT8 ONNX (2.60 MB)
├── TinyFox-2.torchscript # TorchScript traced model
├── infer.py # Ultralytics inference script
├── infer_onnx.py # Standalone ONNX Runtime runner (no PyTorch required)
├── export_all_formats.py # Multi-format export utility
├── yolo_quantizer.py # YOLO mixed-precision quantizer (MIT)
├── upload_to_hf.ps1 # Hugging Face upload script
└── evaluation/ # Performance curves & validation plots
├── BoxF1_curve.png
├── BoxPR_curve.png
├── confusion_matrix.png
├── results.png
└── results.csv
from ultralytics import YOLO
# Load model
model = YOLO("TinyFox-2.pt")
# Predict on an infrared image
results = model.predict(source="night_frame.jpg", conf=0.40, imgsz=640)
# Display or save results
for r in results:
r.show() # Display
r.save(filename="output.jpg") # Save
# Run on an image
python infer.py --source test_ir.jpg --conf 0.40 --output result.jpg
# Run on a video file
python infer.py --source trail_cam.mp4 --conf 0.40 --output annotated.mp4
# Run on an RTSP stream (live monitor)
python infer.py --source "rtsp://192.168.1.100:554/stream" --conf 0.40 --show
For low-power edge nodes (Raspberry Pi, mini PCs) without PyTorch:
pip install onnxruntime opencv-python numpy
python infer_onnx.py --model TinyFox-2_int8.onnx --image test_ir.jpg --conf 0.40
To re-quantize or export to additional formats:
# Quantize to INT8 with YOLO-Quantizer
python yolo_quantizer.py TinyFox-2.onnx --mode int8 --per-channel --out TinyFox-2_int8.onnx
# Export to TorchScript / OpenVINO
python export_all_formats.py --model TinyFox-2.pt --imgsz 640
If you use TinyFox-2 in your research or deployment, please cite:
@misc{tinyfox2026,
title={TinyFox-2: High-Performance Night/IR Red Fox and Wildlife Object Detector},
author={Thenukegun10x and Contributors},
year={2026},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/Thenukegun10x/TinyFox-2}}
}