Original Source Here
Real-world Example: Car Detection
Multiple companies have been working on self-driving cars for some time now, and who knows, we’d witness powerful cars that are affordable and drive themselves with minimal human input very soon.
These self-driving cars must detect other vehicles on the road to avoid any accidents on the road. It’s a problem that researchers are actively working on to improve existing solutions. And it’ll be a great addition to your portfolio, so why not follow alongside me?
Step 1: Data Annotations
Assuming you have already logged into the Nexus platform, I’m going to list down a few steps.
- From the homepage, click on
create a projectand give it a name, something like “Car Detection.”
typeas “Object Detection” and
contentas “Image.” This helps the platform configure the project repository as needed.
- Then click on the
imageicon from the sidebar, upload all the training images. (Note: I deleted the last training image as the free-tier had an upload limit of 1000 images, but it was more than enough to train our model.)
Since our dataset came with annotations, I uploaded them into the platform, using the
Annotations tab after selecting the “Bounding Box CSV Four Corner Detection” format. Please check this specific page on how your CSV file should be formatted. (Note: In our case, I added an extra “label” column and edited the header accordingly.)
The platform gives you a summary view, and we notice only 354/1000 images are annotated, and we have to annotate the rest. Use the
Annotator tab on the left to inspect images one by one and draw labels quickly. In our case, when inspected, non-annotated images don’t have a car at all.
Don’t worry, even if it looks time-consuming at first, by my 3rd project, I finished my annotations in less than 5 minutes. Talk about setting up the dataset real fast.
Step 2: Model Training
Since we’ve got our data ready, It’s time we create our training pipeline. Here are the steps I followed:
- Click on the
workflowtab on the left to create an empty workflow page.
- Right-click on the empty page and add blocks. The overall workflow should contain three main blocks: Dataset, Augmentations, Model. Drag and connect them in sequence to make it a pipeline
- Tune the parameters by clicking on the blocks. I experimented with a few to settle with the FasterRCNN InceptionV2 640×640 model with a batch size of 2, 5000 epochs, a train test split of 0.2, and some horizontal flip, vertical flip, center crop as the augmentations.
- Before training by clicking on
Preview AugmentationsI compared different sets of augmented techniques and the resulting images, which helped me settle on the specific augmentation techniques I wanted to use.
- Click on
Run Trainingfrom the button on the bottom right corner, and start training. I used 1 Nvidia T4 GPU with the Lowest validation loss as the selection strategy. A summary of our configurations can be seen below.
- It took me about 3 hours for the training to complete, and an integrated TensorBoard was available to analyze the common evaluation metrics. Looking at it, we can tell our model has converged and trained well.
Finally, click on the
artifacts tab, select the artifact that is relevant to the training that was completed. Right-click on it and download the TensorFlow model to your local machine.
We download the model to our local machine so that we can use an open-source visual platform called Portal to make the predictions locally.
Step 3: Inference
We will use a recently released open-source engine, Portal, which integrates with Nexus really well to make the predictions. Portal is the fastest way to load and visualize your deep learning models, period.
Using the “+” icon on the homepage, I registered the TensorFlow model locally by specifying the folder path. Clicking on the registered model again loads the load (Note: you can only have one model loaded at any time.)
Open Folder option under the Assets Folder tab, I loaded the test images we got we downloaded the images. We can perform inference on images one by one or as a bulk operation. I chose the
Bulk Analysis option and let the model make predictions in real-time on the images.
As you can see from the video above, it performed exceptionally well for a project that took me only a couple of days to set up.
As you would realize by now, I intentionally kept the example simple to navigate you through the entire CV stack using the Nexus and Portal platforms; however, the possibilities on these platforms are more.
Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot