An efficient multi-level thresholding method for breast thermograms analysis based on an improved BWO algorithm

Breast cancer is a prevalent disease and the second leading cause of death in women globally. Various imaging techniques, including mammography, ultrasonography, X-ray, and magnetic resonance, are employed for detection. Thermography shows significant promise for early breast disease detection, offering advantages such as being non-ionizing, non-invasive, cost-effective, and providing real-time results. Medical image segmentation is crucial in image analysis, and this study introduces a thermographic image segmentation algorithm using the improved Black Widow Optimization Algorithm (IBWOA). While the standard BWOA is effective for complex optimization problems, it has issues with stagnation and balancing exploration and exploitation. The proposed method enhances exploration with Levy flights and improves exploitation with quasi-opposition-based learning. Comparing IBWOA with other algorithms like Harris Hawks Optimization (HHO), Linear Success-History based Adaptive Differential Evolution (LSHADE), and the whale optimization algorithm (WOA), sine cosine algorithm (SCA), and black widow optimization (BWO) using otsu and Kapur's entropy method. Results show IBWOA delivers superior performance in both qualitative and quantitative analyses including visual inspection and metrics such as fitness value, threshold values, peak signal-to-noise ratio (PSNR), structural similarity index measure (SSIM), and feature similarity index (FSIM). Experimental results demonstrate the outperformance of the proposed IBWOA, validating its effectiveness and superiority.


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.
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.
Fig. 1 Most sensitive area for malignant tissue [5] 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.

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/ pront uario/ 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.

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 = [th 1 , th 2 , th n ,..., th d-1 ].Each class may be defined in Eq. 1.

The interclass variance/ between class variance σ 2
B is given by the following equation.
Where ω 0 andω n are the probability of the same grey- scale pixel of classes C 1 and C n given in Eq. 1, µ 0 and µ n (1) for average pixel levels of classes C 1 and C n .The expres- sion of µ 1 and µ n are given by Eq. 3.
It is necessary to compute the probability distribution p i that is given by Eq. 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 (k) between-class variance is represented in Eq. 6. while considering the above classes Otsu method can be easily extended to multilevel thresholding for M-1 thresholding levels.Where ω i is a zeroth-order cumu- lative moment for i th class and µ T is mean intensity for hole image.
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.

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. (3) 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 Shan- non theorem is given by Eq. 9.
Where with P i as the possibility of the i th 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.

Different entropies associated with distinct classes may be described as the following equation
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.
Kapur's entropy is used as an objective function to find optimal thresholding values by maximizing the following function given by Eq. 14 [76]. (9) f Kapur (T ), will provide multiple optimal threshold values as mentioned in Eq. 15 [56] where T represents a vector having multiple threshold values th 1 , th 2 , th 3 , . . ...th k−1 and i correspond to a spe- cific 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.

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 ( 14) Every value of the array x 1 , x 2 , . . . . . . . . ..xK var will be a floating-point number.The fitness of a widow is determined by Eq. 17 applying the fitness model F to widow of 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 ( α) 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.

Cannibalism
In this phase, three different Cannibalism processes will happen and they are given in Fig. 4. First is sexual (16) 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.
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 Mute pop data.

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 populationbased 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 α′ .Also, new offspring will be named as V new The standard Lévy flight distribution parameter for step size (Lévy) is given by Eq. 20.
where, R 6 and R 7 are normal distribution arbitrary values consist of the standard deviation σ R 6 andσ R 7 respectively, and are calculated as The Lévy flight σ R 6 is formulated by Eq. 21.
where Ŵ 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.
Where, x obl,i (t) is the opposite solution presented by the current given solution x i (t) 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: (20) Where, x obl,i (t) is the opposite solution, x qobl,i (t) 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.
The proposed IBWOA algorithm enhances the existing BWOA by combining the Lévy flight process and quasiopposition-based learning with the standard BWOA algorithm.The pseudo-code of the IBWOA is explained in Algorithm 1.

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 Fig. 6 Representation of Quasi Opposition-Based Learning (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.

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.
where where the size of an image is M × N, a higher PSNR value is desirable and it represents less amount of noise that (24 has been added during the processing [82].Structural Similarity Index is another parameter used to evaluate given by the following Eq.where µ I S (σ I,I S ) and µ I (σ I ) are the mean intensity of images IS and I, respectively, where σ I,I S is the govern- ance 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.
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 con- stant of the original and segmented image respectively and T 2 is again a constant positive.

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   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 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.
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.
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.Similarity Index) values for ten test images at 2, 3, 4, and 5 level thresholds, with IBWOA achieving the maximum number of best 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.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.

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.

Fig. 7
Fig. 7 Representation of benign and malignant cases.a Breast thermogram: Benign.b Breast thermogram: Malignant 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.Table3presents 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 3, . . . . . . . . . . . .k 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 × K var for the problem of dimension K var.

Table 1
Dataset along with associated histogram

Table 2
The Otsu's optimal thresholds values

Table 7
presents the FSIM (Feature

Table 3
Results after applying IBWOA-Otsu's method to the thermography images

Table 4
Comparison of Otsu's fitness values

Table 5
Comparison of Otsu's SSIM values

Table 6
Comparison of Otsu's PSNR values

Table 7
Comparison of Otsu's FSIM values

Table 8
Kapur's optimal thresholds values Table8presents 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.Table9consists 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

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