---
title: COS2A Algorithm for Hyperspectral Imaging
url: https://www.emergentmind.com/topics/cos2a-algorithm
type: topic
---

# COS2A Algorithm for Hyperspectral Imaging

Searching arXiv for the cited COS2A paper and the similarly named but unrelated matrix-functions paper.
COS2A, short for **Conversion from Sentinel‑2 to AVIRIS**, is a computational imaging algorithm for reconstructing an **AVIRIS‑like hyperspectral cube** from a **single multi‑resolution Sentinel‑2 scene**. In the formulation reported in "COS2A: Conversion from Sentinel-2 to AVIRIS Hyperspectral Data Using Interpretable Algorithm With Spectral-Spatial Duality" [2507.06575], the input is a 12-band Sentinel‑2 image with mixed spatial resolutions of 10/20/60 m, and the target is a **172-band VNIR–SWIR hyperspectral image at 10 m resolution**. The method is explicitly designed for the **very small‑data regime** and combines a **deep unfolding** stage with a **convex low-rank reconstruction** stage under the authors’ **CODE** (convex/deep) learning framework. A central theoretical claim is a **spectral–spatial duality** theorem that recasts the spectral super-resolution problem into a coupled-NMF spatial super-resolution form, permitting the use of an existing convex solver [2507.06575]. A common source of confusion is the unrelated matrix-function literature: "Computing the Action of Trigonometric and Hyperbolic Matrix Functions" [1607.04012] does **not** define any algorithm named COS2A.

## 1. Problem definition and sensing model

COS2A addresses a remote-sensing inverse problem in which Sentinel‑2 provides broad spatial coverage but only **12 usable spectral bands** in the reported setup, whereas AVIRIS provides a much denser spectral sampling. The reported target is an **AVIRIS-like** subset of **172 bands** obtained after removing water-vapor absorption and corrupted channels from the original AVIRIS acquisition [2507.06575]. In the notation of the paper, the Sentinel‑2 observation is represented by
\[
Y_S \in \mathbb{R}^{12 \times L},
\]
and the hyperspectral target by
\[
Y_H \in \mathbb{R}^{172 \times L}, \quad M:=172.
\]

A distinctive complication is that Sentinel‑2 bands are natively acquired at multiple resolutions: **4 bands at 10 m**, **6 bands at 20 m**, and **2 bands at 60 m** in the configuration described in the paper [2507.06575]. To place all inputs on a common grid, lower-resolution bands are stored as if they were on the 10 m lattice by replication: each 20 m pixel is copied 4 times and each 60 m pixel 36 times. This produces a unified \(12 \times L\) representation without eliminating the underlying multi-resolution character of the observation model [2507.06575].

The paper emphasizes that this problem is substantially more ill-posed than the usual spectral super-resolution settings studied on CAVE- or Harvard-type benchmarks. The difficulty arises from the **12 \(\to\) 172** spectral lift, the mixed-resolution input, the scarcity of real overlapping AVIRIS–Sentinel‑2 pairs, and the absence of official spectral response functions linking AVIRIS to Sentinel‑2 in the reported setup [2507.06575]. This suggests that COS2A is positioned not as a generic hyperspectral reconstruction pipeline, but as a sensor-pair-specific inverse method whose design is closely tied to these structural constraints.

## 2. Forward model, low-rank factorization, and CODE objective

The convex phase of COS2A uses only the four high-resolution Sentinel‑2 bands, denoted
\[
\widetilde{Y}_S \in \mathbb{R}^{4 \times L},
\]
together with a **scene-adaptive spectral response matrix**
\[
\widetilde{\Phi} \in \mathbb{R}^{4 \times 172}.
\]
The associated forward model is
\[
\widetilde{Y}_S \approx \widetilde{\Phi} Y_H,
\]
with data fidelity
\[
\text{DF}(Y_H \mid \widetilde{\Phi}, \widetilde{Y}_S)=\|\widetilde{Y}_S-\widetilde{\Phi}Y_H\|_F^2.
\]
The paper states that the full 12-band multi-resolution observation is used by the deep stage, while the convex data term is restricted to the four 10 m bands, with lower-resolution information entering through regularization design [2507.06575].

