ThesisMar – Oct 2024
A Sensor Data Collection System for Training a Smart-Parking ML Model
Bachelor’s internship thesis on GeneroCity, a smart-parking app that detects when you leave a parking spot. I designed and built the backend that collects phone sensor data to train its model, and brought the Go codebase under unit tests.
GeneroCity is a smart-parking app developed at Sapienza. The idea is that drivers share parking spots without touching their phone: the app notices on its own when you are leaving a spot and offers it to someone nearby who is looking. To do that, a machine learning model reads the phone’s sensors (GPS, Wi-Fi, Bluetooth, battery charging state) and recognises when you are driving around looking for a spot, or leaving one. Training that model needs data, and lots of it.
My internship, which became my bachelor’s thesis, was about the backend that gathers that data.
What I built
- Data collection endpoints. New REST endpoints in the Go backend to store readings from the phone’s sensors, with the database schema designed for it (sensor and sensor-data tables in MariaDB) and API documentation for each endpoint.
- Faster exports. The endpoint that hands the collected data to the ML side got slow as the tables grew; I reworked the schema and added pagination.
- Tests. I removed duplicated code and wrote the missing unit tests, using go-sqlmock for the database and a small MockFS I wrote to simulate the file system, so code that reads and writes files could be tested in isolation.
- GeneroCity BLE. Smaller contributions to the companion app that records nearby Bluetooth devices, one of the signals the model uses.
The thesis (in Italian) covers the project’s architecture, the REST design choices, the testing work and the data collection pipeline in detail.
Supervised by Dr. Emanuele Panizzi.