Six seconds a photo: the Balearic AI that traces the shoreline in beachgoers' snaps
SOCIB and the University of the Balearic Islands' AI institute have released open-source software that finds the waterline in phone photos with around 70% less error than standard automatic methods.

At s'Amarador beach, in the Mallorcan municipality of Santanyí, a fixed cradle invites anyone with a phone to rest it in place, take a picture of the sand and send it in. Since 2022 those snapshots have flowed to the Balearic Islands Coastal Observing and Forecasting System (SOCIB) in Palma, where each one had to be marked by hand to show where the beach ends and the sea begins. A computer program now does that job in about six seconds per photo.
The tool, called SOCIB Shoreline extraction, was built by SOCIB together with the Artificial Intelligence Research Institute (IAIB) of the University of the Balearic Islands (UIB). The study behind it appeared in the journal Environmental Modelling & Software, and the university announced it on 10 November. The code is open source, so any town hall, university or residents' group can use it.
- The software finds the shoreline in phone pictures taken by members of the public from fixed viewpoints.
- It cuts the error by around 70% compared with conventional automatic methods.
- It needs about six seconds per image on an ordinary computer and under one second with a graphics card.
- SOCIB plans ten new stations across Mallorca, Menorca and Ibiza.
A holiday snap turned into scientific data
The idea did not start in Mallorca. In May 2017, coastal engineer Mitchell Harley of the Water Research Laboratory at the University of New South Wales installed the first CoastSnap cradle at Manly Beach in Sydney: a bracket fixed to the ground that forces every photographer to frame the scene in exactly the same way. Passers-by slot in their phone, shoot, and either post the image on social media with a set hashtag or email it to the research team.
Because the viewpoint never changes, pictures from different days can be laid on top of one another. Strung together, they become a film of the waterline creeping forward or pulling back after each storm.
It worked better than its creators expected. In a first seven-month trial, almost 1,000 people uploaded more than 2,500 images, the Australian publication iTnews reported in 2019. Engineers found the results were nearly as accurate as those from professional survey equipment, even when the photos themselves were of modest quality. By 2024 the network counted 350 stations in 30 countries; in March 2025 the university was already citing more than 600 stations and over 100,000 photos gathered since 2017.
Over time we've gotten this incredible record of changes, all crowdsourced from the community.
Mitchell Harley, University of New South Wales
Spain joined in 2018 with a station on the Cíes Islands, run by the University of Vigo. Today the CoastSnap Spain network has about twenty points spread across Galicia, Cádiz, Huelva, Catalonia, the Valencia region and the Canary Islands, with the universities of Cádiz, Seville and Las Palmas de Gran Canaria and the Spanish National Research Council's Institute of Marine Sciences among the partners. In the Balearics, both cradles belong to SOCIB: one at s'Amarador and one at s'Arenal d'en Tem, in Campos, next to the long beach of es Trenc.

The bottleneck was back at the office
Collecting the photos turned out to be the easy part. The hard part came afterwards. Turning each image into usable data means tracing the exact boundary between dry sand and water, and that boundary is deceptive. Sunlight glints off the surface, clouds cast shadows, wet sand darkens until it looks like sea, and in autumn the waterline fills with dead Posidonia seagrass. Classic automatic programs, which look for sharp changes in colour or brightness, stumble over all of it.
The reliable alternative was manual tracing by specialists, which is slow. With two cradles the workload was manageable. With twelve, as SOCIB now plans, it would be a different matter.
The team, led by Josep Oliver-Sansó, a data scientist at SOCIB, and including Jesús Soriano-González, Javier Varona, Gabriel Moyà-Alcover and Elena Sánchez-García, chose to train neural networks on real photographs. They assembled 1,717 images from five beaches on the Atlantic and the Mediterranean and pitted four deep-learning models against each other.
DeepLabV3 came out on top. It is an image-segmentation architecture that judges each pixel in the light of what surrounds it rather than in isolation. That wider view lets it tell a reflection from a wave, or a patch of damp sand from a tongue of water, and cope with flooded areas or stretches covered in plant debris, according to the UIB's announcement.
Automating this process makes it possible to turn thousands of citizen photographs into useful information.
Josep Oliver-Sansó, data scientist at SOCIB
What the numbers show
Across the whole study, the error fell by about 70% compared with conventional automatic methods. On the two Mallorcan beaches, the average gap between the line drawn by the machine and the one drawn by a specialist was 2.6 metres at s'Arenal d'en Tem and 3.4 metres at s'Amarador.
A margin of two or three metres is small next to the distance a shoreline can shift after a storm, and it comes without sending anyone onto the sand with a GPS unit.
Speed is the other half of the story. On an office computer the program handles each image in roughly six seconds; with a graphics card, in less than one. A whole season of photos from one station can therefore be processed in minutes, and the system can grow without the staff having to grow with it.
SOCIB has published the tool on two European open-science platforms. One is iMagine, an EU-funded project worth €4.5 million that ran from September 2022 to August 2025 under the coordination of the Dutch EGI Foundation, bringing together AI-based image-analysis services for water sciences. The other is AI4EOSC, a federated cloud funded by Horizon Europe for training and deploying machine-learning models, with computing resources in Spain, Portugal, Slovakia, Poland and Turkey and with the Institute of Physics of Cantabria (CSIC–University of Cantabria) among its participants.
Being open has practical consequences. Any other CoastSnap node, in Vigo or at Las Canteras in Gran Canaria, can plug it into its own monitoring without paying for a licence.

Why the Balearics need to watch their sand every week
In the Balearic Islands, beaches are an economic asset, a natural buffer against waves and a protected landscape all at once. And they are getting narrower.
The 2021 Balearic Sea Report, produced by the regional government and the Marilles Foundation with input from 30 institutions and 98 people, noted that sea level in the western Mediterranean has risen by an average of 1.32 millimetres a year over 134 years, and that the pace has quickened to about 3 millimetres a year over the past four decades. With a rise of 57 to 75 centimetres by the end of the century, the islands' beaches could retreat by between 7 and 50 metres.
A study by the Balearic Oceanographic Centre, reported in 2024 by the newspaper Menorca, counted 870 beaches in the archipelago and estimated that 185 could vanish for good by 2100 unless emissions are curbed, while the rest would lose about half their area on average. Researcher Biel Jordà explained at the time that each beach's shape and how built-up it is matter as much as the sea itself.
Coastal engineers work with a simple and sobering rule. Raúl Medina, director of the Environmental Hydraulics Institute of Cantabria, reminded the EFE news agency this year, in remarks carried by Canarias7, that a beach retreats roughly one metre for every centimetre the sea rises.
Against those projections, the practical problem is knowing what is happening now, beach by beach. Satellites help but offer less detail. Topographic surveys are precise but expensive and infrequent. Citizen photos fill the gap: they arrive often, cost nothing and, as the UIB points out, offer far greater spatial resolution than an image taken from orbit.
Two protected beaches as a test bed
The two Mallorcan stations were not picked at random. S'Amarador lies inside Mondragó Natural Park, declared in 1992 and covering about 766 hectares on the island's south-east coast, 95 of them publicly owned. The park's official page highlights the dune system at s'Amarador.
S'Arenal d'en Tem is in Campos, next to es Trenc, inside the es Trenc–Salobrar de Campos Land and Marine Natural Park, created by a regional law in 2017. That the same program performs well both in an enclosed cove and on an open stretch of sand bodes well for rolling it out across the islands.

