Clear Sky Science · en

Analysis of hybrid CNN models optimized with metaheuristic algorithms for melanoma detection

· Back to index

Why smarter skin cancer checks matter

Melanoma is a dangerous form of skin cancer that can spread quickly if it is not caught early. Dermatologists now use cameras and software alongside the naked eye, but designing reliable artificial intelligence (AI) systems for these images is still a challenge. This study explores a new way to build such systems by letting nature-inspired search strategies automatically design and tune a deep‑learning model, with the goal of catching more melanomas while keeping false alarms under control.

Figure 1
Figure 1.

Teaching computers to see troubled skin

The researchers focus on dermoscopic images—close-up, magnified pictures of skin spots taken with a special device. These images contain subtle patterns in color, texture, and shape that can hint at cancer. Convolutional neural networks (CNNs) are a type of AI particularly good at recognizing such visual patterns, but they are finicky: their performance depends on many design choices, such as how many layers they have, how large their filters are, and how fast they learn from data. Traditionally, experts guess or hand-tune these settings, or reuse designs from unrelated tasks, which can limit how well the models adapt to skin‑cancer images.

Letting nature-inspired search design the model

Instead of fixing a CNN in advance, the authors turn the whole design into a search problem. They combine the CNN with six so‑called metaheuristic algorithms—search strategies inspired by natural behaviors like cuckoos laying eggs in other birds’ nests, wolves hunting in packs, or flocks of birds moving as a swarm. In this framework, each metaheuristic treats a complete CNN design, including its main training settings, as a candidate solution. It then generates many such candidates, tests each one by actually training and validating a CNN on skin images, and gradually steers the population toward better-performing designs based on how accurately they distinguish melanoma from benign lesions.

Cleaning and enriching the images first

Before any learning can happen, the images themselves need careful preparation. The team uses the widely adopted HAM10000 collection, containing more than eleven thousand dermoscopic images across seven types of skin lesions, including melanoma. They resize all images to a standard size, even out brightness differences, and remove distracting artifacts such as hairs and marks that could confuse the model. To help the CNN cope with the variety found in real clinics, they then create new, slightly altered versions of each melanoma image by flipping, rotating, zooming, cropping, and adjusting brightness. This doubles as a way to balance the number of melanoma and non‑melanoma examples, ensuring the model does not simply learn to favor the more common class.

Putting six search strategies to the test

Within this cleaned and expanded dataset, the six metaheuristics—Cuckoo Search, Firefly Algorithm, Whale Optimization Algorithm, Particle Swarm Optimization, Grey Wolf Optimizer, and Crow Search Algorithm—each search for strong CNN configurations. They explore choices such as how many convolutional layers to use, how many filters per layer, whether to apply a stabilizing technique called batch normalization, how big each training batch should be, and the learning rate that controls how fast the model updates its internal settings. For each proposed design, a CNN is built, trained, and checked on a separate validation set, and its accuracy is fed back to the search algorithm as a score to guide the next round of candidates. This cycle repeats over multiple experimental schemes that vary the population sizes and number of iterations for each optimizer.

Figure 2
Figure 2.

Which strategies worked best

All six approaches produced CNNs that outperformed a carefully constructed, manually tuned baseline network. The baseline topped out at about 84 percent correct classifications, whereas the best metaheuristic‑guided models reached around 91 percent accuracy. Two algorithms stood out. Cuckoo Search delivered the highest overall accuracy and sensitivity—meaning it was especially good at catching melanomas and lowering the risk of missed cancers. Grey Wolf Optimizer offered similarly strong accuracy but achieved the best ability to correctly recognize benign lesions, reducing unnecessary alarms. Other methods, such as the Firefly Algorithm, performed competitively but with more variability, while Particle Swarm and Crow Search tended to settle earlier in less‑optimal regions of the design space.

Peeking inside the model’s “reasoning”

Because medical AI must be trusted by clinicians, the authors also examine how the optimized CNNs make decisions. Using a visualization technique called Grad‑CAM++, they generate colored heatmaps over input images that show where the network is “looking” when it calls a lesion malignant or benign. In successful cases, these maps focus on the actual spot rather than on surrounding skin or leftover artifacts, and they highlight irregular structures that align with what dermatologists themselves regard as suspicious. When the system errs, it often struggles with lesions that are visually ambiguous even to specialists, such as benign spots with rough texture or early melanomas with very subtle contrast.

What this means for future skin checks

To a non‑specialist, the key message is that the study shows how letting nature‑inspired search strategies design the inner workings of a deep‑learning model can make automated melanoma detection both more accurate and more reliable than expert hand‑tuning alone. By systematically comparing several such strategies on the same large, public dataset, the authors identify Cuckoo Search and Grey Wolf Optimizer as especially promising tools for building future clinical decision‑support systems. While these systems are not intended to replace dermatologists, they could become valuable second readers, helping ensure that dangerous lesions are less likely to be overlooked and that benign spots are less likely to trigger unnecessary anxiety and procedures.

Citation: Hermosilla, P., Soto, R., Monfroy, E. et al. Analysis of hybrid CNN models optimized with metaheuristic algorithms for melanoma detection. Sci Rep 16, 13075 (2026). https://doi.org/10.1038/s41598-026-42711-9

Keywords: melanoma detection, dermoscopic imaging, convolutional neural networks, metaheuristic optimization, medical artificial intelligence