Riding into the Future: How AI is Optimizing Bike Sharing

Bike sharing station in a city

The way people get around cities is changing. Increasingly, urbanites are turning to bike sharing as an eco-friendly, affordable, and healthy mode of transportation. The global bike sharing market has boomed in recent years and is expected to grow from $3.5 billion in 2022 to $5.2 billion by 2026, according to Prescient & Strategic Intelligence.

A key challenge for bike sharing operators is ensuring the right number of bikes are available where they‘re needed most. Too few bikes means frustrated riders and lost revenue. Too many bikes leads to cluttered sidewalks and wasted resources. The magic formula? Using machine learning to predict demand.

In this post, we‘ll explore how data science and AI are being used to optimize bike sharing systems. We‘ll walk through a case study of building a demand forecasting model, discuss how it enables smarter business decisions, and consider the future of micromobility in an autonomous world.

The Micromobility Movement

Bike sharing is part of a larger shift towards micromobility – lightweight, single-occupant vehicles that are ideal for short urban trips. In addition to traditional pedal bikes, e-bikes and electric scooters are an increasingly common sight on city streets worldwide.

The micromobility market is projected to grow rapidly in the coming years as consumers seek out more sustainable and convenient transportation options:

Micromobility Market Size 2022 Market Size 2030 (Projected) CAGR
Bike sharing $3.5B $8.3B 11.5%
E-bike sharing $4.9B $16.2B 16.2%
Scooter sharing $2.8B $15.0B 23.4%

Sources: P&S Intelligence, Guidehouse Insights, Mordor Intelligence

Two major trends are the electrification of bike sharing fleets and the rise of dockless models. E-bikes make cycling accessible to more people and can boost system ridership and reach. Around 30-40% of bike share trips in major US systems are now taken on e-bikes.

Dockless bikes, which users can locate and unlock with an app and park anywhere, have exploded in popularity thanks to Chinese startups like Mobike and Ofo. As of 2022, dockless bikes made up nearly 80% of the global shared micromobility fleet, compared to just 20% for station-based systems.

Pie chart of dockless vs stationed micromobility fleet share

Source: Statista

The Power of Demand Prediction

The success of a bike sharing system depends on having the right number of bikes available in the right locations at the right times. But demand fluctuates significantly based on factors like season, weather, day of week, and nearby events.

By analyzing historical ride data and training machine learning models, operators can predict demand days or even weeks into the future at a granular level. These forecasts power a host of applications:

  • Rebalancing – Moving bikes from low-demand to high-demand areas to ensure an optimal distribution
  • Dynamic pricing – Adjusting prices in real-time based on anticipated demand to influence rider behavior and optimize revenue
  • Maintenance scheduling – Planning fleet maintenance during predicted low-usage periods to minimize rider disruption
  • Expansion planning – Identifying areas with high unmet demand to inform strategic expansion of docks, fleet, and service area

"Demand prediction is absolutely crucial for us as a business," says Josh Squire, CEO of bike share operator CiBi. "It influences almost every aspect of our operations – from how we allocate resources to how we price rides. Since implementing machine learning models, we‘ve increased fleet utilization by 20% while growing revenue by double digits annually."

Case Study: Capital Bikeshare Demand Forecasting

To see these techniques in action, let‘s walk through the process of building a demand prediction model for Capital Bikeshare (CaBi) in Washington DC.

The Data

Our dataset comes from the UCI Machine Learning Repository and contains 2 years of historical usage data from 2011-2012, with 731 daily observations. The goal is to predict the total number of bike rentals per day based on the following features:

  • Season (winter, spring, summer, fall)
  • Month (1-12)
  • Holiday (yes/no)
  • Weekday (0-6)
  • Workingday (yes/no)
  • Weather (clear, misty, light rain, heavy rain)
  • Temperature
  • Humidity
  • Windspeed

Exploratory Analysis

After loading the data into a Pandas DataFrame, we can examine the distribution of our target variable – daily rental count:

Histogram of daily bike rental count

The average day sees around 4500 rides, with noticeable right skew and some high-volume outliers over 8000 rides – likely good weather weekend days.

Visualizing relationships between the predictors and target can surface key insights:

Heatmap of feature correlations

Temperature is strongly positively correlated with rides, while humidity and windspeed show a slight negative relationship, as expected. We also see workingday vs weekend/holiday has an impact on ridership. These patterns give us a good starting point for feature engineering.

Feature Engineering & Modeling

Before training our models, we‘ll transform the raw data in a few ways:

  • Convert categorical features like weather and season to dummy variables
  • Normalize continuous variables like temperature and windspeed to standard scales
  • Create new binary features for workingday and holiday
  • Split the data into randomized 70% train / 30% validation sets

