Our industrial project is called Intelligent Road Crack Detection using Deep Learning where we create an artificial intelligence (AI) system that is able to classify and detect road cracks on New Zealand roads.
This repositories contains three main folders and two Google Colab files.
Main Folders:
- Faster_R-CNN_Object_Detection
- Image_Classification
- YOLO_v3_Object_Detection
Google Colab Files:
- DenseNet161_Image_Classification.ipynb
- Faster_R_CNN_Object_Detection.ipynb
The Faster_R-CNN_Object Detection folder is the main folder that was used to create the object detection model for our project. Inside this folder, there are two folders which are called Pytorch_OD and RoadDamageDataset. The Pytorch_OD folder contains all the Python code files. The RoadDamageDataset folder contains the road damage image folders of seven Japanese cities from the Road Damage Detection and Classification (RDDC) dataset.
The Image_Classification folder is the main folder that was used to create the image classification model for our project. This folder contains five Convolutional Neural Network (CNN) models and two main datasets. The two main datasets are the Concrete Crack for Image Classification (CCIC) dataset and the RDDC dataset. Each dataset is split into a 70/30 ratio for training and testing. There are two extra training and testing folders which are named AUG_RDDC and Balanced_RDDC. AUG_RDD_Train and AUG_RDD_Test contains augmented images that was used to try and improve the performance of our model. Balanced_RDDC_Test and Balanced_RDDC_Train contains an equal amount of images for each class in the RDDC dataset.
This folder contains Python code files for YOLO v3 object detection and configuration files. The YOLO v3 object detection model was only used for upskilling purposes during the object detection phase in our project. Therefore, it is only provided to show evidence of upskilling.
Option 1: Using the code in the "Image_Classification" and "Faster_R-CNN_Object_Detection" folders.
Option 2: Directly using the Google Colab files which are "DenseNet161_Image_Classification.ipynb" and "Faster_R_CNN_Object_Detection.ipynb".
Proceed to "RoadCrackDetection/Faster_R-CNN_Object_Detection/Pytorch_OD" directory.
If the annotation file is of type XML, there is a Python file called "xml_to_csv.py" to change it to CSV.
Provide the directories of image folders and CSV files.
Define the total number of images in "num_total_for_train_test".
Define the number of test images in "num_test" that will be used for testing.
Once total and test images have been specified, the number of images that will be used for training is defined in the formula:
"num_train = num_total_for_train_test - num_test"
Define the "num_classes" according to your number of classes.
Adjust the learning rate in "lr" and number of epochs in "num_epochs" as you need.
Provide a directory to save and name the trained model. After that, run the model for training.
Define the number of classes and load the trained model that was saved after training.
After that, run the model for testing.
Proceed to "RoadCrackDetection/Image_Classification" directory.
Provide the directories of image folders for training and testing.
(Optional) Change the DenseNet model if you want to use DenseNet-121 or DenseNet-201.
Define the "num_labels" according to your number of classes.
(Optional) Modify the layers of neural network.
Define the number of epoch.
After that, run the model for training and testing.