Sensor-driven heavy-drinking risk detection using smartphone accelerometer time-series and TAC-based labels (UCI Bar Crawl dataset), with an interactive analytics dashboard.
- Sliding-window signal processing pipeline for accelerometer streams.
- Classical ML benchmark (RandomForest / ExtraTrees / LogisticRegression / HistGB / XGBoost).
- Sequence-model benchmark (1D CNN, PyTorch) with subject-aware split.
- Single-page web dashboard for risk trends, participant comparison, and downloads.
- UCI Bar Crawl: Detecting Heavy Drinking
- Expected archive path:
bar+crawl+detecting+heavy+drinking.zip
- Python: 3.9 (recommended for this setup)
- Install dependencies:
pip install -r requirements.txtFor sequence model training (1D CNN), install the extra dependency:
pip install -r requirements-sequence.txtpython src/prepare_data.py
python src/train.py
python src/evaluate.pypython src/train_sequence.py --max-windows-per-pid 500python -m streamlit run src/dashboard.py --server.address 127.0.0.1 --server.port 8501 --server.headless trueOpen: http://127.0.0.1:8501
- Push this project to GitHub.
- Create a new Streamlit app.
- Set entry file to
app.py. - Deploy with default
requirements.txt.
Use included Procfile:
web: streamlit run app.py --server.port=$PORT --server.address=0.0.0.0
| Metric | Value |
|---|---|
| F1 | 0.6686 |
| Precision | 0.5975 |
| Recall | 0.7588 |
| ROC-AUC | 0.6950 |
| Model | F1 | Precision | Recall | ROC-AUC |
|---|---|---|---|---|
| Baseline LogReg Features | 0.4925 | 0.3530 | 0.8142 | 0.5448 |
| 1D CNN Sequence | 0.5179 | 0.3706 | 0.8596 | 0.5298 |
alcohol-detection/
data/
raw/
processed/
models/
reports/
src/
prepare_data.py
train.py
evaluate.py
train_sequence.py
dashboard.py
requirements.txt
README.md