This is a Streamlit-based web application that uses advanced machine learning models to detect whether an audio file is bonafide (emotionally authentic) or spoofed (emotionally fake). The application leverages Facebook's Wav2Vec2 for feature extraction and a TensorFlow-based CNN model trained on PTMs features for classification.
- Upload
.wavaudio files for classification. - Provides predictions (
bonafideorspoof) with confidence scores. - Displays class probabilities with a visually appealing bar chart.
- Easy-to-use interface built with Streamlit.
git clone https://github.com/gir-ish/Emo-FAKE.git
cd Emo-FAKEpython -m venv env
source env/bin/activate Install the required Python libraries using the requirements.txt file:
pip install -r requirements.txtNavigate to the APP folder and launch the Streamlit app:
cd APP
streamlit run app.pyIf the model isn't available in your project, you can download it from the following link:
After downloading: replace the model folder from new one.
-
Open the App: After running the above command, Streamlit will provide a local URL (e.g.,
http://localhost:----). Open it in your browser. -
Upload an Audio File:
- Click on the "Browse files" button or drag and drop a
.wavfile. - Ensure the file is in WAV format and meets the required specifications (e.g., 16kHz sampling rate).
- Click on the "Browse files" button or drag and drop a
-
View Results:
- The app will process the audio and display the following:
- Prediction: Whether the file is "bonafide" or "spoof."
- Confidence Score: How confident the model is in its prediction.
- Class Probabilities: Probabilities for each class (visualized as a bar chart).
- The app will process the audio and display the following:
You can also use the application directly via the following link:
Access the EmoFake Detection App on Hugging Face Spaces
-
Dependency Errors:
- Ensure you have the correct versions of
torch,transformers,tensorflow, andtorchaudio. Use the providedrequirements.txtto avoid version mismatches.
- Ensure you have the correct versions of
-
File Format Errors:
- Ensure the uploaded file is in
.wavformat and is not corrupted.
- Ensure the uploaded file is in
-
GPU Not Detected:
- If using a GPU, ensure CUDA is installed and the
torchversion matches your CUDA version.
- If using a GPU, ensure CUDA is installed and the
-
Permission Issues (Windows):
- Run Command Prompt as Administrator to resolve file permission issues.
.
├── APP # Folder containing Streamlit application
│ ├── app.py # Main Streamlit application
├── CNN-MODEL # Trained TensorFlow CNN model directory
├── requirements.txt # Python dependencies
├── README.md # Project documentation
This project is licensed under the MIT License. See the LICENSE file for details.