1
00:00:00,750 --> 00:00:07,110
Hi and welcome back to the course in this section, we'll take a look at our first medical data project,

2
00:00:07,110 --> 00:00:11,070
which is pretty image classification of CT scans.

3
00:00:11,430 --> 00:00:12,580
So let's take a look.

4
00:00:12,630 --> 00:00:16,630
So firstly, we have to understand something with this treaty data.

5
00:00:17,100 --> 00:00:22,150
Well, basically considered treaty data to be a sequence of frames, almost like a video.

6
00:00:22,170 --> 00:00:25,040
To be fair, however, it's not treated like a video.

7
00:00:25,260 --> 00:00:29,610
Separately, it's treated all together, so we sort of keep all the frames together.

8
00:00:29,760 --> 00:00:34,410
So this is how we actually operate a tree, the icon on a tree, the image here.

9
00:00:34,410 --> 00:00:39,960
So you can see these are the images stacked here, and we just take the convolutional filter here and

10
00:00:39,960 --> 00:00:45,540
apply it to different segments here, depending on the parameters we set for stride and padding and

11
00:00:45,540 --> 00:00:46,530
those types of things.

12
00:00:47,190 --> 00:00:55,050
So what's important to know is that what truly kind of is trying to capture is no treaty spatial relationships.

13
00:00:55,140 --> 00:01:01,740
So if there's something in the first and image and the next image after it, if you're looking at an

14
00:01:01,740 --> 00:01:07,350
image right here that will capture those correlations of localized correlations there.

15
00:01:07,680 --> 00:01:10,920
So that's what's kind of cool about these feature maps that it produces.

16
00:01:11,700 --> 00:01:13,080
So let's begin.

17
00:01:13,080 --> 00:01:14,070
So here's a lot of links.

18
00:01:14,070 --> 00:01:17,010
If you want to learn more about this project, feel free to check them out.

19
00:01:17,610 --> 00:01:19,500
So we just import some libraries.

20
00:01:19,500 --> 00:01:26,760
We've downloaded the most data chest CT scan dataset, so you can see this is what it looks like here.

21
00:01:27,360 --> 00:01:29,970
These are the chest CT scans, so you do.

22
00:01:29,970 --> 00:01:36,000
Scans are basically in layers, so as you can see it, scans like one that of the of the lungs.

23
00:01:36,330 --> 00:01:40,050
Then it goes up and then up, so you can see different segments of the lung.

24
00:01:40,500 --> 00:01:41,690
It pretty much in 3D.

25
00:01:41,700 --> 00:01:45,750
That's basically what the CT scanner is trying to compute.

26
00:01:46,230 --> 00:01:50,190
So there's a reference to more of that data set.

27
00:01:50,190 --> 00:01:52,710
This is from the most med dataset.

28
00:01:52,860 --> 00:01:55,020
You can read all about it in this PDF.

29
00:01:55,830 --> 00:02:04,170
So now let's go back to the project, so let's download our dataset here and unzip it.

30
00:02:04,290 --> 00:02:08,010
So now we have to load a dataset and pre-processed it.

31
00:02:08,010 --> 00:02:11,430
So now we're scaling the dataset values between zero and one.

32
00:02:11,970 --> 00:02:17,760
We rotate 180 degrees, so the orientation is fixed and receives a height and return depth.

33
00:02:18,360 --> 00:02:21,540
So let's do those Gruden's functions to do that.

34
00:02:22,860 --> 00:02:28,170
And next, no, that's really the parts of the city scans from the cluster of trees, so we can see

35
00:02:28,200 --> 00:02:29,540
how much data we're looking led.

36
00:02:29,550 --> 00:02:36,210
So we have a hundred scans of normal lung tissue and then 100 of abnormal tests.

37
00:02:36,210 --> 00:02:40,860
You know, each scan has a bunch of different images together with it.

38
00:02:40,860 --> 00:02:43,950
So it's not it's a hundred individual images.

39
00:02:43,950 --> 00:02:44,970
It's actually a lot more.

