Abstract
Standard dimensionality reduction (DR) techniques like t-SNE and UMAP often fail to capture spatial context in high-dimensional images because they treat pixels as independent data points. This paper introduces texture-aware distance metrics that compare spatial neighborhoods (patches) rather than individual pixels. By integrating local texture and spatial context directly into the DR process, the proposed methods produce embeddings that naturally cluster data based on spatial structures, significantly improving performance on synthetic and real-world hyperspectral and biological datasets.
Introduction: The "Bag of Pixels" Problem
In fields such as astronomy, earth observation, and systems biology, researchers frequently work with high-dimensional images where each pixel contains hundreds of channels (e.g., hyperspectral imaging). To visualize this data, researchers typically use dimensionality reduction (DR) tools like t-SNE or UMAP to project pixels into a 2D scatterplot.
However, standard DR algorithms treat images as a "bag of pixels," ignoring spatial layout. For example, a checkerboard pattern of two colors looks identical to solid blocks of those same colors in attribute space. This forces a clunky workflow where researchers must manually map colors back to the image to interpret spatial patterns. This research aims to integrate spatial texture directly into the DR process.
Methodology: Texture-Aware Distance Metrics
The core innovation is swapping standard Euclidean distance for a texture-aware distance metric. Instead of comparing individual pixels, the algorithm compares spatial neighborhoods (e.g., 3x3 or 5x5 patches). Two primary approaches were explored:
- Feature-Based Methods (FBM): Summarize neighborhoods into mathematical features (like local histograms or covariance matrices) before comparison.
- Area-Based Methods (ABM): Treat pixels in a neighborhood as a mini "point cloud" and compare their geometry directly using metrics like the Chamfer Distance.
Spatial weighting, such as a Gaussian blur kernel, is often applied to give pixels closer to the patch center more influence on the distance calculation.
Experimental Results
The proposed methods were tested on synthetic and real-world datasets, including Indian Pines hyperspectral data and lung tissue imaging mass cytometry.
Synthetic Validation
A synthetic 2-channel image was designed with solid blocks and checkerboard patterns. Standard t-SNE failed to distinguish these textures, achieving only a 35.1% k-nearest neighbor (k-NN) hit rate. In contrast, texture-aware methods achieved 78%–80% accuracy, successfully separating identical pixels arranged in different spatial patterns.
Real-World Applications
- Hyperspectral Imaging: Point-cloud-based t-SNE produced cleaner, continuous clusters for agricultural fields and identified narrow dividing aisles missed by standard pixel-wise embeddings.
- Biological Imaging: In lung tissue data, using a 7x7 neighborhood revealed distinct concentric layers of immune cells surrounding granulomas, providing biological insights that were previously muddled.
Conclusion and Future Work
By treating texture as a first-class citizen, DR embeddings naturally group regions with similar spatial structures. While computationally more expensive—particularly for the Chamfer distance and Bhattacharyya distance—these methods eliminate the need for constant cross-referencing between embeddings and original images. Future work includes extending these techniques to unstructured grids and exploring multi-scale neighborhoods.
Summary updated