Next Article in Journal
Hard to Detect Factors of Univariate Integer Polynomials
Next Article in Special Issue
Deep Learning-Based Classification of Abrasion and Ischemic Diabetic Foot Sores Using Camera-Captured Images
Previous Article in Journal
Numerical Computing Research on Tunnel Structure Cracking Risk under the Influence of Multiple Factors in Urban Deep Aquifer Zones
Previous Article in Special Issue
Enhancing Robustness of Viewpoint Changes in 3D Skeleton-Based Human Action Recognition
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Efficient Harris Hawk Optimization (HHO)-Based Framework for Accurate Skin Cancer Prediction

by
Walaa N. Ismail
1,2,* and
Hessah A. Alsalamah
3,4
1
Department of Management Information Systems, College of Business Administration, Al Yamamah University, Riyadh 11512, Saudi Arabia
2
Faculty of Computers and Information, Minia University, Minia 61519, Egypt
3
College of Computer and Information Sciences, King Saud University, Riyadh 4545, Saudi Arabia
4
Computer Engineering Department, College of Engineering and Architecture, Al Yamamah University, Riyadh 11512, Saudi Arabia
*
Author to whom correspondence should be addressed.
Submission received: 27 July 2023 / Revised: 16 August 2023 / Accepted: 18 August 2023 / Published: 20 August 2023

Abstract

:
The prediction of skin cancer poses a number of challenges due to the differences in visual characteristics between melanoma, basal cell carcinomas, and squamous cell carcinomas. These visual differences pose difficulties for models in discerning subtle features and patterns accurately. However, a remarkable breakthrough in image analysis using convolutional neural networks (CNNs) has emerged, specifically in the identification of skin cancer from images. Unfortunately, manually designing such neural architectures is prone to errors and consumes substantial time. It has become increasingly popular to design and fine-tune neural networks by using metaheuristic algorithms that are based on natural phenomena. A nature-inspired algorithm is a powerful alternative to traditional algorithms for solving problems, particularly in complex optimization tasks. One such algorithm, the Harris hawk optimization (HHO), has demonstrated promise in automatically identifying the most appropriate solution across a wide range of possibilities, making it suitable for solving complex optimization problems. The purpose of this study is to introduce a novel automated architecture called “HHOForSkin” that combines the power of convolutional neural networks with meta-heuristic optimization techniques. The HHOForSkin framework uses an innovative custom CNN architecture with 26 layers for the analysis of medical images. In addition, a Harris hawk optimization algorithm (HHO) is used to fine-tune the developed model for multiple skin cancer classification problems. The developed model achieves an average accuracy of 99.1% and 98.93% F1 score using a publicly available skin cancer dataset. These results position the developed optimization-based skin cancer detection strategy at the forefront, offering the highest accuracy for seven-class classification problems compared to related works.

1. Introduction

Skin cancer is a prevalent and potentially life-threatening condition characterized by the abnormal growth of skin cells [1,2]. Approximately 80% of all cancers diagnosed worldwide are related to skin cancer, according to the World Health Organization (WHO); https://www.who.int/uv/faq/skincancer/en/index1.html (accessed on 20 May 2023).
The primary cause of the condition is exposure to ultraviolet (UV) radiation, either from the sun or from artificial sources such as tanning beds [3,4]. Skin cancer has become a significant global health concern, prompting awareness campaigns, sun protection measures, and the development of improved detection and prevention strategies [1,2,3]. In order to reduce the impact of skin cancer on individuals and communities around the world, early detection, education about sun safety practices, and regular skin examinations are essential. The biopsy method is a medical procedure used to obtain a sample of tissue or cells from the body for diagnostic purposes [1,4]. Often, a skin biopsy is conducted to determine whether a skin lesion is cancerous or not. Biopsy results, along with other clinical information, are used to determine the stage of the patient’s cancer and to devise an individualized treatment plan [5,6]. In addition to the biopsy method, there are other screening methods for detecting skin cancer. By performing a visual inspection, a healthcare professional or dermatologist examines the skin in detail and looks for any abnormal lesions, moles, or growths that could be indications of skin cancer. As part of this method, the healthcare provider relies on their expertise and experience in identifying abnormal or concerning features [6,7]. Dermoscopy, also known as dermatoscopy or epiluminescence microscopy, uses a handheld device known as a dermatoscope to examine skin lesions [5]. A magnified view of the skin allows healthcare professionals to assess whether the lesion is cancerous by observing its structure, color, and pattern. Despite the fact that these screening methods are helpful in detecting skin cancer in its early stages, they do not provide definitive automatic diagnostic tools. A biopsy is typically necessary to confirm the presence of skin cancer. Moreover, dermatologists continue to conduct professional skin examinations regularly to ensure accurate diagnosis and follow-up of skin conditions.
Computer-aided design (CAD) systems may enhance the efficiency and accuracy of skin cancer diagnosis by providing an automated and objective approach to analyzing lesions on the skin [8,9,10]. Dermatologists and other healthcare professionals can use them to leverage the power of computer vision and machine learning techniques to assist in the early detection and prompt treatment of skin cancer, ultimately improving the health of their patients [3,9]. An inherent limitation of CAD is the manual selection of features based on human intuition and expertise. The system may fail to recognize relevant features that are not readily apparent to human observers, resulting in decreased diagnostic accuracy. By selecting features manually, a limited feature set may be selected that is not sufficiently comprehensive to capture the complex and diverse features of skin lesions [11,12]. A CAD system may suffer from decreased classification accuracy if important features are missed during the selection process. Furthermore, CAD systems heavily rely on training data in order to develop and fine-tune their algorithms [13,14,15]. CAD systems may have difficulty generalizing well to real-world scenarios if the training dataset is biased or does not represent the diverse population and skin lesions of a particular region. Consequently, when applied to cases that are unfamiliar or difficult to classify, the classification accuracy may be reduced [11,16]. The detection of skin cancer from images has become an increasingly important area of research and medical practice as a result of advances in deep learning. Using deep networks, it is possible to learn representations of input data that are extremely complex and abstract [11,13,15]. The architecture of convolutional neural networks (CNNs) often consists of multiple layers with deep architectures. These deep architectures allow CNNs to capture both low-level and high-level features, allowing them to extract meaningful information from images with varying qualities, lighting conditions, and perspectives. Additionally, a CNN is capable of learning relevant features automatically from raw data, eliminating the need for manual selection of features [12,15]. CNNs can capture intricate patterns and subtle features necessary for accurate classification by learning hierarchical representations of the input images [17,18,19]. The complexity of the CNN architecture, however, can significantly influence the training time. Training deeper networks with more layers and parameters generally takes longer and requires more computational power [20,21]. In addition, CNNs may be prone to overfitting, particularly when the model is complex and trained on a limited amount of data [20,21]. Furthermore, the tuning of models’ hyperparameters, such as learning rate, batch size, and regularization, typically requires multiple training iterations [22]. The duration of the overall training process may be extended as a result of this iterative process [20,21,22].
Optimization techniques based on metaheuristic algorithms play a crucial role in fine-tuning CNN models and improving their performance [23,24,25,26]. Metaheuristic algorithms have the advantage of using random structures rather than gradient-based methods. A simplified optimization process is thereby achieved [27,28]. Additionally, as the number of complicated situations increases, traditional methods such as grid search cannot be used to resolve these problems. On the other hand, these stochastic methods can provide a near-optimal solution in a reasonably short period of time based on their stochastic nature [29,30,31]. HHO is a metaheuristic algorithm that simulates Harris’s hawks’ cooperative hunting behavior in order to optimize hawk hunting success by sharing information and coordinating their actions [32,33,34]. A hawk’s search process is mimicked in this algorithm to solve optimization problems [35,36]. Through this approach, optimal or near-optimal weights and biases can be found for neural networks, improving their performance in tasks such as image classification, object detection, and image segmentation [32,33,34].
An automated early detection system for skin cancer is presented in the current study through the use of a novel customized CNN architecture. A customized architecture can be used to optimize the model size while maintaining or even improving performance. This facilitates the deployment of the model in real-world applications. Furthermore, HHO techniques will be employed to fine-tune the parameters of the CNN models, thus reducing training time, improving convergence, and enhancing their performance in skin cancer detection. To the best of our knowledge, this is the first study in the literature that focuses on automated CNN fine-tuning using HHO for a multiple skin cancer classification problem. The contribution of this paper can be summarized as follows:
  • A novel deep learning framework, HHOForSkin, is presented to improve the detection of multiple skin cancers by using a CNN architecture.
  • A novel custom CNN architecture comprising 26 layers was designed for the analysis of skin cancer images and framed as an optimization problem addressed by an HHO nature-inspired algorithm. This architecture was developed from scratch and trained to accurately identify and delineate lesion regions in medical images.
  • By incorporating the Harris hawk optimization (HHO) algorithm, the developed convolutional neural network (CNN) undergoes fine-tuning for multi-class classification, resulting in improved performance. This is achieved through the automatic selection and fine-tuning of disease features and the model’s hyperparameters.
  • A comparative analysis and performance evaluation of HHOForSkin have been conducted using a variety of performance metrics. The developed model was validated using a well-known dataset, specifically, HAM10000, covering seven types of skin cancer cases.
The paper is divided into five sections. In the Section 1, the problem addressed in this paper is introduced, and a concise overview of the proposed solution is presented. Section 2 delves into a thorough examination of the significant advancements found in the literature related to skin cancer detection. Section 3 outlines the materials and procedures utilized in the proposed solution. Section 4 elucidates the algorithms and solutions proposed in this research. The experimental results are then discussed in Section 5. Finally, Section 6 concludes the paper by providing a comprehensive analysis and discussion of the findings obtained.

2. Related Work

Several studies have been conducted to aid medical practitioners in detecting skin cancer at an early stage. Recent research has focused on the development of artificial intelligence algorithms to automate the diagnosis of various types of skin cancer. An overview of the recent literature regarding the use of DL models for the diagnosis of skin cancer is provided in this section.
A novel method of detecting skin cancer using deep learning and machine learning is presented by Tembhurne et al. [37]. The developed model uses state-of-the-art neural networks to extract features from images, whereas the machine learning model processes image features derived from techniques such as contourlet transform and local binary pattern histogram. A remarkable 93% accuracy is achieved by integrating manual and automated skin features. Additionally, it demonstrates a recall rate of 99.7% for benign cases and 86% for malignant cases of cancer using the ISIC archive. The study in [38] proposed combining the strengths of EfficientNetV2S and swin-transformer models to develop an ensemble model for the early detection of skin cancer. Specifically, the fifth block of the EfficientNetV2S model was modified and the swin-transformer model was integrated. The model accuracy was 99.10%, sensitivity was 99.27%, and specificity was 99.80%. An innovative approach for the classification of skin lesions based on deep learning and machine learning was developed in [39]. This study involved several complex steps including contrast amplification of skin lesion images, feature extraction, and feature selection. An extreme learning machine (ELM) is used to classify the selected features based on a modified canonical-correlation-based technique. On two different datasets, 93.40% and 94.36% accuracy rates were achieved. Several convolutional neural networks (CNNs) were employed in [40] to classify melanoma skin cancer, namely, ResNet50, EfficientNet B6, Inceptionv3, and Xception. A total of 10,500 images were used to train these CNN models. A deep-learning-based skin cancer classification network, DSCCNet, utilizing a convolutional neural network (CNN) architecture, is presented in [41]. DSCCNet was evaluated against three well-established benchmark datasets and scored 94.17% accuracy, 93.76% precise, and 94.28% F1 score.
Using dermoscopy images, Fu et al. [23] developed a robust pipeline approach that detects melanoma accurately. The study involves image preprocessing followed by segmentation of the region of interest (RoI) using kernel fuzzy C-means. The final detection is then performed using an optimized classification approach based on MLP (multilayer perceptron). An enhanced version of the red fox optimization method is used for the optimization of classification and feature selection. Another study [24] presents a novel DL-based architecture for the classification of a variety of skin tumor types, such as basal cell carcinoma, benign keratoses, melanocytosis, and melanoma. SCDNet combines VGG-16 with CNN to effectively classify different types of skin tumors. A computer-aided diagnosis method based on the random Boolean networks (RBNs) model was proposed by Burada et al. [25] for the detection of melanoma skin tumors. To remove noise and unwanted artifacts, color images are converted into grayscale and filtered using a median filter. Once the segmented images have been classified as benign or malignant, the RBN classifies them accordingly. An innovative computer-aided approach was introduced in yet another study [42] to detect skin cancer. In this method, DL is combined with wildebeest herd optimization (WHO), which is a metaheuristic approach. Inception CNNs are used to extract the initial features, and then the WHO algorithm is used to filter out the relevant features, thereby reducing the complexity of the analysis.
A novel approach to diagnosis of melanoma by N. K. Priyadharshini combines the strengths of learning-based optimization (TLBO) with extreme learning machines (ELMs). The ELM is a feed-forward neural network with a single hidden layer that is fast and accurate, while the TLBO algorithm is an optimization algorithm designed to optimize the parameters of the network to enhance its performance. The proposed method leverages these techniques to classify skin lesions as benign or malignant with an accuracy of 93.18%. Srilakshmi Ch et al. [43] propose a new method for the analysis of dermoscopic images called DBOA-MMDLSCC. The DBOA-MMDLSCC technique utilizes ensemble learning, combining three DL models with hyperparameter tuning using a metaheuristic approach. DBOA-MMDLSCC uses the U-Net++ model for skin lesion segmentation as well as multi-modal DL models that include Xception, ResNet, and SqueezeNet for feature extraction. Additionally, the Dung Beetle Optimization Algorithm (DBOA) is used to tune the hyperparameters of the DL models. The accuracy of the three-class classification of melanoma, seborrheic keratosis, and nevus was 98.24% based on 2000 images.
Recent advancements in the field have demonstrated substantial headway in leveraging the strengths of CNNs, as shown in Table 1, such as their capacity to acquire intricate features and their aptitude to effectively adapt to unfamiliar data. Nonetheless, it is crucial to address several limitations that demand additional consideration.
  • Previous studies have predominantly depended on conventional machine learning approaches, focusing on a restricted set of skin cancer classes. Nevertheless, accurately calculating the texture, shape, hue, and spectral properties of skin cancer images necessitates a substantial dataset and a concise training period. The current study utilized a more comprehensive perspective by examining multiple classes of skin lesions and their relationships via a simple CNN architecture. In this manner, the modeling process is streamlined and complexity is reduced.
  • There is a tendency in the literature on skin cancer classification to exaggerate the effect of imbalanced datasets on classification outcomes. The literature tends to overstate the actual impact of imbalanced data on classification results, although imbalanced data can present difficulties, particularly in identifying minority groups. The usefulness of the model developed in the present study was confirmed by validating the model with both balanced and imbalanced well-known datasets encompassing seven distinct classes of skin cancer.
  • Several literature studies have considered building and training complex DL-based architectures, image segmentation, and feature selection approaches for skin lesion detection, which can be computationally complicated and time consuming, particularly if the model architecture involves several parameters. This may limit the scalability and practicality of the approach in resource-constrained environments. An efficient CNN model comprising 26 layers was developed and tested in this study to assimilate crucial insights regarding skin cancer by traversing individual layers of neurons within its architecture.
  • Many studies have demonstrated the utility of fine-tuning CNNs for biomedical image analysis, but the majority of these fine-tunings have been conducted only once with available training samples without any active hyperparameter selection process. This study utilizes the HHO algorithm to automatically determine the optimal CNN hyperparameters for a multi-class classification problem. This endeavor seeks to enhance skin cancer classification precision.

3. Proposed Framework

This section provides comprehensive explanations of the proposed methodology, including a detailed description of the utilized dataset.

3.1. Dataset Collection

The study utilized a collection of skin cancer images obtained from various regularly updated sources. Specifically, the skin cancer images used were sourced from the HAM10000 dataset, comprising a total of 10,500 samples [47,48]. A single lesion in this dataset is represented in multiple images acquired at different times and under different lighting conditions, which further contributes to the variability in the data. The HAM10000 dataset encompasses a comprehensive representation of significant diagnostic categories within the domain of pigmented lesions (shown in Figure 1).
These categories (shown in Table 2) include actinic keratoses and intraepithelial carcinoma/Bowen’s disease (referred to as akiec), basal cell carcinoma (bcc), benign keratosis-like lesions (such as solar lentigines/seborrheic keratoses and lichen-planus such as keratoses, denoted as bkl), dermatofibroma (df), melanoma (mel), melanocytic nevi (nv), and vascular lesions (comprising angiomas, angiokeratomas, pyogenic granulomas, hemorrhage, vasc). Additionally, data augmentation techniques such as translational, specular, and rotational methods were applied to each class, resulting in a final set of 10,500 images.
Figure 2 and Figure 3 showcase a selection of skin cancer images to provide visual examples.

