AI System Uses Social Media to Predict Train Delays

Marina Castellano, a 24-year-old mathematical data engineering student at Pompeu Fabra University (UPF), has created an artificial intelligence system that identifies train incidents on the Rodalies commuter rail network up to 45 minutes before official alerts are issued. The system monitors user messages on the social media platform X, particularly those shared by passenger advocacy groups like Dignitat a les Vies, to detect early signs of service disruptions. It automatically processes and verifies tweets to extract key details such as the affected line, stations, time of incident, and cause, whether due to technical failure, construction, or industrial action. Between 1 August 2025 and 30 June 2026, the system analysed 65,372 tweets from 120 train stations, identifying 8,383 incident-related messages.


Up to Two Hours' Advantage During Major Disruptions

Castellano’s research compared the timing of user-generated alerts on X with official Rodalies communications from Renfe and Adif. On average, her AI detected incidents 45 minutes earlier. In some cases, such as during a major storm on 20 January 2026, the gap widened to nearly two hours. The system classifies disruptions by cause and verifies reports through cross-referencing multiple user messages, ensuring reliability. Although currently based on historical data, it is designed to operate in real time, processing new messages within seconds.

What I wanted was to reduce the current time lag, and I’ve achieved providing information about 45 minutes earlier on average.

Castellano stated in an interview with 3Catinfo that her goal was to give passengers timely information to make informed decisions, such as whether to wait or seek alternative transport.

Integration into Public Transport App Planned

The project is linked to the UPF’s Rodalinets initiative, which aims to build a citizen-powered information network for public transport. The AI system will eventually be integrated into a mobile app or digital platform accessible to Rodalies users. According to UPF’s Department of Engineering, the tool will not replace official communications but will complement them by harnessing the real-time insights of passengers. The university highlights that social media can serve as a valuable early-warning mechanism for transport operators and users alike. More details on the project are available via UPF's Focus platform.


Primary sources: upf.edu, tfg.esup.upf.edu. Reported by 3cat.cat, en.ara.cat, ara.cat, lavanguardia.com, ACN, 3CatInfo Barcelona.