TEFormer: Texture & Edge-Aware Transformer
- The paper introduces TEFormer, a Transformer architecture that integrates explicit statistical texture modeling and edge-aware decoding for precise semantic segmentation in urban imagery.
- Empirical evaluations on datasets like ISPRS Potsdam and Vaihingen show improved performance, with TEFormer achieving up to 88.57% mIoU and enhanced boundary precision.
- Ablation studies confirm that dedicated modules for texture discrimination and edge guidance significantly reduce class confusion and improve mask delineation.
A Texture-Aware and Edge-Guided Transformer (TEFormer) is a neural architecture designed for semantic segmentation in urban remote sensing imagery (URSI), addressing the challenges of ambiguous textures, blurred or irregular boundaries, and overlapping object distributions. TEFormer combines explicit statistical texture modeling with multi-scale edge preservation through a specialized hybrid Transformer framework that integrates novel modules for enhanced feature discrimination and precise mask delineation (Zhou et al., 8 Aug 2025).
1. Motivation and Challenges in Urban Remote Sensing Segmentation
Semantic segmentation of URSI encounters distinct obstacles:
- Texture ambiguity: Urban materials (e.g., pavement vs. rooftops, or dense vs. sparse vegetation) often exhibit globally similar visual patterns at the resolutions typical of modern sensors, resulting in class confusion.
- Blurred and irregular boundaries: Urban scenes contain objects with contiguous, overlapping, or highly intricate outlines, making conventional contour extraction unreliable.
- Multi-scale occlusion and object overlap: Phenomena such as vehicles under tree cover, shadows, and the coexistence of variously sized structures introduce complex spatial relationships and hinder pixel-precise labeling.
TEFormer addresses these via dual mechanisms: explicit texture encoding for global discrimination and edge-aware decoding to maintain boundary fidelity. This design is motivated by the limitations of standard Vision Transformers, which struggle with high-frequency details and local texture cues (Zhou et al., 8 Aug 2025, Azad et al., 2023).
2. Encoder Structure and the Texture-Aware Module (TaM)
The TEFormer encoder comprises four hierarchical Transformer stages. The first two integrate the Texture-Aware Module (TaM) in parallel with convolution-channel-attention (CCAB) and cross-shaped window self-attention (CWSA). Stages three and four employ standard dual-attention Transformers (from D2SFormer), deepening global and local feature reasoning.
TaM operates as follows:
- Quantize-Count-Encode (QCO): Given , QCO quantizes features into levels, counts occurrences, and produces a statistical histogram and per-pixel indicator .
- Level-Attention Update: Attention weights over quantization bins refine the histogram encoding:
- Feature Concatenation: Fused histogram and indicator maps are concatenated with the original feature:
- Multi-scale Re-QCO: is partitioned into four branches, each pooled at a distinct scale, passed through QCO, then upsampled and concatenated.
- Final Texture Feature: Aggregated and fused to output at full resolution.
TaM is injected into the low-level stages to amplify discrimination between visually similar classes via learned global texture signatures. Output is combined with representations from local attention and convolution for subsequent Transformers.
3. Edge-Guided Tri-Branch Decoder (Eg3Head)
The Eg3Head decoder preserves and integrates boundary and texture cues via three parallel branches:
- Edge Branch: Aggregates multi-scale features to predict edge probability maps through spatial downsampling and summation:
followed by convolution to produce 0.
- Detail Branch (DAM): Employs the Detail Analysis Module from PIDNet, splitting features into high-frequency (edge/texture) and low-frequency (context) streams, fusing them via learned gates to yield 1.
- Context Branch (PASPPM): Applies parallel global pooling and atrous convolutions at varying dilation rates, concatenates outputs, and generates spatial attention maps modulating global context:
2
with 3 produced by PASPPM attention.
Each branch isolates a complementary property: boundaries, fine local structure, and global semantic context.
4. Edge-Guided Feature Fusion Module (EgFFM)
EgFFM synthesizes the outputs of Eg3Head by:
- Computing an edge-derived gating map:
4
- Fusing detail and context via gating:
5
- Adding a skip connection from the highest-resolution encoder feature 6.
- Passing through an MLP and softmax for per-pixel semantic class prediction.
This procedure allows boundaries to modulate the contribution of fine details and global context, refining segmentation masks for both precision and smoothness.
5. Training Paradigm and Optimization
TEFormer employs the AdamW optimizer with parameters: learning rate 7, weight decay 8, batch size 9, trained for 0 iterations on 1 random crops.
The loss is a compound of standard multi-class cross-entropy for segmentation and binary cross-entropy for edge map prediction:
- Segmentation loss:
2
- Edge loss:
3
- Complete loss: 4 (with 5 not specified in the source, typically 6).
6. Empirical Performance and Ablation Analysis
TEFormer is evaluated on:
- ISPRS Potsdam (RGB+NIR, 7 tiles): mIoU 8 (mF1 9), superior to D2SFormer by 0 mIoU.
- ISPRS Vaihingen (RGB+NIR, 1 tiles): mIoU 2, highest in comparative study.
- LoveDA (3 patches): mIoU 4; especially robust in urban features (buildings, roads).
Ablation studies confirm:
- Full TaM (QCO + attention) significantly outperforms QCO alone and baseline (Potsdam: baseline 5, QCO 6, +TaM 7).
- Each Eg3Head component (PASPPM, DAM, EgFFM) incrementally adds performance, with the full Eg3Head yielding the highest mIoU.
Qualitative results demonstrate sharper object outlines, reduction in class confusion (especially between cars and trees), and better preservation of small objects.
7. Relation to Broader Context and Methodological Impact
TEFormer’s approach is distinct in combining explicit texture statistics and boundary-aware mechanisms within a unified Transformer framework. The methodology closely parallels observations in Laplacian-Former (Azad et al., 2023), which showed that Vision Transformer models benefit from frequency decomposition (Laplacian pyramids) and dual-attention mechanisms for texture and edge capture. While Laplacian-Former targets medical imaging and emphasizes frequency domain calibration, TEFormer adapts these conceptual underpinnings to urban scenes, demonstrating the versatility and generalizability of dual-path (texture/edge) attention architectures.
Core contributions are:
- The Texture-Aware Module (TaM), establishing global statistical descriptors for material discrimination.
- The Edge-Guided Tri-Branch Decoder, structurally segregating edge, detail, and context processing.
- Edge-Guided Feature Fusion, providing a principled, learnable strategy for integrating boundaries and global cues.
A plausible implication is that such architectural motifs—explicit global texture modeling and tight boundary integration—could be beneficial in other dense prediction tasks where edge preservation and fine-grained texture differentiation are critical.