Clear Sky Science · en

Coral morphology detection in underwater imagery using YOLOv12 with CNN and transformer encoder fusion

· Back to index

Why coral shapes matter to all of us

Coral reefs are more than pretty underwater scenery; their shapes help determine how well they protect coasts, shelter marine life, and support fisheries and tourism. Watching how these coral shapes change over time is key to understanding reef health in a warming, more polluted ocean. This study presents a new way to automatically spot different coral growth forms in underwater photos, helping scientists track reef condition faster and more reliably.

Challenges of seeing clearly underwater

Monitoring coral reefs has long relied on divers painstakingly labelling photos by hand, a process that is slow, costly, and influenced by personal judgment. Underwater images are hard for computers to interpret, because light is absorbed and scattered, colors shift, and suspended particles hide fine details. Different coral growth forms such as branching, dome-like, and flat plate-like shapes can look confusingly similar in murky water. Earlier artificial intelligence tools often struggle in these conditions, missing small colonies, mixing up look-alike forms, or running too slowly for real-time use on survey robots.

Figure 1. How AI helps pick out different coral shapes in murky underwater scenes for faster reef monitoring.
Figure 1. How AI helps pick out different coral shapes in murky underwater scenes for faster reef monitoring.

A smarter digital eye for coral reefs

The researchers build on a popular family of fast object detectors known as YOLO, using the latest version, YOLOv12, as the base. They add two complementary components: a type of network that excels at noticing local textures and edges, and another that excels at grasping the broader scene. The first component, a Convolutional Neural Network, picks up fine visual details such as tiny coral branches and surface patterns. The second, called a transformer encoder, looks across the whole image to understand how colonies are arranged and how they stand out from rocks, sand, or algae. A special fusion module then combines these local and global signals so the system can recognize subtle differences between coral shapes.

How the system learns coral shapes

To train and test their model, the team uses a publicly available collection of underwater images that includes several key coral morphologies: branching, massive, and tabular. Images are resized and enhanced, and a variety of color and geometric changes are applied so the model sees many versions of the same scene, mimicking real-world changes in depth, lighting, and water clarity. Inside the detector, features are processed at multiple scales so that both small coral tips and large colonies can be found. The fused information then flows into a detection stage that outputs bounding boxes around coral colonies and assigns each one to a growth-form category.

What the results show

The fused model, called YOLOv12-CT, is tested against a range of well-known detection systems, including earlier YOLO versions, classic deep-learning detectors, and newer transformer-based designs. Across standard measures of performance, such as how many colonies are found, how often labels are correct, and how precisely their outlines are placed, the new method comes out ahead. It achieves a high mean Average Precision at typical evaluation thresholds, outperforming all comparison models while keeping processing times suitable for near real-time use. The system proves especially strong at recognizing flat, plate-like corals, and it substantially improves the detection of more intricate branching forms, which are usually the hardest to distinguish in cloudy water.

Figure 2. How an AI model combines fine coral details and overall scene patterns to sort colonies by their growth shape.
Figure 2. How an AI model combines fine coral details and overall scene patterns to sort colonies by their growth shape.

What this means for reef protection

By more accurately and efficiently identifying how corals are growing, this approach makes it easier to track reef structure, biodiversity, and resilience through time. The method still faces limits, such as imbalances in the training data and the added computing cost of transformer modules, and performance may vary in very harsh or unfamiliar underwater settings. Even so, the study shows that blending detailed texture cues with a wider view of the scene can give marine scientists a powerful new tool for large-scale, automated coral monitoring, supporting better decisions about conservation and restoration.

Citation: Nandal, P., Siwach, M. & Upadhyay, G.M. Coral morphology detection in underwater imagery using YOLOv12 with CNN and transformer encoder fusion. Sci Rep 16, 15426 (2026). https://doi.org/10.1038/s41598-026-42591-z

Keywords: coral morphology, underwater imaging, deep learning, object detection, reef monitoring