Skip to content

Car damage classification from images using a convolutional neural network trained on Peltarian dataset using TensorFlow

Notifications You must be signed in to change notification settings

politecat314/car-damage-detection-peltarion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 

Repository files navigation

car-damage-detection-peltarion

Car damage detection trained on peltarion dataset using Keras (82.84% accuracy on validation set)

hdf5 file of model available at https://drive.google.com/file/d/1LaGm3aXrPWSWNQrTW8ridMiUWFGZZ2b4/view?usp=sharing

Inference

1. download hdf5 file above and place inside src/model/
2. Replace the images in src/test_images with your own
3. Open src/demo.ipynb run

For training the model

1. for each category of images, make a folder inside src/dataset/train/ and place images there
2. Create directory src/model
3. Run src/Transfer_ResNet152v2.ipynb
4. Models are saved inside src/model
5. Follow inference steps above to test the model


For testing this model, create a dir for each category in src/dataset/test
In each categorie's dir, create a dir called Image and keep the images there. For example, 1.jpg will be stored in: src/dataset/test/category1/Image/1.jpg. This is a necessary workaround due to problems with the ```tf.keras.preprocessing.image_dataset_from_directory``` function.

Alt text

Info about the dataset

Dataset available for download here: https://peltarion.com/knowledge-center/documentation/terms/dataset-licenses/car-damage

Image input size is 224x224x3 (RGB). Model classifies images to one of the classes:
0: 'bumper_dent'
1:'bumper_scratch'
2:'door_dent'
3:'door_scratch'
4:'glass_shatter'
5:'head_lamp'
6:'no_damage'
7:'smash'
8:'tail_lamp'

How model was trained

ResNet50 model pretrained on ImageNet is loaded. 2 dense layers added. ResNet50 layers are frozen and the 2 dense layers are trained on peltarian dataset. Refer to \src\Transfer_ResNet50.ipynb for details.

Requirements

Tensorflow 2.6
Pillow 8.3.1

About

Car damage classification from images using a convolutional neural network trained on Peltarian dataset using TensorFlow

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published