Hi and welcome back to the course in this section, we'll take a look at our first medical data project,
which is pretty image classification of CT scans.
So let's take a look.
So firstly, we have to understand something with this treaty data.
Well, basically considered treaty data to be a sequence of frames, almost like a video.
To be fair, however, it's not treated like a video.
Separately, it's treated all together, so we sort of keep all the frames together.
So this is how we actually operate a tree, the icon on a tree, the image here.
So you can see these are the images stacked here, and we just take the convolutional filter here and
apply it to different segments here, depending on the parameters we set for stride and padding and
those types of things.
So what's important to know is that what truly kind of is trying to capture is no treaty spatial relationships.
So if there's something in the first and image and the next image after it, if you're looking at an
image right here that will capture those correlations of localized correlations there.
So that's what's kind of cool about these feature maps that it produces.
So let's begin.
So here's a lot of links.
If you want to learn more about this project, feel free to check them out.
So we just import some libraries.
We've downloaded the most data chest CT scan dataset, so you can see this is what it looks like here.
These are the chest CT scans, so you do.
Scans are basically in layers, so as you can see it, scans like one that of the of the lungs.
Then it goes up and then up, so you can see different segments of the lung.
It pretty much in 3D.
That's basically what the CT scanner is trying to compute.
So there's a reference to more of that data set.
This is from the most med dataset.
You can read all about it in this PDF.
So now let's go back to the project, so let's download our dataset here and unzip it.
So now we have to load a dataset and pre-processed it.
So now we're scaling the dataset values between zero and one.
We rotate 180 degrees, so the orientation is fixed and receives a height and return depth.
So let's do those Gruden's functions to do that.
And next, no, that's really the parts of the city scans from the cluster of trees, so we can see
how much data we're looking led.
So we have a hundred scans of normal lung tissue and then 100 of abnormal tests.
You know, each scan has a bunch of different images together with it.
So it's not it's a hundred individual images.
It's actually a lot more.
So now let's build and trying to just create a validation and treating and assets for lab tests, just
validation and training.
So you can see we're doing a split one 40 to 60, and now let's create some data augmentation functions.
So we just doing using a side by to do a rotate and then some other helper functions here with data
translation.
And now we create our data loaders here as well.
And this at some reskilling here.
So now we can visualize an augmented tree CT scan.
You can see this is what it looks like.
So again, this is a CT scan as many slices.
You can visualize a whole montage of scans and you can see all of this is basically one lung scan and
you can kind of see what's happening.
You can see as it goes, this is one depth and then it goes and gets it gets higher, it gets and lower,
and you can see it for each level of the lung.
This is just kind of what it looks like.
So you can see no way we would want to take these images, all of these images as a group to classify
them correctly, whether they're normal or abnormal.
So, no, let's define our 3D convolutional network here.
You can see we use a kind of 3D function to create this, and this is a relatively simple kind of network
here.
We build it, and a number of parameters is just over a million.
Now we can test so we can train a model.
It doesn't take that long to train twins that nine epochs have had.
Callbacks have been triggered and then can see we have gotten an accuracy of 70 percent, although the
best accuracy of missing is any one percent, which is why they actually said any tree was achieved
depending on the actually injury was achieved.
So you can see we did get the results that we that is specified here.
So now you can visualize in model performance for the history graphs, and now we can make a prediction
so we don't actually visualize that montage.
Well, if you could if you want, but just takes a random image here and loads it and then predicts
the score.
So you can see the score is going to be given a whole batch of city scans.
What they would be.
So actually, this is a random suggests that the first volley of the validation dataset.
So you can see this is what it looks like.
So this is a normal scan giving that went to any three percent accuracy network.
So that's it for this lesson.
In the next lesson, we'll take a look at another medical project Medical Data Project Imaging Project,
which is looking at Chest X scripts for pneumonia for detection, using tips as well.
So stay tuned for that lesson.
But.