Introduction

According to the World Health Organization, Breast cancer is the second most common cancer among women worldwide after lung cancer. Breast cancer accounted for more than five hundred thousand deaths each year and 1.7 million new cases are identified every year [1]. Breast cancer is one of the most often diagnosed tumor forms across the globe [2]. As a result of this exponential expansion, there is a substantial advancement in the field of novel technologies for early detection and prevention of breast cancer. If breast cancer is treated promptly, it can be healed, and also the death rate can be lowered. As a result, early detection is critical for enhancing survivorship, and frequent checks are required for those who may be at risk. It is most commonly seen in the ducts, which are tubes that deliver milk to the nipple, and the lacrimal gland, which is the milk-producing center. This form of malignancy has been observed in both men and women; nevertheless, women are significantly more likely to suffer from it. This is represented in the fundamental difference between the breasts of both sexes, where malignant cells are frequently identified in milk-producing centers, lobules, milk transporting canals, and ducts [3]. An anatomy image of the woman's breasts is shown in Fig. 1, along with the most preferable and sensitive area of cancer development. Breasts are the exterior structures of the female organism, so imaging tools can identify abnormalities in it. There are various imaging approaches for early breast cancer detection such as Magnetic Resonance Imaging (MRI), ultrasound, X-Ray imaging, and Computed Tomography (CT). The most widely employed method is mammography; it is also the most effective screening tool [4]. It employs X-rays to print an image of the breast to detect cancer and provide accurate results. This method is usually followed in the age group of 50 years to 70 years. Despite its efficiency, it has several limits and downsides, one of which is the risk of wrongful convictions or negatives owing to a large number of variables analyzed for evaluation. Furthermore, because of the pressure on the breast, the mammography procedure is unpleasant for females also this procedure is not recommended for dense breasts.

Fig. 1
figure 1

Most sensitive area for malignant tissue [5]

More pleasant and secure alternatives for breast-testing are thermal imaging. The thermal screening process is quick, easy, safe, painless, non-invasive, and inexpensive. It can identify tumor development at a preliminary phase and is also valid for dense breasts. Breast thermography uses infrared light to detect the vasculature energy emitted out from the breast's membrane [1]. This is significant since malignant tumors have greater metabolic activity than healthy tissue. Because breast tumors very seldom develop symmetrically for each breast, physicians frequently use asymmetrical assessment to analyze breast thermogram images. The rise in temperatures aids in the detection of malignant cells by analyzing the existence of unsymmetrical thermal trends in each breast's thermogram [6]. Thermography has seen a surge in popularity in recent years, particularly for the breast diagnosis process. This is owing to the allure of its low-risk strategy and the possible development in signal processing and Artificial intelligence.

The eventual objective of current research on this subject is to develop a precise and reliable tumor diagnostic that can be used as a benchmark for breast cancer examination purposes. The area of thermal images and their implications have been resurrected as a result of recent technical developments. A breast cancer diagnosis is among the most prevalent usage of thermal imaging. Thermography, on the other hand, has not yet been accepted as a common approach for this objective. Furthermore, even though mammography is hazardous to health, even then the doctors prefer it over thermography findings. If thermal imaging improves to a reasonable level, it may be presented as a suitable alternative option.

Image segmentation is a critical step in image processing that is used in areas including object recognition, pattern classification, robotics vision, diagnostic imaging, farming, and cryptography. The categorization system may fail if the segmentation result is erroneous. The segmentation approach has been used to tackle several difficulties. Based on a given thresholding value, segmentation divides an image into multiple homogenous sections or segments with comparable qualities such as texture, colour, intensity, contrasts, shape, and size. There are two types of thresholds: bilevel and multilayer. In the basic lesson, a specific threshold value is utilized to divide the image into two homogeneous portions. The latter approaches are used to divide an image into more than two sections using a histogram of pixel intensities. Because of substantial image thresholds, choosing threshold values is critical when segmenting an image. As a result, either parametric or non-parametric approaches are used to frame it as an optimization problem.

Because existing multilevel image thresholding techniques are sometimes computationally costly, meta-heuristics optimization approaches have attracted interest such as differential evolution (DE) [7, 8], ant colony optimization algorithm (ACO) [9], gravitational search algorithm (GSA) [10], Particle swarm optimization (PSO) [11, 12], bacterial foraging algorithm (BFO) [13], cuckoo search (CS) [14], grey wolf optimizer (GWO) [15], harris hawks optimization (HHO) [14], and moth-flame optimization (MFO) [16]. The number of thresholds employed in this experiment can affect the study's importance. Numerous meta-heuristic approaches used to solve various optimization issues usually have flaws such as entrapment in local regions, premature conversion, and insufficient global searchability. Scholars may now suggest improved and hybrid versions as well as improved methodologies based on these findings. In optimization problems, considering a candidate and its inverse solution at the same time can speed up converging to a globally optimum solution. Opposition-based learning (OBL) and Lévy Flight are two of the most effective methods for improving meta-heuristic algorithm search performance.

The Black Widow Optimization Algorithm (BWOA) is a recently developed population-based meta-heuristic optimization approach influenced by black widow spiders' peculiar mate selection [17]. This method mimics the distinctive behavioral traits of black widow spiders by imitating their mating behavior. This approach involves different phases known as initialization, cannibalism, mutation, and convergence. When a female wants to procreate, she sprays chemicals on selected parts of her web to lure the male black widow. Animals with insufficient fitness are eliminated from the loop at this stage, resulting in early convergence. These first spiders opted to procreate the future group in pairs. The female black widow eats the male black widow either during or after mating. She then pulls preserved sperm cells from her reproductive level of functioning and releases them into egg pouches. The spiderling emerges in the egg pouches as early as eleven days after the egg is placed. They dwell together on the parental web for several days; sibling cannibalism is detected at this time. As a result, they lift off by being propelled by the wind.

Contribution and Motivation

