Untangling urban traffic: when AI observes traffic flows, understands mobility patterns and anticipates them

Original text published on https://wp.unil.ch/geoblog/2024/03/qui-se-deplace-ou-comment-et-quand-le-deep-learning-contribue-a-demeler-lecheveau-du-trafic-urbain/

How can we better understand urban flows in a city in constant motion? Christian Kaiser, a specialist in computational geography at UNIL, uses artificial intelligence to analyze urban mobility based on real-time image data. Through deep learning, mobility behaviors—whether on foot, by bike, or by car—are precisely modeled, providing valuable tools for urban planning. Yet this innovation also raises ethical concerns, which Kaiser addresses carefully in his collaborations with the City of Lausanne and other academic partners.

To study traffic in a city or neighborhood, it’s essential to identify the movements of its many users. To this end, Christian Kaiser deploys cameras at strategic urban locations that transmit live data directly to visualization software—without recording footage, thereby preserving data privacy. Using deep learning, he trains the software to recognize different moving objects such as pedestrians, cyclists, and vehicles. The goal is to achieve accurate object recognition, enabling the distinction of each entity and the analysis of its trajectory or travel time.

This method has significantly improved the recognition capabilities of visualisation software. It is now possible to reliably recognise 90% of objects moving in traffic, compared to 70% initially. Individual movements can therefore be better determined, providing valuable information on the preferred routes or alternatives chosen by different users. In addition, the algorithms also make it possible to group similar movement behaviours (clustering), which are too complex to identify immediately due to the very high number of images to be interpreted.

AI, a significant advance for digital visualisation tools and other developments to come

Although Christian Kaiser does not like the term artificial intelligence (preferring statistical learning), he notes the enormous progress made in the field of digital visualisation. ‘We have moved from shapeless blocks to recognisable structures.’ In addition, the quantity and quality of available data has also improved. For example, it is now possible to discern cycle lanes on satellite images or determine the function of a building based on the comings and goings recorded in its surroundings. Looking ahead, Christian Kaiser sees potential for development in text recognition and the possibility of drawing maps based on written descriptions.

What We Want to Do, What We Can Do, and What We’re Allowed to Do

While the results achieved through machine learning are highly promising, caution is essential in its application. “There’s what we want to do, what we can do, and what we’re allowed to do. Legal frameworks clearly define rules that prevent intrusion into people’s privacy—which is a very good thing.” In the context of urban research based on image recognition and visualization, it is crucial to rely on these frameworks and ensure they are strictly respected.

Leveraging AI for Urban Mobility: Observation as a Planning Tool

Christian Kaiser is contributing to a project funded by Interact, in collaboration with Patrick Rérat (professor at IGD) and Stéphane Bolognini (head of the mobility division for the City of Lausanne). The project aims to analyze cyclist behavior following the introduction of a new traffic rule allowing right turns at certain red lights. Multiple cameras have been installed at intersections—with and without this option—to observe how cyclists respond: do they take advantage of the rule? If so, how? If not, what hesitations or barriers prevent them from doing so? Deep learning is being used to automatically process the data collected by the cameras. In parallel, the CIMA group (focused on wildfire risk management and forest conservation) had developed a highly sophisticated deterministic model, which they wanted to compare with machine learning–based approaches. Both models were tested using 80% of the available data, with projections made on the remaining 20% of independent data. The AI-based model significantly outperformed the more traditional deterministic one. According to Marj Tonini, “the model was ultimately adopted as the standard for wildfire risk mapping at both local and European levels by the CIMA center.


Dr. Christian Kaiser is a lecturer and researcher in computational geography. He uses artificial intelligence to analyse urban mobility flows in real time, in collaboration with the City of Lausanne, in order to improve urban planning and mobility policies.

Faculty of Geosciences and Environment

ck igd (1) cropped