HAIR (HADAR-based Image Restoration) is a physics-driven framework for restoring ground-based thermal-infrared hyperspectral images (TIR-HSI). It is designed for HADAR-related applications where TIR-HSI must preserve not only visual quality, but also the thermodynamic consistency needed for temperature, emissivity, and texture (TeX) decomposition.
Real-world TIR-HSI acquisitions are often degraded by sensor noise, stripe artifacts, dead or invalid bands, spectral undersampling, and wavelength shifts. These artifacts can corrupt both the radiance image and the downstream HADAR TeX decomposition. HAIR addresses this problem by combining sensor-aware restoration with the HADAR rendering equation and an atmospheric downwelling radiative-transfer reference.
The framework is built around four main ideas:
- Physics-consistent restoration: HAIR uses a TeX decompose-synthesize strategy to restore TIR-HSI while preserving temperature, emissivity, and texture consistency.
- Downwelling-guided spectral calibration: HAIR aligns observed atmospheric signatures with a forward-modeled atmospheric downwelling reference to estimate spectral shifts, complete corrupted bands, and enhance spectra.
- Unified sensor degradation modeling: HAIR analyzes pushbroom and FTIR TIR-HSI degradations, separating tractable perturbations such as noise and stripes from invalid spectral measurements.
- Comprehensive restoration tasks: HAIR is evaluated for denoising, inpainting, spectral calibration, and spectral super-resolution, with experiments on outdoor DARPA Invisible Headlights data and in-lab FTIR measurements.
The public code provides the open components around data loading, noisy-band detection, destriping, subspace/BM3D denoising, sky-spectrum extraction, spectral calibration utilities, and interactive visualization.
Paper: HADAR-Based Thermal Infrared Hyperspectral Image Restoration
Authors: Cheng Dai*, Jiale Lin*, Bingxuan Song, Yifei Chen, Jiashuo Chen, Xin Yuan, and Fanglin Bao
* Equal contribution. Corresponding author: Fanglin Bao.
The example above summarizes the spectral calibration and restoration behavior under severe band degradation. HAIR uses an atmospheric downwelling reference to estimate wavelength shifts, recover corrupted spectral regions, and stabilize the downstream TeX decomposition.
The core HADAR TeX inversion module is not included in this public release because it is subject to patent and intellectual-property restrictions. In particular, the public repository intentionally keeps the following functions as interfaces/placeholders:
get_config()inhadar_module_v2.pyhadar_solver_v2(...)inhadar_module_v2.py
As a result, this repository does not reproduce the complete end-to-end HADAR restoration results from the paper by itself. The released code is meant to document and run the non-proprietary preprocessing, restoration utilities, calibration scaffold, and visualization workflow around the protected HADAR solver interface.
.
├── figures/ # README figures copied from the paper
├── main.ipynb # Example HAIR workflow notebook
├── hair_module.py # Restoration and spectral calibration utilities
├── hadar_module_v2.py # Data loading, plotting, sky processing, LUT helpers
├── highres_ref_sky.txt # High-resolution atmospheric sky reference
├── pyproject.toml # Python project and dependency specification
└── uv.lock # Locked dependency versions
This project is configured with uv and requires
Python 3.12 or newer.
git clone https://github.com/jialelin2007/HAIR.git
cd HAIRuv syncThe locked environment includes the main dependencies used by the released modules:
jax[cuda12]numpyscipymatplotlibplotlyspectralbm3djoblibemd-signalipykernel
The default dependency file pins CUDA-enabled JAX (jax[cuda12]==0.6.2). If you
want to run on a CPU-only machine, replace jax[cuda12]==0.6.2 in
pyproject.toml with the matching CPU JAX package for your
platform, then refresh the environment.
The example notebook is organized as a staged pipeline:
- Load a TIR-HSI cube from ENVI-style files (
.hdrwith.bsq,.sc, or.dat) usingload_data(...). - Detect noisy or corrupted spectral bands with
detect_noisy_bands(...). - Apply the released destriping and denoising utilities.
- Extract a sky spectrum and align it to the high-resolution atmospheric
reference in
highres_ref_sky.txt. - Call the HADAR solver interface.
- Visualize temperature, emissivity, brightness, and spectra.
Before running the notebook, update:
file_input_folder = "./data"
file_name = "Input file name here"to point to your own HSI data. The repository does not include the full experimental datasets used in the paper.
This file contains the released restoration and spectral calibration utilities:
detect_noisy_bands(...): row/stripe-based noisy-band detectiondestripe(...): JAX-based ADMM destriping routinedenoise(...): subspace denoising with BM3D filteringcorrect_band(...): downwelling-reference guided wavelength calibrationinterpolate_emmisivity_vmap(...): emissivity interpolation helperlookup_B_vector_batch(...): Planck-LUT lookup helper
This file contains released data and visualization helpers:
load_data(...): ENVI-style HSI loading for.bsq,.sc, and.datwavenumber_to_wavelength(...): wavenumber-to-wavelength conversionprocess_sky_spectrum(...): sky-spectrum extraction by ALS, EMD, or direct modegenerate_planck_lut(...): Planck radiance and derivative lookup tablesplot_hsi(...),plot_T_map(...),plot_e_map(...),plot_bright_map(...): interactive visualization utilities
The protected HADAR-specific functions are intentionally left as placeholders.
highres_ref_sky.txtis a two-column high-resolution atmospheric reference spectrum used by the calibration utility.- The outdoor pushbroom-camera experiments in the paper use the TIR subset of the DARPA Invisible Headlights / HEADLIGHTS dataset. Dataset information is available from Kitware: https://www.kitware.com/darpa-headlights-dataset/.
- The full experimental datasets used in the paper are not redistributed in this repository.
If you use this code or build on HAIR, please cite:
@misc{dai2026hadarbasedthermalinfraredhyperspectral,
title = {HADAR-Based Thermal Infrared Hyperspectral Image Restoration},
author = {Cheng Dai and Jiale Lin and Bingxuan Song and Yifei Chen and Jiashuo Chen and Xin Yuan and Fanglin Bao},
year = {2026},
eprint = {2605.13664},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2605.13664}
}We have released TeX-1500, a paired real-world LWIR hyperspectral dataset and benchmark for temperature-emissivity-texture (TeX) decomposition, as a follow-up project that uses the HAIR restoration pipeline to construct calibrated HSI-TeX pairs. Please see the TeX-1500 paper, the benchmark code repository, the Hugging Face dataset, and the TeX-UNet checkpoint resources.
The released code in this repository is licensed under the
PolyForm Noncommercial License 1.0.0. See LICENSE for details.
The PolyForm Noncommercial License 1.0.0 applies only to the materials released in this repository. The core HADAR TeX inversion module is not included in this public release due to patent and intellectual-property restrictions, and this license does not cover unreleased HADAR inversion implementations, separately released datasets, trademarks, or third-party materials.

