Skip to content

fengyiwu98/TensorISTD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

63 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TensorISTD

MATLAB License

TensorISTD is an open-source MATLAB toolbox designed for optimization-based Infrared Small Target Detection (ISTD) research and evaluation.

It provides a unified, streamlined evaluation pipeline covering:

  • Single-frame / Multi-frame tasks
  • Matrix / Tensor representations
  • Mainstream evaluation metrics (SCRG, BSF, CG, and 3D-ROC series)

Objectives:

  1. Enable rapid prototyping and verification of optimization-based detection methods.
  2. Establish a standardized benchmark for fair comparison and reproducibility.
  3. Encourage community contributions to enrich the algorithm library.

Table of Contents

Note:

  1. This benchmark also includes the code of our profound and powerful baseline, STPA-FCTN, which can be found in TensorISTD/algorithms/STPA_FCTN.
  2. This repository will be updated regularly, so stay tuned for improvements and new features!
  3. If you would like to contribute, please contact us!

Requirement

Matlab 2021b or higher.

Usage Instruction

πŸ“‚ Document Structure
TensorISTD/
β”œβ”€β”€ algorithms/               # Core detection algorithms
β”‚   β”œβ”€β”€ 4D_ISTD/              # [1]
β”‚   β”œβ”€β”€ LogTFNN/              # [2]
β”‚   β”œβ”€β”€ NPSTT/                # [3]
β”‚   β”œβ”€β”€ PSTNN/                # [4]
β”‚   └── STPA_FCTN/            # Ours
β”œβ”€β”€ all_results/              # Raw detection outputs
β”‚   └── sequence1/            # Sample sequence
β”‚       └── STPA_FCTN/        # Algorithm-specific results
β”œβ”€β”€ fig_results/              # Visualization outputs
β”‚   └── sequence1/            # Sequence-specific figures
β”œβ”€β”€ mat_results/              # Performance metrics
β”‚   β”œβ”€β”€ curve_results/        # .mat documents
β”‚   └── index_results/        # Metrics records(3D-ROC,SCR, etc.)
β”œβ”€β”€ time_results/             # Runtime logs
β”‚    └── STPA-FCTN.txt        # Time consumption record
β”œβ”€β”€ utils/                    # Support utilities
β”‚   β”œβ”€β”€ analyse_pts.m         # Point analysis script
β”‚   β”œβ”€β”€ curves_draw.m         # Visualization generator
β”‚   β”œβ”€β”€ get_algo_result.m     # Algorithm output collector
β”‚   β”œβ”€β”€ get_curves.m          # Metrics calculator
β”‚   β”œβ”€β”€ measure_calculator.m  # SCR/CG/BSF/BSR calculator
β”‚   └── pt_nms.m              # Non-maximum suppression
β”œβ”€β”€ 3D_Visualization          
β”œβ”€β”€ LICENSE                   # open-source license
β”œβ”€β”€ README.md
β”œβ”€β”€ color1.mat           
└── evaluation.m              

πŸš€ Get Results

Main command

evaluation.m

Use all the evaluation algorithms to get the result plots for all the evaluation datasets present in . /result in the mat file.

1. Inititalization

Select the desired algorithm name and datasets:

eval_algo_names = ...
    {
     'STPA_FCTN' %'TT','TR','LogTFNN','NPSTT','PSTNN','RIPT','STT'
    };

eval_data_names = ...
    {
     'sequence1' 
    };

Fill in the following configuration:

img_types = {'*.jpg', '*.bmp', '*.png'}; 
algo_base_path = '.\algorithms\'; 
data_base_path = '.\dataset\data\';
res_base_path =  '.\all_result\'; 
time_path = '.\time_results\';

2. Choose single-frame or multi-frame algorithm:

Single-frame (PSTNN, etc.)

get_algo_result(eval_algo_names, eval_data_names, ...
     img_types, algo_base_path, data_base_path, res_base_path, time_path );

Multi-frame (STT, NPSTT, 4-D-TT/TR, STPA-FCTN, etc.)

get_algo_result_multiframe(eval_algo_names, eval_data_names, ...
     img_types, algo_base_path, data_base_path, res_base_path, time_path );

πŸ’‘ Note

If the metrics are calculated directly from the existing test image, then comment out this section and go directly to Evaluation.

πŸ“ˆ Evaluation

In this repo, we include the following metrics:

βœ… SCRG, βœ… CG, βœ… BSF,

βœ… Diverse AUC Analysis ([6]): $AUC_{(FPR,TPR)}$, $AUC_{(\tau,TPR)}$, $AUC_{(\tau,FPR)}$, $AUC_{ODP}$, $AUC_{SNPR}$, $AUC_{TD}$, $AUC_{BS}$, $AUC_{TDBS}$

1. Calculate the corresponding .mat file based on Get Results or the existing result plots with the target coordinates of the dataset and store it in the curve index folder.

get_curves(eval_algo_names, eval_data_names, thres_num, radius, res_base_path, ...
     mat_base_path, txt_base_path, mask_base_path, preimg_type);

This step will combine the result plots from step 1 and . GT under /dataset/ann/ to get the roc sequence results

  • Related Configurations:
%% evaluation.m
mat_base_path = '.\mat_results\'; 
txt_base_path =  '.\dataset\anno\'; 
preimg_type = '*.png';

2. Calculate the Multi-perspective AUC Analysis:

curves_drawer(1, eval_algo_names, eval_data_names, figure_base_path, mat_base_path, x_axis_ratio, FPR_thres);

3. Calculate the SCRG gain, CG, BSF metrics:

measure_calculator(eval_algo_names, eval_data_names, data_base_path, res_base_path, ...
    mat_base_path, txt_base_path, img_types, preimg_type);

4. Draw the 3D-ROC figures

  • πŸ“‚The evaluation result will be saved in index_results:
β”œβ”€β”€./mat_result/
β”‚    β”œβ”€β”€ curve_results
β”‚    β”‚    β”œβ”€β”€ sequence1_STPA-FCTN.mat
β”‚    β”‚    β”œβ”€β”€ ...
β”‚    β”œβ”€β”€ index_results
β”‚    β”‚    β”œβ”€β”€ sequence1.txt
β”‚    β”‚    β”œβ”€β”€ ...
  • The 3D-ROC image can be obtained during the execution of step 3.

    • Related Configurations:
    %% evaluation.m
    figure_base_path = '.\fig_results\';
    x_axis_ratio = 1e-4;
    FPR_thres = 1;
    %% utils\curves_drawer.m
    % Line Color
        color_map = [ ...
    %          55/255   126/255  184/255;  % Blue
    %          77/255   175/255  74/255;   % Green
    %          228/255  26/255   28/255;   % Red
    %          255/255  217/255  47/255;   % Yellow
    ];
    % Line Type
    LineType = {':' }; %'-.'
    • πŸ“‚ The evaluation 3D-ROC result has the following structure:
    β”œβ”€β”€./fig_results/
    β”‚    β”œβ”€β”€ sequence1
    β”‚    β”‚    β”œβ”€β”€ SOTA_1
    β”‚    β”‚    β”œβ”€β”€ SOTA_2
    β”‚    β”‚    β”œβ”€β”€ SOTA_3
    β”‚    β”‚    β”œβ”€β”€ SOTA_4
    β”‚    β”œβ”€β”€ sequence2
    β”‚    β”‚    β”œβ”€β”€ SOTA_1
    β”‚    β”‚    β”œβ”€β”€ ...
    β”‚    β”œβ”€β”€ ...
    
    • The following figures are 3D-ROC results of STPA-FCTN in seq 1.

    • Comparison of multiple algorithms.

🎨 Draw Visualization Images

  • This following script provides a standardized pipeline for generating publication-quality 3D visualizations from 2D images.

    • Key Configuration Parameters
    1. Figure Window
    figure('Units', 'pixels', 'Position', [100 100 703 641]);
    1. Axis Configuration
    xticks(0:50:250);          
    xtickformat('%d');          
    xlim([0 250]);             
    xtickangle(0);         
    ...
    1. View Perspective
    view(-37.5,30);              % Set 3D view perspective (azimuth -37.5Β°, elevation 30Β°)
    1. Color Configuration

    The colormap is provided as color1.mat.

    • 3D Visualization

Evaluation Table