The BWOA is a good alternative for solving numerical optimization benchmark problems and in engineering applications [18, 19]. However, it has some drawbacks: convergence speed, stagnation in local optima, an insufficient balance between exploitation/exploration, and low diversity. The following two stages are employed in the IBWOA version: (1) Levy flights and (2) Quasi Opposition-based learning (QOBL). Levy flights are amended to enhance the exploration capability of the basic BWOA algorithm [20]. Whereas quasi opposition-based learning is presented to improve the exploitation capacity [21]. An image-processing would be evolved as the major challenge in this arena. The major goal of this study is to provide a reliable and high-performance thermal image analysis for the diagnosis of breast cancer. The presented algorithm will enhance the balance between exploration and exploitation and also prevent stuck in the local solutions. To solve the aforementioned limitations, this paper suggests the use of a metaheuristic approach to segment thermographic images for breast cancer detection. This study intends to advance image segmentation investigation by presenting an enhanced IBWOA based on QOBL and Lévy Flight method. As per the author’s best knowledge, it's the first time that BWOA has been used for image segmentation in thermal imaging of breast cancer images. The proposed IBWOA algorithm is applied in the image segmentation process. The major contributions and objectives of this paper can be summarized as follows:

  • Conduct background study and literature review of thermal breast imaging, image segmentation using various optimization techniques.

  • Propose an improved BWOA using levy flight process has been proposed for solving the image segmentation problem using Otsu and Kapur’s entropy as an objective function.

  • A Novel quasi opposition-based learning is presented to improve the exploitation ability and balance between exploration and exploitation.

  • Performance comparison of improved BWOA is performed with existing state of art techniques such as Harris Hawks Optimization (HHO) [22], LSHADE [23], Whale Optimization Algorithm (WOA) [24], Sine Cosine Algorithm (SCA) [25], Slap Swarm Algorithm (SSA) [26], and Black Widow Optimization Algorithm(BWOA) [27] and Quantitative analysis is carried out using threshold, PSNR, SSIM, and FSIM based parameters.

Organization of paper:

The remainder of the paper is structured as follows: Sect. “ Related Works” reviews related works, while Sect. “ Materials and methods” details the materials and methods. Sect. “Proposed Methodology: Improved Black Widow Optimization algorithm (IBWOA)” outlines the proposed methodology. Sect. “Experimentation setup and Results” presents and analyzes the experimental results. Finally, Sect. “Conclusions and future work” concludes the paper and discusses future research directions.

Related works

Thermal imaging

In medical terms, thermal imaging is the practice of applying the heat energy fluctuations released by the body parts and translating them into images that can be evaluated by professionals. This particular concept has a long and illustrious history, traced to ancient cultures. The ancient People used their symbols to sense heat generated from limbs in evaluating and treating sickness. Furthermore, Greeks used clay or mud to record the temperature of human organs, with the irregularity being discovered by watching the region which dries out first. Thermal imaging of the breasts refers to the variation in the heat map deep within the skin among normal and cancerous tissues. The presence of a tumor in the body raises the heat of the cells and around it [28]. A balanced assessment of normal and cancerous tissues is generally used by professionals. The process for utilizing thermography to screen for breast cancer is relatively simple. It begins with a visual examination of the area of the chest. This enables doctors to link any unexpected activity to the heat map.

Image segmentation

For diagnosing breast cancer, image segmentation is a necessary stage. The classification system may fail if the segmented outcome is incorrect. To make the analytical stage easier, segmentation divides an image into various parts based on recognized information such as color, pattern, intensity, or movement [29, 30]. A visualization, detection, identification, and quantifying assessment are usually performed after a segmentation technique. Furthermore, thresholding has been widely used in the automated process of medical image analysis as a means of assisting doctors in the diagnosis phase. Even though there are numerous works on fully automated and semi- automated segmentation, the assessment of images and evaluation remains a challenge even today also. The major reason behind this is the complex frameworks with common characteristics, noise situations, poor contrast, and inferior boundaries, all of which are common in medical images. Support Vector Machine (SVM) [31,32,33], decision tree, K-nearest neighbor (k-NN) [26, 34, 35], Bayesian network (BN) [36], artificial neural network (ANN) [35, 37, 38], deep learning (DL) [39,40,41], and convolutional neural networks (CNNs) [42,43,44] are widely used method in machine learning for classification and problem analysis.

The early thermography trials for breast cancer detection were ineffective due to thermal imaging technology's inability to monitor temperature differences. Cameras have grown more sensitive as a result of technological advancements, and temperature disparities in breast infrared thermography of tumor patients have been emphasized.

Thermal imaging are useful for breast cancer diagnosis, assessment of benign diseases, and follow-up operations since 2014 [32, 42]. In this context, as explained, thermal imaging has become the focus of various investigations involving breast cancer diagnosis in recent years. We'll go through a few of these in this subsection. The development of a Computer-Aided Diagnostic (CAD) approach for breast cancer classification always begins with the segmentation of a Region of Interest. The goal of Region of Interest segmentation is to isolate the breast areas from the surrounding tissue. The researchers of [3] presented a thermography-based breast cancer classification approach as a novel process for classification. This approach is based on categorizing breast thermal images into three groups: healthy, harmless, and cancerous. Pre-processing stage and segmentation, extraction of features, feature selection employing ant colony optimization and particle swarm optimization, and classification using a Multi-class support vector machine are the primary phases in this approach. The integration of the curve variable k and the gradient vector flow is employed as a segmentation approach [45]. To characterize the segmented breast cancer dataset, the authors used a convolutional neural network (CNN). They employed a mix of binary masks, k-means clustering, and the signature border for feature extraction. In the study [46] AlFayez et al. utilized the Multilayer Perceptron (MLP) and Extreme Learning Machine (ELM) as classification techniques (ELM). Ibrahim et al. [47] suggested a horizontal projection profile (HPP) examination to segment both the right and left breasts by locating the top, left, lower, and right boundaries. HPP was utilized to identify the top and bottom boundaries, while Vertical Projection Profile (VPP) was utilized to identify the left and right borders. After employing HPP, Sathish et al. [48] applied asymmetric assessment, a novel alternative for segmentation that relies on locating the point of intersection to separate the right and left breasts [28, 48].