3.2. Dataset Preprocessing

The experimentation involved testing various image sizes, specifically, 256 × 256, 128 × 128, and 64 × 64 (2n). Larger images require more time and resources but tend to yield higher accuracy. On the other hand, smaller images such as 64 × 64 run faster but offer reduced accuracy. As a result, optimal performance was achieved with an image size of 128 × 128. Consequently, all labeled skin cancer images were preprocessed and scaled to a uniform size of 128 × 128 before training.
This dataset comprises a modest number of classes, but the distribution of classes appears to be unbalanced. In some classes, fewer images are present than in others, resulting in a dataset imbalance. The class with the lowest number of samples is VASC, which initially contained 142 images. On the other hand, the class with the highest number of samples is NV, which consists of 6705 images. This issue was addressed by implementing data sampling techniques. Both size and class imbalances are effectively mitigated by these techniques, ensuring that all image categories carry equal weight, resulting in the following data shape: (46,935, 28, 28, 3). The shape of the data indicates that after the balancing process, there were 46,935 final images in the dataset. Each image has dimensions of 128 × 128 pixels and consists of three layers, representing colored images.
The data balancing was carried out based on the principle of equalizing the number of samples in the least represented class with the number of samples in the most represented class within the dataset using the RandomOverSampler technique. RandomOverSampler is a machine learning technique that is employed to address class imbalance in data [49]. It involves selecting and duplicating multiple instances from the minority class randomly and adding them to the dataset several times, potentially resulting in the two classes being equally represented [49]. After the dataset had been balanced, 6705 images were created for each of the seven types of skin cancer.

3.3. Customized Convolution Neural Network

The devised model utilizes a simple customized CNN model that has proven to be highly effective in accurately classifying images of skin cancer.
The purpose of this approach is to construct a custom artificial network while emphasizing the importance of training deep learning models using both balanced and unbalanced datasets. The devised model is designed to process an input tensor of shape ( b a t c h _ s i z e , 28, 28, 3). b a t c h _ s i z e stands for the number of samples in each batch, while 28 × 28 stands for the height and width of the input image, and 3 stands for the number of channels. Convolutional and pooling operations are applied sequentially to the input tensor, followed by fully connected layers for classification. In the input layer, filters are applied to the input image in order to extract the essential elements. In the HHOForSkin model, the feature map is represented as follows:
y ( i , j , k ) = σ u = 1 U v = 1 V c = 1 C W ( u , v , c , k ) X ( ( i + u 1 ) , ( j + v 1 , c ) )
In Equation (1), the activation values y ( i , j , k ) represent the activation value in the kth feature map. The activation function σ is applied to the summation of the weighted input values W ( u , v , c , k ) X ( ( i + u 1 ) , ( j + v 1 , c ) ) , where X ( i , j , c ) refers to the input channel value at position ( i , j ) and W ( u , v , c , k ) refers to the weight value for the kth feature map at position ( u , v ) of the cth input channel. The parameters U, V, and C represent the width, height, and channel count of the filters, respectively.
The next layer, which is the convolution block, consists of four layers: two convolutional layers with the same parameters as the previous layer; a maximum pooling layer that reduces the spatial dimension of the output tensor by selecting the maximum value within a 2 × 2 window; and a BatchNormalization layer that stabilizes the training process and enhances it by standardizing the output of the convolutional layers. A similar process is repeated with two additional convolutional blocks. Upon completion of the final max pooling layer, the output is flattened into a vector and passed to a series of fully connected layers responsible for classifying the data. The output is calculated using the following equation:  
y ( k ) = σ j = 1 J W j , k X j + b k
Equation (2) computes the output value y ( k ) , where σ is the activation function applied to the weighted sum of the input values W j , k X j with the corresponding bias term b k .
As part of the training process, the dropout layer randomly sets a fraction of the input units to 0 during each update in order to prevent overfitting. A linear transformation is performed on the input by four dense blocks, followed by an activation function. The output of each dense layer is subsequently standardized by a layer of BatchNormalization. To generate a probability distribution across the classes, the last output layer consists of seven units, corresponding to the number of classes in the classification task. Figure 4 and Table 3 present the devised model settings.
The training of the network on unbalanced data can reflect the inherent class imbalance commonly encountered in many applications, by capturing the distribution of the classes in the real world. As a result, the network is able to effectively differentiate and classify minority classes. Meanwhile, when the network is trained on balanced data, a different perspective is presented. In order to ensure an equal representation of each class during training, we balance the distribution of classes. In this manner, the network can be prevented from being biased in favor of the majority class and encouraged to learn more about the distinctive features of each class.
Using both balanced and unbalanced data to train the network, we are able to produce a more robust and versatile model. Having learned how to handle class imbalance scenarios, it becomes adept at maintaining accuracy across all classes. In this way, the model is capable of generalizing better and will perform more reliably in real-world applications with imbalanced datasets.

3.4. Artificial Harris Hawk Optimization

An AI model consists of three basic components: data, network architecture, and its parameters. An optimal balance between these elements is essential for maximizing the efficiency of a deep learning model. A random initial set of parameters is used for each trial of the model, and the model’s performance is evaluated in each trial to ensure that it is suitable for use. When performing complex tasks such as multiple skin cancer detection, the incorrect selection of the model’s hyperparameters can lead to suboptimal results, and traditional trial and error approaches can take a long time to tune hyperparameters and analyze results. Therefore, optimizing hyperparameters based on training data is crucial to finding the best values. In HHOForSkin, we use the Harris hawk optimization (HHO) algorithm, which is a metaheuristic method based on Harris’s hawks’ hunting behavior to solve the multiple skin cancer optimization problem.
The Harris hawk optimization (HHO) algorithm is implemented by a function named HHO, which optimizes an objective function, objf, given a set of inputs. As indicated in Algorithm 1, the function requires several parameters. Initialization is performed (lines 1–2) within the function in order to determine the rabbit’s position and energy level as well as the Harris’s hawks’ locations. For each individual i (ranging from 1 to N) and dimension j (ranging from 1 to D), generate a random value, r a n d , between 0 and 1 and compute the initial value, X i j , (exploration phase given by Equation (3)):
X i j = X i j + rand ( ) · ( U p p e r j j L o w e r k t ) ,
U p p e r j j and L o w e r k t are two randomly selected upper and lower hawk limits for the jth dimension of X. The HHO guides the optimization process using the M a x I t e r number. During each iteration, each Harris’s hawk’s location is evaluated using the o b j f function (lines 3–4), which returns the accuracy and loss metrics of a machine learning model trained with the current set of hyperparameters for X i , i = 1 , 2 , , N . The algorithm updates the best solution found so far and maintains a record of the rabbit’s location, which represents the worst solution found so far (exploitation phase, as given in Equation (4)).
X i t + 1 = ( X i t ) + ( X j t ) 2 + rand ( ) · ( X j t X k t ) ,
A wide exploration is conducted by the HHO algorithm in order to guide the optimization process by conducting random searches and diversifying the solution space. The HHO algorithm employs four distinct methods for updating its location based on the escape energy factor E and a random number between 0 and 1. Compute the energy factor, A(t), using the following equation:
A ( M a x I t e r ) = 4 ( 1 t M a x I t e r ) × l n ( 1 r ) ,
where r is a random value between 0 and 1. A value of r determines the likelihood that the prey will escape before the surprise pounce. Prey cannot escape if r is equal to or greater than 0.5 , while prey can escape if r > 1 . The first technique (i.e., “soft besiege”) comes into play when the prey possesses sufficient energy to attempt an escape by jumping, but ultimately fails to do so. Secondly, “hard besiege” occurs when the prey is captured by low-energy hawks. The formula for updating the position of the hawk is as follows:
X ( t + 1 ) = X r a b b i t ( t ) X ( t ) E | J . ( X r a b b i t ( t ) X ( t ) ) | , if r 0.5 . When r 0.5 and | E | 0.5 . X r a b b i t ( t ) E | J . ( X r a b b i t ( t ) X ( t ) ) | , if r = 0.5 and | E | = 0.5 .
Moreover, the HHO algorithm updates the location of each Harris’s hawk by mimicking the hunting behavior using “soft besiege with progressive rapid dives” when the rabbit has “soft besiege” with escape still being possible. Furthermore, it will randomly apply “hard besiege with progressive rapid dives” when the prey is able to escape. As part of the optimization process, the function also records the convergence curve, the accuracy curve, and the loss curve of the best solution (lines 5–7). As soon as the HHO function has been completed, it returns the convergence curve and the best solution found by the HHO algorithm.
Algorithm 1 Function: Make Harris hawk’s POPULATION
Ensure: 
N [ ] H a r r i s h a w k s
 1:
