MITB Banner

Step by Step Guide To Object Detection Using Roboflow

We will discuss each of the steps in the task of object detection using roboflow.

Share

roboflow

Roboflow is a Computer Vision developer framework for better data collection to preprocessing, and model training techniques. Roboflow has public datasets readily available to users and has access for users to upload their own custom data also. Roboflow accepts various annotation formats. In data pre-processing, there are steps involved such as image orientations, resizing, contrasting, and data augmentations

The entire workflow can be co-ordinated with teams within the framework. For model training, there’s a bunch of model libraries already present such as EfficientNet, MobileNet, Yolo, TensorFlow, PyTorch, etc. Thereafter model deployment and visualization options are also available hence encompassing the entire state-of-art. 

Roboflow is used in various computer vision industries for use cases such as – gas leak detection, plant vs weed detection, aeroplane maintenance, roof damage estimator, satellite imagery, self-driving cars, traffic counter, garbage cleaning, and many more.

Steps To Use Roboflow in Object Detection:

1.Dataset Loading

2.Labeling

3.Organise

4.Process

5.Train

6.Deploy

7.Display

Roboflow has an account set up for each user. Now we will discuss each of the steps in the task of object detection.

1. Dataset Loading

Roboflow has both public and private datasets. Public datasets can be accessed from the website itself and private datasets can be uploaded by users.

roboflow

We can select any dataset we feel like from these or upload our own custom dataset from the ‘your dataset’ section. If you wish to use public datasets make sure to fork it after opening. After forking a dataset if we wish we can also add our own images. 

2. Labeling

Public datasets come with annotations. For custom datasets, we need to make sure to have annotations. Roboflow annotations aren’t always available to all users but users can contact them for the service. Labelling images can be done with a free open source software LabeIImg in python. Labelling is basically drawing bounding boxes to get the notations of where exactly the object is present in the image. Roboflow has the feature to correct annotation errors and provide statistics of images with and without annotations.

3. Organise

Team collaboration is easily possible using roboflow team sharing. For every version of changes made to data will be reflected directly to anyone from the team using it. There’s also an option for public sharing which will be reflected in the roboflow community. 

4.Process

Various steps are involved in processing such as a health check of the dataset could be done to check if the dataset is imbalanced for classification models and other such insights about data. Data modifications can be done in the following ways:

I’ve uploaded a custom dataset of Indian coins to predict the category of coins( Re 1, Rs 2, Rs 5, Rs 10)

roboflow

After the needful steps, we generate a version of the dataset and export it in the format as required all the files in a zipped form. There are various formats COCO JSON, Pascal VOC, YOLO, Tensorflow Object Detection, Multiclass Classification, etc.  The code-free versions are not available in the free tier, those generate models directly from the cloud- AWS, GCP, or Azure. To use the downloaded code in Google Colab notebook a unique code is generated which should not be shared with anyone.

5. Train

Roboflow provides train-valid-test split ratio. The models’ library in roboflow will let us select different training models available to be used on Google Colab notebook directly.

Make sure to first copy the drive and then make changes into the notebook.  

Paste the link acquired from the previous step into the 2nd cell of the Colab notebook.

Run subsequent cells where code for training is already present. This might take some time and then visualize the model performance.

Last iteration Output:

(next mAP calculation at 8000 iterations) 
Last accuracy mAP@0.5 = 61.67 %, best = 80.83 % 
8000: 0.004265, 0.003273 avg loss, 0.000026 rate, 0.733761 seconds, 384000 images, 0.020533 hours left
calculation mAP (mean average precision)...
12
detections_count = 27, unique_truth_count = 11  
class_id = 0, name = Re1, ap = 50.00%   (TP = 3, FP = 2) 
class_id = 1, name = Rs10, ap = 33.33%   (TP = 1, FP = 2) 
class_id = 2, name = Rs2, ap = 100.00%   (TP = 3, FP = 0) 
Class_id = 3, name = Rs5, ap = 46.67%   (TP = 1, FP = 1) 
for conf_thresh = 0.25, precision = 0.62, recall = 0.73, F1-score = 0.67 
for conf_thresh = 0.25, TP = 8, FP = 5, FN = 3, average IoU = 49.10 % 

6. Deploy

Run model on cloud or system. Use models on mobile or servers or both. Weights that have provided the best results are automatically saved.

7. Display

I’ve trained a custom dataset of Indian coins using roboflow to predict the category of coins( Re 1, Rs 2, Rs 5, Rs 10) after following all the above steps and training model on Yolov4 tiny. Along with classification it also tracks the objects.

roboflow

Our model seems to have predicted well. Note that this image is from the test set and not the train set.

Conclusion

Roboflow helps in every step of computer vision problem right from data collection to deployment. Roboflow enhances performance by its efficient parameters readily available to use.    
You can find the complete notebook of the above implementation in AIM’s GitHub repositories. Please visit this link to find this notebook.

Share
Picture of Jayita Bhattacharyya

Jayita Bhattacharyya

Machine learning and data science enthusiast. Eager to learn new technology advances. A self-taught techie who loves to do cool stuff using technology for fun and worthwhile.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.