A complete educational implementation of Mask R-CNN from scratch using TensorFlow/Keras. Learn the complete architecture behind CNNs, ResNet-50, Feature Pyramid Network (FPN), Region Proposal Network (RPN), ROI Align, Object Detection, Classification, Bounding Box Regression, and Instance Segmentation without relying on pre-built implementations.
- ✅ Mask R-CNN implemented from scratch
- ✅ TensorFlow/Keras Functional API
- ✅ ResNet-50 Backbone
- ✅ Feature Pyramid Network (FPN)
- ✅ Region Proposal Network (RPN)
- ✅ ROI Align
- ✅ Detection Head
- ✅ Mask Head
- ✅ Bounding Box Prediction
- ✅ Multi-class Object Detection
- ✅ Pixel-level Instance Segmentation
- ✅ Educational implementation with detailed explanations
Mask R-CNN is one of the most influential deep learning architectures in Computer Vision.
Unlike traditional CNN models that only classify images, Mask R-CNN can simultaneously perform:
- Image Classification
- Object Detection
- Bounding Box Prediction
- Instance Segmentation
- Confidence Score Prediction
This repository focuses on understanding how every component works internally, instead of simply using an existing implementation.
This repository explains and implements:
- Convolutional Neural Networks (CNN)
- Feature Maps
- Convolution Mathematics
- Padding
- Stride
- Pooling
- Batch Normalization
- Residual Learning
- ResNet-50
- Feature Pyramid Network (FPN)
- Anchor Generation
- Region Proposal Network (RPN)
- ROI Align
- Classification Head
- Bounding Box Regression
- Mask Prediction
- Non-Maximum Suppression (NMS)
- Loss Functions
- Training Pipeline
- Inference Pipeline
Input Image
│
▼
ResNet-50 Backbone
│
▼
Feature Pyramid Network (FPN)
│
▼
Region Proposal Network (RPN)
│
▼
ROI Align
│
├───────────────┐
▼ ▼
Detection Head Mask Head
│ │
▼ ▼
Bounding Boxes Segmentation Masks
│
▼
Final Predictions
mask-RCNN-from-scratch/
├── images/
├── models/
│ ├── backbone.py
│ ├── detection_head.py
│ └── mask_head.py
│
├── backbone.py
├── config.py
├── dataset_loader.py
├── training.py
├── main.py
├── utils.py
└── .gitignore
- Modular implementation
- Clean code structure
- Beginner-friendly
- Well-documented code
- Educational project
- Easily extendable
- Research-oriented implementation
- Python
- TensorFlow
- Keras
- NumPy
- OpenCV
- COCO Dataset
- Matplotlib
- Convolution
- Activation Functions
- Pooling
- Padding
- Stride
- ResNet-50
- Multi-scale Feature Extraction
- Anchor Generation
- Proposal Scoring
- Bounding Box Regression
- Accurate Feature Extraction
- Quantization-free Region Pooling
- Object Classification
- Bounding Box Refinement
- Pixel-wise Instance Segmentation
- Project Setup
- CNN Fundamentals
- Convolution Mathematics
- ResNet-50
- Feature Pyramid Network
- Region Proposal Network
- ROI Align
- Detection Head
- Mask Head
- Complete Mask R-CNN
- COCO Dataset Training
- Inference Pipeline
- Computer Vision Learners
- Deep Learning Enthusiasts
- AI Students
- Research Students
- Machine Learning Engineers
- TensorFlow Developers
- Interview Preparation
- University Projects
- Final Year Projects
Mask R-CNN, Mask RCNN, CNN, Convolutional Neural Networks, TensorFlow, Keras, Computer Vision, Deep Learning, Neural Networks, Object Detection, Instance Segmentation, ResNet, Feature Pyramid Network, Region Proposal Network, ROI Align, COCO Dataset, Image Segmentation, Artificial Intelligence, Machine Learning.
If this repository helps you learn Mask R-CNN, consider giving it a ⭐.
Your support helps the project reach more students and developers.
NAGARGOJE UTTAM
Passionate about Artificial Intelligence, Deep Learning, Computer Vision, Machine Learning, and building educational implementations of advanced neural network architectures from scratch.
This project is released under the MIT License.
- Training on COCO Dataset
- Real-time Inference
- Custom Dataset Training
- Faster Training Pipeline
- Model Evaluation
- Visualization Tools
- ONNX Export
- TensorRT Optimization
- Docker Support
- Research Documentation
"Don't just use AI models. Understand how they work from the ground up."