Clear Sky Science · en

Metaheuristic optimization of deep CNNs for multi-class diagnosis of cervical cancer and lymphoma

· Back to index

Smarter tools for catching cancer early

For many people, a cancer diagnosis still arrives too late, when treatment is harder and survival chances fall. Doctors already use microscopes and computers to inspect tissue samples, but teaching machines to tell similar looking cancers apart is surprisingly difficult. This study explores how to make artificial intelligence far more dependable at spotting two serious diseases, cervical cancer and lymphoma, by letting nature inspired search strategies automatically fine tune a powerful image analysis network.

Figure 1. Nature inspired algorithms tune a deep network to sort cervical and lymphoma cell images into the right cancer categories.
Figure 1. Nature inspired algorithms tune a deep network to sort cervical and lymphoma cell images into the right cancer categories.

Why cancer images confuse computers

Under the microscope, cells from different cancers can mimic each other, while cells from the same cancer can vary wildly in shape, color, and texture. This visual mess makes it hard for both humans and machines to deliver consistent diagnoses. Deep learning systems, especially a popular image network called VGG 16, can learn to pick up useful visual patterns. However, their performance depends heavily on many hidden settings, such as learning rate, batch size, and how strongly the model is regularized. These settings, called hyperparameters, are usually chosen by hand or left at default values, which can hold back accuracy, especially when the goal is to distinguish multiple cancer types at once.

Borrowing strength from big data without needing it

Medical image datasets are often small, because high quality labeled samples are hard and expensive to collect. To get around this, the researchers rely on transfer learning. They start from a VGG 16 network trained on a huge general image collection and reuse its early layers as a feature extractor for cell images. They then add custom layers tailored to the new task. The team works with two public collections: a cervical cancer set with five cell categories and a lymphoma set with three subtypes. Each original dataset had under a thousand images, so the authors expanded them through careful augmentation, such as small rotations, shifts, zooms, brightness changes, and flips, to create tens of thousands of varied training examples.

Figure 2. Different virtual swarms adjust a deep network’s settings so mixed cancer cell images become clearly separated groups.
Figure 2. Different virtual swarms adjust a deep network’s settings so mixed cancer cell images become clearly separated groups.

Letting virtual animals tune the knobs

Instead of guessing good hyperparameters, the study uses six metaheuristic algorithms inspired by animal behavior and evolution to search for the best settings. In these methods, each candidate solution is like a creature exploring a landscape of possibilities. The Whale Optimization Algorithm imitates how humpback whales spiral around prey, Grey Wolf Optimizer models wolves encircling and tracking a target, Particle Swarm Optimization treats solutions as birds in a flock, Genetic Algorithm recombines and mutates solutions like genes, Ant Colony Optimization follows virtual pheromone trails, and a Modified PSO variant works to avoid getting stuck too soon. Each candidate defines a full training recipe for VGG 16; the network is trained briefly, its validation accuracy is measured, and the metaheuristic adjusts its population to favor better recipes over several rounds.

From tuning recipes to fine polishing the network

The framework runs in two phases. First, the pre trained VGG 16 is used as a frozen feature extractor while the algorithms search for strong hyperparameter sets. Second, once the best set is found, the top layers of VGG 16 are unfrozen and fine tuned on the cancer data using those optimized settings, allowing the network to adapt its internal filters to the specific tissue patterns. Despite using very small search budgets just five agents and three iterations and modest numbers of training epochs, this dual strategy produced striking gains. On the lymphoma dataset, for example, a baseline VGG 16 without optimization reached about 83 percent accuracy, whereas optimized models climbed into the high nineties. Similar jumps were seen for cervical cancer, where tuned systems surpassed 99 percent accuracy even with only five epochs of training.

Which strategy worked best and why it matters

Across both cancer types and in repeated runs, the Whale Optimization Algorithm stood out. When paired with the pre trained VGG 16, it reached perfect scores on the test sets for accuracy, precision, recall, and specificity, and it converged reliably within just a few steps. Other algorithms, such as Ant Colony Optimization and Particle Swarm Optimization, showed their strength especially once fine tuning of the deep layers was enabled, also approaching or exceeding 99 percent accuracy. Statistical tests confirmed that the gains from whale based tuning over the other methods were not due to chance. While such near perfect results must still be checked on broader, more varied data, the study shows that carefully chosen search strategies can unlock far more performance from existing networks than default settings allow.

What this means for future cancer care

For non specialists, the main takeaway is that the study offers a smarter way to adjust an existing deep learning system so it can separate multiple, look alike cancers with very high reliability, using limited training data and reasonable computing resources. Rather than replacing doctors, such systems could serve as consistent assistants, flagging suspicious slides and helping reduce missed or wrong diagnoses. The authors note that larger and more diverse datasets, lighter network designs, and tools that explain what the model sees will be needed before deployment in clinics. Still, this work suggests that letting virtual whales, wolves, and swarms tune our cancer detecting networks can make automated diagnosis sharper, faster, and more trustworthy.

Citation: Abdelhay, E.H., Elgamily, K.M. & Badr, W.O.EF. Metaheuristic optimization of deep CNNs for multi-class diagnosis of cervical cancer and lymphoma. Sci Rep 16, 15110 (2026). https://doi.org/10.1038/s41598-026-51619-3

Keywords: cervical cancer imaging, lymphoma classification, deep learning diagnosis, hyperparameter optimization, metaheuristic algorithms