The hyperspectral image is assumed to obey the standard low-rank unmixing model
\[
Y_H = AS,
\]
where
\[
A \in \mathbb{R}^{172 \times N}, \qquad S \in \mathbb{R}^{N \times L},
\]
with \(A\) the endmember matrix and \(S\) the abundance matrix. The final reconstruction is
\[
Y_H^\star = A^\star S^\star.
\]
The paper treats \(N\) as the model order and reports using \(N=10\) in the convex phase across experiments [2507.06575].

Under the authors’ CODE principle, the generic objective is
\[
Y^\star = \arg\min_{Y \in \mathcal{Y}} \text{DF}(Y \mid X) + \lambda\,\text{REG}(Y),
\]
with a quadratic regularizer centered at a rough deep estimate:
\[
\text{REG}(Y) \triangleq \frac{1}{2}\|Y-Y_{\text{DE}}\|_Q^2.
\]
Specialized to the endmember–abundance parameterization, the COS2A objective is written as
\[
\min_{A,S \ge 0} \|\widetilde{Y}_S - \widetilde{\Phi}AS\|_F^2
+\frac{\lambda}{2}\|AS-Y_{\textrm{DE}}\|_Q^2
+\alpha\,\text{vol}(A)
+\beta\,\|S\|_1.
\]
The paper reports \(\lambda=2\) and \(\alpha=\beta=0.002\) [2507.06575].

Two additional priors complete the formulation. The first is a minimum-volume surrogate,
\[
\text{vol}(A) \triangleq \frac{1}{2}\sum_{i=1}^{N-1}\sum_{j=i+1}^{N}\|a_i-a_j\|_2^2,
\]
which the paper connects to Craig’s minimum-volume unmixing criterion. The second is the \(\ell_1\) penalty on \(S\), intended to promote sparse abundances [2507.06575]. In this architecture, the deep prior contributes a rough scene-adaptive estimate, while the convex phase imposes low-rank, minimum-volume, and sparsity structure.

## 3. Deep unfolding stage and rough hyperspectral prior

The rough estimate \(Y_{\text{DE}}\) is produced by a small unrolled ADMM network with a Deep-Image-Prior-type objective. The reported optimization is
\[
Y_{\textrm{DE}} := \arg\min_{Y_H} \|Y_S - Y_H\|_F^2 + \text{DIP}(Y_H),
\]
which is rewritten using an auxiliary variable \(Z\) as
\[
\min_{Y_H=Z} \|Y_S - Y_H\|_F^2 + \text{DIP}(Z).
\]
The scaled augmented Lagrangian is
\[
\mathcal{L}_\rho(Y_H,Z,U)=\|Y_S-Y_H\|_F^2+\text{DIP}(Z)+\frac{\rho}{2}\|Y_H-Z-U\|_F^2,
\]
where \(U\) is the dual variable and \(\rho>0\) is trainable [2507.06575].

The ADMM decomposition consists of three updates. The \(Z\)-update is a proximal denoising step,
\[
Z^{k+1}:=\textrm{prox}_{\frac{1}{\rho}\text{DIP}}(Y_H^k-U^k),
\]
interpreted in the paper as a deep denoiser. The \(Y_H\)-update is a quadratic subproblem. The paper first writes the closed form
\[
Y_H^{k+1}=(2\Phi^T\Phi+\rho I)^{-1}\left(2\Phi^T Y_S+\rho(Z^{k+1}+U^k)\right),
\]
and then uses the Woodbury identity to obtain the implemented form
\[
Y_H^{k+1}:=\frac{1}{\rho}\left(I-\frac{2}{\rho}\Phi^T\bm{\Phi}\right)\left(2\Phi^T Y_S+\rho(Z^{k+1}+U^k)\right),
\]
with
\[
\bm{\Phi}:=(\Phi\Phi^T+\tfrac{2}{\rho}I)^{-1}.
\]
The dual update is
\[
U^{k+1}:=U^k-Y_H^{k+1}+Z^{k+1}.
\]
After \(K\) stages, the network outputs
\[
Y_{\textrm{DE}}:=Z^K.
\]
The paper reports **\(K=4\)** [2507.06575].

