Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,54 +1,108 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
tags:
|
|
|
|
|
|
|
| 4 |
- rgb-thermal
|
| 5 |
- semantic-segmentation
|
| 6 |
- segformer
|
| 7 |
- defense
|
| 8 |
-
-
|
|
|
|
|
|
|
|
|
|
| 9 |
datasets:
|
| 10 |
- MFNet
|
| 11 |
- PST900
|
| 12 |
- FMB
|
| 13 |
metrics:
|
| 14 |
- mIoU
|
| 15 |
-
pipeline_tag: image-segmentation
|
| 16 |
---
|
| 17 |
|
| 18 |
-
# DEF-rtfdnet
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
##
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
|
| 25 |
-
- **
|
|
|
|
| 26 |
- **Losses**: CE + Modal CE + AKD (feature distillation) + RegionL1 (logit distillation)
|
| 27 |
-
- **Input**: 6-channel tensor (RGB + Thermal),
|
|
|
|
| 28 |
|
| 29 |
## Results
|
| 30 |
|
| 31 |
-
| Dataset | Classes | mIoU | Accuracy |
|
| 32 |
-
|---------|---------|------|----------|
|
| 33 |
-
| MFNet | 9 | 0.929 |
|
| 34 |
-
| PST900 | 5 |
|
| 35 |
-
| FMB | 14 |
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
## Usage
|
| 46 |
|
| 47 |
```python
|
| 48 |
-
from def_rtfdnet.model import build_rtfdnet
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
```
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
## Citation
|
| 53 |
|
| 54 |
```bibtex
|
|
@@ -60,4 +114,7 @@ model = build_rtfdnet(variant='mit_b2', num_classes=9, pretrained='models/mit_b2
|
|
| 60 |
}
|
| 61 |
```
|
| 62 |
|
|
|
|
|
|
|
|
|
|
| 63 |
Built with ANIMA by Robot Flow Labs
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
tags:
|
| 3 |
+
- robotics
|
| 4 |
+
- anima
|
| 5 |
- rgb-thermal
|
| 6 |
- semantic-segmentation
|
| 7 |
- segformer
|
| 8 |
- defense
|
| 9 |
+
- robot-flow-labs
|
| 10 |
+
library_name: pytorch
|
| 11 |
+
pipeline_tag: image-segmentation
|
| 12 |
+
license: apache-2.0
|
| 13 |
datasets:
|
| 14 |
- MFNet
|
| 15 |
- PST900
|
| 16 |
- FMB
|
| 17 |
metrics:
|
| 18 |
- mIoU
|
|
|
|
| 19 |
---
|
| 20 |
|
| 21 |
+
# DEF-rtfdnet — RTFDNet: Fusion-Decoupling for Robust RGB-T Segmentation
|
| 22 |
|
| 23 |
+
Part of the [ANIMA Perception Suite](https://robotflowlabs.com) by Robot Flow Labs.
|
| 24 |
|
| 25 |
+
## Paper
|
| 26 |
+
**RTFDNet: Fusion-Decoupling for Robust RGB-T Segmentation** (ArXiv 2603.09149)
|
| 27 |
+
Kunyu Tan, Mingjian Liang (2026)
|
| 28 |
|
| 29 |
+
## Architecture
|
| 30 |
+
- **Backbone**: BIMixVisionTransformer — dual-stream SegFormer (MiT-B2, 50.4M params)
|
| 31 |
+
- **Fusion**: EAEF_clip (CLIP-style cross-modal alignment) + gated feature fusion at 4 stages
|
| 32 |
- **Losses**: CE + Modal CE + AKD (feature distillation) + RegionL1 (logit distillation)
|
| 33 |
+
- **Input**: 6-channel tensor (RGB + Thermal), flexible resolution
|
| 34 |
+
- **Robustness**: Graceful degradation when one modality fails (RGB-only, thermal-only)
|
| 35 |
|
| 36 |
## Results
|
| 37 |
|
| 38 |
+
| Dataset | Classes | Best mIoU | Accuracy | Epochs |
|
| 39 |
+
|---------|---------|-----------|----------|--------|
|
| 40 |
+
| MFNet | 9 | **0.929** | 97.9% | 300 |
|
| 41 |
+
| PST900 | 5 | **0.836** | 99.5% | 89 |
|
| 42 |
+
| FMB | 14 | **0.684** | 93.1% | 74+ |
|
| 43 |
+
|
| 44 |
+
## Model Variants
|
| 45 |
|
| 46 |
+
### MFNet (9-class urban RGB-T)
|
| 47 |
+
| Format | File | Size |
|
| 48 |
+
|--------|------|------|
|
| 49 |
+
| PyTorch | `mfnet_b2/pytorch/rtfdnet_mfnet_b2.pth` | 201.8 MB |
|
| 50 |
+
| SafeTensors | `mfnet_b2/pytorch/rtfdnet_mfnet_b2.safetensors` | 201.6 MB |
|
| 51 |
+
| ONNX | `mfnet_b2/onnx/rtfdnet_mfnet_b2.onnx` | 340.2 MB |
|
| 52 |
+
| TensorRT FP16 | `mfnet_b2/tensorrt/rtfdnet_mfnet_b2_fp16.trt` | 110.9 MB |
|
| 53 |
+
| TensorRT FP32 | `mfnet_b2/tensorrt/rtfdnet_mfnet_b2_fp32.trt` | 211.6 MB |
|
| 54 |
|
| 55 |
+
### PST900 (5-class indoor thermal)
|
| 56 |
+
| Format | File | Size |
|
| 57 |
+
|--------|------|------|
|
| 58 |
+
| PyTorch | `pst900_b2/pytorch/rtfdnet_pst900_b2.pth` | 201.8 MB |
|
| 59 |
+
| SafeTensors | `pst900_b2/pytorch/rtfdnet_pst900_b2.safetensors` | 201.6 MB |
|
| 60 |
+
| ONNX | `pst900_b2/onnx/rtfdnet_pst900_b2.onnx` | 319.3 MB |
|
| 61 |
+
| TensorRT FP16 | `pst900_b2/tensorrt/rtfdnet_pst900_b2_fp16.trt` | 110.0 MB |
|
| 62 |
+
| TensorRT FP32 | `pst900_b2/tensorrt/rtfdnet_pst900_b2_fp32.trt` | 210.4 MB |
|
| 63 |
+
|
| 64 |
+
### FMB (14-class multi-modal benchmark)
|
| 65 |
+
| Format | File | Size |
|
| 66 |
+
|--------|------|------|
|
| 67 |
+
| PyTorch | `fmb_b2/pytorch/rtfdnet_fmb_b2.pth` | 201.8 MB |
|
| 68 |
+
| SafeTensors | `fmb_b2/pytorch/rtfdnet_fmb_b2.safetensors` | 201.6 MB |
|
| 69 |
+
| ONNX | `fmb_b2/onnx/rtfdnet_fmb_b2.onnx` | 319.3 MB |
|
| 70 |
+
| TensorRT FP16 | `fmb_b2/tensorrt/rtfdnet_fmb_b2_fp16.trt` | 110.0 MB |
|
| 71 |
+
| TensorRT FP32 | `fmb_b2/tensorrt/rtfdnet_fmb_b2_fp32.trt` | 210.3 MB |
|
| 72 |
|
| 73 |
## Usage
|
| 74 |
|
| 75 |
```python
|
| 76 |
+
from def_rtfdnet.model import build_rtfdnet, load_pretrained_mit
|
| 77 |
+
import torch
|
| 78 |
+
|
| 79 |
+
# Build model
|
| 80 |
+
model = build_rtfdnet(variant='mit_b2', num_classes=9, channels=256)
|
| 81 |
+
|
| 82 |
+
# Load trained weights
|
| 83 |
+
ckpt = torch.load('mfnet_b2/checkpoints/best.pth', map_location='cpu')
|
| 84 |
+
model.load_state_dict(ckpt['model'])
|
| 85 |
+
model.eval()
|
| 86 |
+
|
| 87 |
+
# Inference: 6-channel input (RGB + Thermal)
|
| 88 |
+
x = torch.randn(1, 6, 480, 640)
|
| 89 |
+
logits = model.forward_inference(x) # (1, 9, 480, 640)
|
| 90 |
+
pred = logits.argmax(dim=1) # (1, 480, 640)
|
| 91 |
```
|
| 92 |
|
| 93 |
+
## Training
|
| 94 |
+
|
| 95 |
+
- **Hardware**: NVIDIA L4 (23GB VRAM)
|
| 96 |
+
- **Optimizer**: AdamW (lr=3e-5, head_lr_mult=10x)
|
| 97 |
+
- **Scheduler**: Warmup cosine (5% warmup)
|
| 98 |
+
- **Batch size**: 4 with gradient checkpointing
|
| 99 |
+
- **Precision**: FP16 (AMP)
|
| 100 |
+
- **Config**: See `configs/` directory
|
| 101 |
+
|
| 102 |
+
## Defense Applications
|
| 103 |
+
|
| 104 |
+
RGB-Thermal fusion for: nighttime surveillance, through-smoke perception, adverse-weather operations. RTFDNet's robustness to modality degradation ensures graceful failure when one sensor is jammed or obscured.
|
| 105 |
+
|
| 106 |
## Citation
|
| 107 |
|
| 108 |
```bibtex
|
|
|
|
| 114 |
}
|
| 115 |
```
|
| 116 |
|
| 117 |
+
## License
|
| 118 |
+
Apache 2.0 — Robot Flow Labs / AIFLOW LABS LIMITED
|
| 119 |
+
|
| 120 |
Built with ANIMA by Robot Flow Labs
|