Determine whether input image(s) are of crosswalk sign
Chose this because the previous year couldn't manage and needed to see if what they were saying was true (it wasn't). Also, Chat GPT suggested CNN, thus I chose this approach 🫡.
Cropped images of traffic signs to be determined as traffic sign (detection not implemented!!!)
Deep learning, neural network (convolutional neural network)
Different approaches | Pros | Cons |
---|---|---|
CNN | Good performance | Needs large amount of labeled data, High computional cost |
SVM | Good performance on image classification tasks | Poor performance on non-linear separable datasets |
KNN | Easy to implement and understand, Good performance on small datasets | Poor performance on large datasets, high computational cost, poor interpretability (decisions made) |
A Convolutional Neural Network (CNN) is a type of deep learning neural network that is typically used for image and video processing tasks. It is composed of multiple layers, including convolutional layers, pooling layers, and fully connected layers. The convolutional layers are responsible for detecting features in the input data, such as edges and shapes, while the pooling layers reduce the spatial dimensions of the data to make it more manageable. The fully connected layers are used to classify the features detected by the convolutional layers.
Large set of labeled images that represent different traffic sign (including crosswalk sign)
This solution consists of 2 main stages first - training and saving the model, second loading the model and input images and specifing output for every single one of them.
- Building the model.
- Load images, preprocess them and split into train, test and validation sets.
- Make the model using sequential group of linear stack of layers, and compile it.
- Train the model with train dataset and validate it with validation dataset.
- Calculate loss and accuracy using test dataset.
- Save the model.
- Classification of input images.
- Load the model.
- Load all the images to be classified.
- Preprocess loaded images.
- Predict images' labels.
- For every image check if it was predicted as crosswalk sign.
- Print the output.
As the output, {image path} - {result} will be printed in console for each input image
- Image that is not a traffic sign might be interpreted as one if it looks similar (the program will try to find best fitting solution).
- Input image has to be cropped and of traffic sign to be correctly classified.
- Large dataset is needed for model training -> my dataset wasn't that large, thus it might not work sometimes.
- It takes a lot of time to train the model.