The problem
Passwords are the weakest link in everyday security: people reuse them, write them down and share them, while OTPs add friction and SIM-swap fraud keeps defeating SMS codes. Fingerprint and face biometrics work well, but they need dedicated sensors or a camera with good lighting, and they cannot authenticate someone over a plain voice call. The human voice carries a distinctive acoustic signature from the shape of each speaker's vocal tract That leaves a gap between the classroom and real biometric pipelines: enrollment, feature extraction, model scoring, threshold setting and the false-accept versus false-reject trade-off. This project closes that gap with a working voiceprint system, so those security concepts are demonstrated on real audio instead of defined on slides.
How it works
- During enrollment, the user speaks for ~10 seconds into a microphone; the audio is captured at 16 kHz.
- Pre-processing applies a noise gate, voice-activity detection (VAD) to drop silence, and amplitude normalization.
- MFCC features (40 coefficients plus delta and delta-delta) are extracted in 25 ms frames with a 10 ms hop using librosa.
- A GMM (16–64 mixtures) is trained per speaker on the enrollment features; alternatively, the CNN maps each utterance to a fixed-length 128-dim voiceprint embedding.
- At login, the spoken sample is converted to the same features and scored against the claimed user's model — log-likelihood ratio for GMM, cosine similarity for the CNN embedding.
- The score is compared with the threshold (set at the equal-error-rate point): above it the login is accepted, below it rejected. All attempts are logged with scores in the VoiceKey app.
Project features
- Voiceprint enrollment from ~10 seconds of spoken audio per user
- MFCC feature extraction with librosa (40 coefficients + delta/delta-delta, 25 ms frames)
- GMM-based speaker matching — one Gaussian Mixture Model trained per enrolled user
- CNN voiceprint classifier option (TensorFlow/Keras embedding + cosine similarity scoring)
- Text-independent verification — no fixed passphrase required
- Similarity score with configurable accept/reject threshold set at the EER point
- Anti-spoofing checks: replay-attack heuristics from spectral and energy cues
- VoiceKey Streamlit app: enroll, verify, and view the score gauge live
- Multi-user enrollment database with per-user models and attempt history
- Full metrics suite: FAR/FRR tables, DET curve and score histograms for the report
What is included
- Complete, commented Python source code (feature extraction, GMM + CNN training, Streamlit app)
- Trained speaker models and voiceprint database schema
- VoiceKey Streamlit web application with live demo mode
- Sample voice dataset for training and testing
- Project report PDF (literature survey, methodology, FAR/FRR results, conclusion)
- PPT presentation for final review
- Viva Q&A preparation document (MFCC theory, GMM scoring, biometric metrics)
- Installation and run guide
FAQs
- How is this different from speech recognition? Speech recognition asks what was said; speaker verification asks who said it. This project models the speaker's voice characteristics — vocal-tract resonances captured in MFCCs — so the same phrase spoken by two people produces different scores.
- Which model is better — GMM or CNN? GMMs are the classic, explainable baseline and train in seconds on CPU; the CNN embedding approach generalizes better across sessions and channels but needs more enrollment data. The report includes the procedure for comparing both on the same trial set.
- What are FAR, FRR and EER? False Accept Rate (impostor accepted), False Reject Rate (genuine user rejected), and the Equal Error Rate point where the two balance — the standard biometric metrics. The app plots the DET curve and sets the default threshold at EER.
- Can someone fool it by playing a recording? Casual replay is partially caught by the anti-spoofing heuristics (spectral flatness and energy-variation anomalies typical of loudspeaker playback). Full protection against voice cloning is listed as future work in the report.
- Can I demo it live in my review? Yes — the VoiceKey app enrolls a voice in ~10 seconds and verifies attempts instantly with a visible score gauge. Enroll yourself and a friend, then show an impostor attempt being rejected.
- How can I extend this project? Common extensions include: text-dependent passphrase mode, channel-robustness with data augmentation, on-device inference with TensorFlow Lite, multi-factor login (voice + OTP), and liveness detection.
Limitations & prerequisites
- Background noise degrades accuracy — quiet-room enrollment and verification is recommended for the demo.
- Very short enrollment samples (<5 seconds) weaken the speaker model; ~10 seconds is the recommended minimum.
- Microphone quality matters — the same headset for enrollment and login gives the most consistent scores.
- Anti-spoofing uses statistical replay heuristics, not full liveness detection against advanced voice-cloning attacks.
- Voice characteristics shift with illness, fatigue or age — the model reflects the voice as enrolled.
Components & software requirements
- Python 3.9+ (NumPy, SciPy, pandas)
- librosa (MFCC extraction, VAD, audio preprocessing)
- scikit-learn (GMM speaker models, metrics)
- TensorFlow/Keras (CNN voiceprint classifier, embeddings)
- Streamlit (VoiceKey web app)
- SoundDevice (microphone capture)
- Matplotlib/Seaborn (DET curves, score distributions)
Specifications
| Parameter | Value |
|---|---|
| Audio format | 16 kHz mono WAV, microphone or file input |
| Enrollment speech | ~10 seconds per user |
| Verification sample | 2–3 seconds per attempt |
| Features | 40 MFCC + delta + delta-delta (120 dims), 25 ms frame / 10 ms hop |
| Speaker models | GMM, 16–64 mixtures per speaker (configurable) |
| CNN embedding | 128-dim voiceprint vector, cosine-similarity scoring |
| Decision threshold | Set at equal-error-rate (EER) point, adjustable |
| Verification accuracy | Target ~90%+; typical EER 4–8% reported for this approach on clean speech — actual results depend on the microphone and environment |
| Anti-spoofing | Replay heuristics (spectral flatness, energy-variation checks) |
| Users supported | Multi-user enrollment database (SQLite) |
| App | Streamlit; enroll, verify, logs, metrics views |