Buoy Detection and Localization
This project aims to develop a two-step system for buoy detection and localization. The first step is to detect buoys in images using a custom fine-tuned YOLOv8 model. The second step is to localize, i.e. get the coordinates of, the detected buoys using triangulation. This model is implemented in a ROS2 node to be used on an autonomous surface vehicle (ASV) for navigation.
First version of our buoy detection and localization approach. While this initial model laid the groundwork, it wasn't yet consistently confident in detecting buoys in images.
Buoy Detection
For buoy detection the YOLOv8 model from the ultralytics framework is fine-tunded on this dataset and on images I collected whenever I saw buoys somewhere. As the model is required to run on a Raspberry Pi 4, the YOLO Nano version has been chosen. It's small size also allows for easy training on a normal computer. The precessing time for one image on the Pi is around 2 seconds.
To reduce the number of false positives, only detections with a confidence score of 0.5 or higher are considered. Using the horizontal center of each bounding box, we get the angle of the corresponding buoy relative to the boat. This angle is then combined with the heading of the boat to get the absolute angle of the buoy.


Buoy Localization
Using the absolute angle to the buoy, a line segment starting at the boat's GPS position is created in the direction of the buoy. Using multiple line segments, from different points of view, the intersections of these lines are calculated to find the location of the buoys. Since we also have lines intersecting at positions where no buoy is, intersections outside a pre-defined area of interest are discarded.
As there is a lot of noise due to sensor inaccuracies, as well as false intersections, we cluster the intersection into an expected number of buoys. The clustering is done using the KMeans algorithm. The centroids of the clusters are then used as the buoy locations. To reduce the uncertainty of the buoy locations, we remove a percentage of intersections that are furthest from the centroid of the cluster and recalculate the centroid which then becomes the final buoy location.