Here’s the updated README.md with the screenshots you provided:
This project applies deep learning to classify hand gestures representing rock, paper, and scissors. It leverages Convolutional Neural Networks (CNN), along with data augmentation and image preprocessing, to achieve high accuracy in a multiclass classification task.
- Project Overview
- Dataset Description
- Model Architecture
- Training Process
- Evaluation Metrics
- Results
- Use Case
- How to Use
- Dependencies
- Acknowledgments
Hand gestures such as rock, paper, and scissors are universally recognized, making them an ideal use case for image classification tasks. This project explores the use of CNNs to classify these gestures. The model was trained and tested using TensorFlow and Keras frameworks, achieving remarkable accuracy.
Key Highlights:
- Dataset: 2,188 labeled images categorized into rock, paper, and scissors classes.
- Model: A CNN model trained with transfer learning and augmented data.
- Performance: Achieved an accuracy of over 96% during training and validation.
- Environment: Developed using Python in Google Colaboratory.
The dataset consists of labeled images sourced from Dicoding Academy. It is split into training and validation sets as follows:
- Training Set: 1,314 images (60% of the dataset)
- Validation Set: 874 images (40% of the dataset)
Each image was resized to 150x150 pixels for uniform input to the CNN model.
Rock-Paper-Scissors Sample Images:

The model employs a sequential CNN architecture designed for feature extraction and classification:
- Convolutional Layers:
- 3 convolutional layers with ReLU activation.
- MaxPooling layers for dimensionality reduction.
- Fully Connected Layers:
- Flattening layer to convert 2D feature maps into 1D vectors.
- Dense layers with 128 and 512 neurons, followed by a softmax output layer for multiclass classification.
- Regularization:
- Dropout (55%) to prevent overfitting.
- Optimizer: Adam optimizer with a learning rate of 0.0007.
- Loss Function: Categorical cross-entropy for multiclass classification.
Optional: Transfer learning with VGG16 was explored for enhanced feature extraction.
- Data Augmentation:
- Random rotation up to 40 degrees.
- Horizontal flips, zoom, and brightness adjustments.
- Normalized pixel values to improve model generalization.
- Dataset Partitioning:
- Training Data: 60% of the dataset.
- Validation Data: 40% of the dataset.
- Early Stopping: Training halts once accuracy exceeds 96%.
- Training Environment:
- Conducted in Google Colaboratory.
- Training completed in under 30 minutes.
The model was evaluated based on:
- Accuracy: Overall correctness of predictions.
- Loss: Difference between predicted and actual values.
- Confusion Matrix: Visualizes classification results.
- Training Accuracy: >96%
- Validation Accuracy: >95%
This repository is useful for developers, educators, and students learning about CNNs for image classification. It provides a hands-on demonstration of applying deep learning to a simple yet effective task like hand gesture recognition.
- Download the dataset:
wget https://github.com/dicodingacademy/assets/releases/download/release/rockpaperscissors.zip - Extract the dataset and place it in the project folder.
- Install required dependencies:
pip install tensorflow keras matplotlib - Run the Jupyter Notebook on Google Colab:
- Train the model from scratch or use pre-trained weights provided in the repository.
- Test the model by uploading custom images with a green-screen background.
The project requires the following:
- TensorFlow 2.8.2
- Keras
- Matplotlib
- Python 3.7 or higher
This project was completed as part of Dicoding Academy's "Machine Learning for Beginners" course. Special thanks to:
- Dicoding Academy for the dataset and guidance.
- The TensorFlow and Keras teams for their excellent documentation and tools.
Plagiarism is discouraged. Please give credit to this repository if you find it useful for your work or research. Learning and innovation thrive on integrity and collaboration.
Let me know if you need further refinements or additional elements!





