Skip to main content

Intracranial hemorrhage detection with machine learning

Description

  • My goal was to create a software solution that would help radiologists in emergency trauma care to determine from CT scans of the brain of patients with head injuries whether there is a brain hemorrhage on the scan.
  • For this, I have created an artificial intelligence, deep learning solution based on a convolutional neural network. It receives DICOM format image slices as input, which have been annotated by radiologists with the presence and type of bleeding. These DICOM slices are received by the network as 3-channel image files, and their label is an n-class binary vector. I developed and trained this network with different parameters and tried to create a version with it that has the highest possible accuracy metric.
  • I evaluated the network from several points of view and created a demo application for it for testability, where it can be tested and tried with its own brain CT scan images, which foreshadows the usability of various own databases.

Hemorrhage types

ICH types

Results

After the last training of the model, it was possible to achieve sufficiently high accuracy for the model to be considered reliable even in real-world use. The minimum expectation from my side towards the network was that it could correctly determine the output in at least eighty percent of the cases, which was achieved. In the data set, the two most common positive labels are intravenricular and any, which has a visible consequence that these two classes have the highest real accuracy. The epidural value is so high because it almost always takes a zero value, which the model quickly learns, so it only fails to find those rare cases where it is positive.

ICH metrics

Projects Content

File(s)about
csv_reader.pyConverts the file containing the original labels into a more optimal format
dataset.pyThe dataset consisting of images and labels
dcm_reader.pyUsed to read DICOM files and convert them into three-channel images
dcm_sampler.pyA sampler whose task is to balance the input dataset
id_vectors.csvThe converted label file
model_test.pthThe already trained model.
model.pyPytorch based CNN classifier model
stage_2_train.csvOriginal input label file.
test.pyA file that summarizes the functions for testing
train.pyUsed to train the network