Created by two nerds ;)
This repository is not final and still in development. You're free to report any bugs and we'll try to roll-out an update as soon as possible. This project is to be presented at Regeneron ISEF 2025, to be held at Columbus, Ohio, USA.
A desktop application that uses machine learning to differentiate between AI-generated and human voices based on audio samples. VoiceAuth employs logistic regression and advanced audio feature extraction to provide accurate classification of voice samples.
- ✅ Audio Processing: Extract features from various audio formats (WAV, MP3, OGG, FLAC)
- 🧠 Machine Learning: Logistic regression model with hyperparameter optimization
- 🔍 Real-time Classification: Analyze and classify voice samples instantly
- ⚡ Performance: Hardware acceleration through parallel processing
- 📊 Visualization: Feature importance and model performance metrics
- 🔄 Feedback System: Continuously improve model accuracy with user feedback
- 💾 Cross-Platform Support: Works on Windows, macOS, and Linux
- Python 3.8 or higher
- C++ Build Tools (for Windows users)
Step 1: Install C++ Build Tools (required for NumPy, SciPy, and other scientific packages)
-
Download Microsoft C++ Build Tools:
- Go to Microsoft C++ Build Tools
- Click "Download Build Tools"
-
Run the installer:
- When prompted for workloads, select "C++ build tools"
- In the right panel, ensure the following components are selected:
- MSVC v142 - VS 2019 C++ x64/x86 build tools
- Windows 10 SDK
- C++ CMake tools for Windows
- Click Install
Alternative: Use Anaconda/Miniconda
If you prefer to avoid installing build tools, you can use Anaconda/Miniconda which provides pre-compiled binaries:
- Download and install Miniconda
- Create an environment:
conda create -n voiceauth python=3.8 - Activate it:
conda activate voiceauth - Install packages:
conda install numpy pandas matplotlib scikit-learn - Then install the remaining packages with pip:
pip install -r requirements.txt
-
Clone the repository:
git clone https://github.com/zohaiblazuli/VoiceAuth.git cd VoiceAuth -
Install dependencies:
pip install -r requirements.txt -
Verify your setup:
python check_setup.pyThis script will check if you have all necessary components installed and provide guidance on fixing any issues.
-
Run the application:
python run_voiceauth.py
VoiceAuth features a user-friendly interface with several tabs:
- Import Sample Tab: Import audio files for classification
- Record Sample Tab: Record your voice directly for classification
- Feedback Tab: Provide feedback on classification results to improve the model
- Information Tab: View model statistics and performance metrics
For training the model, organize your dataset as follows:
dataset_folder/
├── ai_generated/ (folder containing AI-generated voice samples)
│ ├── sample1.wav
│ ├── sample2.wav
│ └── ...
└── human/ (folder containing human voice samples)
├── sample1.wav
├── sample2.wav
└── ...
VoiceAuth uses a robust path management system to ensure compatibility across different environments, particularly when shared via GitHub. The system:
- Automatically determines the base directory: Works whether running from source, as a compiled executable, or from any relative directory
- Standardizes path access: All file paths are accessed through utility functions, not hardcoded strings
- Creates necessary directories: Output and model directories are automatically created if they don't exist
- Cross-platform compatibility: Paths are normalized for the operating system in use
Key path utility functions:
get_base_dir(): Gets the base application directoryget_resource_path(relative_path): Gets the absolute path to any resourceget_media_path(filename): Gets the path to media filesget_output_path(filename): Gets the path to output files or directoriesget_model_path(filename): Gets the path to model files
VoiceAuth extracts various audio features using the librosa library:
- MFCCs (Mel-Frequency Cepstral Coefficients)
- Spectral Centroid, Contrast, Rolloff
- Zero Crossing Rate
- Chroma Features
- Spectral Bandwidth
- Tempo and Beat Features
- Mel Spectrogram
- Preprocessing: Standard scaling for feature normalization
- Feature Selection: Optional using SelectFromModel
- Model: Logistic regression with hyperparameter tuning
- Evaluation: Uses accuracy, precision, recall, and F1-score
The application includes an adaptive learning system that:
- Collects user feedback on classification results
- Stores correctly labeled samples
- Automatically retrains the model when sufficient feedback data is collected
- Updates the model in real-time
voiceauth.py: Main application moduleui_components.py: UI components and widgetssimple_model.py: Machine learning model implementationaudio_processor.py: Audio processing and feature extractionbatch_process.py: Batch processing of audio samplestabs.py: Implementation of application tabsutils.py: Utility functions, including path managementmedia/: Contains graphics and media assetsoutput/: Contains generated files (features, models)
To add new features:
- For new UI components, add them to
ui_components.py - For new tabs, extend the functionality in
tabs.py - For new model features, modify
simple_model.py - For additional audio processing, update
audio_processor.py
- Media files not found: If you see errors about missing media files, ensure the
mediadirectory is in the same location as the application. - Model loading errors: Make sure the model has been trained and the appropriate model files exist in the output directory.
- Audio recording issues: Check your microphone permissions and settings.
Contributions are welcome! Please feel free to submit a Pull Request.
Please do mention us when showcasing this repository.
- librosa for audio feature extraction
- scikit-learn for machine learning components
- PyQt5 for the GUI framework