for (each h- h a w k s in H) do
 2:
    Initialize the Harris’s hawks based on Equation (3).                                       ▹ Exploration Phase
 3:
    Evaluate the population fitness function F(A)
 4:
    F(A) → random Harris’s hawks using Equations (4) and (6).
 5:
    Select the best-performing Harris’s hawks solutions h%.
 6:
    Assemble n Harris’s hawk’s for each Harris’s hawk.
 7:
    Align next generation by choosing the remaining ( 1 h ) % while updating their values using Equations (4) and (6).        ▹ Exploitation Phase
 8:
Return N[].                                            ▹ Selected Deep Neural Networks’ Parameters.
The HOOForSkin framework is described in detail in Algorithm 2. Figure 5 illustrates the block diagram of the designed HHOForSkin framework, depicting the entire workflow. The proposed approach entails the direct loading of skin cancer image data into the HHOForSkin deep modeling framework, which facilitates the decision-making process (Algorithm 2, lines 1–2). Initially, in the first step of the analysis process, the dataset was collected and prepared and then divided into three distinct groups: training, validation, and testing. The data preparation techniques were initially applied to the training sets, following which they were applied to the test and validation sets. For skin cancer disease classification, a customized CNN model was developed and evaluated (Algorithm 2, line 4). HHOForSkin’s framework utilized a nature-inspired evolutionary algorithm to automatically optimize the network’s hyperparameters based on their accuracy (Algorithm 2, lines 5–7). The final step involved testing and evaluating the performance of the developed models in classifying skin cancer into seven classes (Algorithm 2, lines 8–10).
Algorithm 2 The suggested HHOForSkin framework pseudocode
Input: 
Processed Skin Cancer images SkinDataset, Ib: Solution Space lower bound, Ub: Solution space upper bound, dim: Solution space dimensionality, SearchAgents#: number of Harris hawks, MaxIter: maximum number of iterations, Objective Function Objf
Output: 
BestFittingModel Architecture, Performance Evaluation Metrics.
 1:
Create TD: Test Dataset, RD: Train Dataset, and VD: Validation Dataset;
 2:
Set Dimension → dim, objf → A c c u r a c y
 3:
for Tt in TD do
 4:
    Create a customized CNN model with random initial hyperparameters.
 5:
    Create solution S L 0 ← Function (Make Harris’s hawks POPULATION) using Ib, Ub, dim, SearchAgents_no, MaxIter.  ▹ Learn the CNN’s model hyperparameters for M a x I t e r using HHO optimization algorithm
 6:
Apply the retrieved HHO parameters for CNN    ▹ Scores and solutions using the optimizer range that produces the best overall results
 7:
Validate CNN using SL, VD
 8:
Perform performance calculations based on the TD;
 9:
Classify skin cancer features into 7 classes: (Akiec, Bcc, Bkl, Df, Mel, Nv, and Vasc).
10:
Return: Fine-tuned model architecture.

3.5. Experimental Setting

During the experimentation phase, the Google Colab environment was utilized, employing the Google Compute Engine backend (GPU) in conjunction with Tensorflow using Python 3. The system configuration encompassed a total of 12.7 GB of RAM, of which 2.7 GB were available, a GPU RAM capacity of 15.0 GB, with 0.4 GB currently in use, and a disk storage of 78.2 GB, with 23.6 GB currently allocated. To optimize the learning rate during training, the ReduceLROnPlateau callback was employed. This callback automatically reduces the learning rate when a plateau in the validation accuracy is detected, which can enhance model performance and mitigate overfitting. The learning rate is reduced by a factor of 0.5 (i.e., multiplied by 0.5) upon plateau detection, with a minimum learning rate set to 0.00001. The HHOForSkin framework employs the HHO algorithm with specific settings. These settings include a learning rate of 0.001, and a batch size of 32. The details of the HHO algorithm settings can be found in Table 4.

3.6. Performance Parameters and Evaluation Metrics

The proposed HHOForSkin was evaluated based on multiple criteria including accuracy, F1 score, sensitivity, and specificity. An accurate classification in a seven-class classification problem represents the proportion of samples correctly classified out of the total number of samples across all classes (Equations (7)–(10)). In each class, the true positive (TP) value indicates how many samples have been correctly classified as belonging to that class. A true negative (TN) value represents the number of samples correctly identified as not belonging to a specific category. A confusion matrix (CM) is employed in order to evaluate HHOForSkin’s performance. During the execution of the method, these matrices will provide insights into the characteristics of the classification performance.
A c c u r a c y = ( T P + T N ) ( T P + F P + F N + T N )
S e n s i t i v i t y ( R e c a l l ) = T P ( T P + F N )
S p e c i f i c i t y ( P r e c i s i o n ) = T P ( T P + F P )
F 1 _ s c o r e = T P ( T P + 0.5 ( F P + F N ) )

4. Results

Our study aimed to assess the precision of the optimized CNN model in classifying skin cancer images. In the subsequent subsections, we will provide a comprehensive overview of the experimental setup and the results obtained.

4.1. Performance Assessment of the CNN Models without Optimization

We first evaluated the performance of the developed CNN without taking into account the HHO algorithm using a balanced dataset (named the first model) and an unbalanced dataset (named the second model). The data were divided into three parts: training, validation, and testing. The ratio of each subset in the case of the unbalanced dataset was as follows: training (70%), validation (10%), and testing (20%). The corresponding number of images for each subset was: training (7210 images), validation (802 images), and testing (2003 images). On the other hand, for the balanced dataset, the data were also divided into training, validation, and testing subsets. The distribution ratio remained the same: training (70%), validation (10%), and testing (20%). The respective number of images for each subset was: training (33,793 images), validation (3755 images), and testing (9387 images).
The performance of the proposed model for an imbalanced dataset graph can be seen in Figure 6 and Figure 7, which illustrate its performance during training and evaluation. This graph illustrates the model’s progress as it learns during the training phase. A training curve represents the evolution of a selected metric over a period of eight epochs. As an independent measurement of the model’s ability to generalize, Figure 8 and Figure 9 show the model’s performance on the testing dataset.
The confusion matrix is a table-like structure that is used for the description or evaluation of the performance of a classifier. The matrix is generally easy to understand and easy to use. For the devised non-optimized CNN model, confusion matrices are presented in Figure 10 and Figure 11 considering balanced and unbalanced datasets.
Each model’s accuracy and additional evaluation metrics are shown in Table 5. Figure 12 and Figure 13 illustrate the predicted and actual output images obtained from the non-optimized model utilized in this study.

4.2. Performance Assessment of the CNN Models Optimized with HHO

By utilizing the same settings employed in the non-optimized experiment, we assessed the performance of the HHOForSkin model provided by the valuable guidance of the optimization process (Shown in Table 6). The progress of the objective function for the fitness solution based on the validation accuracy is shown in Figure 14 and Figure 15 and the validation loss as shown in Figure 16 and Figure 17.
Optimization of a model’s performance often involves tuning its hyperparameters. An assessment of convergence facilitates the determination of optimal hyperparameter values by observing how different settings affect convergence behavior. It is considered that the optimization algorithm has converged when further iterations do not result in the objective function improving significantly. In Figure 18 and Figure 19, we show that the HHO coverages for 10 epochs with 451 iterations per epoch for the unbalanced dataset and 2113 for the balanced dataset.
Using HHO, the best solution for skin cancer detection from an unbalanced dataset could be represented by a 10-dimensional vector with the following values:
0.07959512 0.92146207 0.04792206 0.61868914 0.10053292 0.13538797 0.5871022 0.6579796 0.98288862 0.0629916
Secondly, based on the balanced skin cancer dataset, the best HHO solution is as follows:
0.0126429 0.04964975 0.64299634 0.17452906 0.27200789 0.37095965 0.22626202 0.73419105 0.15275893 0.91497799

4.3. HHOForSkin Performance Compared to State of the Art