Shahari S and Wakankar [49], utilized the segmentation technology known as hot region segmentation strategy, which relies on explicitly dividing objects from backdrops after implementing the k-means clustering algorithm, that was implemented to categorize colors for Lab mode after converting from RGB mode to show and compare the distance between colors. Gonçalves et al. [33] relied on using three kinds of thermal images for an individual, whether healthful, normal, or dangerous, to diagnose breast cancer using machine learning algorithms. They used a mix of feature extraction algorithms following segmenting the ROI. Hossam et al. introduced a novel automated segmentation approach in [38], which included pretreatment, segmentation, and segregation for an area of interest, followed by ROI segmentation towards the image. Just the segmentation ROI was subjected to the feature extraction technique. Ultimately, support vector machines (SVM) and artificial neural networks were used to generate output. Multilevel thresholding of Breast Thermal images using the Dragonfly algorithm was proposed by Díaz-Cortés et al. [1]. The temperature distribution of the photos is used as a source for segmenting grayscale breast infrared images. [50] suggest colour segmentation of aerial photos using nature-inspired optimization techniques. As objective functions, Otsu's between-class variance and Kapur's entropy were used to evaluate the techniques' effectiveness. For colour segmentation of satellite images, Kapur's entropy-based objective function performs better, while the Cuckoo's search strategy is more economical. He and Huang [51] proposed an effective krill herd (EKH) optimization strategy for multilayer thresholding of colour images, based on Otsu's method with Kapur and Tsallis entropy as objective functions. When compared to the krill herd algorithm, the effective krill herd (EKH) method performs better krill herd (KH). Oliva et al. [52] offer a multilayer thresholding approach based on the electromagnetism optimization (EMO) algorithm. The objective functions are Otsu's and Kapur's entropy criteria, and the source is a histogram of photographs. For image segmentation, Samantaray et al. [14] proposed a hybrid Artificial Bee colony-Salp Swarm algorithm (ABC-SSA). In a multilevel thresholding issue utilizing Kapur's entropy as the objective function, the hybrids technique outperforms the ABC [53], Sine Cosine Algorithm (SCA) [25], Social Spider Optimization (SSO) [54], and SSA algorithms [26].

Pare et al. [55] presented multilevel thresholding of satellite images utilizing optimization algorithms Wind Driven Optimization (WDO) [56], Bacterial Foraging Optimization (BFO) [57], Firefly Algorithm (FA), Artificial bee colony algorithm (ABC), Differential evolution (DE), and Particle swarm optimization (PSO) with image energy curves as input. Kapur's entropy, Tsallis entropy, and Otsu's approach are utilized as objective functions. The entropy-based DE algorithms developed by Kapur generate superior segmented images. Bhandari et al. [56] presented multilevel thresholding utilizing WDO and CS, utilizing Kapur's entropy as the aim function. The studies describe multilevel thresholding employing multiple optimization strategies. Using maximizing Otsu's, Kapur's, and Tsallis's entropy, Bhandari et al. [58] suggested a modified artificial Bee colony (MABC) optimizer for multilayer thresholding of aerial photos. When compared to the ABC approach, the MABC technique provides superior segmented images. Acharya et al. [59] uses a support vector machine (SVM) for 50 breast images for automatic diagnosis and classification using the texture feature. Milosevic et al. [34] presented classification, and segmentation of breast thermal images using SVM, Naive Bayes classifier, K Nearest Neighbor classifier, and GLCM features.

Nonetheless, these methods have drawbacks; for instance, they are computationally costly, especially as the number of thresholds grows [12]. As a result, multilevel thresholding is seen as a unique issue that must be overcome. Meta-heuristic approaches are extensively used in the associated literature to tackle these difficulties on these grounds. Nature inspires metaheuristic algorithms to find application in many areas like physics, biology, and social behavior, among other subjects. Many researchers have utilized them to discover the ideal values for real-world situations because of their ease of implementation, versatility, and good performance. Many meta-heuristic algorithms have been presented in recent years like swarm intelligence (SI) [60] like Particle Swarm Optimization (PSO) [11], Ant Colony Optimization (ACO) [61], Artificial Bee Colony (ABC) [53], Teaching Learning Based Optimization (TLBO) [62], Gray Wolf Optimization (GWO) [63], Salp Swarm Algorithm (SSA) [26], and evolutionary computing (EC) [64] like Differential evolution (DE) [65], etc. Along with all these optimizations many different modified versions of these algorithms have also been proposed for example Cuckoo Search Algorithm via lévy flights, Learning enthusiasm-based TLBO (LebTLBO) [66, 67], Modified Naked Mole Rat Optimization (mNMRO) [68], etc. Zhao et al. proposed a variant of the Slime Mould Algorithm (SMA) [69], which had been used for the segmentation of computed tomography (CT) images using multilevel thresholding using Renyi’s entropy as the primary objective function. Many such algorithms have been presented recently to improve the superiority of image segmentation.

Materials and methods

To understand our work, this part gives the thoughts about the materials and procedures necessary for the construction of the suggested segmentation approach.

Dataset

