SuryaT1 commited on
Commit
0f7a2ff
Β·
verified Β·
1 Parent(s): be27668

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +145 -1
README.md CHANGED
@@ -9,4 +9,148 @@ tags:
9
  - voicebased
10
  - ai
11
  - ml
12
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  - voicebased
10
  - ai
11
  - ml
12
+ ---
13
+
14
+
15
+ # AuthEcho_Project
16
+
17
+ This project contains well-trained deep learning models to predict the **Speaker** and their **Gender**.
18
+
19
+ The repository offers a **Speaker and Gender Prediction System** built using **TensorFlow**, **Librosa**, and **Gradio**. The application predicts the top 3 speakers and their probabilities from an audio file, determines the speaker's gender, and classifies unknown speakers using a confidence threshold.
20
+
21
+ ## Features
22
+
23
+ - Predicts the top 3 speakers from an audio file.
24
+ - Determines the gender of the speaker.
25
+ - Identifies unknown speakers with a confidence threshold.
26
+ - Provides a Gradio interface for easy testing.
27
+
28
+ ## Getting Started
29
+
30
+ ### Prerequisites
31
+
32
+ To run this application, you need:
33
+
34
+ - **Python**: Version 3.8 or higher
35
+ - Required Python libraries:
36
+ - `tensorflow`
37
+ - `numpy`
38
+ - `librosa`
39
+ - `gradio`
40
+ - `scikit-learn`
41
+
42
+ Install the required libraries with:
43
+
44
+ ```
45
+ pip install tensorflow numpy librosa gradio scikit-learn
46
+ ```
47
+
48
+ ### Installation
49
+
50
+ 1. **Clone the Repository**:
51
+
52
+ ```
53
+ git clone https://github.com/your-username/speaker-gender-prediction.git
54
+ cd speaker-gender-prediction
55
+ ```
56
+
57
+ 2. **Add Pre-Trained Models and Label Encoders**:
58
+
59
+ Place the following files in the repository's root directory:
60
+ - `lstm_speaker_model.h5`: Pre-trained speaker recognition model.
61
+ - `lstm_gender_model.h5`: Pre-trained gender prediction model.
62
+ - `lstm_speaker_label.pkl`: Label encoder for speaker classes.
63
+ - `lstm_gender_label.pkl`: Label encoder for gender classes.
64
+
65
+ ### Usage
66
+
67
+ Run the application using:
68
+
69
+ ```
70
+ python app.py
71
+ ```
72
+
73
+ ### Gradio Interface
74
+
75
+ The Gradio interface allows you to:
76
+
77
+ - **Upload** an audio file or **record** audio directly.
78
+ - Predict the **top 3 speakers** and their probabilities.
79
+ - Determine the **gender** of the speaker.
80
+ - Detect and classify **unknown speakers** using confidence thresholds.
81
+
82
+ ## Project Structure
83
+
84
+ ```
85
+ .
86
+ β”œβ”€β”€ app.py # Main application file
87
+ β”œβ”€β”€ models/lstm_speaker_model.h5 # Pre-trained speaker model (to be added)
88
+ β”œβ”€β”€ models/lstm_gender_model.h5 # Pre-trained gender model (to be added)
89
+ β”œβ”€β”€ models/lstm_speaker_label.pkl # Speaker label encoder (to be added)
90
+ β”œβ”€β”€ models/lstm_gender_label.pkl # Gender label encoder (to be added)
91
+ β”œβ”€β”€ requirements.txt # Python dependencies
92
+ └── README.md # Project documentation
93
+ ```
94
+
95
+ ## Example Output
96
+
97
+ ### Top 3 Predicted Speakers:
98
+
99
+ ```
100
+ The top 3 predicted speakers are:
101
+ Speaker 1: 85.23%
102
+ Speaker 2: 10.12%
103
+ Speaker 3: 4.65%
104
+
105
+ The predicted gender is: Male
106
+ ```
107
+
108
+ ### Unknown Speaker:
109
+
110
+ ```
111
+ The top 3 predicted speakers are:
112
+ Unknown: 45.23%
113
+
114
+ The predicted gender is: Unknown
115
+ ```
116
+
117
+ ## How It Works
118
+
119
+ 1. **Feature Extraction**:
120
+ - Extracts **MFCCs**, **chroma features**, and **spectral contrast** from the input audio file using `librosa`.
121
+
122
+ 2. **Speaker and Gender Models**:
123
+ - **Speaker Model**: A pre-trained LSTM model classifies the speaker based on extracted features.
124
+ - **Gender Model**: A separate LSTM model determines the gender.
125
+
126
+ 3. **Unknown Detection**:
127
+ - If the highest confidence score for a speaker is below a defined threshold, the speaker is classified as "Unknown."
128
+
129
+ ## Roadmap
130
+
131
+ - Add support for real-time audio predictions.
132
+ - Improve unknown speaker detection using open-set recognition techniques.
133
+ - Expand the dataset for more robust gender classification.
134
+
135
+ ## Contributing
136
+
137
+ Contributions are welcome! To contribute:
138
+
139
+ 1. Fork the repository.
140
+ 2. Create a feature branch (`git checkout -b feature-branch-name`).
141
+ 3. Commit your changes (`git commit -m "Add new feature"`).
142
+ 4. Push to the branch (`git push origin feature-branch-name`).
143
+ 5. Open a Pull Request.
144
+
145
+ ## License
146
+
147
+ This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.
148
+
149
+
150
+
151
+
152
+ ## Acknowledgments
153
+
154
+ - **TensorFlow**: For building the deep learning models.
155
+ - **Librosa**: For audio processing and feature extraction.
156
+ - **Gradio**: For creating the user interface.