In this section, we present a comprehensive analysis of the efficiency of HHOForSkin compared to state-of-the-art algorithms. A detailed comparison between the proposed algorithm and its peers is presented in Table 7. The table is composed of six columns that represent different aspects of the study: dataset name, skin cancer classification classes, the model, accuracy, and the utilization of optimization algorithms. The results of the study indicate that HHOForSkin achieves remarkable levels of accuracy for multi-class classification problems, comparable to those of existing methods. The consistent performance of HHOForSkin demonstrates its robustness and reliability as a classification solution.

5. Discussion

The incidence rate of skin cancer is experiencing a global increase, positioning it as one of the most prevalent forms of cancer. Early detection of skin cancer presents an opportunity for timely intervention, reducing the necessity for invasive treatments and potentially preventing its spread. A range of approaches has been developed to tackle the complexities associated with skin cancer detection, encompassing traditional clinical assessment to advanced computer-aided diagnostic systems. Promising results have emerged from the utilization of machine learning and deep learning techniques, notably convolutional neural networks (CNNs), in automating skin cancer detection. These approaches leverage large datasets of annotated skin lesion images to learn patterns and features indicative of malignancy, thereby enhancing their understanding of skin lesions. Optimizing hyperparameters in deep learning models plays a vital role in enhancing their performance for specific tasks. This study investigates how the accuracy of skin cancer detection can be improved using a customized CNN architecture.
In order to avoid bias in the classification accuracy of the developed DL model, balance and imbalance among classes should be considered. When there is a skewed distribution of classes in the dataset, relying solely on overall balanced accuracy can lead to misleading results. To address this, we evaluated the developed CNN over the same dataset twice, including the imbalanced and balanced data (shown in Figure 6 and Figure 8). The training and test results after eight iterations of training. There is a tendency for validation accuracy to be higher during the initial iterations compared to training accuracy. As the epochs progress, test and validation accuracies are likely to become more similar. The correlation between the training and test reached approximately 70%. A balanced HAM10000 dataset with 46,935 images was initially validated with a 50% degree of accuracy (Figure 7 and Figure 11). A 0.2 loss was recorded after the sixth epoch, and the percentage reached 90% for both the test and validation sets (Figure 9). A number of additional metrics have been generated after training the model has been completed, which can be viewed in Table 5 and Figure 12. The first model has a 100% specificity (true positive rate) and a 38.2% sensitivity (true negative rate), indicating that it can primarily predict instances of the majority class (i.e., NV and BKL cases), but not accurately identify instances of the minority class. As the second approach training process does not involve class imbalance, an F1 score of 90 indicates an acceptable model performance.
There are a number of hyperparameters that can affect the model’s ability to capture complex patterns in skin cancer data. In order to improve classification accuracy, these hyperparameters can be optimized to find the right balance between underfitting (too simple model) and overfitting (too complex model). Utilizing the HHO over the developed CNN, we have been able to fine-tune a number of hyperparameters to optimize the model’s performance. These parameters include batch size, dropout rate, learning rate, and regularization, which results in improving the classification accuracy (Figure 14 and Figure 20) and performance on the imbalanced dataset to 77.9%. In the second experiment, the HHO algorithm achieved accuracy values of 99.1% (as shown in Figure 15 and Figure 21) with 0.04. There is, however, a discrepancy between the true positive rate and the true negative rate for the imbalanced and balanced datasets as shown in Figure 22 and Figure 23. Based on these results, it is evident that the customized deep learning models, with their optimized hyperparameters, are capable of accurately classifying the collected skin cancer information. The effectiveness of the proposed HHOForSkin surpasses that of traditional techniques. However, the optimized architecture necessitates a high-performance computer to handle the high-dimensional input data. The model did not consistently achieve optimal sensitivity and specificity. In order to resolve this issue, we will add image masks to the preprocessing steps, such as contour and semantic segmentation masks, which label or color different parts of the image, such as lesions or healthy skin.
Convergence is an important criterion in the evaluation of optimization algorithms in order to determine the speed at which solutions are discovered. Slow convergent algorithms require more iterations to reach a satisfactory solution, whereas fast convergent algorithms can achieve good results in fewer iterations. Based on Figure 19, our HHO algorithm converged after undergoing multiple iterations, resulting in a solution of x = 0.99. In this solution, the gradient is almost zero, indicating that the objective function has nearly flattened out. The algorithm, thus, appears to have located a solution that is close to the optimal one, eliminating the need for further iterations. The algorithm has iteratively adjusted x = 0.77 for the imbalanced dataset (Figure 18), and at this point more adjustments or iterations may not be necessary to significantly improve the objective function’s value.
Skin cancer detection is a complex process that requires the collaboration of dermatologists, pathologists, computer scientists, and engineers. In comparison to prior studies, our approach has achieved significant advancements in addressing demanding multi-class classification problems (see Table 7). In addition, the optimization network produced highly satisfactory results, establishing HHOForSkin as the top-performing model with exceptional adaptability and flexibility across various classification scenarios. Furthermore, our method consistently outperforms both uni-class and multi-class learning-based methods employing grid search and other optimization algorithms such as NNA, DBOA, or TLBO.

6. Conclusions

To enhance the accuracy, efficiency, and accessibility of skin cancer detection, there is great potential in combining advanced imaging technologies, machine learning algorithms, and medical expertise. The purpose of the present study is to present a novel approach to categorizing seven types of skin cancer using pruned machine learning techniques. Using a 26-layer conventional neural network, “HHOForSkin” is an automated end-to-end model for classifying skin cancer images. In order to fine-tune the parameters of the CNN model, the proposed methodology incorporates the metaheuristic algorithm HHO. For multi-class skin classification problems, the proposed method exceeded existing optimization strategies by achieving an accuracy of 99.1% through a series of experiments. This detection accuracy outperforms all other optimized approaches for skin cancer detection.

Author Contributions

Conceptualization, W.N.I. and H.A.A.; Methodology, W.N.I. and H.A.A.; Software, W.N.I.; Writing—original draft, W.N.I. and H.A.A.; Writing—review and editing, H.A.A. All authors have read and agreed to the published version of the manuscript.

Funding

