Manuscript Offprint
arXiv:2611.06230Homology Features for X-Ray Hyperspectral Images Segmentation
ABSTRACT
Characterizing Multi-Energy X-ray Transmission (XRT) hyperspectral images presents significant challenges for traditional classification frameworks due to high-dimensional redundancy and non-linear spectral overlaps. Although manifold learning techniques such as UMAP enhance spectral representation by preserving non-linear correlations, they do not explicitly utilize the geometric structure of the embedded manifold for segmentation. This study introduces a hybrid architecture that integrates topological features derived from persistent homology with convolutional and graph neural networks. The approach computes Vietoris-Rips persistent homology on UMAP-projected superpixel point clouds to capture cyclic structures that encode spectral heterogeneity. These topological descriptors are combined with pixel-level CNN features through a broadcasting mechanism that propagates superpixel-level graph representations to full spatial resolution. Experimental results on XRT multi-energy imagery demonstrate that the proposed hybrid model significantly outperforms both CNN-only and superpixel-pooling fusion baselines, suggesting that topological features provide complementary discriminative information to local spectral-spatial descriptors.
Index Terms— Hyperspectral imaging, X-ray detection, Topology, Manifold learning, Dimensionality reduction, Deep learning, Feature extraction, Computer Vision.
1. INTRODUCTION
Linear projection techniques such as Principal Component Analysis (PCA) [1] do not capture the non-linear geometry of Hyperspectral Images (HSI) [2], and our previous work showed that they also fail to represent the intrinsic geometry of XRT datasets [3]. The Uniform Manifold Approximation and Projection (UMAP) algorithm [4, 5] was shown to improve optical HSI classification over PCA [6], and our previous work established that the manifold underlying XRT data exhibits non-linear correlations that can be characterized through topological approximation [3]. These results indicate
that the topology of the data contains discriminative information that is not captured by standard spectral-spatial feature extractors.
Building upon this foundation, we propose a hybrid architecture that integrates tools from Topological Data Analysis (TDA), specifically persistent homology [7, 8], with Graph Neural Networks (GNNs) [9, 10] and Convolutional Neural Networks (CNNs). The high dimensionality and spectral redundancy of HSI data have motivated a shift from pixel-wise classification to region-based reasoning through graph representations [11]. In this framework, the image is abstracted as a graph where nodes correspond to image regions and edges encode spatial or spectral adjacency. Early approaches constructed graphs at the pixel level, treating each spectral vector as a node and connecting -nearest neighbors in spectral space [12]. While preserving fine-grained spatial resolution, this approach suffers from computational intractability and susceptibility to spectral noise, as the graph connectivity becomes unreliable in high-dimensional, noisy spectral spaces [11]. Graph Convolutional Networks (GCNs) [13] operate on this structure through message-passing mechanisms that propagate information across the graph, enabling the integration of local spectral features with global spatial context.
Computing persistent homology requires a sufficient number of data points to form meaningful topological structures. Operating at the pixel scale is impractical because individual pixels lack adequate spectral information to construct stable persistence diagrams. We therefore adopt a superpixel-based strategy. Following our previous methodology in [3], we first perform a UMAP projection on the image before grouping pixels into perceptually coherent superpixels using Simple Linear Iterative Clustering (SLIC) [14]. Each superpixel's spectral point cloud constitutes an independent metric space on which Vietoris-Rips persistent homology is computed via Ripser [15]. The resulting persistence statistics, combined with spatial descriptors, form node features for a GCN operating on the superpixel adjacency graph. A broadcasting mechanism propagates superpixel-level graph features back to individual pixels, where they are concatenated with pixel-level CNN features for segmentation.
Prior work has integrated topological summaries into machine learning pipelines through persistence images [16],
AUTHOR EMAIL: FETHI.HARKAT@UNIV-GRENOBLE-ALPES.FR landscapes [17], kernel embeddings [18], and direct graph architectures [19, 20]. However, the application of localized persistent homology to superpixel-based representations of hyperspectral data remains unexplored. Furthermore, existing hybrid CNN-GNN frameworks treat the two branches of the two neural networks as independent feature extractors whose outputs are combined only at the final layer, missing opportunities for intermediate information exchange [11, 12]. None of these approaches explicitly incorporate topological features into the GNN branch.
The key contributions of this paper are threefold. First, we demonstrate that persistent homology features computed on UMAP-projected superpixel point clouds provide complementary discriminative signal to standard spectral-spatial descriptors. Second, through systematic ablation, we identify a minimal subset of persistence statistics that optimizes the trade-off between feature dimensionality and segmentation performance. Third, we propose a broadcasting fusion strategy that preserves pixel-level spatial resolution and outperforms superpixel-pooling alternatives by a substantial margin. Experiments on XRT multi-energy imagery validate the proposed framework.
The remainder of this paper is organized as follows. Section 2 details the proposed methodology, including UMAP projection, superpixel segmentation, topological feature extraction, and the hybrid CNN-GNN architecture. Section 3 describes the experimental setup and datasets, then presents quantitative and qualitative results. Section 4 concludes with directions for future work.
2.1. Overview
The proposed framework, illustrated in Fig. 1, consists of four stages. First, raw XRT hyperspectral cubes are projected onto a low-dimensional manifold using UMAP [4], fitted on a sample of training pixels, following the approach in [3]. Second, the projected image is segmented into superpixels. Third, topological and spatial features are extracted from each superpixel's spectral point cloud. Fourth, a dual-branch hybrid architecture fuses pixel-level CNN features with superpixel-level GNN features via a broadcasting mechanism, followed by a final classification layer. The first three stages are preprocessing steps; only the two branches and the classifier are trained. We detail below these different steps.
2.2. Superpixel Segmentation and Graph Construction
Raw ME-XRT images are acquired as three-dimensional cubes of shape , where and denotes spatial dimensions, the detector pixel axis, and the energy band axis [3]. UMAP [4], fitted on a sample of training pixels, projects each pixel's -dimensional spectral signature onto a -dimensional manifold (; here and ),

