Hello everyone and welcome to this new and exciting session.
According to the World Health Organization, nearly half of the world's population is at risk of malaria.
In 2022, an estimated 249 million people contracted malaria in 85 countries.
That same year, the disease claimed approximately 608,000 lives across the world.
Malaria is an acute febrile illness caused by the Plasmodium parasites, which are spread to people
through the bite of an infected female Anopheles mosquito.
Now this disease is preventable and curable.
In this section, we shall see how we could build out a model which takes in as input this blood cell
and says whether this blood cell is infected by the malaria parasite or not.
With that said, the data, we shall be using to train our model will be composed of input images like
this one, and the output which is parasitic or uninfected.
So we could have parasitic and then we could also have uninfected.
So we have these two outputs or these two possible outputs.
In this section we shall start by understanding the task.
Then we'll dive into preparing the data.
Then we'll build a model, in this case a new model.
That's a convolutional neural network.
We shall check out on another error sanctioning method.
Then we'll go ahead and train our model, evaluate this model, then apply necessary corrective measures
to ensure that we have an even more performant model to understand the task, we shall get back to how
the blood cells are being generated.
Given that these blood cells make up the dataset which we shall use in training our model.
So as you could see here, the first thing is we select the finger to be punctured.
Then we puncture the ball of the finger.
And lastly we touch the next drop of blood with a clean slide.
With the blood now placed on the clean slide, we could view this under a microscope where you could
see here we have Thin Blood film and then we have the Thick Blood film.
Um, what's important to note here is the fact that we could extract each and every one of the cells
here.
So if you could pick out just the cell, and then you have this image which you have right here, and
then, um, is this image with its corresponding label, which is that of parasitic or uninfected that
will use to train our model.
Now just focusing on our input.
That's the image.
You would find that if you zoom in.
Let's get in here.
If you zoom in we have um, this units here beyond which we cannot, um, zoom in any further.
So let me reduce this.
Let's draw around the outlines of these little squares.
So let's take this, um, specific square here.
Let's draw this.
And uh, there we go.
So you'll notice that we have all these little squares right here.
And these little squares actually represent a pixel.
So let's let's just have this.
So this here is a pixel.
And all these different pixels are what make up our complete image.
If you try to zoom out now you see you see that pixel that um unit which we could not, um, zoom in
uh, or from which you could not zoom in any further.
You see that when we try to zoom out, you see, it becomes, um, much smaller.
So what we're saying is, um, this, uh, each and every, uh, small square or small pixel, um,
forms part of our complete image and understanding, um, that, uh, pixel forms part of this complete
image.
And the kinds of values it takes in is important, um, when building machine learning systems.
That said, when we see, um, an image like this one is 490 by 760, um, 766 pixel image.
What we mean is that we have 490 images, um, or rather 490 um, pixels horizontally, like if you
go if you scroll right here, you, uh, take note.
Let's, let's make sure you take note of what, um, every value we have here.
So at this point here you would have the values.
So getting back to the image you see around here we have 400.
If I get to the the last I have 490.
Well I'm seeing 489.
So I have 489 by six.
Let me go.
Um slightly up.
Um, okay.
So you see I have 480, 489.
Well, 88 488 by one.
So what this tells us is, um, if we reduce you see, the value is reducing.
Now we have 283 by zero.
As we increase see, we get we go right up to 400 and um, 90.
Let's get here.
We have well 487 but that's actually 490.
So this tells us that horizontally we have 490 pixels.
And vertically we have 476 pixels.
Now if we scroll right down here right up to this, you see we have zero now by 473.
Well if you go get right below we should get 476.
So that's it.
So this tells us that we have those, um pixels.
Now if we zoom in you zoom in.
You have, um, similar scenario to what we had on, uh, the previous board.
See, we have this small cells, uh, which we had seen already here.
So we had picked out this particular cell, um, this particular cell here, which represented, um,
a pixel.
An image like this one, which contains 490 by 476 pixels, will contain totally
233,240
pixels.
So this are the total number of pixels we have, um, in this image.
And then for each and every pixel we have, um, it takes um three values.
So when we have an RGB image like this one or a colored image, we have um, that for let's say this
pixel this.
Well let's get back for let's say a pixel, this pixel it has or it takes in three values the r value,
the g value, and then the B value.
And then each and every one of these values range between 0 and 255.
So um the r will range between 0 to 55.
The g between 0 to 55 and then the B between 0 and 255.
Making use of this image gotten from the Matlab website, you find that um, our image is made of the
r c, the g that's the green and then the blue.
So um, and then the blue component.
So if you pick out a pixel like um let's say we pick out this pixel, um, you have its R value, you
have its g value.
You have its blue value.
Now you may be wondering why all those values actually range between 0 and 1.
The simple answer is that if we have values ranging between zero and then 255, um, for them to range
between 0 and 1, we could normalize them.
And that's by simply dividing all the values that if we take all those values that we have and we divide
by one, then um, or rather we divide by 255, not one.
If we divide by 255, then all our values now will range between 0 and 1.
And so with that said, now we could split this our image up into, um, this three different channels.
We'll call this, um, our, our channel.
And then we will have the G channel.
And then we'll also have well let's paste that out and then we'll also have the B channel.
And so this image, which is 700 or rather 476 by 490, is actually 476.
That's 476 by 490 by three, because we have this three channels R, G and B.
In the case where we have a black and white image that's, um, a grayscale image with only one channel,
then we will not have this last channel.
We just have, um, 476 by 490 or 476 by 490 by one.
In that case, we only have, um, one of these channels right here.
The RGB value for an image which is completely white, like this one is actually 255 by 255 by 255,
meaning that the R value is 255, the g value is 255, and then the B value is 255.
And then for an image which is completely black, um, the r value is zero.
The g value is zero, and then the b value is zero.
With that said, we could go ahead now and prepare our data, which is composed of this cell images
and the corresponding labels.