This work received funding from the Deanship of Scientific Research at King Saud University.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Pacheco, A.G.; Krohling, R.A. The impact of patient clinical information on automated skin cancer detection. Comput. Biol. Med. 2020, 116, 103545. [Google Scholar] [CrossRef] [PubMed]
  2. Kadampur, M.A.; Al Riyaee, S. Skin cancer detection: Applying a deep learning based model driven architecture in the cloud for classifying dermal cell images. Informatics Med. Unlocked 2020, 18, 100282. [Google Scholar] [CrossRef]
  3. Hasan, M.; Barman, S.D.; Islam, S.; Reza, A.W. Skin cancer detection using convolutional neural network. In Proceedings of the 2019 5th International Conference on Computing and Artificial Intelligence, Bali, Indonesia, 19–22 April 2019; pp. 254–258. [Google Scholar]
  4. Vijayalakshmi, M. Melanoma skin cancer detection using image processing and machine learning. Int. J. Trend Sci. Res. Dev. IJTSRD 2019, 3, 780–784. [Google Scholar]
  5. Zhang, N.; Cai, Y.X.; Wang, Y.Y.; Tian, Y.T.; Wang, X.L.; Badami, B. Skin cancer diagnosis based on optimized convolutional neural network. Artif. Intell. Med. 2020, 102, 101756. [Google Scholar] [CrossRef]
  6. Blumenthal, L.Y.; Arzeno, J.; Syder, N.; Rabi, S.; Huang, M.; Castellanos, E.; Tran, P.; Pickering, T.A.; Dantus, E.J.; In, G.K.; et al. Disparities in nonmelanoma skin cancer in Hispanic/Latino patients based on Mohs micrographic surgery defect size: A multicenter retrospective study. J. Am. Acad. Dermatol. 2022, 86, 353–358. [Google Scholar] [CrossRef] [PubMed]
  7. Kalashnykova, N.M. Characteristics of the volume and outcomes of medical care for patients with skin cancer in ukraine in 2010–2020. Wiad. Lek. 2023, 76, 799–804. [Google Scholar] [CrossRef] [PubMed]
  8. Reis, H.C.; Turk, V.; Khoshelham, K.; Kaya, S. InSiNet: A deep convolutional approach to skin cancer detection and segmentation. In Medical & Biological Engineering & Computing; Springer: Berlin/Heidelberg, Germany, 2022; pp. 1–20. [Google Scholar]
  9. Mampitiya, L.I.; Rathnayake, N.; De Silva, S. Efficient and low-cost skin cancer detection system implementation with a comparative study between traditional and CNN-based models. J. Comput. Cogn. Eng. 2022, 2, 226–235. [Google Scholar] [CrossRef]
  10. Malibari, A.A.; Alzahrani, J.S.; Eltahir, M.M.; Malik, V.; Obayya, M.; Al Duhayyim, M.; Neto, A.V.L.; de Albuquerque, V.H.C. Optimal deep neural network-driven computer aided diagnosis model for skin cancer. Comput. Electr. Eng. 2022, 103, 108318. [Google Scholar] [CrossRef]
  11. Kumar, S.; Jaiswal, G.; Sinha, K. Skin Cancer Lesion Detection Using Improved CNN Techniques. In Handbook of Research on Technological Advances of Library and Information Science in Industry 5.0; IGI Global: Hershey, PA, USA, 2023; pp. 355–377. [Google Scholar]
  12. Rajesh, G.; Anirudh, V.; Archana, R.; Kumar, P.P.; Manoj, K. An Improved Skin Cancer Classification Method Using Deep Convolutional Neural Networks and Transfer Learning Models. J. Eng. Sci. 2023, 190–200. [Google Scholar]
  13. Sreelakshmi, C.; Adithya, V.; Rajesh, R. An Efficient Method for Skin Cancer Detection Using Convolutional Neural Network. In Proceedings of the International Health Informatics Conference: IHIC 2022; Springer: Berlin/Heidelberg, Germany, 2023; pp. 161–165. [Google Scholar]
  14. Singh, S.K.; Banerjee, S.; Chakraborty, A.; Bandyopadhyay, A. Classification of Melanoma Skin Cancer Using Inception-ResNet. In Frontiers of ICT in Healthcare: Proceedings of EAIT 2023, Kolkata, India, 25 April 2023; Springer: Berlin/Heidelberg, Germany, 2023; pp. 65–74. [Google Scholar]
  15. Hu, Q.; Xia, H.; Zhang, T. Chatbot Combined with Deep Convolutional Neural Network for Skin Cancer Detection. Methods 2023, 2, 35. [Google Scholar]
  16. Khattar, S.; Kaur, R.; Gupta, G. A Review on Preprocessing, Segmentation and Classification Techniques for Detection of Skin Cancer. In Proceedings of the 2023 2nd Edition of IEEE Delhi Section Flagship Conference (DELCON), Rajpura, India, 24–26 February 2023; pp. 1–6. [Google Scholar]
  17. Ghafoor, K.J.; Rawf, K.M.H.; Abdulrahman, A.O.; Taher, S.H. Kurdish dialect recognition using 1D CNN. Aro Sci. J. Koya Univ. 2021, 9, 10–14. [Google Scholar] [CrossRef]
  18. Taher, A.H. Train Support Vector Machine Using Fuzzy C-means Without a Prior Knowledge for Hyperspectral Image Content Classification. Aro Sci. J. Koya Univ. 2022, 10, 22–28. [Google Scholar] [CrossRef]
  19. Ismail, W.N.; Rajeena, P.P.F.; Ali, M.A. MULTforAD: Multimodal MRI Neuroimaging for Alzheimer’s Disease Detection Based on a 3D Convolution Model. Electronics 2022, 11, 3893. [Google Scholar] [CrossRef]
  20. Alzubaidi, L.; Zhang, J.; Humaidi, A.J.; Al-Dujaili, A.; Duan, Y.; Al-Shamma, O.; Santamaría, J.; Fadhel, M.A.; Al-Amidie, M.; Farhan, L. Review of deep learning: Concepts, CNN architectures, challenges, applications, future directions. J. Big Data 2021, 8, 53. [Google Scholar] [CrossRef]
  21. Shin, H.C.; Roth, H.R.; Gao, M.; Lu, L.; Xu, Z.; Nogues, I.; Yao, J.; Mollura, D.; Summers, R.M. Deep convolutional neural networks for computer-aided detection: CNN architectures, dataset characteristics and transfer learning. IEEE Trans. Med. Imaging 2016, 35, 1285–1298. [Google Scholar] [CrossRef] [PubMed]
  22. Zhang, Q.; Zhang, M.; Chen, T.; Sun, Z.; Ma, Y.; Yu, B. Recent advances in convolutional neural network acceleration. Neurocomputing 2019, 323, 37–51. [Google Scholar] [CrossRef]
  23. Fu, Z.; An, J.; Yang, Q.; Yuan, H.; Sun, Y.; Ebrahimian, H. Skin cancer detection using kernel fuzzy C-means and developed red fox optimization algorithm. Biomed. Signal Process. Control 2022, 71, 103160. [Google Scholar] [CrossRef]
  24. Naeem, A.; Anees, T.; Fiza, M.; Naqvi, R.A.; Lee, S.W. SCDNet: A Deep Learning-Based Framework for the Multiclassification of Skin Cancer Using Dermoscopy Images. Sensors 2022, 22, 5652. [Google Scholar] [CrossRef] [PubMed]
  25. Burada, S.; Swamy, B.M.; Kumar, M.S. Computer-Aided Diagnosis Mechanism for Melanoma Skin Cancer Detection Using Radial Basis Function Network. In Proceedings of the International Conference on Cognitive and Intelligent Computing: ICCIC 2021; Springer: Berlin/Heidelberg, Germany, 2022; Volume 1, pp. 619–628. [Google Scholar]
  26. Razmjooy, N.; Arshaghi, A. Application of Multilevel Thresholding and CNN for the Diagnosis of Skin Cancer Utilizing a Multi-Agent Fuzzy Buzzard Algorithm. Biomed. Signal Process. Control 2023, 84, 104984. [Google Scholar] [CrossRef]
  27. Myriam, H.; Abdelhamid, A.A.; El-Kenawy, E.S.M.; Ibrahim, A.; Eid, M.M.; Jamjoom, M.M.; Khafaga, D.S. Advanced meta-heuristic algorithm based on Particle Swarm and Al-biruni Earth Radius optimization methods for oral cancer detection. IEEE Access 2023, 11, 23681–23700. [Google Scholar] [CrossRef]
  28. Abd Elaziz, M.; Dahou, A.; Mabrouk, A.; El-Sappagh, S.; Aseeri, A.O. An efficient artificial rabbits optimization based on mutation strategy for skin cancer prediction. Comput. Biol. Med. 2023, 163, 107154. [Google Scholar] [CrossRef] [PubMed]
  29. Balaha, H.M.; Hassan, A.E.S. Skin cancer diagnosis based on deep transfer learning and sparrow search algorithm. Neural Comput. Appl. 2023, 35, 815–853. [Google Scholar] [CrossRef]
  30. Nandipati, B.L.; Devarakonda, N. VGG19+ CNN: Deep Learning-Based Lung Cancer Classification with Meta-Heuristic Feature Selection Methodology. Indones. J. Electr. Eng. Informatics IJEEI 2023, 11, 248–266. [Google Scholar] [CrossRef]
  31. Malaiarasan, S.; Ravi, R.; Maheswari, D.; Rubavathi, C.Y.; Ramnath, M.; Hemamalini, V. Towards Enhanced Deep CNN For Early And Precise Skin Cancer Diagnosis. In Proceedings of the 2023 International Conference on Networking and Communications (ICNWC), Chennai, India, 5–6 April 2023; pp. 1–7. [Google Scholar]
  32. Rammurthy, D.; Mahesh, P. Whale Harris hawks optimization based deep learning classifier for brain tumor detection using MRI images. J. King Saud Univ. Comput. Inf. Sci. 2022, 34, 3259–3272. [Google Scholar] [CrossRef]
  33. Kaur, N.; Kaur, L.; Singh, S. DLHO-: An Enhanced Version of Harris Hawks Optimization By Dimension Learning-Based Hunting For Breast Cancer And Other Serious Diseases Detection. Res. Sq. 2021. [Google Scholar] [CrossRef]
  34. Fathimathul Rajeena, P.P.; Ismail, W.N.; Ali, M.A. A Metaheuristic Harris Hawks Optimization Algorithm for Weed Detection Using Drone Images. Appl. Sci. 2023, 13, 7083. [Google Scholar]
  35. Wang, L.; Cao, Q.; Zhang, Z.; Mirjalili, S.; Zhao, W. Artificial rabbits optimization: A new bio-inspired meta-heuristic algorithm for solving engineering optimization problems. Eng. Appl. Artif. Intell. 2022, 114, 105082. [Google Scholar] [CrossRef]
  36. Wen, L.; Wang, G.; Yue, L.; Liang, X.; Chen, H. Multistrategy Harris Hawks Optimization Algorithm Using Chaotic Method, Cauchy Mutation, and Elite Individual Guidance. Discret. Dyn. Nat. Soc. 2022, 2022, 5129098. [Google Scholar] [CrossRef]
  37. Tembhurne, J.V.; Hebbar, N.; Patil, H.Y.; Diwan, T. Skin cancer detection using ensemble of machine learning and deep learning techniques. Multimed. Tools Appl. 2023, 82, 27501–27524. [Google Scholar] [CrossRef]
  38. Shehzad, K.; Zhenhua, T.; Shoukat, S.; Saeed, A.; Ahmad, I.; Sarwar Bhatti, S.; Chelloug, S.A. A Deep-Ensemble-Learning-Based Approach for Skin Cancer Diagnosis. Electronics 2023, 12, 1342. [Google Scholar] [CrossRef]
  39. Jaisakthi, S.M.; Aravindan, C.; Appavu, R. Classification of skin cancer from dermoscopic images using deep neural network architectures. Multimed. Tools Appl. 2023, 82, 15763–15778. [Google Scholar]
  40. Javid, M.H.; Jadoon, W.; Ali, H.; Ali, M.D. Design and Analysis of an Improved Deep Ensemble Learning Model for Melanoma Skin Cancer Classification. In Proceedings of the 2023 4th International Conference on Advancements in Computational Sciences (ICACS), Lahore, Pakistan, 20–22 February 2023; pp. 1–6. [Google Scholar]
  41. Tahir, M.; Naeem, A.; Malik, H.; Tanveer, J.; Naqvi, R.A.; Lee, S.W. DSCC_Net: Multi-Classification Deep Learning Models for Diagnosing of Skin Cancer Using Dermoscopic Images. Cancers 2023, 15, 2179. [Google Scholar] [CrossRef]
  42. Zhou, B.; Arandian, B. An improved CNN architecture to diagnose skin cancer in dermoscopic images based on wildebeest herd optimization algorithm. Comput. Intell. Neurosci. 2021, 2021, 7567870. [Google Scholar] [CrossRef] [PubMed]
  43. Ch, S.; Lydia, L.; Ramakrishnaiah, N. Dung Beetle Optimization Algorithm with Multi-modal Deep Learning based Skin Cancer Classification on Dermoscopic Images. Res. Sq. 2023. [Google Scholar] [CrossRef]
  44. Rashid, J.; Ishfaq, M.; Ali, G.; Saeed, M.R.; Hussain, M.; Alkhalifah, T.; Alturise, F.; Samand, N. Skin cancer disease detection using transfer learning technique. Appl. Sci. 2022, 12, 5714. [Google Scholar] [CrossRef]
  45. Priyadharshini, N.; Selvanathan, N.; Hemalatha, B.; Sureshkumar, C. A novel hybrid Extreme Learning Machine and Teaching–Learning-Based Optimization algorithm for skin cancer detection. Healthc. Anal. 2023, 3, 100161. [Google Scholar] [CrossRef]
  46. Huaping, J.; Junlong, Z.; Norouzzadeh Gil Molk, A. Skin cancer detection using kernel fuzzy c-means and improved neural network optimization algorithm. Comput. Intell. Neurosci. 2021, 2021, 9651957. [Google Scholar] [CrossRef]
  47. Tschandl, P.; Rosendahl, C.; Kittler, H. The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions. Sci. Data 2018, 5, 180161. [Google Scholar] [CrossRef] [PubMed]
  48. Codella, N.; Rotemberg, V.; Tschandl, P.; Celebi, M.E.; Dusza, S.; Gutman, D.; Helba, B.; Kalloo, A.; Liopyris, K.; Marchetti, M.; et al. Skin lesion analysis toward melanoma detection 2018: A challenge hosted by the international skin imaging collaboration (isic). arXiv 2019, arXiv:1902.03368. [Google Scholar]
  49. He, H.; Garcia, E.A. Learning from imbalanced data. IEEE Trans. Knowl. Data Eng. 2009, 21, 1263–1284. [Google Scholar]
