# A Transformer-Based Feature Segmentation and Region Alignment Method For UAV-View Geo-Localization

Dai, Ming, Hu, Jianhong, Zhuang, Jiedong, Zheng, Enhui · arXiv · 2022-1-23

- **Problem** Drone-to-satellite matching has to cope with position shift and scale change, and CNN features with small effective receptive fields and pooling struggle with both.
- **Method** Splits a transformer feature map into patch regions by mean heat value, then pools each region and aligns corresponding regions across views with classification and triplet losses.
- **Results** Reached 82.25% Recall@1 and 84.82% AP on drone view target localization on University-1652 with k=1.

![Figure 3: The framework of proposed FSRA. The Heatmap Segmentation Module (light green) reorders the heatmap information and evenly divides it into regions acc…](https://refivu.com/papers/40248641-910a-4482-8dee-ddb16d64651d/figures/figure-fc7731775f91e5bb189fe8c77f52af19.png?thumb=512)

**Fig. 3** . The framework of proposed FSRA. The Heatmap Segmentation Module (light green) reorders the heatmap information and evenly divides it into regions according to the distribution of the heatmap to achieve the purpose of segmenting different characteristic content. Heatmap Alignment Branch (light blue) pools the features of each region to obtain feature vectors and performs classiﬁcation supervision on each feature vector. In order to achieve end-to-end learning, TripletLoss is applied to each branch to narrow the distance of the same feature content. FSRA also retains the global branch (light purple) of the transformer-based strong baseline.

[Original paper](https://arxiv.org/abs/2201.09206v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Dai, Ming, Hu, Jianhong, Zhuang, Jiedong, Zheng, Enhui · A Transformer-Based Feature Segmentation and Region Alignment Method For UAV-View Geo-Localization · Original paper figure · Extracted the figure area from page 3 of the original PDF.

## Why drone-satellite matching is hard for CNN features

Cross-view geo-localization asks which image from one view shows the same place as a query image from another view, so it is a retrieval problem across two image sources. Drone frames sit between the two sources: a drone image can be matched to a satellite tile whose GPS coordinates are known, which lets a drone be located or navigated without GPS equipment.

Images from the two sources differ by rotation, scale and offset, so a useful descriptor has to capture global context rather than a few discriminative spots.

The authors attribute the focus of CNN features on small discriminative regions to the Gaussian distribution of effective receptive fields. Pooling and strided convolution lower the resolution, which can erase fine-grained detail that retrieval depends on. In their heatmap comparison, the transformer baseline highlights buildings and roads and ignores trees more clearly than LPN does.

## A transformer baseline with a global class token

The input is split into N fixed-size patches that are flattened into a sequence, and a learnable class token is added to the sequence. The output of the class token after the last layer is the global feature \\(f\\).

Position embeddings are learned during training and cannot be copied from ImageNet pretraining, because the input resolution for the cross-view task differs from classification. The transformer layers keep the sequence dimension, so no down-sampling is needed and every layer attends over the whole image. The baseline uses a Vit-S pretrained on ImageNet with inputs resized to 256×256, and trains with CrossEntropy loss without label smoothing as its ID loss.

## Splitting patches by heat value

The segmentation step asks whether the transformer's own activations separate patches belonging to buildings, roads and trees, so such regions can be cut out without any added supervision. The idea rests on the observation that building patches tend to carry large heat values while trees and background carry small ones, as Fig. 4 shows for a two-region split.

Each patch's heat value is the average of its feature vector, \\(P^c = \\frac{1}{S}\\sum\_{i=1}^{S} M^c\_i\\), where \\(S\\) is the feature length. The outputs for all patches, excluding the class token, come from the transformer forward pass, with \\(L \\in R^{B\\times N\\times S}\\) for batch size \\(B\\), patch count \\(N\\) and feature length \\(S\\). The patches are sorted by heat value in descending order and assigned to \\(n\\) regions.

Each of the first \\(n-1\\) regions gets \\(N\_i = \\lfloor N/n \\rfloor\\) patches, and the last region gets the remainder.

The number of regions \\(n\\) is a hyperparameter, and \\(n = 3\\) gave the best results in the ablations. Because the split follows the heat ranking, the regions adapt to where the transformer places attention rather than to a fixed image layout. Splitting by heat alone does not make the regions correspond across views, which is why the alignment step follows.

## Aligning region vectors across views

Each region's patch features are average-pooled into one vector, \\(V\_i = \\frac{1}{N\_i}\\sum\_{j=1}^{N\_i} f^j\_i\\), where \\(f^j\_i\\) is the feature of the j-th patch in region i. Fig. 5 shows the drone and satellite feature maps split into three regions and the pooled vector of each region.

Each pooled vector goes through a classifier layer with CrossEntropy loss, so every region receives its own classification supervision. Triplet loss is then applied to the region vectors to pull corresponding regions from the two views together. The loss is \\(TL = \\\|d(a,p) - d(a,n) + M\\\|\_+\\) with \\(d(a,x) = \\\|a - x\\\|\_2\\), where \\(\\\|\\cdot\\\|\_+\\) takes \\(\\max(\\cdot,0)\\) and \\(M = 0.3\\) is the margin.

Only pairs from different views enter the loss, since the matching task is across sources and same-view pairs are not compared.

FSRA keeps the global branch of the transformer baseline and adds the segmentation and alignment branches beside it. Each branch is supervised with triplet loss, so the whole model is trained end to end.

## Multiple sampling for scarce satellite images

In University-1652 one satellite image corresponds to 27 drone-view images, so a batch built from one satellite image per class carries far fewer satellite samples than drone samples. The strategy generates k augmented satellite images per class, with augmentations such as random shifting, padding, cutting and colour changes. Alongside them, k images from other views of the same category are drawn.

Sampling lengthens training but leaves inference unchanged. Because k changes only the training set, it affects training time and has no effect at inference.

The authors also connect the gain to the number of positive and negative samples in each TripletLoss batch, since changing k changes that count.

## Mutual learning with KLLoss

The mutual learning term treats the drone-view output and the satellite-view output as two predictions that should agree, and it applies the divergence in both directions. It is \\( \\mathrm{KLLoss} = \\mathrm{KLDiv}(O\_d\\\|O\_s) + \\mathrm{KLDiv}(O\_s\\\|O\_d) \\), where \\(O\_d\\) and \\(O\_s\\) are the drone-view and satellite-view outputs. Each divergence sums over the \\(N\\) classes, with \\(p\\) given as the log of a softmax and \\(q\\) as the softmax itself.

With KLLoss alone, AP increased by 0.84% on drone to satellite and by 1.06% on satellite to drone relative to the 1× baseline row of Table VII. Adding TripletLoss on top of KLLoss did not raise AP significantly, and the authors guess the two losses push the network in the same direction. For that reason the final model uses TripletLoss without KLLoss.

## Results against existing methods

For drone view target localization with k=1, FSRA reached 82.25% Recall@1 and 84.82% AP, against 75.93 Recall@1 and 79.14 AP for LPN in the same comparison. For drone navigation with k=1, FSRA scored 87.87 Recall@1 and 81.53 AP, against 86.45 and 74.79 for LPN. The authors describe the AP margin over LPN on the drone task as about 6%.

With 3× sampling, drone view target localization Recall@1 rose from 82.25% to 84.51% and AP from 84.82% to 86.71%. In drone navigation, Recall@1 rose from 87.87% to 88.45% and AP from 81.53% to 83.37% with the same sampling change. A k=1 model at input size 512 reached 85.50 Recall@1 and 87.53 AP on drone to satellite, and 89.73 and 84.94 on satellite to drone.

All these comparisons train on drone and satellite views only.

## Vit-S versus ResNet backbones

On drone to satellite, the single-branch Vit-S/16 scored 71.04 Recall@1 and 74.62 AP, against 60.93 and 65.31 for ResNet-50 on the same device. Its inference time is 1.21× that of ResNet-50, while ResNet-101 takes 1.48× and Vit-B/16 takes 1.79×.

Vit-B/16 reached 73.32 Recall@1 and 76.88 AP on drone to satellite, against 71.04 and 74.62 for Vit-S/16. The authors attribute the limited gain from the larger model to the data size and describe University-1652 as a 10,000-level dataset that does not suit large transformers.

Heatmaps in Fig. 7 show ResNet-50 focusing on salient spots while the transformer covers wider context.

## Input image size

The input size was varied from 224 to 512 with \\(n = 3\\) and sampling multiplicity \\(k = 1\\). Drone to satellite Recall@1 and AP were 80.81 and 83.65 at size 224, and 85.5 and 87.53 at size 512. The authors note a large AP gain when the size moves from 256 to 320. Larger images need more memory and longer inference time, so the choice depends on the hardware available.

## Number of regions

The default is \\(n = 3\\). At \\(n = 0\\) only the global branch of Vit is used, and at \\(n = 1\\) the feature vectors are globally pooled and concatenated with the global branch. The authors interpret the three regions as buildings, roads and trees, and note that \\(n = 2\\), which separates architecture from background, also performs well.

## Accuracy across drone distances

The dataset was split into Long, Middle and Short distance subsets, and FSRA was evaluated on each for drone to satellite. Recall@1 and AP were 79.71 and 82.69 for Long, 84.05 and 86.36 for Middle, and 82.87 and 85.25 for Short, against 82.25 and 84.82 overall. Accuracy is lowest at long distances. The authors report that LPN has a margin of 20% Recall@1 and 17% AP between Long and Middle.

## Robustness to black and flip padding

Black pad fills a block of width P on the left and crops the same width on the right, while flip pad mirrors a strip of width P from the left side and crops the right side. AP was measured while P increased from 0 to 60 pixels. At pad 0, FSRA reached 84.77 AP and LPN 81.17, and at black pad 60 they fell to 65.76 and 52.09.

With black pad 60, FSRA's AP dropped by 19.01% and LPN's by 29.08%. With flip pad 60, the drops are 26.81% for FSRA and 31.29% for LPN. The authors put the FSRA advantage at about 10 points for black pad and about 4.5 points for flip pad.

The authors attribute the larger flip-pad damage to the mirrored strip adding confusing edge content and an uneven distribution of content. They explain the robustness by the regions being learned from the feature distribution, not drawn at fixed positions, so the split stays patch-level after a shift.

## Sampling multiplicity and batch size

Without TripletLoss, AP and Recall@1 rose and then fell as k increased, with the best value at k = 3. With TripletLoss added, the same rise and fall appeared, again peaking at k = 3. Relative to the 1× TripletLoss row, 2× raised AP by 1.51% and 1.17%, and 3× raised it by 1.86% and 1.85%, on the two tasks.

In the Appendix B sweep at batch size 16, which used classification loss only, the authors conclude that k = 5 is optimal, while k = 3 was optimal at batch size 8. The authors link this to the share of same-class samples in a batch, which affects how effectively the model trains.

The authors suggest that large k overfits, and that a larger share of same-class samples in a batch leaves fewer inter-class differences to learn.

## Qualitative retrieval

For three drone-view queries from the test set, the top five gallery results were, according to the authors, completely correct. For three satellite-view queries in drone navigation, the top five results were also completely correct.

## Limitations

Multiple sampling increases training time, and k affects training time but not inference. Ground-view matching was tested only in Appendix A, where results remain in single digits.

The reported experiments use University-1652 only. The batch-size sweep was run at batch sizes 8 and 16 and used classification loss only. Larger input sizes improve accuracy but need more memory and inference time.

## Paper info

- **Authors**: Dai, Ming, Hu, Jianhong, Zhuang, Jiedong, Zheng, Enhui
- **Venue**: arXiv · Preprint
- **First published**: 2022-1-23
- **Added**: 2026-11-6
- **Updated**: 2022-1-23
- **Version**: v1
- **arXiv**: 2201.09206
- **DOI**: 10.1109/tcsvt.2021.3135013
- **Category**: cs.CV · cs.AI
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2201.09206v1) · [PDF ↗](https://arxiv.org/pdf/2201.09206v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Cross-view geo-localization is a task of matching the same geographic image from different views, e.g., unmanned aerial vehicle (UAV) and satellite. The most difficult challenges are the position shift and the uncertainty of distance and scale. Existing methods are mainly aimed at digging for more comprehensive fine-grained information. However, it underestimates the importance of extracting robust feature representation and the impact of feature alignment. The CNN-based methods have achieved great success in cross-view geo-localization. However it still has some limitations, e.g., it can only extract part of the information in the neighborhood and some scale reduction operations will make some fine-grained information lost. In particular, we introduce a simple and efficient transformer-based structure called Feature Segmentation and Region Alignment (FSRA) to enhance the model's ability to understand contextual information as well as to understand the distribution of instances. Without using additional supervisory information, FSRA divides regions based on the heat distribution of the transformer's feature map, and then aligns multiple specific regions in different views one on one. Finally, FSRA integrates each region into a set of feature representations. The difference is that FSRA does not divide regions manually, but automatically based on the heat distribution of the feature map. So that specific instances can still be divided and aligned when there are significant shifts and scale changes in the image. In addition, a multiple sampling strategy is proposed to overcome the disparity in the number of satellite images and that of images from other sources. Experiments show that the proposed method has superior performance and achieves the state-of-the-art in both tasks of drone view target localization and drone navigation. Code will be released at https://github.com/Dmmm1997/FSRA

## Quote from the paper

Dai, Ming, Hu, Jianhong, Zhuang, Jiedong, Zheng, Enhui (2022). A Transformer-Based Feature Segmentation and Region Alignment Method For UAV-View Geo-Localization. arXiv:2201.09206v1. https://doi.org/10.1109/tcsvt.2021.3135013

**BibTeX**

```
@article{ming2022transformer,
  title = {{A Transformer-Based Feature Segmentation and Region Alignment Method For UAV-View Geo-Localization}},
  author = {Dai, Ming and Hu, Jianhong and Zhuang, Jiedong and Zheng, Enhui},
  year = {2022},
  eprint = {2201.09206},
  archivePrefix = {arXiv},
  doi = {10.1109/tcsvt.2021.3135013},
  url = {https://arxiv.org/abs/2201.09206v1}
}
```

## Other paper commentary

- [RGBT Salient Object Detection: A Large-scale Dataset and Benchmark](https://refivu.com/en/papers/715261f7-1c2d-4aa5-a3d6-104319c9fd28-rgbt-salient-object-detection-a-large-scale-dataset.md)
- [Deep Gradient Learning for Efficient Camouflaged Object Detection](https://refivu.com/en/papers/ab2734b0-aadf-4a7a-9878-ec87828236f4-deep-gradient-learning-for-efficient-camouflaged-object.md)
- [CIFAKE: Image Classification and Explainable Identification of AI-Generated Synthetic Images](https://refivu.com/en/papers/e594d784-9005-4f7c-810b-586b7b9a7338-cifake-image-classification-and-explainable-identification.md)
- [U-shape Transformer for Underwater Image Enhancement](https://refivu.com/en/papers/090ea979-276e-4ff3-b5ba-8d3483b8e2e8-u-shape-transformer-for-underwater-image-enhancement.md)
- [MSRF-Net: A Multi-Scale Residual Fusion Network for Biomedical Image Segmentation](https://refivu.com/en/papers/6a391bec-28c7-48c8-b3ae-92ae5788cd01-msrf-net-a-multi-scale-residual-fusion-network.md)
- [Advanced Steel Microstructural Classification by Deep Learning Methods](https://refivu.com/en/papers/40557ea6-2c03-4d59-8884-5b126f8414d1-advanced-steel-microstructural-classification-by-deep.md)
- [DONeRF: Towards Real-Time Rendering of Compact Neural Radiance Fields using Depth Oracle Networks](https://refivu.com/en/papers/64e1fae7-088c-4eb8-a1a7-e7d4ad65157f-donerf-towards-real-time-rendering-of-compact-neural.md)
- [Kimera: from SLAM to Spatial Perception with 3D Dynamic Scene Graphs](https://refivu.com/en/papers/e204e6b6-1fe3-4011-8543-5c864cd427d9-kimera-from-slam-to-spatial-perception-with-3d.md)
- [Deep Reinforcement Learning framework for Autonomous Driving](https://refivu.com/en/papers/baaead94-eeef-4412-9a69-b14b7ab4fe14-deep-reinforcement-learning-framework-for-autonomous-driving.md)

## Terms in this paper

- [Transformer](https://refivu.com/en/terms/48e8be2570bc-transformer)
- [ResNet-50](https://refivu.com/en/terms/eb2323a60a89-resnet-50)
- [AP](https://refivu.com/en/terms/476f7c8deadf-ap)
- [recall@1](https://refivu.com/en/terms/98de2584e489-recall-1)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/40248641-910a-4482-8dee-ddb16d64651d-a-transformer-based-feature-segmentation-and-region)
