Model fitting is complete.
It has run 430 epochs and we can see that we have achieved validation, accuracy of nearly 89 to 90
percent in the twenty seventy Borg.
You can see that it is ninety point five.
So at the 30th Epoch is giving us a validation accuracy of eighty nine point eight percent.
You can see on the graph that our validation accuracy is stagnant.
It has stopped increasing.
Also, you can observe that validation accuracy is a little bit on the higher side, then turning accuracy.
This is a little counterintuitive because usually we see that training accuracy are always higher than
validation equities.
This is mostly because the input data during training is being transformed.
It has.
Zoom out effect it has here.
It has linear transformations and rotation transformations.
So that is why training accuracy is a little bit less than the validation accuracy.
You can save the last model.
That is the more latitude epoch using this same model.
I just got STF five function and you can retrieve this model.
That is, you can create a new model and save these same architecture and read into that.
Using this load model just is DFI function.
Now the last part of our analysis is checking the performance on test data.
Although we saw the performance on validation data and we did not modify anything in the model basis,
the validation deserved.
So the result on validation data will be very similar to the design on that data.
But just to see how it is done, we have to create a test in data that is generated, will have test
territory and test data engine as the input parameters we specified test data.
Again, in this line it was only rescaling the images, the data of pixels by dividing it by 255.
That goes as a parameter and this function.
The other barometers are seen.
We run this and then we can use the evaluate underscored generator function to evaluate the performance
of this model on our deficit.
So do you value it in later function as run and on the test set?
I'm getting an accuracy of eighty nine point nine percent on the validation test.
Also, I was getting eighty nine point eight percent.
Both of these are giving the same level of accuracy for us because for our model validation, data is
also equally unseen as the test data.
Last time, when we only used data augmentation, we were able to get accuracy's in the range of 83
to 84 percent.
Now we have increment of nearly six percent in the accuracy range.
And this increase is because of the convolutional base that we have used.
The convolutional base was an already train set of convolutional and pooling layers, and those trained
LEDs have given us an incremental accuracy of nearly six to seven percent.
So we'll achieve nearly 90 percent, not to further increase the accuracy to 96, 97 percent.
You need to do only one small change to the standard model.
And that small changes to remove this freeze roots line.
As you remember, we used this line to freeze the weight of our convolutional base, which means that
the convolutional base will not be retrained.
Now, one way is to unfreeze the last few layers.
And another way is to unfreeze the entire convolutional base.
Both of these will give you significant increase in the accuracy.
The concept is, since the features that we were finding out from this convolutional base were targeted
at the image data.
It may need some tuning in, finding out the features.
Also for our particular problem.
So if you do not freeze the rates of last few conversion layers or you do not freeze the of the entire
convolutional base, then you can further increase the accuracy.
And with BDD model, without freezing the rates, you should be able to get accuracy's in the range
of 97 percent.
But keep in mind that since this is a very big network, it will take a lot of computation power of
your computer.
So it will take a lot of memory from your DRAM and Dipu.
Also it will take one or two hours extra if you're running a very big model.
So it may not be feasible to run this on every computer, but just to tell you that this is a possibility.
And you can get 97 percent accuracy in image recognition problems.
This is the only change you have to make and you will be able to get 97 percent accuracy for such problems.
So that's the entire project.
We started this project by importing the data and building a normal, convolutional neural network,
which was giving us accuracy's in the range of 70 to 75 percent.
Then we improve the accuracy using the documentation.
We updated our image data generator with few more parameters.
And this data generator was giving us artificial images with some transformations on the original images
only.
So instead of inputting 2000 images in one epoch, we were inputting 30, 200 images, and all these
images had some transformations done on them.
This improved the accuracy of our model from nearly 73 74 percent to 83 84 percent.
Then we made another small change.
We removed our own convolutional base and used the convolutional base of a pre train model.
We used we did you 16.
You can try out on other models also with this change.
We were able to get accuracy's in the range of 90 percent.
And the last part, which I'm not running right now, but you can try on your only if you have a very
good system with large arm and large Deepu, then you can probably run that part also in which you unpretty
delayers.
You removed this line
from the entire model compiler for data game and then take out the desert accuracy and that will be
coming out at nearly 97 percent.
And with this project, I believe that you'll be pretty comfortable in building of a major recognition
model using convolutional neural networks on your system.