How maharshith1910/final-year-project works
SafeWatch AI is a scream-audio distress detection prototype. Its documented workflow acquires audio datasets, prepares a manifest and Mel features, trains and evaluates CNN or CNN-LSTM models, then runs file or microphone inference through a Streamlit dashboard that records potential alerts for human review. The graph preserves these domain stages and the model/data-loading layers. Relationships for unsampled data utilities and dashboard capabilities follow README documentation; source excerpts and the index support the shown training, inference, model, and alert interactions.
Main entry points: evaluate.py Test evaluation · train.py Training loop · predictor.py Audio predictor · cnn_lstm_model.py CNN-LSTM
Components 17
Data preparation
- Dataset download
utils/download_datasets.py - Manifest and splits
utils/data_prep.py - Mel extraction
utils/feature_extraction.py - Mel feature files
data/features_manifest.csv
Model development
- PyTorch datasets
training/dataset.py - Training loop
training/train.py - Baseline CNN
models/cnn_model.py - CNN-LSTM
models/cnn_lstm_model.py - Test evaluation
training/evaluate.py - Model checkpoints
Detection and review
- Streamlit dashboard
dashboard/app.py - Audio predictor
inference/predictor.py - Alert logger
inference/alert_logger.py
Persisted outputs
- Alert log
outputs/alerts/alert_log.csv - Evaluation results
outputs/metrics
Other components
- Security operator
- Dataset sources
Connections 22
- Dataset sources → Dataset download: provides audio
README.md - Dataset download → Manifest and splits: supplies audio
README.md - Manifest and splits → Mel extraction: indexes files
README.md - Mel extraction → Mel feature files: writes features
README.md - Mel feature files → PyTorch datasets: loads samples
training/dataset.py - PyTorch datasets → Training loop: feeds batches
training/train.py - Training loop → Baseline CNN: trains model
training/train.py - Training loop → CNN-LSTM: trains model
training/train.py - CNN-LSTM → Baseline CNN: extracts features
models/cnn_lstm_model.py - Training loop → Model checkpoints: saves weights
- PyTorch datasets → Test evaluation: feeds test set
training/evaluate.py - Test evaluation → Baseline CNN: evaluates model
training/evaluate.py - Test evaluation → CNN-LSTM: evaluates model
training/evaluate.py - Test evaluation → Model checkpoints: loads weights
- Test evaluation → Evaluation results: writes metrics
- Security operator → Streamlit dashboard: uses dashboard
README.md - Streamlit dashboard → Audio predictor: runs detection
dashboard/app.py - Audio predictor → Baseline CNN: loads model
inference/predictor.py - Audio predictor → CNN-LSTM: loads model
inference/predictor.py - Audio predictor → Alert logger: logs alerts
inference/predictor.py - Streamlit dashboard → Alert logger: queries alerts
dashboard/app.py - Alert logger → Alert log: reads and writes
inference/alert_logger.py