A simple voice-based authentication system built with Python. Record a voice password, train a machine learning model using MFCC features, and run real-time voice validation to grant or deny access.
Inspired by spy-movie-style biometric systems — but built entirely with open-source tools, running locally.
- Record your own voice password
- Extract MFCC features with
librosa - Train an SVM model using
scikit-learn - Real-time voice authentication from mic input
- Lightweight, local-only — no cloud APIs
- Record audio samples of your password phrase (e.g., "access")
- Record negative samples (e.g., saying a different word like "banana")
- Extract features from the audio files using MFCC
- Train a classifier to distinguish between your voice and others
- Use the model to authenticate future voice input
auth-voice-system/
├── authenticate.py
├── extract_features.py
├── record_voice_password.py
├── train_model.py
Note: The voice samples, extracted features, and trained model are not included for privacy reasons. Run the scripts yourself to generate them.
pip install sounddevice scipy librosa scikit-learn numpy joblibRecord 20 samples of your password phrase:
python3 record_voice_password.pyThen change the phrase (e.g., to "banana") and record 10 negative samples into a different folder.
python3 extract_features.pyThis generates a dataset from your recordings.
python3 train_model.pyThis saves voice_auth_model.pkl.
python3 authenticate.pySpeak your password — the system will predict if it's you and decide whether to grant access.
- Raspberry Pi door unlocker
- Secure local script runner
- Biometric voice login for private folders
- Smart home voice toggle
- Multispeaker verification system
- Use deep learning (e.g., CNNs or
speechbrain) for better accuracy - Add a simple GUI with Streamlit or Flask
- Hook it to real hardware using GPIO (e.g., Raspberry Pi relay)
- Add noise filtering or augmentation for robustness
- Detect spoofing attempts with audio playback detection
This project is open-sourced for educational purposes. Use responsibly. No biometric data is included in this repository.