5 Steps to Build a Custom Car Identifier in Minutes
For this article, we hired Becca Miller, a freelance software developer and technical writer, to build a custom car identifier with Nyckel image classification. Becca details her experience below and shares how you can build the image classifier yourself.
Identifying car makes and models is a common need for many organizations. For example, a busy car dealership might want to accelerate the process of categorizing its vehicle inventory by make, model, and color. Meanwhile, a transportation department might need to identify and classify the makes and models of cars passing through their tollways to help identify vehicle owners. Organizations like these benefit from leveraging machine learning and computer vision to quickly identify car makes and models using tools such as a car identifier API.
Although you can use pretrained models like Google’s Cloud Vision API to tag cars, they often provide generic labels such as “car” and “wheel” rather than the details that matter, like car brand or model. For that level of precision, you’ll need to train a custom classifier, which enables you to use your own data to train a model.
While “custom” frequently implies a difficult and time-consuming undertaking, that doesn’t have to be the case. In this article, we’ll show you how quick and straightforward it is to build a custom car identifier with Nyckel.
Create a custom car identifier in 5 steps
For this example, we’ll use the Stanford Car Dataset to train an image classification function with Nyckel. This dataset contains over 16,000 car images across 196 classes of cars, with each class labeled by make, model, and year. It includes data from popular car brands like Ford and Jeep.
In this example, we’ll be focusing on cars at the make (i.e., brand) level, and specifically, we’ll aim to identify whether a given car is a Jeep. If you need your model to label other features, like color, you could create an image tagging function to assign multiple labels to one image.
(Note: This dataset is missing many new car makes and models. We’re using it as an illustrative example, but we recommend building a dataset of your own when creating your custom car identifier.)
1. Collect training data
The first step to creating an effective car identifier is to collect strong training data. Include a diverse array of images that feature the vehicles you want to detect in various environments and scenarios where the car isn’t perfectly displayed. This image variety enables your image classifier to learn to recognize your car brand even if the image is obscure or imperfect and helps ensure good model performance.
We start by taking all 220 Jeep images from the training dataset and placing them in a folder labeled “Jeep.” These include images of the Jeep Compass SUV 2012, Jeep Grand Cherokee SUV 2012, Jeep Liberty SUV 2012, Jeep Patriot SUV 2012, and Jeep Wrangler SUV 2012. Because this is such a large dataset, for our other car examples, we’ll take one car image from each make, model, and year combination, resulting in a subset of 191 images. The resulting dataset includes cars from over 40 makes, such as Ford, Toyota, and Honda, as well a range of model years between 1991 and 2012. We’ll place these images in a folder labeled “Not_Jeep.”
2. Upload your data to Nyckel
To upload your data to Nyckel, you first need to create an image classification function. This is as simple as two clicks: set your input to “image” and your output to “classify.” Next, you can import your training data into Nyckel’s platform.
Nyckel lets you bulk-upload and bulk-label your images, simplifying the data annotation process. You can efficiently upload your data by selecting images in batch sizes (limited to 1,000 images per batch) and assigning labels accordingly. In this case, labeling the data is as simple as saving them into separate folders (e.g., “Jeep” and “Not_Jeep”), like we did in the previous step. We can then label all the images at once when we upload a folder. If you prefer, you can also manually annotate the images after uploading them. Two of the images in the “Jeep” category and one of the images in the “Not_Jeep” category were too large to import, so our upload includes 218 “Jeep” images and 190 “Not_Jeep” images.
After your data is uploaded and annotated, Nyckel immediately starts training your model. As the model trains, you’ll see an indicator on the side of your screen telling you how confident Nyckel is in its model predictions. This immediate feedback allows you to monitor and assess the accuracy and performance of your car identifier in real-time.
3. Try out the model
After the model finishes training, we can check its performance and see that it correctly identified 216 out of 218 Jeep vehicles as “Jeep” (99.1%) and 187 out of 190 other cars as “Not_Jeep” (98.4%).
We can look at the specific examples that our model got incorrect. For example, our model incorrectly classified these two Jeep images as “Not_Jeep”:
To improve our model’s performance, we can always add more training data to our model, focusing on features and data samples that our model has difficulty with. For example, including additional photos of boxy vehicles from other car brands.
4. Deploy the model into your systems using our API
Once the car identifier is trained and ready to go, the next step is to deploy the model into your systems using Nyckel’s API. Nyckel makes this deployment process simple so that you can easily integrate your model into your existing infrastructure.
Through Nyckel’s API, your model automatically runs on optimized hardware, eliminating the need for you to grapple with hardware-related complexities. Because Nyckel handles scaling demands and performance optimization, you can focus on getting the most out of your car identifier while enjoying the benefits of a high-performance API.
5. Monitor and improve model performance
Nyckel provides tools that make it easy to monitor and enhance your car identifier’s performance. Its invoke capture feature makes refining and fine-tuning your model quick and intuitive. This feature automatically captures random data and data with low confidence predictions from the model’s invokes so that you can annotate this data to retrain the model, ultimately improving the model’s performance.
Demo: My experience building a car identifier with Nyckel
Overall, building a car identifier with Nyckel was quick and easy. Most of my time was spent organizing the Car Dataset into “Jeep” and “Not_Jeep” folders.
The only obstacle I ran into was when I was uploading the data. The UI did not inform me which three images within the directory were too large to upload. Since Nyckel converts the uploaded images to new names, I excluded those entries from the training process rather than converting them to a smaller size. Once the data finished uploading, the model started training immediately, and I was able to examine the model’s performance within minutes.
Walk through this clickable demo to see the process I followed to train a Nyckel image classification function to detect the vehicle model:
Nyckel vs. prebuilt car identifier
There are many prebuilt car identifiers and image recognition tools available. And while these tools may work well for certain use cases, custom car identifiers (like the one we built with Nyckel) offer several benefits.
The most noticeable distinction is that prebuilt car identifiers are trained using a set selection of vehicle make, models, and years. With a custom car identifier, however, you provide your own training data, so you can build a tool that’s optimized to detect the cars that are relevant to you.
Second, Nyckel’s built-in data engine makes it easy for you to improve your model over time with new samples of real-world data. This is especially important in the automotive industry since new car models are released every year. As new car models are released, you can update your car identifier to incorporate them, improving model recognition. With Nyckel, you can adapt your car identifier to accurately identify vehicles even as the car landscape changes.
Nyckel provides the flexibility, accuracy, and adaptability that businesses need to create a reliable car identifier. If you’d like to take the next step, sign up for a free Nyckel account to create your custom car identifier. Run into any issues along the way? Reach out to us at any time.