-
Notifications
You must be signed in to change notification settings - Fork 4
Create README.md #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pshivraj
wants to merge
10
commits into
master
Choose a base branch
from
training_pipeline_doc
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Create README.md #37
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
af7e289
Create README.md
pshivraj ef3050b
Added more inputs to model training
pshivraj 884fa36
Update header
pshivraj 3006406
Update mrcnn/README.md
pshivraj 77a36f2
Fixed Typo
pshivraj 12d29f7
Update mrcnn/README.md
pshivraj 760b158
Update mrcnn/README.md
pshivraj 0bfc2e6
Update mrcnn/README.md
pshivraj ebb1444
Fixed bullet points
pshivraj 9212d65
Update README.md
pshivraj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Model Training | ||
|
||
## Table of Contents | ||
|
||
1. [Introduction](#introduction) | ||
1. [Examples](#examples) | ||
1. [Usage](#usage) | ||
|
||
|
||
## Introduction | ||
|
||
|
||
## Setup | ||
|
||
Run data syntheszer module to generate the training datasets in the following folder structure: | ||
|
||
~~~~~~~ | ||
project | ||
|-- mrcnn | ||
|-- scipts | ||
|-- config.py | ||
|-- model.py | ||
|-- train.py | ||
|-- pre_process.py | ||
|-- requirements.txt | ||
|-- utils.py | ||
|-- visualize.py | ||
|-- Inference_notebook.ipynb | ||
|-- utils.py | ||
|
||
|--- mask_data | ||
|-- id_map.json | ||
|-- logs/ | ||
|-- mask_rcnn_coco.h5 | ||
|-- test_image | ||
|-- train_image | ||
~~~~~~~ | ||
|
||
## Training | ||
|
||
|
||
### Pre-processing | ||
Data pre-processing using pre_process.py to generate .h5 file for masks. | ||
|
||
|
||
### Model and Training | ||
|
||
``` | ||
pshivraj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-- Modified Matterport's implementation of Mask-RCNN deep neural network for object instance segmentation. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you replace all There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for this, updated the file now with bullets. |
||
Model - Added two new methods to train just specific masks. | ||
mrcnn_mask: Just mask layers | ||
mask_heads: Mask layers or rpn/fpn | ||
Multiclass- Pre_processed images and mask files accordingly to prepare for multi classification. | ||
-- Increased maximum number of predicted objects since an image can contain 200 or more bottles/bags/boxes. | ||
-- Increased POST_NMS_ROIS_TRAINING to get more region proposals during training. | ||
-- Resized images and masks to 512x512. | ||
-- Used Default anchor size as we do not expect small objects: RPN_ANCHOR_SCALES = (16, 32, 64, 128, 256) | ||
-- Relied heavily on deep image augmentation due to small training set: | ||
Random horizontal or vertical flips | ||
Random 90 or -90 degrees rotation | ||
Random rotations in the range of (-20, 20) degrees | ||
Random scaling of image and mask scaling in the range (0.5, 2.0) | ||
-- Used Resnet101 architecture as a backbone encoder. | ||
-- Trained the model with Adam optimizer for 65 epochs: | ||
-- 5 epochs of heads with learning rate 1e-4 (To speed up the training process) | ||
-- 30 epochs with learning rate 1e-5 | ||
-- 30 epochs with learning rate 1e-6 | ||
-- changed mAP computation to be (0.5 - 0.8) | ||
-- weighted mAP | ||
-- weighted loss | ||
LOSS_WEIGHTS = { | ||
"rpn_class_loss": 20., | ||
"rpn_bbox_loss": 1., | ||
"mrcnn_class_loss": 10., | ||
"mrcnn_bbox_loss": 1., | ||
"mrcnn_mask_loss": 10. | ||
} | ||
|
||
``` | ||
pshivraj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Model Execution and Run-Time | ||
Run python pre_process.py to pre-process data | ||
pshivraj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Run python train.py to train the model. Model weights are saved at ../data/logs/kaggle_bowl/mask_rcnn.h5. | ||
pshivraj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Run python inference_notebook.ipynb.py to evaluate model performance on test set | ||
|
||
|
||
The following execution times are measured on Nvidia P100 GPUs provided by AWS Deep learning AMI | ||
|
||
``` | ||
pshivraj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Each training epoch takes about 25 minutes. | ||
It takes about 18 hours to train the model from scratch. | ||
``` | ||
pshivraj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Example model predictions | ||
|
||
[put graphs from notebook] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.