Skip to main content
Brain4it is an open source platform to develop artificial intelligence applications for the Internet of things.
Owner
Ajuntament de Sant Feliu de Llobregat
Local Authority
Contact information

Brain4it (http://brain4it.org) is an open source platform developed by the City Council of Sant Feliu de Llobregat to manage and monitor the Smart City’s infrastructure, which is called City Operating System (City-Os), as well as to develop expert systems and other artificial intelligence applications.

Sant Feliu de Llobregat is a mid-sized city with a population of 45.218 persons (by March 2019) and a total surface area of 11,79 square km, located in Catalonia, Spain, in the Metropolitan Area of Barcelona (about 10 km from Barcelona). Besides, it is the capital of the county of Baix Llobregat. The City Council’s annual budget for 2019 is 44,4 M€ (7M€ of Capital Budget) and it has 330 employees.

It is a city that stands out for innovation and for its strategy to become an engine for the development of its territory, enhancing the quality and performance of urban services, sharing information with citizens and increasing citizen engagement. The scope is to make the city more liveable, resilient and better able to address the complex challenges facing society today, such as the Sustainable Development Goals proposed in the UN Agenda 2030. This strategy has led the City Council to win several awards in Spain.

The incorporation of new generations of technologies and methodologies (Big Data, Data Warehouse, Business Intelligence, BIM), which allow more and better capacities for data capture, processing and storage, have enabled the City Council to intervene in the functioning of the city in a smart way, to offer better services to citizens, and to optimise internal processes.

All of these infrastructures and technologies are integrated within the city operating system (City-Os), a platform based on open-code Big Data technology, and managed by Brain4it.

 

Brain4it is an open source platform to develop artificial intelligence applications for the Internet of things.

Brain4it is an open source software, an expert system,  designed by the City Council of Sant Feliu de Llobregat to automate the City-Os infrastructures management, as well as to develop other artificial intelligence (AI) applications for the Internet of Things. It runs as a network service that provides a REST API (Representational State Transfer Application Programming Interface) which allows to control and program the City-Os platform remotely using a functional language that facilitates the implementation of expert systems and machine learning applications. Likewise, it develops all those use cases that a Smart City may need, managing security, data governance and with a modular and adaptable orientation.

Brain4it has been developed to take on the new challenges of a Smart City, and more specifically for the management of dynamic environments where flexibility and adaptability are essential requirements.

It is an open source software and can be installed on a wide range of devices, from smartphones and embedded systems to cloud servers. This characteristic expands its possibilities and use cases.

Besides, Brain4it has proved its value in multiple areas such as smart cities, domotics, robotics, IT infrastructure management and mathematics. Some concrete applications carried out in the city of Sant Feliu with the use of this software are: (a) control of the lighting in public buildings, (b) management of energy efficiency for equipments, (c) monitoring of air quality, and (d) control of vehicle traffic.

Among its key features are:

  • Smart: designed to implement artificial intelligence applications like expert systems.
  • Efficient: it can be installed on devices with scarce resources (memory and CPU).
  • Portable: developed in Java to facilitate the porting to multiple devices (PCs, RaspberryPi, Android, etc.).
  • Universal: Brain4it allows you to program different devices using the same language.
  • Remote control: Brain4it devices can be remotely controlled and programmed through a HTTP REST API.
  • Dynamic: changes in code can be applied immediately without service interruption.
  • Interoperable: is able to interact with other systems through HTTP, MQTT, XMPP and other protocols.
  • Extensible: Brain4it language can be easily extended with new functions to satisfy future needs.
  • Hardware access: it can directly access the hardware resources of the device (GPIO pins, sensors, serial ports, etc.)
  • Tools availability: programming and control tools are available for the desktop, mobile and web environments.
  • Open source: offered with EULA and LGPL licenses.

 

Key words of project

City-Os, expert system, Open source, Artificial intelligence, Internet of things, Smart Cities, domotics, robotics, IT infrastructures, REST API.

Background: grounds/ reasons for the project idea, challenges the project aimed to overcome or improve, how did the project address real needs)

In 2017 the City Council of Sant Feliu de Llobregat launched an ambitious plan for Digital Transformation that articulates the policies and actions to undertake in order to digitalise the administration and transform it into an engine for the economic, productive, social, democratic and cultural development of the territory.

This strategy marks a series of objectives to adapt in an agile way to the new demands of a changing context, providing trusted and secure information and digital services for any time and place, through multiple channels. In addition, it has the goal to generate new forms of relationship with citizens, so that they can participate in the definition and design of municipal policies and public services.

The strategic objectives of the Digital Transformation Strategy are: (a) to transform the productive structure of the organization and facilitate cultural change; (b) to develop Intelligent Governance; (c) to foster the Open Government Strategy; (d) to create an innovative and efficient service supply for citizens; (e) to deploy a new model of comprehensive and quality care for citizens and businesses.

The achievement of the previously identified strategic objectives is articulated in four axes of action: 1) Digital Administration; 2) Digital services, inclusive and innovative; 3) Relational framework with citizens and companies; 4) Technologies and tools for digital transformation.

In what regards Strategic Objective (b), "to Develop Smart Governance", the City Council aims to achieve greater efficiency in internal processes by digitalising internal procedures and key management areas of the municipal administration, as well as guaranteeing that the city has the digital infrastructures required for the intelligent management of the territory. Such infrastructures are:

  • The telecommunications infrastructures that allow collecting and transferring data and information from multiple sources scattered throughout the territory from both public and private sources;
  • The technologies and tools that enable to storage, manage and publish large amounts of information (Big Data, Open Data, Indicators...);
  • The systems of analysis, simulation, aggregation, mining and action of these data to convert them into information and knowledge (Data Warehouse, Business Intelligence, Facility Management, Prediction, Remote Management and control...);
  • The solutions that ensure the interoperability between the different management systems of the public organizations, external agencies and private stakeholders with information on the city, in order to provide services such as transport, energy, environment, weather information, etc.

In order to integrate all of these infrastructures it has been necessary to implement the City Operating Platform (City-Os) and to develop the expert system Brain4it to manage and control –also remotely–, these infrastructures using a simple functional language.

This expert system have made possible to have a unified point of access to data and to develop all the Smart City use cases, managing security and data governance with a modular and adaptable orientation. In fact, while being the brain of the system, Brain4it  also facilitates the implementation of other expert systems and machine learning applications.

General and Specific Objectives

  • What problem is our solution solving?

The general purpose of the project was to implement an expert system to automate the management of the Smart City infrastructure (City-Os). A secondary, more specific, objective was to create a system that would be useful to develop other artificial intelligence (AI) applications for the Internet of things.

The project was designed to fulfil these objectives while achieving a set of desirable requirements:

  • To be quickly and flexibly.
  • To become a generic tool, reusable in different scenarios.
  • To interoperate with multi-sensory platforms: e.g. Sentilo, Fi-ware.
  • To allow integration with portable devices embedded, such as Raspberry-pi,, enabling Brain4it to be used used as an integrator of sensors and actuators on the Sentilo’s platform.
  • To be programmable in a functional and easy-to-learn simple language, powerful enough to implement complex algorithms of artificial intelligence, fuzzy logic, learning, etc.
  • To be programmable remotely through an interface HTTP / REST.
  • To have Web tools, java and mobile availability, in order  to program expert system rules and interact with them.

Implementation

In 2014 Sant Feliu de Llobregat City Council defined the technology model to implement a smart city unique cross-platform, unificate sensors protocols, and (tele)manage services such as: lighting, irrigation, waste management and route optimization, mobility control, management alerts and municipal database integration.

Thus, it was decided to develop and implement an expert system to automate the infrastructure management of the city, which was called Brain4it.

It allows to interoperate with City-OS and other platforms such as Matrix (the Document Management System) and Sentilo sensors actuators platform, with Geographic Information Systems, with Communication and Monitoring Services, as well as Social Networks.

It had been also necessary to involve the technology providers in order to adapt Brain4it to the requirements of the IT solutions that would have to interact with it. This involvement reached also third parties such as private companies that provide public services.

It had been also necessary to develop Brain4it libraries to support the protocols and technologies used by IT solutions from companies that provide public services.

The figure showing Brain4it’s architecture is available at: http://brain4it.org/images/arch.svg

The Brain4it server is a software that can run on a wide variety of devices like computers, smartphones, raspberry robots, etc. It implements the logic that make these devices behave smartly. That logic is programmed in BPL (Brain4it Programming Language), a simple but powerful language specially designed to develop expert systems and other AI applications. It runs on top of a Java VM and has access to: External services like messaging systems, sensor/actuator platforms, web services, etc.; hardware resources of the device like GPIO (General Purpose Input Output) pins, sensors, serial ports, camera, audio, screen, etc., and other Brain4it servers.

The Brain4it manager is the program that allows the user to interact with the server. It has tools to program the server logic and control its operation through the HTTP REST API. There are 3 manager apps available: for desktop computers, Android devices and web browsers.

Third party applications can also communicate with the server through the same HTTP REST API to read or write information or to invoke a module function.

The server

The server is the "brain" of the device. It is organized in modules that implement specific tasks and do not share data with others (a figure of the server is available at: http://brain4it.org/images/server_components.svg).

Internally, the server has 3 components:

  • The RestService implements a simple HTTP REST interface to read and write module data, invoke functions and manage the server modules.
  • The ModuleManager performs all the module management operations (list, create, load, save, destroy, start and stop modules). Some of these operations are exposed through the REST API while others can be invoked through the functions of the Module library. The ModuleManager also manages the libraries that are loaded at server startup. Each library contains a set of built-in functions which allow to perform different tasks.
  • The Store is responsible of saving the module snapshots in persistent storage. The default implementation saves these snapshots in the underlying filesystem.

Currently, there are five versions of the Brain4it server:

  • Standalone server: It is a lightweight server implementation intended for devices with few resources;
  • Server for web containers (J2EE): It is a server implementation designed to run in a J2EE web container like Tomcat or Jetty;
  • Raspberry server: Based on the standalone server, it incorporates functions to access the Raspberry Pi hardware (GPIO pins, serial ports, etc...);
  • Android server: Also based on the standalone server, it offers functions to access the Android device hardware and software resources (sensors, GPS, text to speech, etc.);
  • Swing server: It is a standalone server with a screen attached to it where you can draw graphic primitives, text and images. This server is typically used as a smart information point.
The manager

The manager is an application that allows the user to program and control the Brain4it server remotely through its HTTP REST API (a screenshot of the manager application can be found at: http://brain4it.org/images/manager_screenshot_s1.png).

The are currently 3 available versions of the manager application:

  • Desktop: Java swing application for desktop computers running on Windows, Linux or MacOS.
  • Android: Native Android application for Android 4.1 and above.
  • Web: HTML5 responsive application that can run on all devices.

All these managers offer the following tools:

  • Workspace manager: allows to setup a group of servers and manage its modules.
  • Console: interactive console to execute commands in a module.
  • Editor: smart text editor to program code or edit data.
  • Dashboard: control panel with buttons, leds, gauges and other widgets to send orders to the server and monitor its internal state.

In addition to these tools, the Desktop version also incorporates the Dashboard designer, which is a visual tool to create control panels in few minutes.

Input/ resources utilized/ allocated

Five years ago, Brain4it started as a small project for controlling devices for the Internet of Things and has evolved into a general purpose platform to develop AI applications.

The last effort was focused on the development of new libraries to widen the functionalities of Brain4it, as well as on the incorporation of new types of widgets to enrich the dashboard possibilities. 

The Brain4it tools implementation and the documentation website (http://brain4it.org) were made by two municipal workers who have dedicated more than 1.000 hours of work to this task.

Most important innovative features according to the applicant's point of view

  • What is innovative about your solution?

Unlike other similar platforms, Brain4it is designed to facilitate the development of complex smart applications like expert systems and neural networks, combining a set of features not available simultaneously in other competitor tools:

  • Artificial Intelligence oriented management for the IoT
  • Remote control and programming
  • Flexibility and dynamism (code changes can be done without service interruption)
  • High interconnectivity (it supports multiple network protocols and can access hardware directly)
  • Creation of dashboards/control panels with a WYSIWYG visual tool
  • Multi-platform (available for desktop, web and mobile environments)

Brain4it can be used in multiple scenarios:

1) AI as a service: When Brain4it runs in the cloud it works as an AI service capable of acting on other platforms and connected devices. It supports multiple connectivity protocols to enable communication with sensor/actuator platforms, messaging systems, databases and web services. It also provides libraries for natural language processing, computer vision and predictive data analysis. The processing results can be monitored at real time through dashboard panels.

2) Embedded controller: Brain4it is suitable to locally control devices such as GPIO pins, sensors, camera, GPS, and serial ports, avoiding latency, reliability and security problems usually related to remote controlling.

It can directly and remotely control robots, drones, routers, sensor boxes, weather stations, industrial PCs, and any other embedded device running a OS supporting Java (like Raspberry Pi, Banana Pi, ARM boards, etc.).

3) Mobile management: Brain4it provides a native manager application for mobile devices running Android and a responsive web version for iOS and other mobile platforms, which allow to monitor, control and programme Brain4it servers from anywhere. For example, the City Council workers, through a single app can monitor the sensors of the city and control the lights and the air conditioners of the City Hall buildings.

Stakeholder Involvement

The stakeholders were easily involved and seduced with Brain4it applications that reduce costs, improve system efficiency or satisfy their personal needs. There are multiple examples of that:

  • A Brain4it module that automatically switches off the air conditioner in a meeting room when there is no event scheduled in it.
  • A Brain4it application to control the lighting of a room depending on the number of people present and the ambient brightness.
  • A Brain4it panel to remotely start the air conditioning so that when the personnel arrives at the office, this is already heated.

Some of the stakeholders that have been involved are: municipal employees that work on the territory, politicians that use Brain4it to remotely control the lightning o air conditioning of their rooms, and private companies such IOTIP, who have use Brain4it to quickly integrate electricity meters in the Sentilo platform.

Results

Prior evaluations have demonstrated the viability of the tool and its possibilities. Among the milestones achieved, it has proven its usefulness to automate the management of a Smart City infrastructure (with Sentilo, Fi-ware or directly accessing sensors) keeping very low development costs. Therefore,  it focuses on the effort of creating the rules of the expert system.

Besides, Brain4it has demonstrated to be easy enough but powerful to use in complex and diverse scenarios, such as:

  • A Brain4it application that control the lighting depending on the presence and level of brightness, and the air conditioners depending on the programming of the corporate agenda.
  • A monitoring application made with Brain4it can detect water leaks in facilities and cut the water supply to avoid extra costs.
  • Brain4it can stop watering a park if the weather forecast indicates that it will rain in a few hours, saving a lot of money.

Brain4it has resulted very useful for improving energy efficiency. Its use for the management of the City Hall’s central building (lighting and air conditioners control) has represented around 60% decrease in energy consumption.

Sustainability: embedding in future activities, financial sustainability of the Project

The City Hall currently uses Brain4it in multiple smart city projects and is absolutely committed to continue its development and evolution, contributing human and economic resources.

Besides, Brain4it was made using open-source software. It is offered to any public or private entity in GitHub (https://github.com/brain4it/brain4it) with flexible open-source licenses, to ensure anybody can access, copy and modify the tools, according to their needs.

The goal is that it may become a common asset for public administrations, helping to share resources between them.

In addition, all the information required about how to download and use Brain4it is available in the project website and in GitHub web.

  • How many times is our solution reused?

Since now 2 municipalities (Sant Feliu & Reus) have used Brain4it in mutiple smartcity projects: lighting control in public buildings, parking time control, intelligent traffic management, integration of weather stations in Sentilo platform, etc.

To guarantee its evolution and sustainability in the long term, the City Council intends to sign a collaboration agreement with Sentilo’s community (http://sentilo.io) in order to extend the use of Brain4it to the City Councils and other Public Administrations that are already using Sentilo Platform and which may be interested in using Brain4it. Sentilo is the open source sensor/actuator platform that Sant Feliu de Llobregat uses to broadcast the data collected by the layer of sensors deployed across the city, and it is completely integrated with Brain4it.

This collaboration agreement will mean that the City Council will help the signatories with the technical set-up of Brain4it and will provide advice on its use.

Sentilo is used across Catalonia in many municipalities and other supra-municipal administrations such as Barcelona Metropolitan Area (AMB), Barcelona Provincial Council (Diputació de Barcelona) and the Catalan Water Agency (ACA), as well as in several cities worldwide (Hampshire County Council in the United Kingdom, Municipality of Dubai). In 2017 Sentilo has  received the “Certificate of Excellence in the recognition of outstanding contribution to more efficient public services for citizens and businesses in Europe” in the Sharing and Reuse Awards Contest.

Being supported by the active and diverse community of cities and companies using Sentilo, would help to increase the sustainability of the Brain4it project.

Potential for adaptability by other entities: potential value and lessons to be learnt for other governments

Brain4it is an open source, offered in GitHub (https://github.com/brain4it/brain4) with a dual license model (EUPL 1.1 and LGPL3) in order to facilitate its reuse and integration in other projects.

It has demonstrated the potential for successful adaptation to other public administrations and contexts, such as the City Council of Reus that is already using the software.

There are several lessons we have learned from the use of Brain4it:

  • Using open standards and free software is the first smart decision a Smart City should take.
  • Before acquiring the devices of a system (sensors and actuators), it is needed a very clear strategy defined in order to know what hardware is actually needed to achieve the best results.
  • The devices to be acquired should be based on open protocols and standard technologies if possible, to avoid lock vendors and facilitate the integration with Brain4it and other technologies.

Links:

Ajuntament de Sant Feliu de Llobregat: https://www.santfeliu.cat/

Brain4it project: http://brain4it.org/

Brain4it in GitHub: https://github.com/brain4it/brain4it

Sentilo project and Community: http://www.sentilo.io/wordpress/

 

v1.0
Release date: 28/02/2019

Brain4it

European Union Public Licence, Version 1.1 or later (EUPL) 

Brain4it 1.0

Detailed information

Last update
Solution type
Business Rule
Release version
1.0
Release date

Related solutions

Last update: 01/03/2024

"Introduction to Artificial Intelligence for Public Service Interoperability" course

Culture and education

Moderation

Only facilitators and authors can create content.
Moderated