Fig. 1: Pipeline of the proposed hybrid CNN+GNN method. The CNN branch (bottom) processes the UMAP-projected image at full pixel resolution, while the GNN branch (top) operates on superpixel-level topological and spatial features. A broadcasting mechanism fuses both representations before the final classification layer.
yielding projected images of shape that preserve non-linear spectral correlations.
The UMAP-projected image is then segmented into perceptually coherent superpixels using SLIC [14], operating on the manifold channels. The resulting superpixels form the nodes of a graph , where edges connect spatially adjacent regions. Thus, the graph comprises nodes instead of the original pixels, reducing the spatial complexity from to while preserving spatial coherence. The spectral dimension is embedded in the -dimensional UMAP coordinates and subsequently encoded in the topological descriptors extracted per superpixel.
2.3. Node Feature Extraction
For each superpixel , let denote its UMAP-projected spectral point cloud. Vietoris–Rips persistent homology is computed via Ripser [15], yielding persistence diagrams and . Diagram captures connected components (0-dimensional features), while captures 1-dimensional loops. From these diagrams we extract a pool of 30 candidate topological descriptors.
Topological descriptors (30 candidates). For each birth–death pair in a persistence diagram, the persistence is . Let () denote the number of points in . The -statistics are defined as:
where , and PointsCount = is the 11th feature. The same 11 statistics are computed on (denoted H_0_-*). Additionally, Betti numbers and are recorded at three fixed filtration scales (6 features), and two composite scores (Total_Complexity, Topology_Score) combine multi-scale topological indicators, yielding 30 candidates in total.
Spectral descriptors (25 dimensions). For each UMAP channel (here ), the mean, standard deviation, and quartiles (Q1, Q2, Q3) of pixel intensities within the superpixel are computed, giving dimensions.
Geometric descriptors (5 dimensions). A superpixel is a connected set of pixels; let denote the collection of pixel coordinates belonging to superpixel . From this set we extract area (the pixel count), perimeter, and:
where , are the eigenvalues of the coordinate covariance matrix of the points in , and denotes the convex hull of (the smallest convex polygon containing all pixels of the superpixel). Thus is the area of that convex hull, and the ratio measures boundary regularity (1 for a convex shape, < 1 for irregular boundaries).
Feature vector. Each superpixel node is initially described by a 60-dimensional vector (30 topological + 25 spectral + 5 geometric). The procedure that selects the final 11 topological features retained for the GNN is detailed in the ablation study (Section 3.2).
2.4. Hybrid CNN-GNN Architecture
As shown in Fig. 1, the architecture comprises two parallel branches whose outputs are fused before the final classification layer.
CNN Branch. The UMAP-projected image is processed by a fully convolutional network with no pooling, preserving spatial resolution. The architecture comprises three stages: a convolution expanding the UMAP channels (where is the output dimension of the UMAP reduction from spectral bands) to 32 feature maps; a convolution with a dilation factor of 2, achieving a effective receptive field at 64 channels; and a convolution projecting to 64 output channels. Each convolution is followed by batch normalization, and by a ReLU activation for the first two.
GNN Branch. The superpixel graph is constructed with 41-dimensional node features: 11 topological descriptors derived from persistence statistics (see Section 3.2; maximum, mean, standard deviation, sum, and minimum persistence; mean and maximum birth and death scales; entropy; and point count) combined with 30 spatial descriptors (per-channel spectral statistics and geometric shape features). These node features are processed by a 3-layer GCN [13] (41 64 64 2), with batch normalization, ReLU activation and dropout (p = 0.3) after the first two layers, producing a 2-dimensional output per superpixel that encodes the topological and structural signature of each region. The source code is publicly available .
2.5. Fusion
The CNN branch outputs pixel-level features . To combine these with the GNN's superpixel-level outputs , where the superscript (3) indicates the third (final) GCN layer and is the number of superpixels ( : SLIC is run with 150 target segments and superpixels of fewer than 5 pixels are discarded), we broadcast each superpixel's feature vector to all its constituent pixels. Let map each pixel to its superpixel index. The broadcasted feature map is defined by:
and set to zero for the pixels of discarded superpixels. The GNN output dimension is set to 2, the number of classes (background and target) of the binary segmentation task; these two channels are latent features learned jointly with the final classifier. The CNN and broadcasted GNN features
https://gricad-gitlab.univ-grenoble-alpes.fr/harkatf/homology-features-for-x-ray-hyperspectral-images-segmentation are concatenated channel-wise and classified by a final convolution:
where contains the per-pixel logits of the two classes. The two branches and the final classifier are trained jointly, with gradients flowing through both branches simultaneously, whereas UMAP, SLIC and persistent homology are fixed preprocessing steps (see Fig. 1).
Training We employ weighted cross-entropy at the pixel level to handle class imbalance:
where is the softmax over the two classes, is the ground-truth label of pixel , and the class weights and penalize false negatives on the target class.
3. EXPERIMENTAL SETUP AND RESULTS
3.1. Dataset and Metrics
We evaluate on the cigarette dataset from our prior work [3], consisting of ME-XRT image patches depicting cigarette packs placed over luggage backgrounds, with binary ground-truth masks distinguishing target (cigarette) from background. This dataset is particularly suited for evaluating topological descriptors in XRT imagery because the partial superposition of two distinct materials creates spectral mixing regions at their interfaces, where cyclic structures in the UMAP-projected manifold encode material boundaries. Evaluation uses Accuracy and F1-score [21] at both the pixel and the superpixel level (a superpixel is positive if 70% of its pixels are target).
3.2. Feature Selection and Ablation
The 11 topological descriptors retained in Section 2.3 were selected by ablating the GNN branch in isolation: the CNN branch was disabled during this phase, so the reported scores reflect pure graph-based classification without pixel-level CNN features. We kept the 30 spatial features (25 spectral statistics + 5 geometric descriptors) fixed and progressively added candidate topological features from the pool of 30 defined in Section 2.3, tracking the F1-score [21] on the test set over 10 runs per configuration (the data set is split beforehand into a training and a test set, same as in [3]).
Table 1 reports the results. Topological features alone (30 candidates on raw HSI) yield the lowest performance (F1 = 0.283), because persistent homology is invariant to pixel permutations within a superpixel and thus discards absolute spectral intensities and spatial coordinates. On raw HSI, adding
Table 1: GNN ablation on raw HSI (16 bands) and UMAP-projected data (5 components). F1 (Target) denotes the F1-score on the positive (target) class; OA denotes Overall Accuracy. All scores are obtained with the GNN branch alone (no CNN fusion).
| Input | Node Features | F1 (Target) | OA |
|---|---|---|---|
| Raw HSI | Topo only (30) | ||
| Raw HSI | Spatial only | ||
| Raw HSI | Spatial + 3 Topo | ||
| Raw HSI | Spatial + 11 Topo | ||
| Raw HSI | Spatial + 19 Topo | ||
| Raw HSI | Spatial + 30 Topo | ||
| UMAP | Spatial only | ||
| UMAP | Spatial + 11 Topo |
the 11 selected statistics to the spatial features raises F1 from 0.685 to 0.764, whereas expanding to 19 or 30 topological features degrades it to 0.752 and 0.725, respectively: the additional candidates ( statistics, Betti numbers at fixed scales [7], composite scores) increase node dimensionality from 41 to 60 without yielding extra discriminative power, diluting class-specific signals during graph convolution. The same 11 features bring a similar gain on UMAP-projected data, where F1 rises from 0.778 to 0.823, confirming a significant complementary signal.
This pattern reflects the distinct nature of the descriptors. statistics correlate with superpixel size and density rather than material identity, whereas the selected descriptors quantify non-trivial cyclic structures in the spectral point cloud arising from spectral mixing in heterogeneous regions. The compact 11-feature subset thus captures the essential topological structure without redundant dimensionality. With and without UMAP, Table 1 also compares persistent homology computed directly in the original 16-band spectral space (raw HSI) and in the 5-dimensional UMAP space. The 11 features improve the spatial-only baseline in both spaces (+0.079 in F1 on raw HSI, +0.045 on UMAP), which shows that the cyclic structures they capture are already present in the original spectra and are not created by the embedding. UMAP nevertheless gives the best results, with F1 rising from 0.764 to 0.823 for the same 11-feature configuration: by unfolding the spectral manifold into a lower-dimensional metric space, it removes redundant and noisy dimensions and yields more stable persistence diagrams.
3.3. Hybrid Architecture: Quantitative Results
Table 2 compares the two fusion strategies against CNN-only baselines. The broadcasting hybrid achieves the highest scores across all metrics, surpassing the best CNN baseline by +0.086 in superpixel F1 and +0.070 in pixel F1. Even the pooling hybrid outperforms both CNN variants, though it trails broadcasting by -0.061 in superpixel F1.
Table 2: Hybrid CNN+GNN: fusion strategies vs. CNN baselines.
| Superpixel | Pixel | |||
|---|---|---|---|---|
| Method | Acc. | F1 | Acc. | F1 |
| CNN (Pixel-wise) | 0.9605\n 0.003 | 0.8467\n 0.007 | 0.9433\n 0.004 | 0.8245\n 0.008 |
| CNN (Superpixel-wise) | 0.9387\n 0.005 | 0.8201\n 0.009 | 0.9317\n 0.006 | 0.8144\n 0.009 |
| Hybrid (Pooling) | 0.9589\n 0.003 | 0.8720\n 0.006 | 0.9496\n 0.004 | 0.8569\n 0.007 |
| Hybrid (Broadcasting) | 0.9802\n 0.002 | 0.9329\n 0.003 | 0.9640\n 0.003 | 0.8945\n 0.005 |
These gains show that persistent homology features carry useful information for XRT segmentation. The CNN captures local spectral-spatial patterns in the UMAP embedding, but it does not characterize the global structure of the spectral manifold. The GNN supplies this through statistics that quantify cyclic structures in each superpixel's spectral point cloud. These cycles encode spectral mixing, the patterns that appear when the X-ray beam crosses multiple materials, and are not visible to convolutional filters alone. The hybrid model therefore outperforms both CNN baselines because topological descriptors capture patterns that local features miss.
The gap between broadcasting and pooling comes from spatial resolution. Broadcasting sends each superpixel's topological descriptor to all its pixels, letting the final classifier mix local CNN features with global topological information at full resolution. Under pooling, the CNN map is collapsed to superpixel averages before fusion, destroying fine spatial detail. Broadcasting is also more robust to segmentation errors: a bad superpixel poisons all its pixels under pooling, but under broadcasting the wrong topological vector only affects 2 of the 66 channels, which the CNN can partially correct.
These results extend our previous work [3], which relied on the UMAP projection alone: adding statistics through the GNN branch yields clear further gains, confirming that the topological structure of the spectral manifold carries discriminative information beyond the UMAP coordinates themselves.
Figure 2 supports this: superpixels with high maximum persistence (warm colors) correspond to regions where the spectral point cloud has complex structure, while homogeneous regions show low persistence (cool colors). The topological signal is strongest where spectral mixing is most pronounced.
4. CONCLUSION
This study investigated the integration of persistent homology features into a hybrid CNN-GNN framework for multi-energy XRT hyperspectral image segmentation. Our findings demonstrate that 1-dimensional persistent homology statistics derived from UMAP-projected superpixel point clouds

Fig. 2: maximum persistence per superpixel overlaid on UMAP intensity. Warm colors indicate high persistence in heterogeneous regions; cool colors indicate homogeneous regions.
effectively encode the non-linear structure and spatial complexity of the spectral manifold. In particular, these topological descriptors capture local spectral mixing at material interfaces, providing complementary discriminative information that standard spectral-spatial features miss. Future works may focus on a deeper theoretical and empirical exploration of topological descriptors in X-ray hyperspectral imaging, investigating why persistent homology is particularly suited to modeling material boundaries, extending the framework to complex multi-class scenarios, and exploring adaptive superpixel partitioning strategies.
5. REFERENCES
[1] Ian T. Jolliffe and Jorge Cadima, “Principal component analysis: A review and recent developments,” Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, vol. 374, no. 2065, pp. 20150202, 2016.
[2] Charles M Bachmann, Thomas L Ainsworth, and Robert A Fusina, “Exploiting manifold geometry in hyperspectral imagery,” IEEE Transactions on Geoscience and Remote Sensing, vol. 43, no. 3, pp. 441–454, 2005.
[3] Fethi Harkat, Guillaume Gey, Valérie Perrier, Kévin Polisano, and Tiphaine Debeuret, “Manifold learning for hyperspectral images,” in 2025 15th Workshop on Hyperspectral Imaging and Signal Processing: Evolution in Remote Sensing (WHISPERS). IEEE, 2025, pp. 1–7.
[4] Leland McInnes, John Healy, and James Melville, “Umap: Uniform manifold approximation and projection for dimension reduction,” arXiv preprint arXiv:1802.03426, 2018.
[5] John Healy and Leland McInnes, “Uniform manifold approximation and projection,” Nature Reviews Methods Primers, vol. 4, no. 1, pp. 82, 2024.
[6] Chen Lou, Mohammed AA Al-qaness, Sike Ni, Dalal Al-Alimi, Robertas Damaševićus, and Saeed Hamood Alsamhi, “Hyperspectral image classification using uniform manifold approximation and projection with fusion deep learning network,” Applied Soft Computing, vol. 180, pp. 113371, 2025.
[7] Herbert Edelsbrunner and John Harer, Computational topology: an introduction, American Mathematical Soc., 2010.
[8] Gunnar Carlsson, “Topology and data,” Bulletin of the American Mathematical Society, vol. 46, no. 2, pp. 255–308, 2009.
[9] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and Philip S. Yu, “A comprehensive survey on graph neural networks,” IEEE Transactions on Neural Networks and Learning Systems, vol. 32, no. 1, pp. 4–24, 2020.
[10] Jie Zhou, Ganqu Cui, Shengding Hu, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun, “Graph neural networks: A review of methods and applications,” AI Open, vol. 1, pp. 57–81, 2020.
[11] Qinghui Liu, Liangpei Xiao, Jie Yang, and Zhongyi Wei, “CNN-enhanced graph convolutional network with pixel- and superpixel-level feature fusion for hyperspectral image classification,” IEEE Transactions on Geoscience and Remote Sensing, vol. 59, no. 10, pp. 5966–5978, 2020.
[12] Danfeng Hong, Lianru Gao, Naoto Yokoya, Jing Yao, Jocelyn Chanussot, Qian Du, and Bing Zhang, “Graph convolutional networks for hyperspectral image classification,” IEEE Transactions on Geoscience and Remote Sensing, vol. 59, no. 10, pp. 5966–5978, 2020.
[13] Thomas N. Kipf and Max Welling, “Semi-supervised classification with graph convolutional networks,” in Proceedings of the 5th International Conference on Learning Representations (ICLR), Toulon, France, 2017.
[14] Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine Süsstrunk, “SLIC superpixels compared to state-of-the-art superpixel methods,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 34, no. 11, pp. 2274–2282, 2012.
[15] Ulrich Bauer, “Ripser: Efficient computation of vietoris-rips persistence barcodes,” Journal of Applied and Computational Topology, vol. 5, no. 3, pp. 391–423, 2021.
[16] Henry Adams, Tegan Emerson, Michael Kirby, Rachel Neville, Chris Peterson, Patrick Shipman, Sofya Chepushtanova, Eric Hanson, Francis Motta, and Lori Ziegelmeier, “Persistence images: A stable vector representation of persistent homology,” Journal of Machine Learning Research, vol. 18, no. 8, pp. 1–35, 2017.
[17] Peter Bubenik, “Statistical topological data analysis using persistence landscapes,” Journal of Machine Learning Research, vol. 16, no. 1, pp. 77–102, 2015.
[18] Jan Reininghaus, Stefan Huber, Ulrich Bauer, and Roland Kwitt, “A stable multi-scale kernel for topological machine learning,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Boston, MA, USA, 2015, pp. 3071–3078.
[19] Mathieu Carrière, Theo Lacombe, Martin Glisse, and Steve Oudot, “Perslay: A neural network layer for persistence diagrams and new graph topological signatures,” in Proceedings of the 23rd International Conference on Artificial Intelligence and Statistics (AISTATS), Palermo, Sicily, Italy, 2020, vol. 108 of Proceedings of Machine Learning Research, pp. 2786–2796.
[20] Max Horn, Edward De Brouwer, Michael Moor, Yves Moreau, Bastian Rieck, and Karsten Borgwardt, “Topological graph neural networks,” ICLR 2022, 2022.
[21] D. M. W. Powers, “Evaluation: from precision, recall and F-measure to ROC, informedness, markedness and correlation,” Journal of Machine Learning Technologies, vol. 2, no. 1, pp. 37–63, 2011.