• Tidak ada hasil yang ditemukan

Research Methodology

3.10 Age Recognition Model

As we already know for age recognition, we use Convolutional Neural Network as our final algorithm according to the number of data, feature type, system requirement and performance. The raw model with required number of layers and optimization is discussed here. We consider best performance for our data along the model complexity to reduce time and resources.

3.10.1 Age Recognition Model Architect Age Recognition Model

1 : ADAM (learning rate)

2 : For 945 iterations in all batch do:

3 : Convolution 1 (Filter, Kernel Size, Stride, Padding, Activation) 4 : MaxPooling 1 (Pool Size, Stride)

5 : Dropout (Rate)

6 : Convolution 2 (Filter, Kernel Size, Stride, Padding, Activation) 7 : MaxPooling 2 (Pool Size, Stride)

8 : Dropout (Rate)

9 : Convolution 3 (Filter, Kernel Size, Stride, Padding, Activation) 10 : MaxPooling 3 (Pool Size, Stride)

11 : Dropout (Rate)

12 : Convolution 4 (Filter, Kernel Size, Stride, Padding, Activation) 13 : MaxPooling 4 (Pool Size, Stride)

14 : Dropout (Rate)

15 : Convolution 5 (Filter, Kernel Size, Stride, Padding, Activation) 16 : MaxPooling 5 (Pool Size, Stride)

17 : Dropout (Rate)

18 : Dense (Units, Activation) 19 : Dropout (Rate)

20 : Dense (Units, Activation) 21 : Dropout (Rate)

22 : Dense (Units, Activation) 23 : Dropout (Rate)

24 : Dense (Units, Activation) 25 : Dropout (Rate)

26 : Dense (Units, Activation) 27 : end for

Proposed Age Recognition Model used a multilayer CNN for classifying Bangla Handwritten Characters. This model used convolution, Max pooling layer, fully connected dense layer and dropout [53].

Convolution 1 layer consists of 32 filters, kernel of size (3 x 3), stride of size (1 x 1), padding

“same” and elu (8) activation function. Next layer is a MaxPooling layer with a pool of size (2 x 2), stride of size (2 x 2) and padding “same”. Next layer is a Dropout layer when the dropout rate is 25%.

(8)

Convolution 2 layer consists of 32 filters, kernel of size (3 x 3), stride of size (1 x 1), padding

“same” and elu activation function. Next layer is a MaxPooling layer with a pool of size (2 x 2), stride of size (2 x 2) and padding “same”. Next layer is a Dropout layer when the dropout rate is 25%.

Convolution 3 layer consists of 64 filters, kernel of size (3 x 3), stride of size (1 x 1), padding

“same” and elu activation function. Next layer is a MaxPooling layer with a pool of size (2 x 2), stride of size (2 x 2) and padding “same”. Next layer is a Dropout layer when the dropout rate is 25%.

Convolution 4 layer consists of 128 filters, kernel of size (3 x 3), stride of size (1 x 1), padding

“same” and elu activation function. Next layer is a MaxPooling layer with a pool of size (2 x 2), stride of size (2 x 2) and padding “same”. Next layer is a Dropout [8] layer when the dropout rate is 25%.

Convolution 5 layer consists of 128 filters, kernel of size (3 x 3), stride of size (1 x 1), padding

“same” and elu activation function. Next layer is a MaxPooling layer with a pool of size (3 x 3), stride of size (3 x 3) and padding “same”. Next layer is a Dropout layer when the dropout rate is 25%.

Then flatten the layer and use a Dense layer with 150 units with elu activation and 25%

dropout. The output of this layer connected with the Dense layer with 100 units with elu activation and 25% dropout. Then output of this layer connected with the Dense layer with 50 units with elu activation and 25% dropout. After that output of this layer connected with the Dense layer with 20 units with elu activation and 25% dropout. At the final output layer, use 3 units with SoftMax (9) activation.

(9)

Code and details about Age Classification can be found on GitHub [54].

The model architecture summary will help us to determine the model more clearly.

Figure 3.10.1.1 showing the proposed Age Recognition Model Architecture.

Figure 3.10.1.1: Architecture of Age Recognition Model.

Table 3.10.1.1 shows the Age Recognition model architecture summary for better visualization of the model.

TABLE 3.10.1.1:AGE RECOGNITION MODEL ARCHITECTURE SUMMARY

Layer No(type) Output Shape Parameter Connected to

(Input Layer) 128, 26, 32 320 -

1(MaxPooling2D) 64, 13, 32 0 Input Layer

2(Dropout) 64, 13, 32 0 1

3(Conv2D) 64, 13, 32 9248 2

4(MaxPooling2D) 32, 7, 32 0 3

5(Dropout) 32, 7, 32 0 4

6(Conv2D) 32, 7, 64 18496 5

7(MaxPooling2D) 16, 4, 64 0 6

8(Dropout) 16, 4, 64 0 7

9(Conv2D) 16, 4, 128 73856 8

10(MaxPooling2D) 8, 2, 128 0 9

11(Dropout) 8, 2, 128 0 10

12(Conv2D) 8, 2, 128 147584 11

13(MaxPooling2D) 3, 1, 128 0 12

14(Dropout) 3, 1, 128 0 13

15(Flatten) 384 0 14

16(Dense) 150 57750 15

17(Dropout) 150 0 16

18(Dense) 100 15100 17

19(Dropout) 100 0 18

20(Dense) 50 5050 19

21(Dropout) 50 0 20

22(Dense) 20 1020 21

23(Dropout) 20 0 22

24(Dense) 3 63 23

Total params: 328,487 Trainable params: 328,487 Non-trainable params: 0

3.10.2 Optimizer and Learning Rate

Optimization algorithms help NN algorithms to minimize the error. Proposed Age Classification used Adam optimizer [55]. Adam optimization algorithm that can be used to update network weights iteratively in training data. Adam is an update of extension to stochastic gradient descent algorithm. For its better performance, it is widely used by numerous researches. Proposed Age Classification used Adam optimizer (10) with a learning rate of 0.001.

(10)

We calculated the error of our model using a function named categorical cross entropy which is needed to optimize the algorithm. A study says that cross entropy (4) has outperformed other loss calculating functions such as classification error and mean squared error etc.

Learning rate has a great impact on hyper-parameter tuning for convolutional neural networks. Low learning rate is good for accuracy as it takes smaller steps towards global optima minimizing the chances of overshooting. But it takes lots of time to reach the global optima. High learning rate can solve this time issue taking bigger steps but there is a chance of overshooting the global minima. And also, accuracy may be compromised. Automatic learning rate reduction method [57] was used to overcome this problem. Initially we set a higher learning rate of 0.001 and it was changed based on the validation accuracy.

3.10.3 Training the Model

The Age Classification model was trained on our dataset with a batch size of 128. After 35 epochs the model got almost 78% accuracy. The optimizer converged faster by reducing the learning rate with the help of the automatic learning rate method.

Dokumen terkait