Official code organization for FSFNet: Frequency-Spatial-Domain Fusion Network for Infrared Small Target Detection.
This repository contains the cleaned FSFNet model code, training script, evaluation script, and inference script.
Infrared small target detection (IRSTD) is challenging because targets usually occupy only a few pixels, have weak visual responses, and are easily submerged in complex background clutter. Most existing deep IRSTD methods mainly extract features in the spatial domain, which limits their ability to exploit frequency-domain cues that are useful for separating small targets from smooth backgrounds.
FSFNet addresses this issue by explicitly fusing spatial-domain representations with frequency-domain information. The network is built around the Frequency-Spatial Block (FSBlock), which combines local spatial details with global frequency-domain context. Within FSBlock, the Spectral Band Gate (SBG) module adaptively emphasizes informative spectral bands and suppresses less useful frequency responses, improving robustness under cluttered scenes.
FSFNet further introduces the Frequency-Spatial Feature Fusion Module (FSFFM), which uses frequency-guided cross-channel attention to adaptively fuse spatial and frequency features. This design bridges the semantic gap between the two domains and enhances the network's ability to highlight small targets while reducing false alarms.
The main contributions are:
- FSFNet explicitly integrates complementary spatial-domain and frequency-domain information for infrared small target detection.
- FSBlock with SBG selectively modulates spectral bands, allowing the model to capture global context and target-related frequency responses.
- FSFFM adaptively fuses spatial and frequency features through frequency-guided channel attention.
- Experiments on NUDT-SIRST, IRSTD-1K, and NUAA-SIRST demonstrate strong detection accuracy and robustness compared with existing methods.
The model is FSFNet:
- Frequency-Spatial Block (FSBlock) for frequency-spatial feature interaction
- Frequency-Spatial Feature Fusion Module (FSFFM) for frequency-domain and spatial-domain feature fusion
- Deep supervision during training
- Optional spectral gate
- Spectral Band Gate (SBG) module enabled by default
The default setting enables SBG for newly initialized models and training runs. Use --no-sbg to disable it.
Code-level public names follow the paper terminology:
FSBlock: Frequency-Spatial BlockSpectralBandGateModule/SBGModule: Spectral Band Gate moduleFSFFM: Frequency-Spatial Feature Fusion Module
FSFNet/
fsfnet/
data.py
metrics.py
utils.py
models/
fsffm.py
ffc.py
fsfnet.py
tools/
train.py
evaluate.py
infer.py
figures/
checkpoints/
outputs/
pip install -r requirements.txtThe loaders expect the common IRSTD dataset layout:
datasets/
IRSTD-1K/
images/
masks/
img_idx/
train_IRSTD-1K.txt
test_IRSTD-1K.txt
NUDT-SIRST/
images/
masks/
img_idx/
train_NUDT-SIRST.txt
test_NUDT-SIRST.txt
NUAA-SIRST/
images/
masks/
img_idx/
train_NUAA-SIRST.txt
test_NUAA-SIRST.txt
Default FSFNet training:
python tools/train.py ^
--dataset-root datasets ^
--dataset-name IRSTD-1K ^
--epochs 1500 ^
--batch-size 8 ^
--patch-size 256 ^
--save-dir checkpointsTrain with the Spectral Band Gate (SBG) module:
python tools/train.py ^
--dataset-root datasets ^
--dataset-name NUDT-SIRST ^
--sbg-type rnnTrain without SBG:
python tools/train.py ^
--dataset-root datasets ^
--dataset-name NUDT-SIRST ^
--no-sbgpython tools/evaluate.py ^
--dataset-root datasets ^
--dataset-name IRSTD-1K ^
--weights checkpoints/FSFNet_IRSTD-1K.pth.tarThe evaluator can infer gate settings from checkpoint parameters:
pre_gate/post_gateenables spectral gate loading.band_gate.*enables SBG loading.
python tools/infer.py ^
--input path/to/image_or_folder ^
--weights checkpoints/FSFNet_IRSTD-1K.pth.tar ^
--dataset-name IRSTD-1K ^
--output-dir outputs@article{chen2026fsfnet,
title={FSFNet: Frequency--Spatial-Domain Fusion Network for Infrared Small Target Detection},
author={Chen, Riyao and Tang, Wenxiao and Yang, Mingchao and Kang, Wenxiong},
journal={IEEE Transactions on Geoscience and Remote Sensing},
volume={64},
pages={1--13},
year={2026},
publisher={IEEE}
}This project is released under the Apache-2.0 License.








