Skip to content

Convolutional Neural Networks for Delamination Assessment

Evan McLaughlin edited this page Mar 29, 2019 · 4 revisions

The CNN for defect detection module contains code specifically for delamination assessment. This code can:

  1. Train a dataset of pixel-wise labeled infrared images to automatically detect and localize delaminations
  2. Test and visualize a single prediction generated by a saved network
  3. Evaluate a model’s metrics on a given dataset
  4. Generate prediction output for a set of input data ran through a saved network

Instructions

Training via train_delam.py

The following steps are all adjustments made to variables in the code.

  1. Define the input shape of the model and number of classes
  2. Adjust the validation and training directory
  3. Compile the model to select optimizer and metrics to track. If unsure, leave as default
  4. Set batch size, image height, and image width
  5. Set the desired number of:
    • Steps per epoch: should equal to the total number of samples (e.g. images) divided by the batch size
    • Epochs: how many times to train on dataset. Higher may provide better results at cost of computation time
    • Validation steps: should equal the total number of validation samples (e.g. images) divided by the validation batch size

To run training, execute train_delam.py. The program will report a training update at the end of each epoch.

Test and Visualize via prediction_test.py

The following steps are all adjustments made to variables in the code.

  1. Enter the path to the model you desire to test and visualize
  2. Enter the paths to the image and image mask
    • The image must be the same size as the model’s expected input size. Resizing by zero-padding can be used if required

To run, execute prediction_test.py. The program will output the original image, image mask, and prediction label.

Evaluate a Model’s Metrics via model_eval.py

The following steps are all adjustments made to variables in the code.

  1. Enter the path to the model you desire to evaluate
  2. Enter the paths to the image and image mask
  3. Set batch size, image height, and image width
  4. Set number of steps
    • Steps: should equal to the total number of samples (e.g. images) divided by the batch size

To run, execute label_gen.py. The program will output the models final scores on specified statistics (e.g. IoU Loss, cross-entropy loss)

Generate Prediction Output via label_gen.py

The following steps are all adjustments made to variables in the code.

  1. Enter the path to the model to use for prediction output
  2. Enter the path to the directory containing the images to be used as inputs
  3. The predictions will be saved in the folder titled predictions_dir

To run, execute label_gen.py. The program will save the predictions in the folder titled predictions_dir.

Clone this wiki locally