Figure 1. An example of skin cancer classes.
Figure 1. An example of skin cancer classes.
Mathematics 11 03601 g001
Figure 2. An example of keratoses class images.
Figure 2. An example of keratoses class images.
Mathematics 11 03601 g002
Figure 3. An example of basal cell carcinoma class images.
Figure 3. An example of basal cell carcinoma class images.
Mathematics 11 03601 g003
Figure 4. The proposed CNN’s model structure.
Figure 4. The proposed CNN’s model structure.
Mathematics 11 03601 g004
Figure 5. HHOForSkin Framework.
Figure 5. HHOForSkin Framework.
Mathematics 11 03601 g005
Figure 6. Non-optimized CNN accuracy based on an imbalanced dataset.
Figure 6. Non-optimized CNN accuracy based on an imbalanced dataset.
Mathematics 11 03601 g006
Figure 7. Non-optimized CNN accuracy based on a balanced dataset.
Figure 7. Non-optimized CNN accuracy based on a balanced dataset.
Mathematics 11 03601 g007
Figure 8. Non-optimized CNN loss based on an imbalanced dataset.
Figure 8. Non-optimized CNN loss based on an imbalanced dataset.
Mathematics 11 03601 g008
Figure 9. Non-optimized CNN loss based on a balanced dataset.
Figure 9. Non-optimized CNN loss based on a balanced dataset.
Mathematics 11 03601 g009
Figure 10. Non-optimized CNN confusion matrix based on an imbalanced dataset.
Figure 10. Non-optimized CNN confusion matrix based on an imbalanced dataset.
Mathematics 11 03601 g010
Figure 11. Non-optimized CNN confusion matrix based on a balanced dataset.
Figure 11. Non-optimized CNN confusion matrix based on a balanced dataset.
Mathematics 11 03601 g011
Figure 12. Predicted output with non-optimized CNN model for an imbalanced dataset.
Figure 12. Predicted output with non-optimized CNN model for an imbalanced dataset.
Mathematics 11 03601 g012
Figure 13. Predicted output with non-optimized CNN model for a balanced dataset.
Figure 13. Predicted output with non-optimized CNN model for a balanced dataset.
Mathematics 11 03601 g013
Figure 14. HHO-optimized CNN accuracy based on an imbalanced dataset.
Figure 14. HHO-optimized CNN accuracy based on an imbalanced dataset.
Mathematics 11 03601 g014
Figure 15. HHO-optimized CNN accuracy based on a balanced dataset.
Figure 15. HHO-optimized CNN accuracy based on a balanced dataset.
Mathematics 11 03601 g015
Figure 16. HHO-optimized CNN loss based on an imbalanced dataset.
Figure 16. HHO-optimized CNN loss based on an imbalanced dataset.
Mathematics 11 03601 g016
Figure 17. HHO-optimized CNN loss based on a balanced dataset.
Figure 17. HHO-optimized CNN loss based on a balanced dataset.
Mathematics 11 03601 g017
Figure 18. HHO-optimized CNN convergence based on an imbalanced dataset.
Figure 18. HHO-optimized CNN convergence based on an imbalanced dataset.
Mathematics 11 03601 g018
Figure 19. HHO-optimized CNN convergence based on a balanced dataset.
Figure 19. HHO-optimized CNN convergence based on a balanced dataset.
Mathematics 11 03601 g019
Figure 20. HHO-optimized CNN confusion matrix for an imbalanced dataset.
Figure 20. HHO-optimized CNN confusion matrix for an imbalanced dataset.
Mathematics 11 03601 g020
Figure 21. HHO-optimized CNN confusion matrix for a balanced dataset.
Figure 21. HHO-optimized CNN confusion matrix for a balanced dataset.
Mathematics 11 03601 g021
Figure 22. Predicted output with HHO-optimized CNN model for an imbalanced dataset.
Figure 22. Predicted output with HHO-optimized CNN model for an imbalanced dataset.
Mathematics 11 03601 g022
Figure 23. Predicted output with HHO-optimized CNN model for a balanced dataset.
Figure 23. Predicted output with HHO-optimized CNN model for a balanced dataset.
Mathematics 11 03601 g023
Table 1. State-of-the-art skin cancer detection methods.
Table 1. State-of-the-art skin cancer detection methods.
Ref.MethodProsCons
Jaisakthi et al. [39]DenseNet and different
variants of EfficientNet
models.
- A high-performance classification is
achieved through the use of
EfficientNet.
- The EfficientNet architecture scales
the depth, width, and resolution of
the network automatically.
- EfficientNet requires a
substantial amount of calculation
in order to be optimized.
- The study focused on a limited
number of skin cancer classes.
Tembhurne et al. [37]For the detection of
skin lesions, a combination of
machine learning and DL algorithms
are used. In addition, skin cancer
features were selected using
a combination of manual
and automated methods.
The devised feature selection
algorithm improves the classification
of multiple skin cancers over
a manual selection approach.
This approach includes notable
computational complexity and
the time-intensive nature associated with
developing and training intricate
deep learning architectures,
in addition to utilizing techniques
such as image segmentation and
feature selection.
Tahir et al. [41]An effective CNN-based
model; consists of 5
convolutional blocks.
The CNN-based model is capable of
learning more complex features
from images and accurately
classifying skin lesions compared
to baseline models.
- The developed model requires a
substantial amount of calculations
in order to be optimized.
Rashid et al. [44]A pretrained MobileNet-V2 model.A high-performance classification is
achieved through the use of
MobileNet.
- Data accuracy decreases due to
the large gap between
the data domain and the target domain.
- The study focused on a limited
number of skin cancer classes.
- The model has been trained using
unbalanced and blurred data, which
may result in biased results.
Fu et al. [23]A multilayer perceptron based on
red fox optimization algorithm.
For the detection of single skin lesions,
a high-performance classification
has been achieved.
- The study focused on a limited
number of skin cancer classes.
- An extensive amount of computational
complexity and time is required
for the development and
training of the developed
architectures.
Priyadharshini et al. [45]A machine learning approach
utilizing extreme learning
and teaching–learning-based
optimization.
For the detection of melanoma,
a high-performance classification
has been achieved.
- The study focused on a limited
number of skin cancer classes.
- The model has been trained using
unbalanced and blurred data, which
may result in biased results.
- The developed model requires
a considerable amount of time, as
techniques such as image
segmentation and feature
selection must be applied.
Huaping et al. [46]A support vector machine classifier
and neural network metaheuristic
optimization algorithm.
For the detection of melanoma,
a high-performance classification
has been achieved.
- The study focused on a limited
number of skin cancer classes.
- The model has been trained using
unbalanced and blurred data, which
may result in biased results.
- The developed model requires
a considerable amount of time, as
techniques such as image
segmentation and feature
selection must be applied.
Table 2. Dataset class distribution.
Table 2. Dataset class distribution.
Class NameNumber of ImagesClass NameNumber of Images
NV6705BKL1099
BCC514AKIEC327
MEL1113VASC142
DF115
Table 3. The CNN’s model structure.
Table 3. The CNN’s model structure.
LayerOutput ShapeNo. of Parameters
InputLayer(None, 28, 28, 3)0
Conv2D(None, 28, 28, 256)7168
Conv2D_1(None, 28, 28, 256)590,080
Max_Pooling2D(None, 14, 14, 256)0
Batch_Normalization(None, 14, 14, 256)1024
Conv2D_2(None, 14, 14, 128)295,040
Conv2D_3(None, 14, 14, 128)147,584
Max_Pooling2D_1(None, 7, 7, 128)0
Batch_Normalization_1(None, 7, 7, 128)512
Conv2D_4(None, 7, 7, 64)73,792
Conv2D_6(None, 7, 7, 64)36,928
Max_Pooling2D_2(None, 3, 3, 64)0
Batch_Normalization_2(None, 3, 3, 64)256
Conv2D_6(None, 3, 3, 32)18,464
Max_Pooling2D_3(None, 1, 1, 32)0
Flatten(None, 32)0
Dropout(None, 32)0
Dense(None, 256)8448
Batch_Normalization_3(None, 256)1024
Dense_1(None, 128)32,896
Batch_Normalization_4(None, 128)512
Dense_2(None, 64)8256
Batch_Normalization_5(None, 64)256
Dense_3(None, 32)2080
Batch_Normalization_6(None, 32)128
Dense(None, 7)231
Total parameters: 1,224,679
Trainable parameters: 1,222,823
Non-trainable parameters: 1856
Table 4. The configuration parameters for HHO optimization.
Table 4. The configuration parameters for HHO optimization.
Parameter DescriptionValue
The fitness function used to evaluate a fitness value that represents CNN model effectiveness.objf = maximum (accuracy) and minimum (loss)
The lower limit of the solution space.lb = 0
The upper limit of the solution space.ub = 1
The dimensionality of the solution space.dim = 10
The number of hawks utilized in the optimization algorithm.SearchAgent# = 30
The upper limit for the number of iterations in the optimization algorithm.MaxIter = 2
Table 5. Non-optimized CNN classification accuracy.
Table 5. Non-optimized CNN classification accuracy.
ModelAccuracyF1 ScoreSensitivitySpecificity
First Approach71.4%60.66%38.20%100%
Second Approach93.2%90.61%97.1%100%
Table 6. HHO-optimized CNN classification accuracy.
Table 6. HHO-optimized CNN classification accuracy.
ModelAccuracyF1 ScoreSensitivitySpecificity
First Approach77.9%75.29%54%83.1%
Second Approach99.1%98.93%100%100%
Table 7. Performance comparison of HHOForSkin and state-of-the-art related works—deep neural network (DNN), swin-transformer model (SWM), extreme learning machine (ELM), support vector machine (SVM), neural network algorithm (NNA), red fox optimization (DRFO), teaching–learning-based optimization (TLBO), dung beetle optimization (DBOA).
Table 7. Performance comparison of HHOForSkin and state-of-the-art related works—deep neural network (DNN), swin-transformer model (SWM), extreme learning machine (ELM), support vector machine (SVM), neural network algorithm (NNA), red fox optimization (DRFO), teaching–learning-based optimization (TLBO), dung beetle optimization (DBOA).
Ref.DatasetTypeModelAccuracyOptimization
 [37]ISIC
