Skip to content

Covid-non Covid detection in python, with challenge: RES_NET transfer learning vs custom CNN trained from scratch (Computer Vision)

Notifications You must be signed in to change notification settings

FlavioLorenzi/Covid_detection_CNN

Repository files navigation

Covid_detection_CNN

AIRO project: Vision & Perception course

Approach

Covid-non Covid detection, with two experiments: RES_NET transfer learning vs custom CNN trained from scratch.

The aim is to identify Covid from x-ray photos of lungs, training the network on a non-covid covid dataset (augmented with techniques such as crop, translation, contrast jitter ...).

Team

  • Flavio Lorenzi

  • Nicolò Mantovani

  • Michele Ciciolla

Documentation

Idea, part of dataset and of the transfer learning experiment is taken from here: (shervinmin/DeepCovid)

Dataset, still too small, it has been increased thanks to some Data Augmentation techniques described in the document (pdf).

COVID SC2 Image

NO COVID SC2 Image

Results

Very good results for each experiment, with an inference accuracy bigger than 0.9 : this is the consequence of a careful tuning of the parameters, but above all, this is due to the fact that it is a Binary Classification (easier to train than a multiclass one).

Custom CNN training-test plot:

SC2 Image

Confusion matrix of the Transfer Learning inference experiment, given a blind balanced dataset of 100 imgs:

SC2 Image

See other results, indices and successes in the pdf document.

Final Considerations and Future Works

The two final accuracies differ very little (0.95 v 0.93) and therefore it is difficult to judge which model is really better; but we came to the conclusion that it is better to choose transfer learning, because not only does it have better accuracy, but above all it did not require a large computational calculation, performed in a short time and locally, while the second experiment required Colab's gpu to speed up the timing.

In the future, having more images available, it would be interesting to pull the custom network on a larger and "different" dataset, in order to seek performance trend(*); or the network could be extended for a classification that is no longer binary but multiclass, introducing for example the recognition of various pathologies (pneumonia, water in the lungs, fractures, etc.). It would be an excellent pathology detection.

(*)

NB: our network is trained on a balanced and enough big dataset, but as we know, a neural network should then be tested on different datasets to see how it really performs (for example lights and contrasts different from those with which it was trained) because it could be overfitted. The results achieved, however, are excellent, as the high accuracy makes us think that even on "different" datasets it is still possible to achieve similar (even if lower) performances.

About

Covid-non Covid detection in python, with challenge: RES_NET transfer learning vs custom CNN trained from scratch (Computer Vision)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published