Skip to content

Prerocessing the images before classification as well as visualizations aiming at understanding how the final model performs classification

Notifications You must be signed in to change notification settings

IDU-CVLab/Images_Preprocessing

Repository files navigation

Visualization and Image Processing for COV19-CT-DB Database Work

This repository is part of the first COV19D Project.
The work is attempts to Region of Interest (ROI) localization and for CT scan images in the COV19-CT-DB database and filtering out uppermost and lowermost slices of the CT volumetric images before classification. The work aims at improving quantitative results on the given dataset.

Guided GRad-Cam Visualization

The code is "Guided-GRad-Cam.py":
In an attempt to understand how our mode at https://github.com/IDU-CVLab/COV19D/blob/main/COV19-CT-DB-CNN-model.py classifies the images in the COV19-CT-DB database, a guided grad-cam class was used on the last convulutional layer. A covid image from the dabase is shown bellow along with the heatmap and the overlaping of the heatmap on the image.


Taken from COV19-CT-DB Database (COVID19 Case)
Correctly Classified COVID CT slice


REFERENCES:

https://stackoverflow.com/questions/66911470/how-to-apply-grad-cam-on-my-trained-model {Last Access 13.12.2021}

Images Preprocessing

1. segmentation and cropping

The code 'cropping-and-segmentation.py' uses python open-cv for gussian blurring, cropping and histogram segmentation of medical images. The code is an attempt to segment lung CT scan images.

The original images look as follows:


The resulting image looks as follows:


REFERENCES:

https://datacarpentry.org/image-processing/07-thresholding/ {Last Access 15.12.2021}

2. Region of Interest cropping

The code 'Rectangular-cropping.py' is an attempt to achieve high accuracy with a model by training it on representative images or images with region of interest. with that the CT images were cropped to include the left and right lung from the CT scan image using opencv version 4. The region of interest is represented simply by a static rectangle. The region of interest in the image is shown in the white rectangle (size of 227x300) as follows:


Taken from COV19-CT-DB Database


REFERENCES:

https://docs.opencv.org/4.x/d7/d4d/tutorial_py_thresholding.html {Last Access 15.12.2021}
https://stackoverflow.com/questions/56467902/select-a-static-roi-on-webcam-video-on-python-opencv {Last Access 15.12.2021}
https://stackoverflow.com/questions/15341538/numpy-opencv-2-how-do-i-crop-non-rectangular-region {Last Access 15.12.2021}

3. Contour Images Cropping

The code 'COV19D_CT_images_Processing_Using_Contour_Cropping.ipynb' is an an attempt to segment and highlight region of interests in the images, this code applies a function to crop Region of Interests on the CT images using open-cv. Results of cropping can be seen in the code on one of the CT images- a central slice.

4. Region based Image Segementation

The code 'Region-Based_Image-Segmentation_full-CT-SCAN.ipynb'. This code used the region based image segmentation method here to be run on full CT scan of nnon-Covid to replace the slices with masks.

About

Prerocessing the images before classification as well as visualizations aiming at understanding how the final model performs classification

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published