The unfolded network has two principal modules. **Model 1** realizes the denoising/proximal block using a **residual-in-residual CNN denoiser**. **Model 2** realizes the linear operator in the \(Y_H\)-update by combining a skip connection with downsampling, a symmetric fully connected layer, and upsampling, corresponding to a “project to multispectral, process, then back-project” operator [2507.06575]. Stage 1 includes an initial spectral upsampling from 12 bands to 172 bands; intermediate stages execute the ADMM pattern; the final stage outputs \(Z^K\). The paper describes the network as **lightweight**, with approximately **0.75M parameters**, and states that this small size is intentional because the CODE framework only requires a rough prior rather than a high-capacity end-to-end predictor [2507.06575].

A plausible implication is that the deep module is not intended to solve the inverse problem by itself. Instead, it supplies a structured initialization around which the convex stage imposes physically motivated constraints.

## 4. \(Q\)-quadratic regularization and spectral–spatial duality

A defining feature of COS2A is the use of a quadratic regularizer with a nontrivial PSD weighting matrix \(Q\):
\[
\text{REG}(Y_H)=\frac{1}{2}\|Y_H-Y_{\textrm{DE}}\|_Q^2
=\frac{1}{2}\operatorname{vec}(Y_H-Y_{\textrm{DE}})^T Q\,\operatorname{vec}(Y_H-Y_{\textrm{DE}}).
\]
The paper designs \(Q\) from a spatial blur operator. Let
\[
B \triangleq I_{L/r^2}\otimes (\mathbf{1}_{r^2}/r^2),
\]
with blurring factor \(r=2\). Then
\[
Q \triangleq B^T B \otimes I_M.
\]
Because \(I_M\) acts on the spectral dimension, the blur encoded by \(Q\) is purely spatial [2507.06575].

The associated interpretation is that the regularizer enforces agreement between the unknown hyperspectral cube and a **blurred** version of the deep prior at the level of spatial regions. The paper states the equivalent identity
\[
\|Y_H B - Y_{\text{DE}} B\|_F^2 = \|Y_H - Y_{\text{DE}}\|_Q^2,
\]
derived via vectorization and Kronecker-product algebra [2507.06575]. This reformulation is central because it permits the deep prior to enter the convex stage as a pseudo coarse-resolution hyperspectral observation.

The main theoretical statement is **Theorem 1**, called **Spectral-Spatial Duality**. The paper states that the COS2A spectral super-resolution problem is mathematically equivalent to a **coupled-NMF spatial super-resolution problem** widely used in optical remote sensing [2507.06575]. The reference CNMF objective is written as
\[
\min_{A,S \ge 0} \frac{1}{2}\text{CNMF}(A,S)+\lambda_1\text{vol}(A)+\lambda_2\|S\|_1,
\]
where
\[
\text{CNMF}(A,S)\triangleq \|X_H-AS\|_F^2 + \|X_M-RAS\|_F^2.
\]

The equivalence works by identifying the COS2A data term
\[
\|\widetilde{Y}_S-\widetilde{\Phi}AS\|_F^2
\]
with the high-resolution multispectral term, and the regularizer
\[
\frac{\lambda}{2}\|AS-Y_{\textrm{DE}}\|_Q^2
\]
with the coarse hyperspectral term through the relation
\[
\|Y_{\textrm{DE}}B-ASB\|_F^2 = \|AS-Y_{\textrm{DE}}\|_Q^2.
\]
The paper then interprets \(Y_{\textrm{DE}}B\) as a pseudo low-resolution hyperspectral image and \(\widetilde{Y}_S\) as the high-resolution multispectral image [2507.06575]. This suggests that the primary theoretical contribution is not merely a new objective, but an inverse-problem transformation that makes an otherwise unusual spectral SR problem compatible with a mature spatial SR solver class.

## 5. End-to-end pipeline and optimization workflow

The reported COS2A workflow proceeds in six steps [2507.06575]. First, the deep unfolding network produces the rough estimate \(Y_{\textrm{DE}}\). Second, the scene-adaptive spectral response \(\widetilde{\Phi}\) is estimated from \(Y_{\textrm{DE}}\) and the four 10 m Sentinel‑2 bands using nonnegative ridge regression:
\[
\widetilde{\Phi}
:=
\arg\min_{\Phi \ge 0}
\|Y_{\textrm{DE}}-\Phi^T\widetilde{Y}_S\|_F^2
+\eta\|\Phi\|_F^2,
\]
with \(\eta=10^{-4}\). The paper states that the nonnegativity constraint enforces physical meaning, while the ridge term discourages excessive sparsity in the response across bands [2507.06575].

Third, the method instantiates the convex objective using \(Y_{\textrm{DE}}\), the \(Q\) matrix defined from the blur operator, and the estimated \(\widetilde{\Phi}\). Fourth, it applies the spectral–spatial duality theorem to convert the spectral SR problem into the coupled-NMF spatial SR form. Fifth, instead of introducing a new ad hoc optimizer, the paper states that it **calls an existing convex algorithm** for CNMF spatial super-resolution, specifically **COCNMF**, to recover \(A^\star\) and \(S^\star\) [2507.06575]. Sixth, it reconstructs the final AVIRIS-like image via
\[
Y_H^\star := A^\star S^\star \in \mathbb{R}^{172 \times L}.
\]

The paper presents this pipeline as an interpretable composition of three elements: explicit deep-unfolding iterations, a quadratic regularizer with a blur-based \(Q\), and a convex NMF solver with minimum-volume and sparsity penalties [2507.06575]. In that sense, interpretability is tied to modular correspondence between each computational block and a stated optimization component, rather than to post hoc explainability.

## 6. Training protocol, evaluation setup, and reported performance

Two training and evaluation regimes are reported. The first is a simulation study based on **646 AVIRIS tiles of size \(256\times256\)**, retaining **172 bands** after removing absorption channels. Sentinel‑2 observations are simulated by constructing a **\(12\times172\)** spectral response matrix from published central wavelengths and bandwidths, keeping the 10 m bands at full resolution, uniformly blurring the 20 m bands with factor 2, uniformly blurring the 60 m bands with factor 6, and replicating lower-resolution pixels to the 10 m grid. The split is **15:1:1** for train/validation/test [2507.06575].

The second regime uses **526 real AVIRIS/Sentinel‑2 pairs**, cropped to \(256\times256\) after AVIRIS Level‑2 and Sentinel‑2 Level‑2A preprocessing, AVIRIS resampling to 10 m, orientation correction, co-registration via ENVI, and removal of cloud and black-border regions. The split is **8:1:1** [2507.06575].

The deep unfolding network is trained end-to-end on **\(64\times64\)** patches with **batch size 8**, for **30 epochs**, using **20,000 overlapping patches for training+validation** and data augmentation via random flips and rotations. The training loss is the robust \(\ell_1\) loss
\[
\mathcal{L}_{\text{train}}=\|Y_H-Y_{\textrm{DE}}\|_1.
\]
The paper notes that the spectral response \(\Phi\) is known in simulation but estimated by ridge regression on real data [2507.06575].

For comparison, the paper introduces a **divide-and-conquer baseline** based on MST++, splitting the 12 \(\to\) 172 mapping into four disjoint 3 \(\to\) 43 branches and concatenating their outputs. Evaluation uses **PSNR**, **SAM**, **RMSE**, and **SSIM** on four land-cover categories: **coastline/lake**, **mountain**, **farm**, and **city**, with **10 test images per category** [2507.06575].

The reported quantitative results are as follows.