Next: ten more cradles
SOCIB intends to install ten new stations, potentially three in Menorca, four in Ibiza and three in Mallorca, funded by a regional government grant, according to the UIB and the Mallorca daily Última Hora. In June, the outlet Mallorca Informa ran a headline saying the regional executive was giving SOCIB €440,000 for a beach-monitoring network. Neither the university nor the centre has yet given exact locations or a timetable.
With twelve stations and thousands of photos a year, manual analysis would have been unworkable. With the automatic program, every image sent in by a beachgoer becomes one more point in a time series. According to SOCIB, that information feeds into planning for climate adaptation along the coast.
It fits into work SOCIB has been doing for years. The Palma-based centre has been operational since 2013 and is funded in equal parts by Spain's central government and the Balearic government, according to the Spanish Science Ministry. It runs an oceanographic catamaran, high-frequency radars, autonomous underwater vehicles, buoys and Argo profiling floats. In 2018 it signed an agreement with the regional government for the Coasts for Change project, which, with researchers from the UIB and the IMEDEA institute, assessed flood risk on the islands' sandy beaches and produced a public map viewer of sea-level rise.
Elsewhere in Spain, coastal conservation is also producing measurable results. In Galicia, 200 Kentish plovers rescued from the tide are back on the beaches, and in Murcia the Mar Menor has recovered 175 hectares of seagrass. Citizen science has its own precedents, too: in Colombia, an Instagram post led botanists to a new giant waterlily. And beneath the sea off Lanzarote, a volcanic tunnel has just joined the world list of geological heritage sites, another reminder of how much of Spain's coast is still being measured.
What still needs solving
Questions remain. Five training beaches are a limited sample, and accuracy on coves with cliffs, harbours or crowded waterlines will have to be checked at the new stations. Nor does everything depend on technology: if nobody takes pictures there is no data, and the cradles need signs and upkeep.
There is a deeper limit as well. Knowing precisely how far a beach is retreating does not protect it on its own. Decisions about planning, access or sand replenishment still rest with public authorities, and in the Balearics that means town halls, the island councils, the regional government and Spain's state coastal authority. What changes is that those decisions can rest on up-to-date data rather than on a survey from five years ago.
The fact you might not know
In the first Australian CoastSnap trial, which lasted seven months, some beaches close to one another behaved in opposite ways: at certain spots the shoreline swung by as much as 50 metres, while a short distance away the sand barely moved. It was proof that every beach has to be watched separately, and often. That is exactly the job the SOCIB and UIB program can now do in six seconds a photo.
Further reading
- UIB announcement of the tool (in Catalan)
- Scientific paper in Environmental Modelling & Software
- The CoastSnap network in Spain, with all its stations
- The CoastSnap story, told by the University of New South Wales
- Coasts for Change, the Balearic government and SOCIB coastal-risk project (in Spanish)
- Mondragó Natural Park, official page (in Spanish)
Go further
- Web · Diari de la UIBDel mòbil a la gestió costanera: el SOCIB i l'IAIB creen una eina d'IA que identifica la línia de costa en segons
La nota original de la universidad, con la referencia completa del estudio y los datos de precisión.
- Web · Oliver-Sansó et al., Environmental Modelling & SoftwareAutomating shoreline extraction from beach imaging systems for coastal monitoring
El artículo científico, para quien quiera ver cómo se compararon los cuatro modelos.
- Web · CoastSnapCoastSnap Spain
Mapa de las estaciones españolas: si vas a una de esas playas, puedes aportar tu propia foto.
- Blog · UNSW SydneyCapturing change with CoastSnap
Cómo nació la idea en Manly Beach en 2017 y cómo llegó a cientos de playas.
- Podcast · Yachting ChannelThe Balearic Yacht Show: SOCIB
Entrevista en inglés con Joaquín Tintoré, director del SOCIB, sobre qué mide el centro y para qué.
- Web · Govern de les Illes Balears y SOCIBCostas por el Cambio
El proyecto que estudió el riesgo de inundación de las playas baleares, con visor de subida del nivel del mar.
- Web · AI4EOSCAI4EOSC: a Federated Cloud Platform for Artificial Intelligence in Scientific Research
Explica la plataforma europea abierta donde está publicada la herramienta del SOCIB.
Sources
- Diari de la UIB: el SOCIB i l'IAIB creen una eina d'IA que identifica la línia de costa en segons
- Automating shoreline extraction from beach imaging systems for coastal monitoring (Environmental Modelling & Software)
- Última Hora: Seguimiento de la evolución de las playas a través de las fotos de los ciudadanos
- Gaceta Náutica: Una IA identifica la línea de costa en fotos móviles
- IyMagazine: El SOCIB y la UIB crean una IA que detecta la línea de costa en segundos