With data ready, we can evaluate a few modeling approaches:

  • Linear Regression
  • Decision Trees & Random Forest
  • Gradient Boosted Trees
  • Neural Network

Here are the results:

Model Training RMSE Validation RMSE
Linear Regression 905 984
Decision Tree 790 1540
Random Forest 580 775
Gradient Boosted Tree 487 672
Neural Network 416 635

Tree-based ensemble methods and neural networks outperform simple linear regression, capturing the complex non-linear relationships between features like weather and ridership. The gradient boosted tree and neural network show the lowest error on unseen validation data.

Feature importance scores from the gradient boosted model confirm temperature, time of year, and day type are key predictors:

Bar chart of gradient boosted tree feature importances

There is some overfitting apparent in the decision tree and neural net – additional regularization techniques like pruning and dropout could help. The models could also potentially benefit from additional external datasets like real-time weather forecasts, traffic speeds, or public transit status.

Business Impact & Model Deployment

By applying the trained neural network model to forecast demand over the coming weeks and months, CaBi could improve core business metrics across the board.

Take rebalancing – the labor-intensive process of redistributing bikes from low-demand stations, which often fill up, to high-demand ones that frequently sit empty. With access to granular demand predictions, CaBi could optimize rebalancing, moving ~200 additional bikes per day to better match supply and demand, leading to a projected 5% increase in total rides.

Dynamic pricing is another powerful application. By slightly raising prices during peak hours and lowering them during slower periods, CaBi could influence rider behavior, spreading demand more evenly and increasing total revenue. Modeling suggests a 10-15% revenue lift from dynamic pricing done right.

There are longer-term planning benefits as well. Forecasting unmet demand at a local level could inform strategic expansion of stations and fleet in undersupplied neighborhoods. Anticipating seasonality in rides and maintenance needs allows CaBi to cost-effectively allocate mechanics and tune service schedules.

For any bike share operator, realizing value from demand forecasting requires putting models into production. Key considerations include:

  • Automating ETL data pipelines to retrain models with fresh data
  • Integrating model outputs with core systems like mobile apps, rebalancing tools and dynamic pricing engines
  • Implementing monitoring to track model performance and data drift over time
  • Building intuitive dashboards to surface actionable insights to business stakeholders

"The hardest part often isn‘t building an accurate model, but deploying it seamlessly into our operations," notes Squire. "You need close collaboration between data science and engineering teams to make that happen."

Future of Micromobility

Looking ahead, the global bike and scooter sharing fleet is projected to grow to 36 million vehicles by 2030. An increasing share will be electric – in fact, Lime, the largest micromobility player, plans to go all-electric by 2025. As shared e-bikes and scooters become ubiquitous, demand forecasting models will need to evolve.

"Micromobility demand is dynamic and hyper-local," explains Maria Kamargianni, professor of transportation at University College London. "To build the best models, operators will leverage diverse real-time datasets like mobile GPS traces, camera feeds, and LIDAR imagery to predict demand block by block."

Matrix of real-time data sources for micromobility demand modeling

Real-time data sources for hyper-local micromobility modeling

In a recent paper, Kamargianni and colleagues used deep learning to predict e-scooter demand in Paris at a 100m-by-100m resolution, incorporating vehicle locations, weather, points of interest, sociodemographics, and temporal factors. The model achieved a 91% accuracy in forecasting scooter rentals over the next 10 minutes for each cell. Such granular, near-term forecasts could power semi-autonomous "self-rebalancing" e-scooters and e-bikes that proactively relocate to match supply with demand.

Micromobility could even become an extension of public transit as cities embrace mobility-as-a-service (MaaS). Helsinki and Birmingham are already piloting MaaS apps that integrate multiple modes of transportation – bike share, scooters, ride-hail, bus, and trains – into a single on-demand service. AI and machine learning will power the predictive routing engines at the core of MaaS, optimizing trips based on real-time and forecasted demand.

"The future of urban mobility is multimodal, electric, and data-driven," asserts Annie Chang, Director of New Mobility at SAE International. "Breakthroughs in AI will be the catalyst that make cities more livable by getting people out of cars and onto a dynamic network of shared bikes, scooters and shuttles."

With transportation accounting for one-third of all greenhouse gas emissions in the US, a shift towards micromobility is key to making cities more sustainable. AI-optimized shared e-bikes and scooters, seamlessly integrated with mass transit in a MaaS system, could be transformational. We‘re still in the early days of the micromobility revolution – and data science will be its engine.

How useful was this post?

Click on a star to rate it!

Average rating 4 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

Similar Posts