can help decrease the size of the feature maps while
preserving those features that are relatively more
important.
Then in order to raise the accuracy of the program
and realize more ideal outcomes, Convolutional
Layers and Pooling Layers with different filters
parameters, 32 64 128 individually, are used
alternately and circularly for a few times.
After all the steps above, the next layer is the
Flatten Layer. The aim of inserting it is to reshape the
outputs from the previous layers, which are multi-
dimensional arrays, into a single long vector. So that
they can be fed into subsequent fully connected layers
for further processing, because these layers can only
accept this kind of one-dimensional input.
Then here comes the Fully Connected Layers in
the model. These layers connect all the features of the
data. In this program, the two Dense functions with
different parameters, which are 128 and 10 in this
program and refer to the number of neurons in this
layer, are used as Fully Connected Layers to do the
linking job between the former layers that has been
built before and the current ones that are being built.
And the task for them in to successful put the neurons
from the two different layers together and create links
to enable them to work as an entirety.
Additionally, the activations of the two layers
above are also different, which are relu and softmax.
What is more, nearly after every layer, a Dropout
function with the parameter of 0.25 is used in this
program to prevent the model from overfitting, so that
the accuracy and the stability of the model can be
guaranteed. After these steps and layers, the model is
finally built.
3.2 Training and Testing
So, the next part is to train and test the model that has
been built. In this part, the training set is used to train
the model, to enable it to identify the pictures and do
the classification. The model is evaluated on the
testing set to measure its results, which are displayed
by printing the summary and the confusion matrix,
and its many performance metrics, including
accuracy, recall, loss and precision etc. And this can
help to judge and prediction how the model performs
when operating on a new set of data.
Then, the next job is to keep adjusting all the
parameters in the program and adding or decreasing
the number of layers according to the performance and
prediction, until the best and most accurate outcomes
are got and ready for analysis and conclusion.
4 RESULT
In this program, the dataset that is used is the widely-
used CIFAR-10dataset.
The CIFAR-10 dataset is got from the Kaggle and
can be imported in the program straightly from the
keras of tensorflow. The CIFAR-10 dataset is made up
of 60 thousand images in 10 different themes with
various colors, with exactly 6000 ones in every single
class, and each picture contains 32*32 pixels. The ten
classes are in a fixed order while using for the better
convenience, which is 'Airplane', 'Automobile', 'Bird',
'Cat', 'Deer', 'Dog', 'Frog', 'Horse', 'Ship', 'Truck', and
it may be mentioned in the following paper by using
the number zero to nine. And every picture can be
visible on the Kaggle or by coding (Iqbal and Qureshi
2023).
Using this dataset has its own convenience. In this
dataset, the images have already been divided into the
training and testing groups. 50 thousand training
pictures and 10 thousand test pictures have been pre-
prepared already in this dataset. What is more, it is
divided into five training lots and a test lot, each is
made up of 10 thousand images, which appear in a
stochastic combination every time being used.
Considering from the aspect of the classes, each one
of the ten classes provide one thousand images, which
are randomly selected as said before, to form the final
test batch. Meanwhile, the rest of the pictures in each
class are undoubtedly contained in those five training
batches in a random formed order that no one knows.
Also, unlike the testing one, the training lot have on
force on that the images from each class must be of
the same number. That means that there may not be
exactly 500 pictures in a single batch, but there are
undoubtedly exactly 5000 pictures in the whole
training part, the five lots.
First, the model should be evaluated according to
its summary of results and all of its evaluation
indicators. Taking all into consideration, the model is
quite successful. The analysis can be based on the
classification report of the testing results after the
attempting of each time.
From all the information in the Table 1, it can be
found out that all the evaluation indicators, the
precision, the recall and the f1-score, of all the ten
classes are totally of a very high level. There is only
one class having the least precision of 77%, while all
the other ones are above 80%, with some of them are
so high that they reach or even surpass ninety
percents. Also, it is easy to find out that except the
class 3, all the recalls and f1-scores are all at such a
high area that they are individually over or close to
80% and 85%. The least f1-score also occurs in the