FENRIS -- AA-YOLO: Anomaly-Aware YOLO for Infrared Small Target Detection

Part of the ANIMA Perception Suite by Robot Flow Labs.

Paper

AA-YOLO: Anomaly-Aware YOLO for Infrared Small Target Detection arXiv: 2510.04741

Architecture

AA-YOLO introduces an Anomaly-Aware Detection Head (AADH) that reformulates IR target detection as a statistical anomaly detection problem. The AADH adds only +0.2M parameters and +5% FLOPs to any YOLO backbone. Key components:

  1. Spatial Filtering Block -- Two Conv1d layers (3x3) with BatchNorm/ReLU, compressing to C=8 channels
  2. Statistical Anomaly Test -- Multivariate hypothesis test computing -ln(F_mu2) anomaly scores
  3. Scaled Sigmoid Activation -- Temperature-scaled sigmoid (alpha=0.001) for sharp anomaly response
  4. Backbone-agnostic -- Drop-in head for YOLOv5/v7/v9 backbones

This checkpoint uses the AA-YOLOv7t backbone (YOLOv8n architecture as v7-tiny proxy).

Training Summary

Parameter Value
Dataset SIRST (427 images: 256 train / 85 val / 86 test)
Backbone AA-YOLOv7t (YOLOv8n + AADH)
Epochs 100
Optimizer SGD (lr=0.01, momentum=0.937, weight_decay=0.0005)
Scheduler Cosine annealing, 3 epoch warmup
Precision FP16 mixed precision
Best val_loss 1.0874 (epoch 73)
Final train_loss 1.0715
Backbone freeze First 10 epochs
Hardware NVIDIA L4 (23GB)
Training time ~2 min (100 epochs)

Loss Curve

  • Epoch 0: train=2.60, val=2.50
  • Epoch 25: train=1.14, val=1.15
  • Epoch 50: train=1.09, val=1.10
  • Epoch 73 (best): train=1.08, val=1.09
  • Epoch 99: train=1.07, val=1.09

Exported Formats

Format File Size Use Case
PyTorch (.pth) pytorch/fenris_v0.1.0.pth 12 MB Training, fine-tuning
SafeTensors pytorch/fenris_v0.1.0.safetensors 12 MB Fast loading, safe
ONNX (opset 18) onnx/fenris_v0.1.0_allinone.onnx 12.3 MB Cross-platform inference
TensorRT FP32 tensorrt/fenris_v0.1.0_fp32.engine ~17 MB Full precision inference
TensorRT FP16 tensorrt/fenris_v0.1.0_fp16.engine ~8 MB Edge deployment (Jetson/L4)
Training checkpoint checkpoints/best.pth 24 MB Resume training (includes optimizer state)

Quick Start

import torch
from safetensors.torch import load_file

# Load SafeTensors (recommended)
state_dict = load_file("pytorch/fenris_v0.1.0.safetensors")

# Or load PyTorch
state_dict = torch.load("pytorch/fenris_v0.1.0.pth", map_location="cpu")

ONNX Inference

import onnxruntime as ort
import numpy as np

session = ort.InferenceSession("onnx/fenris_v0.1.0_allinone.onnx")
input_data = np.random.randn(1, 3, 256, 256).astype(np.float32)
outputs = session.run(None, {"ir_input": input_data})

TensorRT Inference

import tensorrt as trt

runtime = trt.Runtime(trt.Logger(trt.Logger.WARNING))
with open("tensorrt/fenris_v0.1.0_fp16.engine", "rb") as f:
    engine = runtime.deserialize_cuda_engine(f.read())

Datasets

  • SIRST (427 images, 256x256) -- Primary benchmark
  • IRSTD-1k (1,000 images, 512x512) -- Extended evaluation
  • VEDAI (1,200 images, IR satellite) -- Cross-domain evaluation

Target Metrics (Paper)

Metric Target Dataset
F1 >= 98.1% SIRST
AP_s >= 79.8% SIRST
AP >= 72.0% IRSTD-1k
AP >= 65.0% VEDAI

ANIMA Module

  • Module name: fenris
  • Category: perception.foundation
  • Container: ghcr.io/robotflow-labs/anima-fenris:0.1.0
  • API port: 8080
  • Health: /health, /ready, /info

License

Apache 2.0 -- Robot Flow Labs / AIFLOW LABS LIMITED

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for ilessio-aiflowlab/project_fenris