- Recommended Python version: 3.10
- PyAudio may not work on Python 3.12+
An AI-powered Final Year Engineering Project to analyze infant cry audio and predict the reason (hunger, discomfort, pain, tiredness) using Machine Learning.
Infants communicate through crying, but identifying the reason is difficult.
This project uses AI to classify cry sounds and assist caregivers.
- 🎤 Audio input (microphone / dataset)
- 🔊 Noise reduction
- 📊 MFCC feature extraction
- 🤖 Random Forest classification
- 📈 Audio visualization
- 🌐 Flask-based web application (localhost)
- 🧠 Real-time prediction with probability distribution of cry reasons
A web-based interface is developed using Flask that runs on localhost.
- 🎙️ Record audio directly from microphone
- 📂 Upload audio file option
- ⚡ Real-time prediction
- 📊 Displays probability distribution of different cry types (hungry, pain, tired, discomfort)
python backend/app.py
Then open in browser:
- Feature Extraction: MFCC (Mel Frequency Cepstral Coefficients)
- Model: Random Forest Classifier
- Output: Predicted class + probability distribution
- Evaluation: Accuracy, Confusion Matrix
Infant-Cry-Analysis-and-Prediction/ ├── audio_dataset/ ├── backend/ │ ├── app.py │ └── Cry_Model.ipynb ├── templates/ ├── requirements.txt └── README.md
git clone https://github.com/YOUR_USERNAME/Infant-Cry-Analysis-and-Prediction.git
cd Infant-Cry-Analysis-and-Prediction
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python backend/app.py
Python, Flask, NumPy, Pandas, Librosa, Scikit-learn, Matplotlib, Seaborn
- 🎯 Model Accuracy: 90.47%
- ✅ Achieved high performance on test dataset
- 📈 Model performs well across most classes with balanced predictions
-
Strong precision and recall for:
- hungry
- burping
- belly_pain
-
Some confusion observed between:
- discomfort ↔ tired
-
Minor misclassifications due to similarity in cry patterns
hungry: 82%
tired: 10%
burping: 5%
discomfort: 2%
belly_pain: 1%
- High accuracy in identifying hungry and burping
- Slight performance drop in discomfort class
The model successfully predicts infant cry reasons with ~90% accuracy and provides probability-based outputs, making it useful for real-time caregiving assistance.