archive
Benign,
malignant
DNN99.7%
86%
No
 [38]HAM100007 types of
skin cancer
images
EfficientNetV2S
and SWM
99.1%No
 [45]DermISdatasetBenign,
malignant
ELM93.18%TLBO
 [41]ISIC 2020
HAM10000,
DermIS
4 types of
skin cancer
images
ResNet-152
VGG-16
VGG-19
Inceptionv3
EfficientNet-B0
MobileNet
89.32%
91.68%
92.51%
91.12%
89.46%
91.82%
No
 [46]American
Cancer
Society
and PH 2
6 types of
skin cancer
images
SVM92.35%NNA
 [23]ISIC 2020MelanomaMultilayer
perceptron
90.5%DRFO
 [43]ISIC 2017Melanoma,
seborrheic-
keratosis,
nevus
Xception
ResNet
SqueezeNet
98.17%
98.83%
98.33%
DBOA
 [39]ISIC 2019
and ISIC 2020
Melanoma,
non-melanoma
DenseNet
and different
variants of
EfficientNet models
77.65%No
 [24]ISIC 2019Melanoma,
melanocytic
nevi,
basal cell,
carcinoma,
benign keratosis
ResNet50
AlexNet
VGG-19
Inceptionv3
95.21%
93.14%
94.25%
92.54%
No
Proposed ModelHAM100007 types of
skin cancer
images
Non-optimized
CNN,
optimized CNN
93.2%
99.1%
HHO
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ismail, W.N.; Alsalamah, H.A. Efficient Harris Hawk Optimization (HHO)-Based Framework for Accurate Skin Cancer Prediction. Mathematics 2023, 11, 3601. https://0-doi-org.brum.beds.ac.uk/10.3390/math11163601

AMA Style

Ismail WN, Alsalamah HA. Efficient Harris Hawk Optimization (HHO)-Based Framework for Accurate Skin Cancer Prediction. Mathematics. 2023; 11(16):3601. https://0-doi-org.brum.beds.ac.uk/10.3390/math11163601

Chicago/Turabian Style

Ismail, Walaa N., and Hessah A. Alsalamah. 2023. "Efficient Harris Hawk Optimization (HHO)-Based Framework for Accurate Skin Cancer Prediction" Mathematics 11, no. 16: 3601. https://0-doi-org.brum.beds.ac.uk/10.3390/math11163601

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop