Validating a model in image classification

Fastai can generate confusion matrices using ClassificationInterpretation (see here and check source code).

This post might be helpful regarding creating a test dataloader and using it to get confusion matrices: