{"id":24360400,"url":"https://github.com/dms-codes/hand-gesture","last_synced_at":"2025-10-16T15:06:21.932Z","repository":{"id":259669343,"uuid":"879166979","full_name":"dms-codes/hand-gesture","owner":"dms-codes","description":"This project performs gesture recognition using a Convolutional Neural Network (CNN) model on a custom dataset of grayscale images. The dataset is structured in folders, each representing a unique gesture, and the project involves preprocessing the images, training a CNN model, and evaluating it with multiple metrics.","archived":false,"fork":false,"pushed_at":"2024-11-26T18:08:31.000Z","size":6933,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T08:34:48.944Z","etag":null,"topics":["cnn","handgesture-recognition","python"],"latest_commit_sha":null,"homepage":"https://github.com/dms-codes/hand-gesture","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dms-codes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-27T07:10:28.000Z","updated_at":"2024-11-26T18:08:34.000Z","dependencies_parsed_at":"2025-03-12T08:38:34.521Z","dependency_job_id":null,"html_url":"https://github.com/dms-codes/hand-gesture","commit_stats":null,"previous_names":["dms-codes/hand-gesture"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dms-codes/hand-gesture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dms-codes%2Fhand-gesture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dms-codes%2Fhand-gesture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dms-codes%2Fhand-gesture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dms-codes%2Fhand-gesture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dms-codes","download_url":"https://codeload.github.com/dms-codes/hand-gesture/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dms-codes%2Fhand-gesture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270885312,"owners_count":24662441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","handgesture-recognition","python"],"created_at":"2025-01-18T21:19:40.010Z","updated_at":"2025-10-16T15:06:16.871Z","avatar_url":"https://github.com/dms-codes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hand Gesture Recognition using Deep Learning Models\n\nThis project implements multiple deep learning models to recognize hand gestures using a dataset of grayscale images. The supported architectures include CNN, LeNet-5, AlexNet, and VGGNet. Each model is evaluated for its effectiveness, accuracy, and resource efficiency, allowing users to select a model suitable for their specific application.\n\n---\n\n## Features\n- **Supports Multiple Architectures**: CNN, LeNet-5, AlexNet, and VGGNet.\n- **Model Evaluation**: Generates confusion matrices, classification reports, and accuracy/loss graphs.\n- **Custom Dataset Handling**: Creates datasets from labeled gesture images.\n- **Model Persistence**: Saves and loads trained models for future use.\n- **Plug-and-Play**: Easily switch between different architectures with minimal changes.\n\n---\n\n## Prerequisites\nBefore running the project, ensure you have the following dependencies installed:\n\n- Python (\u003e= 3.7)\n- NumPy\n- Pillow (PIL)\n- Matplotlib\n- Seaborn\n- Scikit-learn\n- TensorFlow/Keras\n- pickle (standard Python library)\n\nTo install missing packages, run:\n\n```bash\npip install numpy pillow matplotlib seaborn scikit-learn tensorflow\n```\n\n---\n\n## File Structure\n- **Input Data**: Gesture images should be stored in the `input/leapGestRecog` directory, organized into subdirectories representing gesture classes.\n- **Model Files**: Saved models are stored with architecture-specific names (e.g., `gesture_model_cnn.keras`, `gesture_model_alexnet.keras`).\n- **Reports and Plots**:\n  - Confusion matrices (`confusion_matrix_\u003cmodel\u003e.png`)\n  - Training history graphs (`training_history_\u003cmodel\u003e.png`)\n  - Classification reports (`report_model_\u003cmodel\u003e.txt`)\n\n---\n\n## How to Use\n\n### 1. Dataset Preparation\nPlace gesture images in the `input/leapGestRecog` directory. Ensure the folder structure is organized with subdirectories named after each gesture class.\n\n### 2. Running the Program\nExecute the script by running:\n\n```bash\npython main.py\n```\n\n### 3. Model Selection\nTo switch between models, update the `MODEL_TYPE` variable in the `__main__` block:\n```python\nMODEL_TYPE = MODEL_TYPE_CNN       # For CNN\nMODEL_TYPE = MODEL_TYPE_LENET5    # For LeNet-5\nMODEL_TYPE = MODEL_TYPE_ALEXNET   # For AlexNet\nMODEL_TYPE = MODEL_TYPE_VGGNET    # For VGGNet\n```\n\n### 4. Outputs\n- **Training History**: Graphs of accuracy and loss for both training and validation phases.\n- **Confusion Matrix**: Visual representation of model predictions.\n- **Classification Report**: Detailed precision, recall, and F1-score metrics.\n\n### 5. Resuming from a Saved Model\nIf a saved model exists for the selected architecture, it will be automatically loaded. Otherwise, a new model will be trained, evaluated, and saved.\n\n---\n\n## Model Architectures\n\n### 1. **Convolutional Neural Network (CNN)**\n- Lightweight and fast to train.\n- Ideal for real-time applications with near-perfect accuracy.\n\n### 2. **LeNet-5**\n- A classic architecture with low computational cost.\n- Suited for small datasets or systems with limited resources.\n\n### 3. **AlexNet**\n- High accuracy but computationally expensive.\n- Best for applications requiring precision over speed.\n\n### 4. **VGGNet**\n- Highly accurate with deep layers.\n- Resource-intensive, suitable for high-performance systems.\n\n---\n\n## Results\nThe project evaluates each model based on:\n- **Test Accuracy**: Overall model performance on unseen data.\n- **Misclassifications**: Insights from confusion matrices.\n- **Training History**: Visual trends of model learning.\n\nExample outputs:\n- Training history (`training_history_\u003cmodel\u003e.png`)\n- Confusion matrix (`confusion_matrix_\u003cmodel\u003e.png`)\n- Evaluation report (`report_model_\u003cmodel\u003e.txt`)\n\n---\n\n## Future Enhancements\n- **Data Augmentation**: Introduce techniques like flipping, rotation, and scaling to improve generalization.\n- **Real-World Testing**: Deploy the model on embedded systems (e.g., Raspberry Pi) for gesture recognition in real-time.\n- **Additional Models**: Explore architectures like ResNet or MobileNet for better performance.\n\n---\n\n## License\nThis project is distributed under the MIT License.\n\n---\n\n**Author**: Donny Marthen Sitompul  \n**Course**: Artificial Intelligence for Engineers (DAT305)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdms-codes%2Fhand-gesture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdms-codes%2Fhand-gesture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdms-codes%2Fhand-gesture/lists"}