< back



Tyre Maintenance


Maintaining proper wheel quality is incredibly important for good road safety. For organisations owning larger fleets of vehicles, taking them off the road for maintenance can be costly. Being able to better plan when maintenance is needed, and on what parts of the vehicle through smarter predictions can significantly reduce expenses.

In this project we collected images of tyres (~300 in total) to test the hypothesis on whether it's possible to predict the tyre tread depth on single camera input images using deep learning techniques. Despite the small dataset, we chose a design that can easily be scaled up to millions of samples with virtually no changes to the code.

Although the dataset is very small, this early-stage experiment seems to indicate that it is possible to predict the tread depth of tyres using deep learning techniques. More data should however be collected to verify the results with greater confidence. Another, plausible more important aspect, is whether it's easier to take a photo of sufficient quality of a tyre rather than just using current methods available on the market.


Table of Contents


Start by loading a batch of images and visualise them so we get a feeling for what we are working with.

The images look good. Since we have so little data I will do data augmentation directly, even though it introduces complexity at an early stage.

Create Image Data Generators with Augmentation

They should be equal in terms of shape - and they are.

Conversely, there should be NO augmentation on the validation set.

Check class distributions.

We have a significant class imbalance problem here where 82.5% of the data belong to the larger class 3. The smallest class 1 only make up for 1.5% of the total.

Train a simple model from scratch without Dropout

Start by training a simple model from scratch. Add data augmentation but no Dropout. We will be using the largest class (82.5%) as baseline for the model to beat.

Well, the model seem to learn something at least as the train accuracy increases. However, due to the small network it stagnates very early on. The validation accuracy is always the same at 82.5%, which is equivalent to the largest class. The model is thus seemingly only predicting the largest class. Let us experiment with a larger network.


Training a larger model from scratch

So far, this doesn't look promising. Let's try an even larger model before taking another approach.


Even larger model from scratch

We can confirm that the model consistently predicts everything as belonging to class 3.

Using pre-trained models (Transfer Learning)

Use an Xception architecture pre-trained on Imagenet.

It's necessary to freeze the convolution base of a pre-trained model as Xception in order to train a randomly initiated classifier on top. Conversely, it's highly recommended to fine-tune the top layers of a convolutional base once the classifier on top has already been trained. If the classifier hasn't been trained, then the error signal propagating through the network during training will be too large, and the representations previously learned by the layers being fine-tuned will be destroyed. For that reason, the steps moving forward will be:


Freeze the convolutional base before compiling and training the model. Very important!

This is exciting and above expectations. It shows how powerful transfer learning can be! It is not merely predicting the largest class all the time and is achieving both precision and recall at around 95% on the validation set. A relative improvement of 12% compared with the baseline.

Fine-tune the pre-trained model

Move on to the last two steps:


Unfreeze the last six layers belonging to "block14" (this can later be re-adjusted).

Fine-tuning the pre-trained Xception model boosts both precision and recall to around 97%. Great!

Summary

This initial experiment indicate that it is possible to learn to classify the thread depth of tyres by training a deep learning model on single camera input images. Although the more basic architectures trained from scratch failed to yield useful results, making use of transfer learning and an Xception model pre-trained on ImageNet indicates that this can possibly be done. This despite using a very small dataset of a total 315 images with significant class imbalance. It's also very important to note that the performance has been calculated on the validation set as the data was too small to be split into three pieces; train, validation and test sets.

The first thing to address moving forward would be to collect more data. That would allow us to more confidently assess how the model performs. Another consideration is also whether it's easier to take an accurate photo of a tyre rather than just using current methods available on the market.