AVIRIS-NG Virtual Remote Sensing
Generating Hyperspectral Data from RGB
2 min readupdated
The model is a Physics-Informed GAN (a model incorporating physical laws into its architecture) that creates a virtual copy of hyperspectral images from the NASA AVIRIS-NG sensor based on a standard RGB image. The generator predicts pixel isolates using USGS (U.S. Geological Survey) reference spectra and a brightness map, after which the data cube is reconstructed using a linear mixing model. The development is useful for researchers and engineers involved in Earth remote sensing, environmental monitoring, and spectral data analysis.
Key features
- Construction of a hyperspectral cube (8 bands, including the visible range and SWIR (short-wave infrared range)) from a standard RGB image.
- Use of 75 USGS reference spectra and accounting for methane plumes along with hydrocarbons.
- GAN-based architecture with a loss function that accounts for physical constraints to ensure realistic results.
- Availability of a trained generator (147.7M parameters) after 1500 training epochs.
What you can do
- Turn standard RGB terrain tiles into spectrally accurate images for scientific or environmental tasks.
- Analyze surface reflectance in the short-wave infrared range (SWIR).
- Integrate the ready architecture and checkpoints into your own remote sensing data processing pipelines.
Example
import torch, torch.nn.functional as F, scipy.io
from huggingface_hub import hf_hub_download
import importlib.util
repo = "girisachin248/aviris-ng-virtual-replica"
spec = importlib.util.spec_from_file_location("network", hf_hub_download(repo, "network.py"))
network = importlib.util.module_from_spec(spec); spec.loader.exec_module(network)
device = "cuda"
spe_lib = torch.tensor(scipy.io.loadmat(hf_hub_download(repo, "spe_grss_75.mat"))["spe_grss"].T).float().to(device)
G = network.generator(network.ResBlock, 128, 3, spe_lib.shape[1]).to(device)
G.load_state_dict(torch.load(hf_hub_download(repo, "generator_param_1500.pth"), map_location=device))
rgb = torch.rand(1, 3, 256, 256, device=device)
with torch.no_grad():
pos, brightness = G(rgb)
abundance = F.softmax(pos, dim=1)
cube = brightness * (spe_lib @ abundance[0].reshape(75, -1)).reshape(1, 8, *rgb.shape[-2:])
Read more
DetailsMetrics on test tiles: SAM: 0.466 | MPSNR: 37.40 dB | MSSIM: 0.569 | Spectral corr.: 0.625 | FSIM: 0.955.
Hardware requirements: a CUDA GPU is required (since network.py creates the brightness parameter on the GPU).
Files in the repository: generator and discriminator checkpoints (1500 and 1400 epochs), the network description file network.py, and the spectrum library spe_grss_75.mat.










Comments