Barcelona promotes the ethical use of artificial intelligence

We present the new “Municipal strategy on algorithms and data to ethically drive artificial intelligence” , the government measure laying down the mechanisms for applying artificial intelligence (AI) to municipal management and services while respecting citizens’ digital rights. Barcelona is thus joining cities such as Amsterdam, New York, Helsinki, Toronto and Seattle in the construction of a human rights-based AI and emerging technology model with a commitment to a democratic digital society.

The strategy provides for the creation of a public register that gives citizens access to all the algorithms affecting people and used by the City Council, in order to make them transparent and subject to scrutiny. It further provides for the establishment of clauses to ensure that any intelligent systems included in municipal tenders respect people’s rights. In addition, an international AI observatory will be established in collaboration with the Barcelona Centre for International Affairs (CIDOB) and within the framework of the Cities Coalition for Digital Rights, a participatory body for the involvement of social agents in the development of ethical AI in the City Council and Barcelona as a whole.



Although we are still very much at an initial stage, pilot tests are already under way which use intelligent systems to make the municipal services more efficient and proactive while taking particular care to protect people’s rights.

Below are a few examples of recent applications of these technologies:

  • Monitoring beach occupancy levels

Thermal cameras monitoring beach occupancy levels made it possible to ensure compliance with the capacity restrictions  in place due to Covid-19 during the summer of 2020.

The privacy of personal data was guaranteed by the system: images were captured on camera every five minutes and sent to a secure server. The server anonymized the image and removed the non-anonymised part. It then processed the image and estimated the total area of sand that is still clear. It did not count the number of people.

The number of people was estimated by processing images and using machine learning to compare the same image when empty and full. If necessary, the server sended an alarm. All the information collected was sent to the monitoring system’s management team, which decided whether or not to close each beach. The information was also sended to the municipal website, where members of the public could check the remaining capacity of each beach in real time.

  • Citizen complaint and suggestion classification support system

IRIS is the service that enables members of the public to report incidents or submit any claims, complaints or suggestions for improvement to the City Council. Any citizen reporting an incident must classify it under one of the categories available in the computer application. This classification is important because it is used to forward the incident directly to the relevant department. Errors in classification result in inadequate responses and delays to the resolution of the incident, affecting the quality of the service.

The classification process is now made simpler by a module called MARIO that is based on machine learning algorithms and natural language processing (one of the technologies developed within the framework of AI). Using an analysis of the free text in which the incident is described, MARIO suggests the most likely categories for the incident to the reporting citizen so that they can choose the best match.

Previously, 50% of communications had to be reassigned. Thanks to MARIO, the success rate is now over 85%.

  • Algorithms in social services

The municipal Social Services deal with an average of 50,000 initial visits every year. These relate to a variety of issues ranging from financial or addiction problems to gender-based violence and are handled by a team of over 700 professionals.

People arriving at the centre are attended to in private booths. The social worker records the conversation and, at the end, writes up the problem and either the help provided or the service to which it has been referred. The City Council conducts thousands of meetings of this type, many of which end up being quite similar due to being based on similar problems.

Now, an algorithm provides staff with digital support in the decision-making process. The algorithm, which has been trained with a corpus of 300,000 interviews, suggests the appropriate resources for each case. In this case, the algorithm is an aid for the decision-making process, but the decision is ultimately made by the professional handling the case.


Municipal strategy on algorithms and data to ethically drive artificial intelligence 


The newsletter The newsletter

Subscribe to our newsletter to keep up to date with Barcelona Digital City's new developments