Damaged Road Detection: Mask R-CNN on Supervisely

Damaged Road Detection: Mask R-CNN on Supervisely

In this project, we are going to create our own model using transfer learning from the existing Mask R-CNN model to detect the damages on roads.

Supervisely is the leading platform for the entire computer vision lifecycle: from image annotation to building custom neural networks. It is a web platform where you can find everything you need to build Deep Learning solutions within a single environment.

Mask R-CNN

Mask Regional Convolutional Neural Network (R-CNN) is an extension of the Faster R-CNN object detection algorithm that adds extra features such as for instance segmentation and an extra mask head. This allows us to form segments on the pixel level of each object and also separate each object from its background.

The framework of Mask R-CNN is based on two stages:

  • First, it scans the image to generate proposals; which are areas with a high likelihood to contain an object.
  • Second, it classifies these proposals and creates bounding boxes and masks.
No alt text provided for this image

Let's begin Creating our model using Transfer Learning to identify damaged roads.

1. Create an account on Supervisely and login to your account:

No alt text provided for this image

2. Create a workspace that will contain your projects:

No alt text provided for this image

Your workspace is created.

No alt text provided for this image

3. Now we have to upload the images of damaged roads which I collected from internet,

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

4. Now we have to do image segmentation to segment the part of a road that is damaged which is very easy to do with Supervisely, it annotates automatically.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image


5. Now we require a large dataset for training our model so run DTL for image augmentation to create train and Val dataset.

No alt text provided for this image

6. It automatically gives the code that we require to do augmentation (we can change the multiply value to increase the size of the dataset).

No alt text provided for this image
No alt text provided for this image

7. So now we are ready with the input dataset to be given to the neural network for model training.

No alt text provided for this image

8. We are using a pre-created model and doing transfer learning, so adding a Neural Network, I used the coco model and cloned it to my workspace.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

9. Now we have a neural network and want to train the model.

No alt text provided for this image

>> When we go for train, it asks for agent. Now for trainig and testing our model we need to provide our own resources as supervisely doesn't provide it. So we have to attach an agent which can be our own machine or any cloud instance. Supervisely Agent is a simple open-source task manager available as a Docker image.

>> The Agent runs on a worker node. It connects to the Supervisely WEB instance and listens for the tasks (like neural net training request) to run. It handles downloading and uploading data to the web instance, sets up proper environments for the specific tasks to run, and keeps track of progress, successes and failures of individual tasks

No alt text provided for this image

10. Add an agent on the cluster page, it will give the instructions to follow.

No alt text provided for this image
No alt text provided for this image

11. The agent we provide should meet the requirements given (it should have GPU). So here I am using aws instance satisfying the requirements, using a deep learning image.

No alt text provided for this image

12. Select a GPU instance ( you may require to request for quota increase from aws support otherwise you won't be able to use it )

No alt text provided for this image
No alt text provided for this image

So, our instance is now ready.

No alt text provided for this image

Our agent is running, now we can train our Mask R-CNN model,

No alt text provided for this image

13. Go to Neural Networks and click on train, select the input project (our dataset)

No alt text provided for this image
No alt text provided for this image

The task will start now,

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

As we can see, model training and epochs have started.

No alt text provided for this image

Finally model is Trained Successfully!

No alt text provided for this image
No alt text provided for this image

We can check the logs,

No alt text provided for this image

This is workflow of the trained model,

No alt text provided for this image

We can see one more NN is added here, which is our trained neural network. Now we are testing our model,

No alt text provided for this image

14. Creating Best Training model for testing.

No alt text provided for this image
No alt text provided for this image

15. Adding other road images as input to it,

No alt text provided for this image
No alt text provided for this image

Model testing will start and we will get the testing result soon,

No alt text provided for this image

This is the complete workflow,

No alt text provided for this image

Finally we have tested our mask R-CNN model and it is working successfully as shown in the image,

No alt text provided for this image

So, this was how we can create our own Mask R-CNN model on Supervisely.

Hope you will find this article interesting. keep supporting guys ???? Like and comment how's article.

THANK YOU !!!


要查看或添加评论,请登录

社区洞察

其他会员也浏览了