This is a healthcare related project where Image Processing and Deep learning models along with Computer Vision libraries are used for image segmentation and area calculation of fat regions to calculate the Visceral Fat Index (VFI) in the CT scan images of 30 patients.
The details of each folder is as below :
- Data-Preprocessing
- Deep_Learning_Segmentation_Models
- ProjectFlow_Diagram
- Raw_Input_Images
- StreamLit-Library
- VAT_Segmented_Outputs
- VFI_for_30_images.xlsx
The 30 raw input dataset images were pre-processed by removing the region of interest, thresholding and adjusting the brightness and contrast to make it more clear before using it for the segmentation. The breakdown of the files are as follows:
-
L3_datapreprocessing The central region of the raw images is the region of interest that contains the fat, bone and muscles. This code is used to extract the central region of interest (ROI) first and then the central region extracted from the raw input images is further cleaned by removing the blurrness to make the image more clear and understandable for segmentation. In order to run this code the file contour_lib.py is required to be imported.
The clean and pre-processed images are used for segmentation of SAT and VAT in order to calculate the Visceral fat Index (VFI). The breakdown of each file inside this folder is as below :
-
K-Means Segmentation This folder contains the Kmeansegmentation.ipynb file where segmentation was doene on ImageJ created images to segment the fat region from the bone, muscle and other elements.However VFI calculation was not successfull using this algorithm.
-
Segmentation CNN
-
Seg_CNN This was the second approach where Convolutional Neural Networks was used for VAT and SAT segmentation using Conv 1D and 2D. Firstly, we performed thresholding to get only the pixels related to VAT and SAT, these thresholded images are used as masks and we performed conv 1D and 2D. As the results were not satisfactory we then used painted images which are generated from ImageJ as masks. However, the results were not satisfactory. By an observation made during our research we founded that thresholded images did have the fat areas required for calculation of VFI. Though segmentation CNN did not provide proper results, the thresholded images were useful for calculating VFI.
-
L3_thresholding This file contains code for generating thresholded images. we used a combination of Binary Inverse thresholding and Tozero thresholding to get the outputs.
-
-
Segmentation using CV This was a successful approach where VAT was extracted from the image using Computer Vision which was then used for VFI calculation. It is the same code as the Extractionof Region of Interest use din data pre-processing and requires the file contour_lib.py to be imported. Below is and example :
-
U-NET Algorithm This folder contains the code for the VAT and SAT segmentation using a complex network called U-NET. This approach did not yield the results as expected.
The whole workflow of this project from the start to the end is shown in this project Flow Diagram. It contains the errors we faced during the implementation of various algorithms and also outcomes of the succesfull ones.
This folder contains 30 raw input dataset images which was used for pre-processing and later segmentation.
- StreamLit is an open source application framework in python library, which creates an easy way to share beautiful and custom web pages to deploy the images to get outputs. - It also allows the users to quickly build interactive web applications about their models.
- The main purpose of this approach is to provide graphical user interface, where it will create a webpage user interface where a common person with no background knowledge on image processing can easily view or play around with these images.
- It can also be considered as an easiest way of viewing the output images.
This folder contains the 30 VAT segmented images from the 30 input images, where we can clearly see the segmeted region with VAT. This can be clearly observed when raw image and segemented image is compared.
This file contains the VFI(Visceral Fat Index) which is calculated for the 30 images of the dataset. It can be seen in the file where it shows the calculated VFI using CV algorithm and VFI using ImageJ tool.