A deep learning project that classifies human poses into three categories: Standing, Sitting, and Lying using transfer learning with MobileNetV2.
This project implements a pose classification system using:
- Base Model: MobileNetV2 (pre-trained on ImageNet)
- Architecture: Transfer learning with custom dense layers
- Training Strategy: Two-phase approach (frozen base + fine-tuning)
- Data Augmentation: Extensive augmentation for robust training
- Test Accuracy: 91%
- Weighted F1-Score: 0.91
- Individual F1-Scores:
- Standing: 0.93
- Sitting: 0.88
- Lying: 0.92
The dataset contains:
- Standing: 421 images
- Sitting: 429 images
- Lying: 509 images
- Total: 1,359 images
human-pose-classifier/
├── notebooks/ # Jupyter notebooks
├── data/ # Dataset (lying, sitting, standing)
├── models/ # Trained models
├── results/ # Plots, metrics, and evaluation results
├── reports/ # Project documentation
├── venv/ # Virtual environment (created during setup)
├── requirements.txt # Python dependencies
└── README.md # This file
- Python 3.8 or higher
- pip (Python package installer)
- Clone the repository:
git clone https://github.com/sachin-prabhakar/human-pose-classifier.git
cd human-pose-classifier- Create a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install required packages:
pip install -r requirements.txt- Register the virtual environment as a Jupyter kernel:
python -m ipykernel install --user --name=human-pose-classifier --display-name="Human Pose Classifier"Option 1: Using Jupyter Notebook
# Activate virtual environment (if not already active)
source venv/bin/activate # On Windows: venv\Scripts\activate
# Start Jupyter Notebook
jupyter notebook notebooks/Human_Pose_Classification_Training.ipynbOption 2: Using the registered kernel
- Open Jupyter Notebook
- Navigate to
notebooks/Human_Pose_Classification_Training.ipynb - Go to Kernel → Change Kernel → Human Pose Classifier
- Run the notebook cells
deactivate- Transfer Learning: MobileNetV2 pre-trained on ImageNet
- Data Augmentation: Rotation, flipping, brightness adjustment for robust training
- Class Balancing: Automatic weight computation for imbalanced dataset
- Two-Phase Training: Frozen base model + fine-tuning approach
- Comprehensive Evaluation: Confusion matrices, F1-scores, and accuracy metrics
- Real-world Testing: External image validation
- TensorFlow/Keras: Deep learning framework
- MobileNetV2: Efficient CNN architecture for mobile deployment
- Scikit-learn: Model evaluation and metrics
- Pandas/NumPy: Data manipulation and numerical computing
- Matplotlib/Seaborn: Data visualization and plotting
- PIL (Pillow): Image processing and manipulation
1. ModuleNotFoundError for numpy, pandas, etc.
- Solution: Make sure you've activated the virtual environment and installed dependencies:
source venv/bin/activate pip install -r requirements.txt
2. Jupyter kernel not found
- Solution: Register the virtual environment as a Jupyter kernel:
source venv/bin/activate python -m ipykernel install --user --name=human-pose-classifier --display-name="Human Pose Classifier"
3. Permission denied errors on macOS
- Solution: Use virtual environment instead of system Python:
python3 -m venv venv source venv/bin/activate
4. TensorFlow installation issues
- Solution: Ensure you have Python 3.8+ and install TensorFlow in the virtual environment:
pip install tensorflow>=2.18.0
If you encounter issues not covered here:
- Check that all dependencies are installed:
pip list - Verify virtual environment is activated:
which python - Ensure Jupyter is using the correct kernel
- Check Python version compatibility:
python --version