The person must then normalize by being at ambient temperature (18 °C to 25 °C) for fifteen minutes. The person must strip down the upper half of his or her body, above the waistline to the neck. The whole mechanism and arrangement are well explained in Fig. 2. In which the patient at room temperature is exposed in front of an IR camera and corresponding thermal images at different positions are shown. The dataset for breast cancer is taken from Digital Database for Screening Mammography (DDSM): Breast Cancer Image Dataset [70] (http://visual.ic.uff.br/dmi/prontuario/home.php). Breast cancer may be detected via thermal imaging analysis, which involves multiple processes like preprocessing, segmentation, and classification of features. Thermal image processing' preprocessing and segmentation phases are believed to be the most important procedures in identifying cancerous tissue since they may enhance the precision of retrieving information and the classification of normal and abnormal situations. The contour (breast area) may be retrieved from the thermal image in the preliminary step by deleting undesirable parts such as the neck and shoulders. This is accomplished by transforming photos to grayscale for segmentation. The three phases of preprocessing include identifying the region of interest, improving the thermal image, and normalizing the image matrix.

Fig. 2
figure 2

Thermal imaging mechanism (Image Dataset [Online]. Available: http://visual.ic.uff.br/dmi/prontuario/home.php)

Methods

To perform segmentation based on image thresholding, Otsu’s between-class variance and other maximum entropy methods like Kapur’s entropy [71], Renyi’s entropy [72], and Tsallis entropy [61] have been developed. This kind of approach combines information theory successfully, but the probability of a gray level value being shown primarily affects the methodologies. Another reason for influencing or affecting the segmentation results is to ignore the gray level value of the pixels. In 1979, Otsu proposed a thresholding method that maximizes between-class variance and minimizes intraclass variance to achieve optimum threshold values [73]. The brightness and contrast of an image do not affect the 1-D Otsu method, furthermore, it is a procedure with the less computational cost for a small number of thresholds. The segmentation results of an image using Otsu are better. Nevertheless, the algorithm primarily considers only the gray level value, for that reason, it fails to produce optimum results in the case of noisy images. Depending upon the number of threshold values, thresholding may be defined by bi-level (BT) or multi-level (MT) thresholding. Bi-level thresholding divides an image into two distinct regions, while MT creates multiple regions in an image.

Otsu between-class variance

The between-class variance introduced by the Otsu is a nonparametric automatic method for image segmentation. It employs techniques to determine a threshold value to separate a histogram into different groups [74]. Conventional techniques offer bi-level thresholding image thresholding but due to the tiny differences between the object and the context of a complex image, bi-level thresholding is unable to properly determine the ideal threshold. Hence, the segmentation problem has been reported as a multilevel problem in literature, but practically it becomes difficult to implement. Otsu's and Kapur's approaches are therefore inappropriate for multilevel image segmentation applications in the real world. According to the literature, 3–4 threshold values will cover all the points in the histogram, thus there is no need to go beyond that [53, 75]. An exhaustive search for multilevel segments will result in an exponential increase in processing time as the number of thresholds rises. When it comes to the usage of photographs, it might be tough to know where to start. Discern the valleys and bottoms, particularly in circumstances when the valley is wide and flat, with a lot of noise. The data in this incident concerning surrounding pixels in the original image might change to make the histogram better helpful for thresholding. This approach is straightforward and unaffected by the image's intensity or brightness. The classic Otsu approach, on the other hand, is a solitary classification technique. The object inside the two classes could no longer be differentiated after applying the method to split the image into two classes. Other targets can be distinguished between the two classes; consequently, these two classes must be further divided. Different classes are segmented using the multi-threshold Otsu approach. To split the actual photo into d classes, d-1 thresholds are required for the multi-level technique. As a result, the array of thresholds used for image segmentation is represented as th = [th1, th2, thn,..., thd-1]. Each class may be defined in Eq. 1.

$$\begin{array}{c}{C}_{1}\leftarrow \left\{0, 1, \dots ., {th}_{1}\right\}\\ {C}_{n}\leftarrow \left\{{th}_{n}+1, {th}_{n}+2, \dots ., {th}_{n+1}\right\}\\ .\\ .\\ {C}_{d}\leftarrow \left\{{th}_{d}+1, {th}_{d}+2, \dots ., L-1\right\}\end{array}$$
(1)

The interclass variance/ between class variance \({\sigma }_{B}^{2}\) is given by the following equation.

$${\sigma }_{B}^{2} ={\omega }_{1}{\left({\mu }_{1}-{\mu }_{T}\right)}^{2}+{\dots \dots .\omega }_{n}{\left({ \mu }_{n}-{\mu }_{T}\right)}^{2}+{\dots \dots .\omega }_{d}{\left({ \mu }_{d-1}-{\mu }_{T}\right)}^{2}$$
(2)

Where \({\omega }_{0} \text{and} {\omega }_{n}\text{ are}\) the probability of the same greyscale pixel of classes \({C}_{1}\) and \({C}_{n}\) given in Eq. 1, \({\mu }_{0}\) and \({\mu }_{n}\) for average pixel levels of classes \({C}_{1}\) and \({C}_{n}\). The expression of \({\mu }_{1}\) and \({\mu }_{n}\) are given by Eq. 3.

$${\mu }_{1 }= \frac{\sum_{i=0}^{n}{ip}_{i}, }{{\omega }_{1}}, { \mu }_{n}= \frac{\sum_{i={th}_{n}+1}^{{th}_{n+1}}{ip}_{i} }{{\omega }_{n}} ,\dots \dots { \mu }_{d}= \frac{\sum_{i={th}_{d-1}+1}^{L-1}{ip}_{i} }{{\omega }_{d-1}}$$
(3)
$${\omega }_{a}= \sum_{i=0}^{n}{p}_{i}, , {\omega }_{b}= \sum_{i={th}_{n}+1}^{{th}_{n+1}}{p}_{i} ,\dots \dots { \omega }_{d}=\sum_{i={th}_{d-1}+1}^{L-1}{p}_{i}$$
(4)

It is necessary to compute the probability distribution \({p}_{i}\) that is given by Eq. 5

$${p}_{i}=\frac{{n}_{i}}{N}$$
(5)

where \({n}_{i}\) is the number of pixels having grey level i and N is the total number of pixels. In Otsu’s method, the intraclass variance is calculated and it provides optimum threshold values. Considering i as a certain class for a given image \(b\) having L gray levels (1,2,…, L) in the range [0, L-1]. Extended between the class value is given by \(f\left(k\right)\) between-class variance is represented in Eq. 6.

$$f\left(k\right)=\sum_{i=1}^{M}{\omega }_{i}{\left({\mu }_{i}-{\mu }_{T}\right)}^{2}$$
(6)

while considering the above classes Otsu method can be easily extended to multilevel thresholding for M-1 thresholding levels. Where \({\omega }_{i}\text{ is a}\) zeroth-order cumulative moment for ith class and \({\mu }_{T}\) is mean intensity for hole image.

$${f}_{OTSU}(T)={\varnothing }_{o}=\text{Arg max}\left(f\left(k\right)\right), 0\le k\le L-1$$
(7)

where \({f}_{OTSU}\) is an objective, and the required optimal threshold value of pixel can be derived from it by maximizing Eq. 7. Fitness function considering i multilevel threshold values is given by the following equation.

$${f}_{OTSU}({T}_{i})={\varnothing }_{o}=\text{Arg max}\left(f\left({k}_{i}\right)\right), 0\le k\le L-1, i=1, 2, \dots .,\text{ d}-1$$
(8)

Kapur Entropy

Kapur's entropy approach has caught the considerable interest of researchers and is commonly utilized for image segmentation problems due to its amazing results. For multilevel thresholding segmentation, Kapur's entropy is a useful and practical statistic. The image is divided into separate classes using Kapur's entropy, and the amount of the entropy decides if the group is homogeneous. Based on information theory, Kapur's entropy methodology shows the ideal thresholding values by maximizing the entropy of every separate class or the summation of entropies. Kapur's entropy has a simple mathematical and very simple procedure to be followed and provides a significant level of stability. It possesses many positive points such as fast processing, a high level of classification performance, and also provides viable separation between distinct classes based on the entropy of the original image. By maximizing the objective function value, Kapur's entropy discovers the optimal threshold values. To tackle the problem of image segmentation different automatic processes are evolved, which can choose the optimum statistical characteristic and threshold automatically. The value of entropy ‘\(H\)’according to the Shannon theorem is given by Eq. 9.

$$H=-\sum_{i=1}^{n}{P}_{i}{log}_{2}{P}_{i}$$
(9)

Where with \({P}_{i}\) as the possibility of the ith gray level and ‘n’ defines the total grey level number. Kapur’s entropy is used to find a single optimal threshold value by maximizing the below expression.

$${f}_{Kapur}(T)={H}_{A}+{H}_{B}$$
(10)

Different entropies associated with distinct classes may be described as the following equation

$${H}_{A}=-\sum_{i=0}^{{t}_{1}-1}\frac{{p}_{i}}{{\omega }_{A}}ln\frac{{p}_{i}}{{\omega }_{A}}, {\omega }_{A}= \sum_{i=1}^{{t}_{1}-1}{p}_{i}$$
(11)
$${H}_{B}=-\sum_{i={t}_{1}}^{L-1}\frac{{p}_{i}}{{\omega }_{B}}ln\frac{{p}_{i}}{{\omega }_{B}}, {\omega }_{B}= \sum_{i={t}_{1}}^{L-1}{p}_{i}$$
(12)

In order to extend the Kapur’s entropy from bi-level to multilevel thresholding further entropy classes may be added as given in Eq. 13.

$$\begin{array}{c}{H}_{A}=-\sum\limits_{i=0}^{{t}_{1}-1}\frac{{p}_{i}}{{\omega }_{A}}ln\frac{{p}_{i}}{{\omega }_{A}}, {\omega }_{A}= \sum\limits_{i=1}^{{t}_{1}-1}{p}_{i} \\ {H}_{B}=-\sum\limits_{i={t}_{1}}^{{t}_{2}-1}\frac{{p}_{i}}{{\omega }_{B}}ln\frac{{p}_{i}}{{\omega }_{B}}, {\omega }_{B}= \sum\limits_{i={t}_{1}}^{{t}_{2}-1}{p}_{i}\\ {H}_{c}=-\sum\limits_{i=0}^{{t}_{3}-1}\frac{{p}_{i}}{{\omega }_{C}}ln\frac{{p}_{i}}{{\omega }_{C}}, {\omega }_{C}= \sum\limits_{i=1}^{{t}_{3}-1}{p}_{i} \\ {H}_{m}=-\sum\limits_{i={t}_{m}}^{L-1}\frac{{p}_{i}}{{\omega }_{m}}ln\frac{{p}_{i}}{{\omega }_{m}}, {\omega }_{m}= \sum\limits_{i={t}_{1}}^{L-1}{p}_{i}\end{array}$$
(13)

Kapur's entropy is used as an objective function to find optimal thresholding values by maximizing the following function given by Eq. 14 [76].

$${f}_{Kapur}(T)={\varnothing }_{k}=\text{arg max}\sum_{i=0}^{m}{H}_{i}(th), 0\le th\le L-1$$
(14)

\({f}_{Kapur}\left(T\right),\) will provide multiple optimal threshold values as mentioned in Eq. 15 [56]

$${f}_{Kapur}\left(T\right)={f}_{Kapur}\left({th}_{i}\right), i=\text{1,2},3,\dots \dots \dots \dots k$$
(15)

where \(T\) represents a vector having multiple threshold values \({th}_{1},{th}_{2},{th}_{3},\dots ..{th}_{k-1}\) and \(\text{i}\) correspond to a specific class.

Black Widow Algorithm

The Black Widow Optimization (BWOA) is a recently developed population-based meta-heuristic optimization approach for solving complicated engineering optimization issues [27]. This method mimics the distinctive behavioral traits of black widow spiders by imitating their mating behavior. The black widow spider belongs to the Araneae family and has eight legs. The infamous and well-known black widow spiders belong to the Latrodectus subfamily of spiders. Latrodectus is a genus of spiders that includes the black widow. The black widow weaves her web at all times of the day and night, while the female widow spends most of her adult life in a similar location. When a female black widow wants to mate, she marks a few locations on her web to attract the male. The suggested technique, like other conventional methods, starts with an initializing spider population, with each spider representing a potential value. The spiders' initializations are in couples and are attempting to generate new offspring. A female spider consumes the male subsequent after or during or post pairing and eventually transports the sperm to the egg sacs. After one and a half weeks of placement, offspring emerges from the egg vesicles. The offspring will stay in the mother web for many weeks and during this stay time sibling cannibalism is decided. As a result, the spiderlings are blown away from the web. The next section outlines the entire procedure of the BWOA methodology phases. It has four phases as described in Fig. 3.

Fig. 3
figure 3

Different phases of the original BWOA algorithm

Population initialization

The variable values of the problem parameter must create an adequate framework for the resolution of the present issue to solve an optimization problem. This framework is referred to as a “chromosome” in GA and a “particle position” in PSO, but it is referred to as a “widow” in the BWOA. The possible answer to each challenge has been modeled like a Black widow spider in the BWOA. The findings of the issue variables are shown on each Black widow spider. The architecture should be treated as an array in this study can fix objective functions. The black widow spider evaluates every problem's possible solution. Each black widow spider displays the values of the issue variables. The solution provided by BWOA is referred to as widow given by Eq. 16 and it generates an array of 1 × Kvar for the problem of dimension Kvar.

$$widow=\left[{x}_{1}, {x}_{2},\dots \dots \dots .{x}_{{K}_{var}}\right]$$
(16)

Every value of the array \(\left[{x}_{1}, {x}_{2},\dots \dots \dots .{x}_{{K}_{var}}\right]\) will be a floating-point number. The fitness of a widow is determined by Eq. 17 applying the fitness model F to widow of \(\left[{x}_{1}, {x}_{2},\dots \dots \dots .{x}_{{K}_{var}}\right].\)

$$F(widow)=F\left({x}_{1}, {x}_{2},\dots \dots \dots .{x}_{{K}_{var}}\right)$$
(17)

The optimization method is started by populating the spider's population with a prospective widow matrix of size \({K}_{var},\)\({K}_{pop}\). Then, through mating, a pair of parents is chosen at random to carry out the procreating stage, in which the male black widow is consumed by the female black widow during or after mating.

Procreate

Because the pairings are self-governing, they start to mate to replicate the next population. As a result, each pair spontaneously mates in their web, regardless of the possibilities. In the physical realm, each pairing produces over a million eggs; nonetheless, Finally, some of the web infants that are muscular are saved. This is where we are right now with this strategy. In the real world, each mating can produce approximately 1000 eggs, but only the strongest spiderlings survive. Similarly, in this algorithm, to facilitate reproduction, an matrix called alpha (\(\alpha )\) is created along with a widow array containing random numbers. After that, progeny is formed by exploitation the array of random numbers. In this context, \({x}_{1}\) and \({x}_{2}\) represent father and mother, while \({V}_{1}\) and \({V}_{2}\) represent the children, as described in Eq. 18.

$$\left\{\begin{array}{c}{V}_{1}=\alpha \times {x}_{1}+(1-\alpha )\times {x}_{2}\\ {V}_{2}=\alpha \times {x}_{2}+(1-\alpha )\times {x}_{1}\end{array}\right\}$$
(18)

Cannibalism

In this phase, three different Cannibalism processes will happen and they are given in Fig. 4. First is sexual cannibalism, in which a female widow will eat a male widow. The gender of the widow will be identified by their respective fitness function value.

Fig. 4
figure 4

Different phases of Cannibalism

The second type is sibling cannibalism, in this only fittest will survive and the strong candidate will eat the weak sibling. The number of survived offspring will be determined by the cannibalism rating denoted by CR. In a few cases, even mother widow is eaten by their baby spiders.

Mutation

The mute pop quantity is randomly determined within the population during the mutation process. Every response can shift two components in the array at the random structure as mentioned in Fig. 5. The mutation rate is calculated using Mutepop data.

Fig. 5
figure 5

Mutation process

Convergence

There will be three stopping/ termination conditions that can be tested in three phases, similar to previous algorithms: (1) obtaining the stated degree of accuracy, (2) observing no fluctuation in the fitness value, and (3) obtaining the required degree of precision. The BWOA is used to solve several benchmark optimization issues, and the best solutions are gathered.

Proposed methodology: Improved Black Widow Optimization algorithm (IBWOA)

The Black Widow Optimization (BWOA) is a population-based meta-heuristic optimization technique for tackling difficult engineering optimization problems that were recently created [27]. This approach imitates the mating activity of black widow spiders to emulate their particular behavioral features. The black widow spider has eight legs and is a member of the Araneae family. The Latrodectus subfamily of spiders includes the famed and well-known black widow spiders. The black widow spider belongs to the Latrodectus genus of spiders. The female widow lives most of her adult years in a similar position as the black widow, who builds her web at all hours of the day and night.

System model

Improved Black Widow Optimization algorithm (IBWOA) will include two major modifications to its existing basic structure. Lévy flight process is used to drive the procreation stage, and hence it will enhance the exploration capability of the basic Black Widow Optimization algorithm and enrich the exploitation capacity and create a balance between the exploration and exploitation quasi opposition-based learning (QOBL) is adopted. Further, details of Lévy flights, opposition-based learning (OBL), and quasi-opposition-based learning (QOBL) are provided in the following subsections.

Lévy flights

By construction, Lévy flights are Markov processes and are a representation of a random process [20], which involves step length as Lévy distribution. To minimize algorithmic stagnation and entrapment in local minima, the Lévy flight distribution is included in the BWOA approach. It also helps to improve the exploring power and exploration potential of this optimization method by boosting its chance of creating novel solutions. Lévy flight is a random procedure for producing a new response based on an arbitrary walk with Lévy steps. The following is the new population position based on the Lévy distribution [69]. This step will model the IBWOA and update the matrix alpha with \({\alpha }{\prime}\). Also, new offspring will be named as \({V}_{1}^{new}\) and \({V}_{2}^{new}\) calculated according to Eq. 19

$$\left\{\begin{array}{c}{V}_{1}^{new}={\alpha }{\prime} \times {x}_{1}+(1-{\alpha }{\prime} )\times {x}_{2}\\ {V}_{2}^{new}={\alpha }{\prime} \times {x}_{2}+(1-{\alpha }{\prime} )\times {x}_{1}\end{array}\right\}$$
(19)

The Lévy flight is characterized by the combination of small and sporadically large step sizes, which enhances the search capability of the model during optimization. The standard Lévy flight distribution parameter for step size \((L\acute{e} vy)\) is given by Eq. 20.

$$L\acute{e} vy=0.01 \times \frac{{R}_{6}}{{\left|{R}_{7}\right|}^{ \frac{1}{\beta }}}$$
(20)

where, \({R}_{6}\) and \({R}_{7}\) are normal distribution arbitrary values consist of the standard deviation \({\sigma }_{{R}_{6}} and {\sigma }_{{R}_{7}}\) respectively, and are calculated as \({R}_{6}=normal\left(0, {\sigma }_{{R}_{6}}^{2}\right) \text{and} {R}_{7}=normal(0, {\sigma }_{{R}_{7}}^{2})\). The Lévy flight \({\sigma }_{{R}_{6}}\) is formulated by Eq. 21.

$${\sigma }_{{R}_{6}}={\left(\frac{\Gamma (1+\beta )\times \text{sin}\left( \frac{\pi \beta }{2}\right)}{\Gamma \left(\frac{1+\beta }{2}\right)\times \beta \times 2\left( \frac{\beta -1}{2}\right)}\right)}^{\frac{1}{\beta }}$$
(21)

where \(\Gamma\) corresponds to standard gamma function, and β is in the limit [1, 2] and assumed to be 1.5 [77].

Opposition-based learning

Tizhoosh suggested opposition-based learning (OBL) [78] as an effective search means to prevent convergence speed in 2005. The central concept behind OBL is to produce the opposite result in the search area given by Eq. 22 and then use the objective function to assess both the initial and opposing solutions. The best option will then be kept and used in the following iteration. Generally, the OBL technique has a higher chance of providing optimum answers that are closer to each other than random solutions.

$${y}_{obl, i}\left(t\right)=u+l-{x}_{i}\left(t\right) , i \in [1, 2,\dots \dots \dots .., n]$$
(22)

Where, \({x}_{obl, i}\left(t\right)\) is the opposite solution presented by the current given solution \({x}_{i}\left(t\right)\) at given time t.

Quasi Opposition-Based Learning

Rahnamayan et al. [21] presented a variation of OBL dubbed quasi-opposition-based learning (QOBL) depending on the given description. The QOBL technique, unlike OBL, used a quasi-opposite result instead of the opposing solution. As a result, the QOBL technique outperforms the prior strategy in terms of discovering globally optimum solutions. The quasi-opposite response may be computed using the fundamental principle of opposing solutions by Eq. 23:

$${x}_{qobl, i}\left(t\right)=\text{rand}\left( \frac{u+l}{2}, {x}_{obl, i}\left(t\right)\right)$$
(23)

Where, \({x}_{obl, i}\left(t\right)\) is the opposite solution, \({x}_{qobl, i}\left(t\right)\) is quasi opposition-based learning solution, \(u\) is upper bound, and \(l\) is lower bound. The pictorial representation and scheme of quasi-opposition-based learning (QOBL) are shown in Fig. 6.

Fig. 6
figure 6

Representation of Quasi Opposition-Based Learning

The proposed IBWOA algorithm enhances the existing BWOA by combining the Lévy flight process and quasi-opposition-based learning with the standard BWOA algorithm. The pseudo-code of the IBWOA is explained in Algorithm 1.

figure a

Algorithm 1. Improved Black Widow Optimization Algorithm (IBWOA)

Experimentation setup and results

IBWOA is programmed in Matlab2021, implemented on windows 10 over a 64-bit environment on a computer with an Intel Core I7 processor, and 10 GB memory. The parametric value chosen for different variables is chosen as a percent of Crossover 0.8, 51 independent runs, the maximum number of 350 iterations for each test image, mutation value 0.4, cannibalism 0.5, and size of population taken as 50. For comparative analysis six meta-heuristic algorithms are considered, which are Harris Hawks Optimization (HHO) [22], LSHADE [23], Whale Optimization Algorithm (WOA) [24], Sine Cosine Algorithm (SCA) [25], Slap Swarm Algorithm (SSA) [26], and Black Widow Optimization Algorithm(BWOA) [27].

Experimental setup

All the parameters in the experiment are fixed as per the default values proposed in the basic research paper. The method was evaluated across 35 independent runs with a maximum of 350 iterations for each test image for an unbiased test image comparability. For a valid comparison, all methods use the same simulation environment. The application of the IBWOA for thermal image segmentation is described in this study. This approach is tested specifically in the instance of Breast Thermography. To qualitatively and quantitatively examine the data, a group of 10 photos from the database is randomly picked from the complete database of digital database for Screening mammography (DDSM): breast cancer image dataset [70]. Artificial objects such as tags, gauges, and branding are removed from the photos to emphasize segmentation. The random images having positive and negative cases are considered for experimentation and Fig. 7 represents a positive and a negative case image. The optimum values are shown in bold values. These ten test images and their corresponding histogram graphs are represented in the Table 1.

Fig. 7
figure 7

Representation of benign and malignant cases. a Breast thermogram: Benign. b Breast thermogram: Malignant

Table 1 Dataset along with associated histogram

Experimental parameters

The peak signal-to-noise ratio (PSNR) indicates the amount of noise present in the resultant image as compared to the original image [79,80,81]. The PSNR between original or ground truth \({I}_{G}\) and the segmented image \({I}_{th}\) is calculated as mentioned in Eq. 24 and the RMSE is provided by Eq. 25.

$$PSNR=20\, {log}_{10}\frac{255}{RMSE} (dB)$$
(24)

where

$$\text{RMSE}=\sqrt{\frac{\sum_{i=1}^{M}\sum_{j=1}^{N}\left({I}_{G}-{I}_{th}\right)}{M X N}}$$
(25)

where the size of an image is M × N, a higher PSNR value is desirable and it represents less amount of noise that has been added during the processing [82]. Structural Similarity Index is another parameter used to evaluate given by the following Eq.

$$SSIM\left(I,{I}_{s}\right)=\frac{(2{\mu }_{I}{\mu }_{{I}_{S}}+{C}_{1})(2{\sigma }_{I, { I}_{S}}+{C}_{2})}{({\mu }_{I}^{2}+{\mu }_{{I}_{S}}^{2}+{C}_{1})({\sigma }_{I}^{2}+{\sigma }_{{I}_{S}}^{2}+{C}_{2})}$$
(26)

where \({\mu }_{{I}_{S}}({\sigma }_{I, { I}_{S}})\) and \({\mu }_{I} \left({\sigma }_{I}\right)\) are the mean intensity of images IS and I, respectively, where \({\sigma }_{I, { I}_{S}}\) is the governance of I and IS, and \({C}_{1}\) and \({C}_{2}\) coefficient values are equal to 6.5025 and 58.52252, respectively.

The Feature Similarity Index (FSIM) is an important parameter used to estimate the similarity between the original image and the segmented image. Its value lies between the range of [-1, 1] and a higher value is desired and given by the following equations.

$$FSIM=\frac{\sum {S}_{L}{PC}_{m}}{\sum {PC}_{m}}$$
(27)
$${S}_{L}={S}_{PC}\times {S}_{G}$$
(28)
$${S}_{pc}=\frac{{2PC}_{1}{PC}_{2}+{T}_{1}}{{PC}_{1}^{2}+{PC}_{2}^{2}+{T}_{1}}$$
(29)
$${S}_{G}=\frac{{2G}_{1}{G}_{2}+{T}_{2}}{{G}_{1}^{2}+{G}_{2}^{2}+{T}_{2}}$$
(30)

Where \({PC}_{1}\) is phase consistency of the original image, \({PC}_{2}\) phase consistency of segmented image and \({T}_{1}\) is a positive constant. Where \({G}_{1}\) & \({G}_{2}\) are the gradient constant of the original and segmented image respectively and \({T}_{2}\) is again a constant positive.

A comparative analysis is carried out with existing state-of-the-art multilevel thresholding techniques like Harris hawks optimization (HHO) [22], LSHADE [23], Whale optimization algorithm (WOA) [24], Sine cosine algorithm (SCA) [27], and Black widow optimization [27]. The parameters selected for comparison with the above-mentioned techniques are threshold values, Peak signal-to-noise ratio (PSNR) [74], Structural similarity index module (SSIM) [83], and Feature similarity index (FSIM).

Result and discussion: IBWOA based on Otsu’s results

This subsection provides the results based on Otsu’s fitness function as given in Eq. 8 using IBWOA. The suggested IBWOA-based breast thermal image segmentation approach is compared to different algorithms using Otsu's method to obtain the best potential threshold value, applied over ten thermography images. The threshold values for 2, 3, 4, and 5 levels are depicted in Table 2. It is noticeable that most algorithms give the same threshold values for the 2nd and 3rd levels but show different values for higher thresholding levels. The computational solution of the suggested technique, the IBWOA algorithm, is presented and discussed in this subsection. Equation 8 uses Otsu's between-class variance as a fitness function. For all the thermal imaging test images utilized in the studies, Tables 4 and 5 show the segmented images derived from the proposed IBWOA with various levels of thresholds, including [Th = 2, 3, 4, 5]. The distribution of the best-selected thresholding values over the histogram is also included in the findings. Table 3 presents the results after applying the IBWOA-Otsu method to the thermography images. It has three sub-parts: the first part shows segmented images after deploying Otsu, the second part demonstrates the histogram graph plotted with the best/optimum histogram values, and the third part provides convergence graphs. Convergence graphs depict how many iterations are required for the thresholding results to stabilize. It's critical to maintain track of computation convergence. Convergence graphs show how a method improves over time, which is important for determining its effectiveness. Table 3 shows superior convergence results. It is also concluded from the convergence results that the computational complexity is not very high, as IBWOA achieves optimum results even before 10 iterations for two, three, and four threshold values. Segmentation using five threshold values is a little more complex, as it takes more iterations to reach optimum values.

Table 2 The Otsu’s optimal thresholds values
Table 3 Results after applying IBWOA-Otsu’s method to the thermography images

Table 4 displays the fitness outcomes obtained from each level using the proposed IBWOA and other comparison algorithms, based on mean and standard deviation (STD). The most important values are shown in bold. A lower STD, in contrast to the mean, is preferred since it represents less variance between the outcomes provided by each strategy. As the situation becomes more complex, the STD rises along with the number of thresholds. According to the findings, the suggested IBWOA outperforms the original BWOA and WOA for all test images at all levels. It also performs better than the HHO, LSHADE, and SCA. For most test images, the LSHADE method is comparable to the proposed IBWOA and outperforms other algorithms. However, as seen in the table, the IBWOA excels in twenty-five different experiments. Among all competing algorithms, the WOA produces the least favorable results. The SCA, on the other hand, did not achieve any significant value in its mean findings.

Table 4 Comparison of Otsu’s fitness values

In terms of the SSIM values based on the IBWOA algorithm and other comparison algorithms presented in Table 5, it can be seen that IBWOA generally performs better than the other algorithms. It shows significant results in all images at all levels except for image 7. The SCA exhibits higher SSIM values for two specific cases: test image-7 at level 2 and test image-5 at level 2. Furthermore, the WOA provides the best values in six different experiments, and LSHADE achieves one best value for test image-10 at level 2.

Table 5 Comparison of Otsu’s SSIM values

Image thresholding aims to produce more informative photographs using a limited number of thresholds. The PSNR (Peak Signal-to-Noise Ratio) is a performance metric frequently used to assess the quality of an output image compared to the original. While traditionally used for evaluating image quality, PSNR has been adapted to evaluate multi-dimensional signal functionality. In Table 6, a higher mean PSNR value indicates better image segmentation when considering the algorithm's thresholds. HHO and SCA provide only three and one best values, respectively, while LSHADE and WOA achieve five and seven best values, respectively. BWOA has limitations, yielding only three best values. In contrast, IBWOA delivers twenty-four best values out of forty experiments. Table 7 presents the FSIM (Feature Similarity Index) values for ten test images at 2, 3, 4, and 5 level thresholds, with IBWOA achieving the maximum number of best values.

Table 6 Comparison of Otsu’s PSNR values
Table 7 Comparison of Otsu’s FSIM values

Result and discussion: IBWOA-based Kapur results

The performance of the proposed thresholding strategy based on IBWOA applied to breast thermographic images using Kapur's entropy as the objective function is examined and discussed in this paragraph. Table 8 presents the threshold values derived from levels 2, 3, 4, and 5 using various algorithms, including HHO, LSHADE, WOA, SCA, and BWOA, as discussed in the previous section. The quality of the thresholded images employing Kapur's method is assessed and compared using thresholding values, SSIM, PSNR, and FSIM. Each test image includes four thresholding levels [Th = 2, 3, 4, 5], as was done with Otsu's algorithm. Table 9 consists of three rows: the first row contains segmented images after applying Kapur’s entropy, the second row shows the distribution of the best-selected thresholding values generated by IBWOA plotted on the histogram of each test image, and the third row provides convergence graphs. The mean and standard deviation of fitness, SSIM, PSNR, and FSIM are shown in Tables 10, 11, 12, and 13, respectively.

Table 8 Kapur’s optimal thresholds values
Table 9 Results after applying IBWOA- Kapur’s method to the thermography images
Table 10 Objective function results for IBWOA- Kapur’s method
Table 11 Comparison of Kapur’s method SSIM values
Table 12 Comparison of Kapur’s method PSNR values
Table 13 Comparison of Kapur’s method FSIM values

Table 10 presents the fitness outcomes received from each level using the proposed IBWOA and other comparison algorithms, based on mean and standard deviation (STD). The most important values are shown in bold. Ideally, the mean should be higher and the STD lower. The proposed IBWOA achieves the highest mean values for different test images compared to other algorithms. Table 11 compares the mean and standard deviation of the Structural Similarity Index Measure (SSIM) for all methods, with optimal findings highlighted in bold, indicating superior image segmentation. Out of forty total experiments, the HHO algorithm yields the best SSIM values four times, LSHADE and SCA each achieve two, and WOA provides three optimal results. The IBWOA method, followed by the BWOA algorithm, consistently obtains the best SSIM values. SSIM is crucial for determining the quality of the structures that remain after segmentation, helping to identify the best approach for segmenting breast thermographic images.

Table 12 shows the PSNR output data. As previously mentioned, PSNR evaluates the similarity between the output image and the source, with higher values indicating better threshold efficiency. It is clear that IBWOA outperforms the original BWOA in terms of PSNR for all test images at each level, surpassing all other tested algorithms. Table 13 presents the mean and standard deviation of the Feature Similarity Index Metric (FSIM) based on Kapur’s entropy as the objective function, with optimal findings denoted in bold. Bold values indicate superior results for quality segmentation. The LSHADE algorithm performed poorly, achieving only two optimal results across all test images and levels. The HHO and WOA algorithms also underperformed, each generating the best results only four times. Among all methods, the proposed IBWOA generates the best FSIM values. The BWOA also identifies better threshold values, yielding expected results with better features using FSIM. This table demonstrates that several methods can work effectively with a limited number of variables.

Conclusions and future work

In conclusion, breast cancer remains one of the most common cancers, and early detection is crucial for reducing mortality. Thermography offers a cost-effective and suitable screening method compared to mammography, ultrasound, and MRI, as it detects abnormal temperature changes indicative of breast cancer. Effective medical image segmentation is vital for accurate analysis, and thresholding is a key technique in this process. This study presents an innovative approach for determining optimal thresholding values using the Improved Black Widow Optimization Algorithm (IBWOA), which combines quasi-opposite-based learning and the Lévy optimization algorithm to enhance the exploitation phase and avoid local optima. The performance of IBWOA was compared with other techniques, including HHO, LSHADE, WOA, SCA, and BWOA, using Otsu’s and Kapur’s methods on thermal images from the DMR-IR database. The results, evaluated through fitness values, PSNR, SSIM, and FSIM, demonstrated that IBWOA outperforms the other methods. Future work will focus on integrating deep learning methodologies like Convolutional Neural Networks, expanding datasets, and combining multiple imaging modalities to further enhance diagnostic accuracy and applicability in real-world scenarios.