Skip to content

SCUT-BIP-Lab/FSFNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FSFNet

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.

Introduction

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.

Figures

Motivation

Motivation

FSFNet Overview

FSFNet overview

Frequency-Spatial Feature Fusion

Frequency-Spatial Feature Fusion

FSFFM

FSFFM

Spectral Band Gate

Spectral Band Gate

Qualitative Results

Qualitative comparison

Feature Visualization

Feature maps

SBG Ablation

SBG ablation

Feature Distribution

PCA density visualization

Model

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 Block
  • SpectralBandGateModule / SBGModule: Spectral Band Gate module
  • FSFFM: Frequency-Spatial Feature Fusion Module

Project Structure

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/

Installation

pip install -r requirements.txt

Dataset Layout

The 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

Training

Default FSFNet training:

python tools/train.py ^
  --dataset-root datasets ^
  --dataset-name IRSTD-1K ^
  --epochs 1500 ^
  --batch-size 8 ^
  --patch-size 256 ^
  --save-dir checkpoints

Train with the Spectral Band Gate (SBG) module:

python tools/train.py ^
  --dataset-root datasets ^
  --dataset-name NUDT-SIRST ^
  --sbg-type rnn

Train without SBG:

python tools/train.py ^
  --dataset-root datasets ^
  --dataset-name NUDT-SIRST ^
  --no-sbg

Evaluation

python tools/evaluate.py ^
  --dataset-root datasets ^
  --dataset-name IRSTD-1K ^
  --weights checkpoints/FSFNet_IRSTD-1K.pth.tar

The evaluator can infer gate settings from checkpoint parameters:

  • pre_gate / post_gate enables spectral gate loading.
  • band_gate.* enables SBG loading.

Inference

python tools/infer.py ^
  --input path/to/image_or_folder ^
  --weights checkpoints/FSFNet_IRSTD-1K.pth.tar ^
  --dataset-name IRSTD-1K ^
  --output-dir outputs

Citation

@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}
}

License

This project is released under the Apache-2.0 License.

About

The official pytorch implementation for paper "FSFNet: Frequency--Spatial-Domain Fusion Network for Infrared Small Target Detection"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages