Improving the bike sharing system with predictions

The bicycle sharing system of Barcelona (called Bicing) has more than 400 stations and about 6.000 bicycles that can be rented by users. Unfortunately, almost every Bicing user has already faced the problem of not finding a bicycle in a station or a free space to leave the bike taken earlier. Good news: It is possible to predict if you will find a bicycle in a Bicing station within 2 days in advance.

Prototype - Bicintime

Prototype of the application “Bicintime”

In 2013, I created with a colleague a prototype of an application that used historical data to predict the number of bicycles in the stations in the UPF and we won a competition organized by the European project Opencities (the idea is better described in this post). It was further presented in the Smart City Expo World Congress in the same year and better developed later.

Now, I published with my supervisors Dr. Boris Bellalta and Dr. Simon Oechsner a paper about the predictions called “Predicting Occupancy Trends in Barcelona’s Bicycle Service Stations using Open Data“, which will be presented in November at the SAI Intelligent Systems Conference in London. The idea behind the research is to exploit the Opendata to improve and promote the use of public bicycles in Barcelona, but it can be extended to other systems around the world.

Based on the information about the stations and on the publicly available data from the city council of Barcelona, it was possible to correctly predict half of the times when the stations were either completely full or completely empty. The use of the bicycles is related with the day of the week, the weather and some other variables. For example, during the weekends, it is more common to use the bikes to go to the beach, and there are always less people using the bicycles if it is raining.

How the predictions were made

After selecting four stations randomly, the information about local holidays and the weather forecast were put together with their respective number of bicycles and free slots observed over a year. Then, we observed that the city and the environmental changes have different impact in each station. For example, those placed close to the metro stations were less used during the weekends, which we believe that it is consequence of the use of the bicycles as an extension of the collective transportation.

Impact of external world

Impact of external world

Using a method called “Random Forest”, we predicted if the stations would be (almost) full of bicycles, (almost) empty or if they would have a reasonable number of bicycles and free slots (half full, half empty) in the future. During the tests, we correctly predicted nearly half of the times when the stations were either completely full or completely empty up to 2 days before they actually happened.

Impact of the results

Finally, we conclude that, using only the data accessible to the public, it is possible to improve the whole Bicing system. As an example, the system administration (city council) might use the predictions to collect bikes from a station that is almost full before the users face the problem of not finding places to leave their bikes. Additionally, they could exploit an extended version of the predictions to decide whether it is a good option to install a new station at a certain place or not, based on how many users would use it during the year. Such a risk analysis increases the savings of the public resources.

The next step is to develop an application for smartphones that will show the users the predictions and make it easier to plan their next trip. The predictions made by the application will be improved using other datasets available online, like the neighborhood wealth and the proximity of the stations to other public transportations, schools and companies. They are expected to be more accurate, which may increase the use of the bicycles, because the users would be more confident about finding (or not) a bicycle close to their house and a free space close to their school, work or university.


Gabriel Martins Dias, Boris Bellalta and Simon Oechsner (2015), “Predicting Occupancy Trends in Barcelona’s Bicycle Service Stations using Open Data”, IntelliSys 2015, 10-11 of November, London.


The predictions became news in the university’s portal and in some of the main newspapers in Spain:

Annotated slides from the presentation

Leave a Reply

Your email address will not be published. Required fields are marked *