| Category | DAC baseline | COS2A |
|---|---:|---:|
| Coastline/lake | PSNR 27.70, SAM 8.41°, RMSE 0.0264, SSIM 0.9285 | PSNR 35.89, SAM 2.45°, RMSE 0.0080, SSIM 0.9704 |
| Mountain | PSNR 28.29, SAM 4.93°, RMSE 0.0180, SSIM 0.9317 | PSNR 33.23, SAM 2.03°, RMSE 0.0092, SSIM 0.9512 |
| Farm | PSNR 27.10, SAM 9.05°, RMSE 0.0427, SSIM 0.8896 | PSNR 35.07, SAM 2.15°, RMSE 0.0113, SSIM 0.9527 |
| City | PSNR 28.08, SAM 8.47°, RMSE 0.0408, SSIM 0.8230 | PSNR 35.84, SAM 3.38°, RMSE 0.0175, SSIM 0.9209 |
| Overall average | PSNR 27.79, SAM 7.71°, RMSE 0.0320, SSIM 0.8932 | PSNR 35.01, SAM 2.50°, RMSE 0.0115, SSIM 0.9488 |

The runtime reported for a \(256\times256\) image is approximately **0.066 s** for the pure deep DAC baseline and approximately **14.6 s** for COS2A, with the paper attributing the overhead mainly to the convex CNMF stage [2507.06575]. Qualitatively, the paper states that COS2A preserves fine edges and textures more effectively and produces spectral curves for representative pixels that align more closely with AVIRIS references, including subtle NIR structure [2507.06575].

For real Sentinel‑2 \(\to\) AVIRIS validation, the paper introduces an illumination calibration scalar
\[
\gamma^\star := \arg\min_{\gamma \ge 0} \frac{1}{2}\|\gamma \widetilde{x}-y\|_2^2,
\]
where \(\widetilde{x}\) is the 12-dimensional subvector of an AVIRIS pixel aligned to Sentinel‑2 band centers. The reported outcome is that COS2A reconstructions visually and spectrally resemble real AVIRIS observations over coastline, mountain, farm, and city scenes, and in some cases fit Sentinel‑2 samples better than raw AVIRIS because of illumination differences [2507.06575].

## 7. Interpretation, limitations, and related uses

COS2A is presented as an **interpretable hybrid convex/deep method** rather than a purely learned black-box predictor. In the paper’s decomposition, the ADMM-unrolled network corresponds to a rough prior generator, \(Q\) encodes a specific spatial blur model, and the final inference stage is a convex coupled-NMF solver with explicit endmember-volume and abundance-sparsity priors [2507.06575]. This architecture is tailored to the **small-data** setting, where large-scale paired training corpora are unavailable.

Several limitations and assumptions are explicitly stated. The method depends on accurate **co-registration and preprocessing** for real data. Its latent scene model is **linear**, relying on \(Y_H=AS\), linear spectral response estimation, and a **uniform blur** model for the lower-resolution content. The \(Q\) construction uses **\(r=2\)** region-level averaging, which the paper presents as an approximation to the way 20 m and 60 m bands are represented on the 10 m grid, rather than a detailed optical PSF model [2507.06575]. The convex stage is substantially more expensive than a pure deep forward pass, which limits throughput for real-time use. The method is also **sensor specific** in the sense that the reported formulation is tuned to Sentinel‑2 inputs and AVIRIS-like outputs, with scene-adaptive response estimation and training choices calibrated to that pair [2507.06575].

The paper proposes several downstream applications for the reconstructed AVIRIS-like products, including **land cover and material classification**, **vegetation and crop monitoring**, **change detection and anomaly detection**, and **mangrove dynamics and environmental monitoring** [2507.06575]. It also suggests extending the general strategy to other sensor-pair mappings and to more resource-constrained deployment settings [2507.06575]. A plausible implication is that the broader methodological significance of COS2A lies less in any one architectural block than in the combination of three ideas: scene-adaptive deep priors, a blur-structured quadratic regularizer, and an inverse-problem transformation that reuses established coupled-NMF machinery.

A final clarification is useful because of naming ambiguity. The 2016 paper "Computing the Action of Trigonometric and Hyperbolic Matrix Functions" [1607.04012] develops algorithms such as `trigmv` and `trighmv` for matrix-function actions and explicitly does **not** use the label “COS2A.” Accordingly, in current arXiv usage, **COS2A** refers to the Sentinel‑2-to-AVIRIS conversion algorithm of 2025 rather than to any matrix cosine action method [1607.04012].

Source: https://www.emergentmind.com/topics/cos2a-algorithm