Method Averaged Values
SCRG BSF CG $AUC_{FPR,TPR}$ $AUC_{\tau,TPR}$ $AUC_{\tau,FPR}$ $AUC_{ODP}$ $AUC_{SNPR}$ $AUC_{TD}$ $AUC_{BS}$ $AUC_{TDBS}$ Time(s)
PSTNN Inf Inf 1.4788 0.9429 0.7011 6.1038e-3 1.6249 1.2251e2 1.6310 0.9238 0.6950 0.1606
LogTFNN 4.5912 5.1813 1.0208 0.9756 0.5694 6.5000e-2 1.5385 0.9629e2 1.5450 0.9629 0.5629 1.3208
NPSTT Inf Inf 1.8846 0.9699 0.7824 5.1423e-3 1.7517 1.5926e2 1.7523 0.9649 0.7818 5.1299
4-D TT 89.171 41.837 2.3124 0.9921 0.9277 5.1489e-3 1.9147 1.8021e2 1.9199 0.9869 0.9226 0.8694
4-D TR 100.62 49.084 2.2463 0.9976 0.9374 5.0947e-3 1.9300 1.8409e2 1.9351 0.9926 0.9324 2.0373
STPA-FCTN 149.26 68.905 2.3292 0.9996 0.9581 5.0778e-3 1.9527 1.8893e2 1.9579 0.9945 0.9530 0.9926

πŸ’‘ Note

  1. In multi-frame evaluation, an "Inf" value does not necessarily indicate that all frames produced infinite results. This can occur if even a single frame yields an "Inf" value. Therefore, for multi-frame scenarios, we recommend using CG or 3-D ROC metrics for more robust and reliable assessment.

  2. We adopted sequences from [1], and we also provide our data collection [2].

Citation

If you find the code useful, please consider citing our paper using the following BibTeX entry.

@ARTICLE{11333368,
  author={Wu, Fengyi and Chen, Siyu and Liu, Simin and Tao, Bingjie and Luo, Junhai and Peng, Zhenming},
  journal={IEEE Transactions on Geoscience and Remote Sensing}, 
  title={A Comprehensive Benchmark for Spatiotemporal Tensor-Based Infrared Small Target Detection}, 
  year={2026},
  volume={64},
  number={},
  pages={1-20},
  keywords={Tensors;Benchmark testing;Three-dimensional displays;Correlation;Object detection;Transformers;Computational modeling;Accuracy;Systematics;Clutter;Benchmark;fully connected tensor network completion;infrared small target detection (ISTD)},
  doi={10.1109/TGRS.2026.3651631}}

References

[1] F. Wu, H. Yu, A. Liu, J. Luo, and Z. Peng, β€œInfrared small target detection using spatiotemporal 4-d tensor train and ring unfolding,” IEEE Trans. Geosci. Remote Sens., vol. 61, pp. 1–22, 2023.

[2] X. Kong, C. Yang, S. Cao, C. Li and Z. Peng, "Infrared Small Target Detection via Nonconvex Tensor Fibered Rank Approximation," in IEEE Transactions on Geoscience and Remote Sensing, vol. 60, pp. 1-21, 2022.

[3] G. Wang, B. Tao, X. Kong, and Z. Peng, β€œInfrared small target detection using nonoverlapping patch spatial–temporal tensor factorization with capped nuclear norm regularization,” IEEE Trans. Geosci. Remote Sens., vol. 60,pp. 1–17, 2021.

[4] L. Zhang and Z. Peng, β€œInfrared small target detection based on partial sum of the tensor nuclear norm,” Remote Sens., vol. 11, no. 4, p. 382, 2019.

[5] C. -I. Chang, "An Effective Evaluation Tool for Hyperspectral Target Detection: 3D Receiver Operating Characteristic Curve Analysis," in IEEE Transactions on Geoscience and Remote Sensing, vol. 59, no. 6, pp. 5131-5153, June 2021,

Note: If you used the above codes, please cite the relevant paper.

Acknowledgements

Despite the organizers of this repo, we would like to thank the former contributors--Tianfang Zhang, Jian Li, Yuelu Wei, Guanghui Wang, Xuan Kong, Haiyang Yi, Ruochen Qie, Hang Yu, Anran Liu, Simin Liu, and Zhenming Peng--for this Toolbox.

About

[TGRS 2026] TensorISTD Toolbox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors