Habitat classification from ground-level imagery using deep neural networks

Hongrui Shi, Lisa Norton, Lucy Ridding, Simon Rolph, Tom August, Claire M. Wood, Lan Qie, Petra Bosilj, James M. Brown

This paper presents a significant step forward in automated ecological monitoring by shifting the focus from "bird's-eye" satellite views to ground-level perspectives. By combining Vision Transformers (ViTs) with Supervised Contrastive Learning, the researchers developed a system that classifies UK habitats with a level of precision that rivals experienced ecological experts.

TL;DR

Researchers have developed a deep learning framework that classifies 18 different UK habitat types using ground-level photography. By leveraging Vision Transformers and contrastive learning, the model achieves expert-level performance, successfully distinguishing between visually similar environments like different types of grasslands that often baffle standard AI models.

What Problem Does This Paper Address?

Accurate habitat classification is the backbone of biodiversity conservation and policies like the UK’s "Biodiversity Net Gain." Traditionally, this relies on two methods: expensive, slow expert field surveys or remote sensing (satellites/drones).

While remote sensing covers vast areas, it suffers from coarse resolution and weather interference, often missing the fine-grained structural cues—like specific plant compositions—visible only from the ground. However, ground-level imagery is challenging for AI because many habitats look nearly identical (e.g., "Neutral Grassland" vs. "Improved Grassland") and photos often contain "distractors" like field equipment or surveyors. This paper tackles the challenge of making automated, ground-level habitat assessment robust and reliable.

Methods

The authors compared two major deep learning approaches:

  1. Convolutional Neural Networks (CNNs): The industry standard, which focuses on local textures and patterns (locality bias).
  2. Vision Transformers (ViTs): Specifically the Swin Transformer, which uses self-attention mechanisms to capture global context across the entire image.

To improve performance on visually similar classes, they employed Supervised Contrastive Learning (SupCon). Unlike standard training that just tries to predict a label, SupCon forces the model to "pull" images of the same habitat together in a mathematical embedding space while "pushing" different habitats apart. This creates a much more discriminative "map" for the AI to use before it even attempts to classify the image. Finally, they used GradCAM to visualize which parts of an image the model was prioritizing, ensuring it was looking at the vegetation rather than the person holding the camera.

Datasets

The study utilized the UK Countryside Survey (CS) dataset, consisting of 5,598 expert-labeled ground-level images.

  • Classes: 18 broad "Level 3" (L3) habitat types (e.g., Acid Grassland, Calcareous Grassland, Coniferous Woodland, Bog).
  • Hierarchy: Based on the UK Habitat Classification (UKHab) system.
  • Challenge: The dataset is "long-tailed," meaning a few habitats (like Grasslands) have thousands of images, while others (like Urban or Montane) have very few, making it difficult for models to learn the rarer classes.

Key Insights and Ideas

  • Global Context is King: ViTs significantly outperformed CNNs. The authors found that CNNs often got "distracted" by high-contrast local features (like a single tree trunk or a surveyor). ViTs, by contrast, looked at the "big picture," integrating cues from the entire landscape to make a decision.
  • Contrastive Learning Fixes "Visual Confusion": Standard training often fails when two classes look alike. By using SupCon, the researchers reduced misclassification between Improved and Neutral grasslands by 6%. It essentially taught the model to look for the "subtle differences" rather than just the "obvious similarities."
  • AI vs. Expert: In a blind test against three professional ecologists, the best model performed on par with the top human expert. This suggests that automated tools are reaching a level of maturity where they can realistically augment or support professional workloads.

Key Results

  • Top Performance: The Swin Transformer (SwinT-B) with SupCon achieved a Top-1 accuracy of 71.53% and a Top-3 accuracy of 90.92%.
  • Statistical Reliability: The model reached a Matthews Correlation Coefficient (MCC) of 0.677, indicating strong performance even with the highly imbalanced dataset.
  • Interpretability: GradCAM visualizations confirmed that ViTs focus on broad ecological features (like the distribution of shrubs or grass density) rather than irrelevant foreground objects.

Limitations and Future Work

  • The "Rare Class" Problem: The model still struggles with habitats that have very few training samples, such as "Montane" or "Inland Rock."
  • Data Quality: The original photos were taken for plot relocation, not specifically for AI training. The authors suggest that establishing clear photography guidelines (lighting, framing) could further boost accuracy.
  • Beyond 2D Images: Future work aims to incorporate auxiliary metadata—such as soil type, elevation, and seasonality—to help the model distinguish between habitats that might look identical in a single photo but exist in different ecological contexts.
  • Scaling Up: The researchers plan to expand the model to "Level 4" classifications, which involve over 80 much more specific habitat categories.

Summary updated

BibTeX
@article{shi2026habitat,
  author = {Hongrui Shi and Lisa Norton and Lucy Ridding and Simon Rolph and Tom August and Claire M. Wood and Lan Qie and Petra Bosilj and James M. Brown},
  title = {{Habitat classification from ground-level imagery using deep neural networks}},
  journal = {Ecol. Informatics},
  year = {2026},
  doi = {10.1016/j.ecoinf.2026.103751},
}
Figure