## 4 Proposed Methodology
### Building a Custom CNN Model  
When dealing with a large dataset, deep learning is typically regarded as an effective algorithm [35]. Conventionally, deep learning techniques demand a significant amount of computing time and large storage space [25]. Figure 3 depicts the customized CNN network model for classifying skin lesions. The custom CNN model is comprised of 4 \(\times\) 2 layers. RGB input image of size 28 \(\times\) 28 was utilized. The convolution operation is performed on the first two layers in each of these layers and 3 \(\times\) 3 sized 32 filters are applied with a ReLu activation function. It is followed by the implementation of max pooling 2D layer with pool size of 2 \(\times\) 2 and a batch normalization layer. In the second layer, the same convolution operation is performed with change in the parameters. In this layer 3 \(\times\) 3 sized 64 filters are used with a ReLu activation function. After ReLu function, a max pooling 2D layer of 2 \(\times\) 2 size and a batch normalization layer are employed. As a part of the third layer, the same convolution operation is performed with alteration in the parameters. In this layer, 3 \(\times\) 3 sized 128 neurons are implemented with a ReLu activation function. It is then followed by the max pooling 2D layer of 2 \(\times\) 2 size and a batch normalization layer. The fourth layer contains the similar convolution operation is performed with another set of parameters. In this layer, 3 \(\times\) 3 sized 256 filters are used which are then followed by max 2D pooling of size 2 \(\times\) 2, batch normalization layer, a dropout layer of 20%, and a flattening layer. In the final stage, the classifier receives the output of the flattening layer. Tables 3 and 4 show the summary and hyper parameters used for designing the model, respectively. Proposed method for classification of skin lesions is illustrated in Algorithm 1.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Class** & **akicc** & **bcc** & **bkl** & **df** & **nv** & **vasc** & **mel** \\ \hline
**Label** & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Notations for each class in the HAM10000 database.  
Figure 2: Overview of the proposed ESRGAN-based CNN algorithm.  
```
Step 1:Pre-processing
1. Raw input images are first pre-processed using the ESRGAN generator model.
2. The images are then resized to 28 \(\times\) 28 for faster classification using the CNN model.
3. The imbalanced dataset is balanced using the data augmentation processes.
4. The augmented data is first split up into training data and testing data. Step 2:Training custom CNN model

1. Feature map \(Fmap\) are extracted from the input images
2. Set \(Fc\) = 2D Conv (_Fmap, size(32)_);
3. Set \(Fr\) = ReLu (_Fc_);
4. Set \(Fp\) = MaxPooling2D (_Fr_);
5. Set \(Fb\) = BatchNormalization (_Fp_);
6. \(size_{1}\) = [64,128,256]

for\(i=0\) to 2:
7. Set \(Fc_{1}\) = 2D Conv (_Fmap, size\({}_{1}\)_(_i_));
8. Set \(Fr_{1}\) = ReLu (_Fc1_);
9. Set \(Fc_{2}\) = 2D Conv (_Fmap, size\({}_{1}\)_(_i_));
10. Set \(Fr_{2}\) = ReLu (_Fc2_);
11. Set \(Fp_{1}\) = MaxPooling2D (_Fr2_);
12. Set \(Fp_{1}\) = BatchNormalization (_Fp1_);
13. end for
2. Set \(Ff\) = Flattening (_Fb1_);
3. Set \(Fd\) = Dropout (_Ff_);
4. \(size_{2}\) = [256,128,64,32]

for\(j=0\) to 3
5. Set \(Fd\) = Dense (_F0,size2(j)_);
6. Set \(Fb\) = BatchNormalization (_Fd_);
7. end j
8. Set \(Foc\) = OutputClassifier (_Fb_);
9.
```  
**Algorithm 1**Proposed algorithm for classification of skin lesions  
Figure 3: Layered architecture of proposed CNN model.