40
00:02:45,870 --> 00:02:52,740
So now let's build and trying to just create a validation and treating and assets for lab tests, just

41
00:02:52,760 --> 00:02:53,940
validation and training.

42
00:02:54,540 --> 00:03:02,120
So you can see we're doing a split one 40 to 60, and now let's create some data augmentation functions.

43
00:03:02,120 --> 00:03:09,930
So we just doing using a side by to do a rotate and then some other helper functions here with data

44
00:03:10,740 --> 00:03:11,640
translation.

45
00:03:11,940 --> 00:03:15,900
And now we create our data loaders here as well.

46
00:03:15,900 --> 00:03:17,700
And this at some reskilling here.

47
00:03:18,600 --> 00:03:22,180
So now we can visualize an augmented tree CT scan.

48
00:03:22,180 --> 00:03:23,970
You can see this is what it looks like.

49
00:03:25,110 --> 00:03:28,350
So again, this is a CT scan as many slices.

50
00:03:28,350 --> 00:03:34,560
You can visualize a whole montage of scans and you can see all of this is basically one lung scan and

51
00:03:34,560 --> 00:03:35,730
you can kind of see what's happening.

52
00:03:35,850 --> 00:03:41,670
You can see as it goes, this is one depth and then it goes and gets it gets higher, it gets and lower,

53
00:03:42,180 --> 00:03:44,550
and you can see it for each level of the lung.

54
00:03:44,760 --> 00:03:46,260
This is just kind of what it looks like.

55
00:03:47,430 --> 00:03:53,370
So you can see no way we would want to take these images, all of these images as a group to classify

56
00:03:54,240 --> 00:03:56,700
them correctly, whether they're normal or abnormal.

57
00:03:57,750 --> 00:04:01,700
So, no, let's define our 3D convolutional network here.

58
00:04:01,710 --> 00:04:07,470
You can see we use a kind of 3D function to create this, and this is a relatively simple kind of network

59
00:04:07,470 --> 00:04:07,880
here.

60
00:04:08,790 --> 00:04:12,070
We build it, and a number of parameters is just over a million.

61
00:04:12,540 --> 00:04:15,300
Now we can test so we can train a model.

62
00:04:15,930 --> 00:04:20,250
It doesn't take that long to train twins that nine epochs have had.

63
00:04:20,250 --> 00:04:27,830
Callbacks have been triggered and then can see we have gotten an accuracy of 70 percent, although the

64
00:04:27,840 --> 00:04:34,170
best accuracy of missing is any one percent, which is why they actually said any tree was achieved

65
00:04:34,680 --> 00:04:36,500
depending on the actually injury was achieved.

66
00:04:36,510 --> 00:04:39,900
So you can see we did get the results that we that is specified here.

67
00:04:40,650 --> 00:04:46,020
So now you can visualize in model performance for the history graphs, and now we can make a prediction

68
00:04:46,020 --> 00:04:48,030
so we don't actually visualize that montage.

69
00:04:48,090 --> 00:04:54,690
Well, if you could if you want, but just takes a random image here and loads it and then predicts

70
00:04:54,690 --> 00:04:55,230
the score.

71
00:04:56,160 --> 00:04:59,550
So you can see the score is going to be given a whole batch of city scans.

72
00:04:59,990 --> 00:05:00,920
What they would be.

73
00:05:01,880 --> 00:05:06,140
So actually, this is a random suggests that the first volley of the validation dataset.

74
00:05:06,680 --> 00:05:08,720
So you can see this is what it looks like.

75
00:05:08,730 --> 00:05:13,670
So this is a normal scan giving that went to any three percent accuracy network.

76
00:05:14,720 --> 00:05:16,600
So that's it for this lesson.

77
00:05:16,610 --> 00:05:23,180
In the next lesson, we'll take a look at another medical project Medical Data Project Imaging Project,

78
00:05:23,600 --> 00:05:28,800
which is looking at Chest X scripts for pneumonia for detection, using tips as well.

79
00:05:28,850 --> 00:05:30,410
So stay tuned for that lesson.

80
00:05:30,620 --> 00:05:30,920
But.
