Neptune is a real-time artificial intelligence system designed to detect early signs of drowning on beaches. Created by former lifeguards and developed by a team of passionate students, Neptune combines computer vision, prolonged immersion detection, 2D mapping, and audio alerts to assist lifeguards in their vital mission.
In this article, we go back to the origins of Neptune, its core technologies, and its future developments.
Neptune interface in action – Visualization of detected swimmers and real-time mini-map.
Every year, thousands of drownings occur in supervised areas. Despite lifeguards’ vigilance, environmental factors such as crowd density, sunlight reflections, and distractions make it difficult to identify danger. Moreover, it’s nearly impossible for a human to stay fully alert for 8 hours straight.
Neptune was born from a simple observation: just before drowning, most victims exhibit typical behavior. They sink and resurface several times, flailing their arms in a disorganized manner — a pattern known as the “bobbing motion”.
By using AI to detect these early warning signs, Neptune can trigger alerts before it’s too late.
The Neptune system is based on three main modules:
A model based on D-FINE, finely tuned to recognize people in the water, including those partially submerged or far away.
An open-source segmentation model that accurately isolates the sea surface, even under changing light conditions.
This module uses an internally developed algorithm to track each detected person, monitor immersion phases, and trigger an alert if someone remains underwater beyond a critical threshold.
The results are then projected onto a 2D homographic map, allowing lifeguards to locate incidents quickly.
Detecting people at sea is a major technical challenge. Swimmers appear small, are partially submerged, and are affected by distance and light reflections.
To address this, the NHD module was initially built on YOLOv11, a fast object detection model. However, early tests revealed its limitations: trained on urban datasets, YOLOv11 struggled to identify distant or partially submerged silhouettes.
The Neptune team then built a custom dataset from beach footage under various conditions: distances, viewing angles, and lighting. Fine-tuning YOLOv11 on this dataset significantly improved detection performance in aquatic environments.
In March 2025, a new model emerged: D-FINE, recently released as open source. Designed for high-precision object detection, D-FINE quickly outperformed the fine-tuned YOLOv11, especially in visually complex scenes.
After several comparative tests, NHD officially migrated to D-FINE, now serving as Neptune’s primary human detection engine.
YOLOv11 misses several individuals, especially those in the water.
D-FINE detects far more swimmers, even those partially submerged or distant.
In a dynamic environment like the sea, clearly separating water from land is crucial. The NWSD module was designed to segment the sea surface in real time, even with shifting light and wave conditions.
This precise water-plane detection is fundamental to Neptune’s operation: it helps filter out false alerts caused by beach activity and defines danger zones for other modules.
To train this module, the team created a custom dataset of coastal images captured under various weather conditions and at different times of day.
GitHub resource:
Link to the NWSD model on GitHubThe module automatically detects the beach/sea boundary despite reflections and sand variations.
The water surface is correctly segmented, even with obstacles or complex lighting. The presence of an island in the background does not interfere with analysis.
The Neptune Drowning Detection (NDD) module is at the heart of the system’s alert process. Its goal: detect distress situations in real time and trigger an alert before it’s too late.
To achieve this, the team developed a custom algorithm capable of tracking each detected individual in the water using a unique identifier.
This tracking system determines precisely when a person disappears beneath the surface, and for how long. Each individual is assigned a danger score that evolves dynamically based on distance from shore, immersion time, and frequency of disappearance.
When this score crosses a critical threshold, an automatic alert is triggered: a sound signal warns lifeguards while the interface highlights the estimated location of the person in danger.
This mechanism allows abnormal behavior detection without constantly watching the screen, enabling fast response even in complex conditions like crowded beaches or rough seas.
Top: a person detected with a low score (13), no danger. Bottom: the same person disappears for over 10 seconds. The score reaches 77 and triggers the “DANGER” state.
To assist lifeguards, Neptune projects detections onto a 2D top-down map of the beach.
This map is generated in real time using a mathematical method called homography, derived from a fixed camera.
The system automatically detects four anchor points in the image (two on the beach, two on the sea side), requiring no manual calibration. This allows adaptation to tides, weather, and camera angles.
Each detected person is represented by a colored dot (green to red depending on risk), with a short trail showing their recent trajectory.
2D homographic map. Each dot represents a detected individual, color = danger level. ID 10 reaches a high score (33), shown in yellow.
Neptune is not designed to replace humans but to provide them with efficient and discreet assistance:
The team plans real-world testing on supervised beaches. Discussions are underway with several coastal municipalities to evaluate feasibility.
These trials aim to:
Meanwhile, several improvement tracks are in development:
The D-FINE model will be fine-tuned on Neptune’s dedicated dataset to improve NHD precision for partially submerged or distant subjects.
The NDD module will be enhanced with better immersion-phase detection, refined disappearance analysis, and more robust tracking.
Eventually, the team aims to detect complex behavioral patterns such as the bobbing motion for an even more accurate danger score.
Final goal: to deliver a reliable, responsive, and field-tested tool serving those who watch over beach safety.