Abstract
BACKGROUND:
Thyroid tumor is considered to be a very rare form of cancer. But recent researches and surveys highlight the fact that it is becoming prevalent these days because of various factors.
OBJECTIVES:
This paper proposes a novel hybrid classification system that is able to identify and classify the above said four different types of thyroid tumors using high end artificial intelligence techniques. The input data set is obtained from Digital Database of Thyroid Ultrasound Images through Kaggle repository and augmented for achieving a better classification performance using data warping mechanisms like flipping, rotation, cropping, scaling, and shifting.
METHODS:
The input data after augmentation goes through preprocessing with the help of bilateral filter and is contrast enhanced using dynamic histogram equalization. The ultrasound images are then segmented using SegNet algorithm of convolutional neural network. The features needed for thyroid tumor classification are obtained from two different algorithms called CapsuleNet and EfficientNetB2 and both the features are fused together. This process of feature fusion is carried out to heighten the accuracy of classification.
RESULTS:
A Multilayer Perceptron Classifier is used for classification and Bonobo optimizer is employed for optimizing the results produced. The classification performance of the proposed model is weighted using metrics like accuracy, sensitivity, specificity, F1-score, and Matthew’s correlation coefficient.
CONCLUSION:
It can be observed from the results that the proposed multilayer perceptron based thyroid tumor type classification system works in an efficient manner than the existing classifiers like CANFES, Spatial Fuzzy C means, Deep Belief Networks, Thynet and Generative adversarial network and Long Short-Term memory.
Keywords
Introduction
There are many problems related to the thyroid gland such as thyroid carcinomas, thyroid sarcomas, thyroid lymphomas, and various other malignancies. Among these, thyroid carcinomas are very prevalent nowadays and it has been threatening mankind in recent times. It is said that three out of 1,00,000 people have been observed to possess one or the other issues related to thyroid in the countries of Europe and United States of America [1]. Various studies have predicted that thyroid cancer will soon become the third most commonly occurring cancer in human beings. It has been predicted so because of the underlying fact that the occurrence of this cancer has increased by three times in the past 30 years of medical history. The World Health Organization in a recent survey has stated that thyroid cancer is the second highest disorder related to the endocrine system next to the disease of diabetes [2]. The gland of thyroid deserves a special place in the endocrine system as it produces various hormones that are inevitable for maintaining various functions of the brain and metabolism of human body. Hence any disorder arising in the thyroid gland is considered very serious and needs to be treated immediately.
Thyroid cancer is the consequence of proliferation of thyroid cells both follicular and parafollicular cells because of many underlying reasons such as iodine deficiency, gender, age factors, lifestyle modifications and sometimes even genetic based inheritance [3, 36–39]. It is a well-known fact that thyroid cancer affects the women population in higher numbers than men. There are various types and subtypes of thyroid cancer which is very intricate in their pattern. Broadly they have been classified on the basis of histology as papillary carcinoma, follicular carcinoma, medullary carcinoma, and anaplastic carcinoma which are different from each other in many factors [4]. Many cytological changes take place in cancerous cells such as becoming hyper cellular, losing their polarity, presence of amyloid and mitosis background, cells becoming isolated and colloid etc.
Papillary Thyroid Carcinoma is the most commonly prevailing type of thyroid cancer accounting for about 80 to 85% of total thyroid cancer [5]. This is slow growing in nature and starts developing from follicular epithelial cells of the thyroid gland. It is a well differentiated carcinoma that has good survival rates and is considered to be less fatal when compared to the other types [6]. It usually does not spread to the nearby organs but there is a possibility of spreading to the other parts if untreated for a long time. Follicular Thyroid Carcinoma is the second highly occurring type of thyroid cancer next to papillary thyroid carcinoma [7, 40–42]. This is caused basically because of deficiency of iodine and arises from the follicular cells just like papillary carcinoma. This also possesses good rates of survival and does not spread to the other organs [8]. It is also differentiated in nature and more aggressive when compared to papillary thyroid carcinoma and more challenging also as far as diagnosis is concerned. The nucleus becomes enlarged here and affects middle-aged people. Medullary Thyroid Carcinoma accounts for only 4 to 10% of the total thyroid carcinomas and it is much more aggressive than its predecessors [9, 31–35]. It is less differentiated and has the ability to spread to its neighboring cells very easily. It starts developing from the C cells, otherwise called the parafollicular cells and has genetic reasons for its occurrence most of the time. The nucleus becomes binucleated or multinucleated in this case and survival rates are not satisfactory.
Anaplastic thyroid carcinoma is considered the rarest and most aggressive form of thyroid carcinomas. It is responsible only for two to three percentage of thyroid carcinomas but yet it is the hardest to diagnose and treat, as it is undifferentiated in nature and these cancerous cells look very similar to normal thyroid cells [10]. Figure 1 below shows the different types of thyroid carcinoma. Apart from these four types of thyroid carcinomas, there are many different subtypes. Amongst these are occult carcinoma, encapsulated cells, columnar cell, clear cell carcinomas, minimally invasive and widely invasive carcinomas, spindle cell and giant cell carcinomas etc [11].

Thyroid carcinoma types.
Thyroid cancer is one among the fast growing type of cancer that needs some kind of automation in its diagnosis process. Initially papillary thyroid carcinoma was the most prevalent one but nowadays oncologists opine that more rare form of thyroid carcinomas such as anaplastic thyroid carcinoma which has very less rates of survival is on the rise. Hence it is high time that new-fangled image processing techniques be applied and aid medical personnel in the diagnosis and staging of thyroid carcinoma. Identifying the exact type of thyroid carcinoma gains prime importance because further treatment and management of the disease differs from type to type. All the four different types of thyroid carcinoma discussed here are similar to each other with very minimal difference among them. Hence classifying the precise type of thyroid carcinoma can be very helpful for the healthcare expert in the prognostic medical process of the disease. The aim of this paper is to classify the accurate type of thyroid carcinoma based on the ultrasound images using advanced deep learning and machine learning techniques. Our research addresses the increasingly critical challenge of accurately diagnosing and classifying thyroid tumors, a task that has become more pressing due to the rising prevalence of thyroid cancer globally. Despite advancements in medical imaging, the precise identification and categorization of thyroid tumors using conventional methods remain fraught with limitations, often leading to diagnostic inaccuracies and delayed treatments. This challenge is compounded by the variability in tumor presentations and the subtleties involved in interpreting ultrasound images. Our study aims to develop an innovative artificial intelligence-based system, leveraging advanced algorithms and machine learning techniques, to enhance the accuracy, efficiency, and reliability of thyroid tumor classification. By doing so, we seek to overcome the limitations of current diagnostic methods, reduce the rate of misdiagnosis, and provide a robust tool that supports clinicians in making informed decisions for timely and effective patient care.
The summarized research work contributions are given below. To conduct background study and literature review on classification of thyroid tumor types using ultrasound images. A novel hybrid classification model is presented to identify and categorize the various types of thyroid tumor using Multi-Layer Perceptron. The obtained results are further optimized using Bonobo optimization algorithm for enhanced classification accuracy. Experimental analysis is carried out using Digital Database of Thyroid Ultrasound Images datasets to validate the classification performance of proposed model. Comparative analysis is done with Co-Active Adaptive Neuro Expert System (CANFES), Spatial Fuzzy C means, Deep Belief Networks, Thynet model and Generative Adversarial Network based Long Short-Term Memory.
The paper is arranged in the following order. Relevant works on thyroid tumour classification are discussed in section 2. Materials and methods used for the proposed model are presented in section 3. A detailed description of proposed model is presented in section 4. Experimentation, evaluation results and discussion are presented in section 5. In section 6, the final summary is presented with future scope.
Related works
Paper [12] explains the detailed process of thyroid tumor classification using computer aided diagnosis systems. CaThyDB dataset containing 510 ultrasound images was utilized. During preprocessing, adaptive median filter was used, and region of interest was extracted using spectral reduction and bilateral filtering. Segmentation was done using active contrast and morphology operations. Geometric features such as compactness and solidity are extracted using gray level Co-occurrence Matrix (GLCM) and classification was done based on the margin, orientation, internal composition, shape, and echogenicity characteristics of the tumor. The sensitivity, specificity and accuracy scores respectively are 100%, 95.45% and 97.78%.
Article [13] presents a population-based study of the biological trend followed by thyroid in certain countries. This study was conducted by the international agency for research on cancer including five continents and 25 countries. Several factors of thyroid cancer such as age, standardization, incidence ratio, patterns followed in six countries and subtypes of thyroid cancer are deeply analyzed. Countries such as Australia, Germany, Japan, South Korea, Spain, Thailand, United Kingdom were included in the study. Thyroid cancer morphology codes was used for carrying out the study and constituted different categories of cancer including unspecified carcinoma, sarcoma and malignant neoplasm based diseases.
This paper [14] explains the survival patterns of different thyroid cancer. The surveillance epidemiology and end results database (SEER) from the year 2010 to 2018 was used as the primary source of information. They included various characteristics of thyroid cancers such as histology, size of the tumor, age, gender, focal variations, regional nodal involvement, mode of treatment surgery. Several other dissemination patterns were studied along with the above covariates. It has also discussed the spreading patterns of different types of thyroid cancers to multiple organs and the mortality risks have been thoroughly analysed. [15] is a review article regarding the involvement of MicroRNA(mRNA) in the identification and diagnosis of thyroid cancer. mRNAs are nothing but protein genes which are found in both tumorous cells and normal cells. The changes occurring to this mRNA is believed to have been related to the formation of cancerous cells and the growth of tumors such as and proliferation and deletion of genes, transcriptional changes, epigenetic changes, or any dysregulation are potential reasons for formation of cancers. These are very important for the process of metastasis, angiogenesis, signaling of cell proliferation, growth suppression, cell death etc. miR-221, mir-222, miR-155, miR-187, miR-224 and miR-137 are found to be the common genes which occur in all the three types of thyroid carcinomas such as anaplastic, follicular and papillary.
Paper [16] explains the typical diagnosis of thyroid cancers with the help of deep neural networks and various contrast enhancement algorithms. Ultrasound images were collected from the Hebei Medical University in China involving 508 patients along with their ultrasounds. The functioning of deep neural networks and their potential application in the classification of thyroid tumors have been discussed and has been compared with other reinforcement learning methods. K nearest neighbor is found to be in close proximity to the deep neural network model in terms of accuracy. It has been mentioned in this article that contrast enhancement of ultrasound images has improved the accuracy from 0.715 to 0.901 thus enforcing the importance of contrast enhancement methods. A multi-layer perceptron based thyroid classification system and prediction of future thyroid malignancies are discussed in this paper [17]. The basic functioning of multilayer perceptron model of artificial neural network has been discussed for the proposed system in training and testing phases. A real data set containing 120 records was collected from Srinagar and was preprocessed. 11 attributes were chosen, and the model was compared with a self-organized fuzzy system. The proposed model scored a classification accuracy of 99.8%.
The authors of [18] have discussed the advantage of feature fusion and dimensionality reduction in the process of classification of thyroid diseases. The input dataset needed was obtained from General Hospital of China comprising 1874 patients. Texture features such as contrast, entropy, inverse different moment, angular second moment were extracted using gray level co-occurrence matrix, gray level size zone matrix and gray level run length matrix. The hardware and software requirements were 2080Ti Graphics Processing Unit (GPU), i7-6700 processor, Ubuntu18.04 operating system. Batch size was set at 16, learning rate at 0.001, epoch size of 50. The Gray level matrix features were combined with Resnet model for achieving future fusion. Principal component analysis was used as classifier which achieved an accuracy of 88.30% recall of 95.10%, precision of 90.06% and F-score of92.52%.
This article [19] explains the classification of thyroid cancer using adaptive learning algorithms and multiplayer perceptron in the regime of Internet of medical things (IoMT). IoMT has gained popularity in recent days. Data set was obtained from the UCI machine learning repository which was standardized including 7200 patients and 21 different variables. Standardized features such as age, levels of thyroxine, pregnancy, surgery for thyroid previously, goiter were extracted. Multi-layer perceptron was used as classifier for categorizing thyroid diseases into either normal, hyperthyroid, or hypothyroid diseases and it gives an accuracy of 99%.
This paper [20] discusses the classification of thyroid cancer using different deep learning algorithms such as Resnet50, Resnext50, EfficientNet, and Densenet121. The input dataset contained thyroid nodule patients from the year 2014 to 2022. A total of 799 pathology images were collected and augmented before further processing. Statistical analysis was done for the performance of each of the algorithm mentioned above for diseases such as papillary, medullary, and follicular carcinoma adenoma and goiter. Accuracy, recall, precision, F-score, AUC, and Kappa coefficient values have been calculated individually for all the diseases.
This paper [21] discusses the efficiency of different machine learning algorithms as far as classification of thyroid diseases are concerned. Standard machine learning algorithms such as decision tree, support vector machine, random forest, Naive Bayes, logistic regression, Linear Discriminant Analysis and Multilayer Perceptron were evaluated against each other with the help of factors like age, gender, antithyroid medication, prior surgery history, levels of thyroid stimulating hormones etcetera. Multilayer perceptron has produced the highest accuracy of 96.4% closely followed by Support Vector Machine with an accuracy of 92.53%.
This paper [22] is about classification of thyroid tumors using multimodal features and knowledge driven learning. Input data set is augmented using local binary patterns and discrete transforms. The data set was obtained from a private hospital containing 230 patients and 678 grayscale ultrasound images. They were cropped to a size of 440* 440. The proposed system was divided into two parts namely the expert consult and knowledge driven learning and compared with existing deep learning models like Alexnet, Googlenet, Resnet, VGG etcetera. Accuracy obtained through knowledge driven learning and expert consult combination was 95.11%, sensitivity of 96.22%, specificity of 93.09% and AUC of 98.79%.
Limitations of the existing works
Though a wide range of study has been conducted in this area of thyroid carcinoma detection, there still exists some drawbacks which need to be addressed very keenly. Much interest has not been shown in the type of medullary and anaplastic thyroid carcinomas which were considered once as rare forms of thyroid cancer. There has been a steep increase in the number of such rare carcinomas which need attention. Also, an adequate amount of standard datasets are available for the disease of thyroid cancer. The input datasets are small in size which leads to the problem of underfitting. Proper augmentation techniques have not been carried out in these papers. Most of the studies conducted lack the usage of optimization algorithms and thereby fail to improvise their classification performances. Several articles do not preprocess the obtained dataset and have used them in a straight manner since they are medical databases. But medical datasets do require proper processing before the application of image processing algorithms. Comparative analysis has not been performed in most of the cases. Efforts have been taken to correct all the above said limitations in the design of the proposed system of thyroid cancer classification.
Materials and methods
Materials
Dataset
The input ultrasound dataset required for processing the proposed system is obtained from the digital database of thyroid ultrasound images. It is a publicly available thyroid data set for classification provided by the country of Colombia and contains 400 images from 99 patients. Each type of thyroid cancer contains roughly about 100 ultrasound images.
Data augmentation
The input data set has 400 images which are not sufficient to train the classifier. Hence in order to bring about a balance in the number of images for each type of thyroid carcinoma, data augmentation process is carried out. It also promises better classification results as there are a satisfactory number of input images available for training and testing the classifier. In order to implement this data expansion technique, several methods of data warping such as flipping, rotation, cropping, scaling, and shifting ultrasound images are performed on the dataset. On each image, exactly one of these techniques are applied and not all of them. The output of augmentation process leaves us with 200 new ultrasound images thereby increasing the total count of input ultrasound thyroid images available counting to 600.
Preprocessing
Preprocessing becomes highly essential as far as medical imaging is concerned as they are not actually meant for image processing. They are just medical images which will be used by the oncologist or the radiologist for the purpose of diagnosis of thyroid cancer and has no background usage in image processing directly [23]. But since we are in the process of designing an automated diagnostic system, we are trying to make use of this medical ultrasound images in the realm of image processing. So therefore, these images need to be processed before they are used by image processing and machine learning algorithms. Here in order to filter the noise present in the images bilateral filtering is used.
3.1.3.1. Bilateral filter. It is a nonlinear filter that is basically used for the purpose of smoothing the input images. It is also used as an edge preserving and noise mitigating filter depending upon the scenario. It is able to achieve this smoothening effect through the averaging process [24]. This process is nothing but replacing original pixel intensities with that of average ones that has been obtained from the bilateral filtering process from the neighboring ones. It is also computationally high in cost but because of its good results it has been used widely in medical processing. It is easy to use because of its fewer number of parameters and contains fewer iterations when compared to its other filters in line. The biggest advantage of bilateral filtering is its edge preserving nature and management of tones and styles. It works well even with large images, and it has its roots in Gaussian convolutions. It has two parameters namely the range parameter and the spatial parameter. The equations for bilateral noise filtering are given below from equations (1) to (5).
3.1.3.2. Dynamic histogram equalization (DHE). It is a kind of histogram equalization that produces many sub histograms until exit criteria is met. It works in an iterative manner and repeats the process of histogram equalization until all the newly produced sub histograms are equal in contrast. It is divided for easier understanding into 3 divisions like histogram partitioning, gray level range set up and sub histogram equalization [25]. In the first part, the histograms of the underlying image are computed, and they are divided on the basis of their local minima points. During the second part gray level ranges are applied for each divided sub histogram and the transformation function is applied on each of them and the gray levels present in the actual input image is matched with that of newly created sub histograms. It is this step of the dynamic histogram equalization algorithm that ensures uniformity in pixel range values and produces an output image that is contrast enhanced in a linear and cumulative manner. The last step contains traditional histogram equalization based on the gray levels that have been allocated in the previous step. The advantage of dynamic histogram equalization is that it has the ability to enhance both local and global contrast whichever is of interest. Mathematical formulation of dynamic histogram equalization is given in equations (6) and (7).

DHE Process.
Image segmentation
Once the input ultrasound images are augmented and preprocessed, they are ready to be segmented and classified further by the chosen classifier of the proposed system. Segmentation in this case is achieved using SegNet algorithm which is meant for exclusive segmentation of images based on a semantic manner. The ability of this algorithm to segment each individual pixel of the constituent image is well appreciated because of which it has found its way in many domains of image processing. Just like any other segmentation and deep learning model, this algorithm is also based on the structure of an encoder and decoder [26]. Each of them is made-up of different layers of convolution and have varying responsibilities and functions to carry out. Operations like convolutions, batch normalization, element wise activation and max pooling are performed by the encoding network and hence achieves down sampling of the preprocessed image.
The decoder on the other hand, up samples the feature maps produced by the encoding network using reverse convolutions in a sparse manner. It converts the sparse feature map into a dense one after which it is fed as input to the SoftMax classifier present towards the end of the SegNet architecture. It is this classifier that segments each of the pixels separately into its output class. It is similar in nature to competitors such as UNet and Deconvnet. It has got wide usage in segmentation like indoor images, roadside images, medical images, remote sensing images etc. The absence of fully connected layers makes the architecture very crisp and efficient and makes it different from others. Figure 3 depicts the process of segmenting ultrasound images of thyroid cancer using SegNet.

Segmenting Thyroid ultrasound images using SegNet.
Feature extraction is achieved using a feature fusion model comprising two very efficient algorithms such as CapsuleNet and EfficientNetB2. CapsuleNet is basically a variation of artificial neural networks that is capable of extracting hierarchical relationship features from segmented images. It consists of individual units called capsules which are reusable in nature and collaborate with one another before producing the end result [27]. Hence the output of this algorithm will generally be an observation vector. The highest advantage of this algorithm is the replacement of max pooling layers by a new way of routing called routing by agreement. Capsules are a bunch of neurons connected to each other that are activated for different objective properties such as contrast, shape, location etcetera.
Though the capsules are interconnected to each other they are still independent in nature which has the ability to take its own decisions. It has been arranged in a hierarchical manner that capsules sitting at higher layers look up at the decision made by the capsules in their corresponding lower layers. The hierarchical and spatial features can thus be preserved in a good manner because of this dynamic routing by agreement protocol. The strength of this algorithm is decision making capacity, reduced parameter size and better generalization results. It has been designed in such a way that lower capsules capture generalist information and higher capsules grab even more complex information from the image. The capsules simulate functions of neurons present in brains because of which it is able to transform input in a scalar form to a vector containing important features. Several weight matrices are associated with CapsuleNet, and it works based on the principle of squashing. Equations corresponding to different operations of CapsuleNet model are presented below in equations (8) to (11).
Dynamic routing by agreement protocol pseudocode
while Routing (c a |b , z, x)
for all capsules a in layer x and capsules b in layer x + 1:
t ab = 0;
for z iterations: do
for all capsules a in layer x:
u a = softmax (t a );
for all capsules b in layer x + 1:
t ab = t ab +c a |b·a b ;
return a b ;
EfficientNetB2 is yet another artificial neural network that uses the process of uniform scaling. It is an updated version of the EfficientNetB0 and B1 models and performs well than its predecessors [28]. They have fewer parameters and can perform scaling in any field. It has a fine-tuned architecture that is very fast and efficient. The topmost advantage of EfficientNetB2 model is the application of uniform scaling method instead of random scaling. It is known to be a very good feature extractor that is capable of transferring learning to a certain extent. Figure 4 illustrates the process of feature fusion using CapsuleNet and EfficientNetB2 algorithms.

Feature fusion using CapsuleNet and EfficientNetB2.
In the proposed work, the feature fusion process plays a pivotal role in enhancing the accuracy of our AI-based thyroid tumor classification system. This process involves the intelligent combination of features extracted from thyroid ultrasound images by two distinct algorithms, CapsuleNet and EfficientNetB2. CapsuleNet outperforms at understanding spatial relationships within the images, while EfficientNetB2 is effective at processing images of varying scales and complexities. During feature fusion, the unique sets of features identified by each algorithm are merged, utilizing sophisticated techniques to maintain the most informative aspects from both. This fusion results in a comprehensive feature set that capitalizes on the strengths of both algorithms, significantly boosting the system’s ability to accurately classify different types of thyroid tumors. The relevance of this process lies in its ability to synthesize a richer, more nuanced understanding of the ultrasound images, thereby overcoming the limitations of using a single feature extraction method and ensuring a higher level of diagnostic precision, crucial in medical imaging analysis.
Classification is achieved in the proposed system using multilayer perceptron-based classifier. It consists of individual units called perceptrons which are interconnected with each other back and forth. Each perceptron has a threshold term, bias term and weight associated with it. It is basically a feed forward model of artificial neural networks capable of nonlinear data separation [29]. It is constituted of 3 layers called input layer, output layer and hidden layer. While the functioning of the input and output layers are quite simple, it is the hidden layers that perform the actual computation and hence are considered the significant part of MLP.
Each perceptron will receive the features as input in a numerical format which will be passed to the perceptrons in the hidden layer that calculates the sum of the input features in a weighted manner. Perceptrons in the output layer perform classification with the help of the activation function [30]. The equations of multilayer perceptron are given below in equations (12), (13) and (14).
M,N– activation functions
w1,w2- weights of the perceptron
b1,b2 - bias values
Θ– threshold value
Figure 5 shows the architecture of MLP for classifying different types of thyroid cancer.

MLP architecture.
Multilayer perceptron can be thought of as a team of decision-makers, where each member specializes in recognizing certain types of information. Imagine a group of experts trying to identify an animal based on various features. The first layer of experts might focus on basic features like size or color, the next layer might consider more complex attributes like the shape of the ears or the length of the tail, and so on. Each layer passes its findings to the next, with each subsequent layer building a more detailed understanding. Finally, the last layer makes the final decision about what animal it is, based on the combined insights from all the layers. In the proposed context, the MLP works in a similar way to classify thyroid tumors, with each layer progressively learning and refining information from ultrasound images to make an accurate diagnosis.
Though we use state-of-the-art classifiers for the process of classification, optimization algorithms are always added to the classifier in order to obtain even more satisfactory results. Optimization algorithms have proved their standard and capability many times in improvising and maximizing the results of any underlying classifier. Employing an optimization technique in conjunction with a classification algorithm will deepen the process of finding the best solution to the undertaken problem. The goal of any optimizer is to elevate the overall efficiency of the proposed system and minimize the classification errors if any.
The proposed work aims to classify the different types of thyroid carcinoma such as papillary thyroid carcinoma, follicular thyroid carcinoma, anaplastic thyroid carcinoma and medullary thyroid carcinoma. One important thing to be noted is the existence of a very thin line of differentiation among these four types. A very small error can lead to misclassification. It is based on this classification result that the oncologist will provide corresponding treatment. Hence any inaccurate classification cannot be accepted as this work is carried out in the realm of medical science involving the life of patients. Therefore, it becomes highly essential that an optimization algorithm is applied in order to achieve high end classification accuracy.
The optimization algorithm that is to be used here is Bonobo optimization. The intention behind opting bonobo optimizer amongst many population-based algorithms is the adaptability and self-adjusting nature of this algorithm. It belongs to a class of multi objective optimization algorithms which is considered to be better and more efficient than single objective optimizers. It clearly exhibits superior performance than its counterparts in the realm of optimization.
The Bonobo optimization algorithm, as applied to thyroid tumor classification, introduces several novel aspects that significantly enhance the effectiveness of the classification system. Key among these is its adaptive learning strategy, which dynamically adjusts parameters in response to the complex landscape of medical image features, ensuring efficient and accurate optimization. The algorithm’s collaborative search mechanism, inspired by the social behavior of bonobos, allows for simultaneous evaluation and information sharing among multiple solutions, leading to a more comprehensive exploration of the solution space. This approach is crucial in medical applications like thyroid tumor classification, where it is essential to balance exploration of new patterns with the refinement of known ones. Additionally, the algorithm is notably robust against variability in medical imaging data, a critical feature given the diverse presentations of thyroid tumors in ultrasound images. To specifically suit the needs of medical imaging analysis, the Bonobo optimization algorithm has been customized for the nuances of ultrasound characteristics and features relevant to thyroid tumors. This customization ensures that the algorithm not only achieves high accuracy but also maintains efficiency and reliability in processing complex medical imaging data, making it a pivotal component in the advancement of thyroid tumor diagnosis.
Bonobo optimization belongs to the class of adaptive optimization algorithms that are meta heuristic in nature. It is derived from the behavioral strategies of bonobos. It is capable of adjusting its parameters according to the scenario. Bonobos are a class of monkeys that are found to be in close association with mankind. The social strategy followed by Bonobo is called fission fusion and the reproductive strategy can be divided into four types called restrictive mating, promiscuous, extra group, and consort ship mating. All these strategies help bonobos to establish themselves in a harmonious way and maintain their population.
Since this is a multi-objective optimization technique, there are many best solutions available. Each solution is termed as a Bonobo and the best solution is called as the alpha Bonobo. There are two phases in this algorithm called the positive phase and negative phase depending upon the improvisation of alpha Bonobo. The algorithm is simple in nature with the following steps of initializing parameters and bonobos, identifying the fitness values and evaluating alpha bonobos. If the found out alpha Bonobo is the best, then stop the algorithm otherwise choose another Bonobo using fission fusion strategy. A random number is also generated and checked if it is lesser than the probability of phase parameter. If it is less, then a new Bonobo is created using promiscuous or restrictive mating. In case if the random number is greater than the checked parameter, then a new Bonobo is created based on extra group or consortship based mating strategy. Fitness values are again calculated for the newly generated Bonobo and the best among them is chosen as the alpha Bonobo. The parameters are updated accordingly.
Pseudocode for Bonobo optimization algorithm
Input: Bonobo population, b, boundary limiting condition, probability of phase.
Output: Best α -bonobo.
do while
Initialize Bonobo population
Calculate fitness range of each bonobo.
Select α -bonobo from the initialized list of bonobos.
if (boundary limiting condition = true),
then end.
else
new bonobo = fission fusion(b).
r = random(b)
if(r < pop)
then new bonobo = promiscuous(b) or restrictive(b).
else
new bonobo = extragroup(b) or consortship(b).
recalculate fitness of all newly generated bonobos.
end while
return α -bonobo.
Mathematical modeling of bonobo optimization is presented below equations (15) to (19).

Bonobo Optimizer.
Given the scenario, the Bonobo Optimization Algorithm can be likened to a group of intelligent bonobos (a type of primate known for their smart problem-solving skills) working together to find the best path through the maze. Each bonobo represents a potential solution. They explore different paths, learn from each other, and adapt their strategies based on the most successful routes found by the group. This process of exploration, learning, and adapting continues until they find the most efficient path through the maze. In our study, this algorithm helps in optimizing the performance of the classification model, ensuring that it not only finds a good solution but the best one, much like finding the most efficient path in the maze.
The proposed system tries to classify the thyroid carcinoma from the ultrasound images of the patient into four different types such as papillary thyroid carcinoma, medullary thyroid carcinoma, follicular thyroid carcinoma and anaplastic thyroid carcinoma based on the difference found in cancerous cells and invasion pattern. It is of high importance that these types of thyroid carcinomas are exactly identified because it is based on the type of thyroid carcinoma, treatments will be prescribed by the oncologist. Different types of carcinomas have different protocols to be followed and different treatments that need to be provided. Therefore, identifying the exact type of thyroid carcinoma becomes very essential in the process of diagnosis and prognosis of thyroid cancer. The input data set is obtained from Digital database of thyroid ultrasound images data set of Kaggle repository.
The obtained data set is subjected to data augmentation processes such as flipping, rotation, cropping, scaling, and shifting in order to increase the number of samples in each type of thyroid carcinoma and avoid the problem of imbalanced class learning. After augmenting the input dataset, the ultrasound images are preprocessed using bilateral filter and contrast enhanced using dynamic histogram equalization process. Once the images have been preprocessed, they are segmented from the background using SegNet algorithm and features are extracted from a hybrid model of fused features involving two deep learning algorithms such as CapsuleNet and EfficientNetB2. Both of them extract features individually from segmented images and the resulting feature maps are fused together to attain better classification accuracy. Finally, the ultrasound images are classified into the above said four different types of thyroid carcinomas with the help of multilayer perceptron-based classifier whose results are optimized using Bonobo optimization algorithm.
Novelty of proposed system
The proposed system is novel over the existing works in many ways. It aims to classify thyroid cancer into different types including the rarest form of thyroid cancer such as anaplastic thyroid carcinoma. The proposed system involves a data augmentation process in order to increase the input ultrasound images so that better classification accuracy can be achieved.
Contrast enhancement technique is coupled with noise removal filtering process so that clean and clear input images are utilized for the processing. Also feature extraction is done using a hybrid process of combining CapsuleNet and EfficientNetB2 models. Features obtained by both the models are concatenated together and a fusion of features is made which is given as input to the MLP classifier for classification. All the techniques employed in the design of the proposed system are up to date and rich algorithms of deep learning. Figure 7 shows the model of proposed system for classification of thyroid carcinomas.

Proposed system model.
Experimental setup
400 DDTI Ultrasound Images obtained from the National University of Colombia was used as the input which was increased up to 600 images using the process of data augmentation. They were split in the ratio 50:50 for training and testing the MLP classifier. The population size and the chromosome length was considered as 10 and 1. Here, the parameters of MLP are tuned by Bonobo optimization with the consideration of attaining the accuracy maximization as the major objective or the fitness function. The proposed MLP-based Bonobo optimization was compared with various state-of-the-art optimization and deep learning models in terms of distinct analysis to describe the superiority of the proposed thyroid tumor type classification model. A total of 300 ultrasound images were used for training and 300 images for testing. 70 images each were present in Papillary and Follicular thyroid carcinoma categories in both training and testing phases separately. 80 images each were presented related to Medullary and Anaplastic thyroid carcinoma categories in both phases individually. Figure 8 shows the sample thyroid ultrasound images containing all four types of thyroid carcinoma.

Sample images of different types of thyroid carcinoma.
Table 1 below the details of data augmentation processes and their corresponding values. Five methods have been chosen for augmentation process which has created 200 new images thus taking the total input size to 600 ultrasound images. The original images are rotated to 90 degress and cropped to the convenient standard size of 240*240 to create new images. Images are also scaled to a a measurement of 0.5 and right shifted to 0.2 percent in order to obtain fresh images. The operation of flipping is also carried out on the actual ultrasound images. Either of the process is carried out on each imahe and not all of them as it will create ununiform images.
Data Augmentation Parameters
Figure 9. shows the preprocessed ultrasound images using bilateral filter and dynamic histogram equalization process. Figure 10. Display that the output of ultrasound images segmented using SegNet.

Preprocessed images.

Segmented thyroid ultrasound images.
To validate the efficiency of our proposed thyroid tumor classification system, we employed a multi-faceted approach. The dataset was initially split into training, validation, and testing sets to evaluate the model’s performance and its ability to generalize to new data. We further implemented cross-validation, dividing the dataset into multiple folds to ensure the model’s robustness and consistency across different data subsets.
The proposed system was benchmarked against established classifiers like CANFES, Spatial Fuzzy C means, Deep Belief Networks, Thynet, Generative adversarial network, and Long Short-Term memory, comparing key performance metrics such as accuracy, precision, F1 score, sensitivity, and specificity. A detailed error analysis helped us understand the types and patterns of errors made by the model, focusing particularly on false positives and false negatives. To assess practical applicability, we considered a phase of clinical validation with real-world data from medical settings. Sensitivity analysis was also conducted to evaluate the model’s robustness against variations in input data. Additionally, we emphasized model interpretability and explainability, crucial in a medical context, by analyzing feature importance to understand the data aspects most influential in the model’s decisions. This comprehensive validation framework ensured a thorough evaluation of the system’s efficiency and reliability, affirming its suitability for practical application in medical diagnostics.
Thyroid tumor type classification performance of the proposed MLP model is calculated using metrics like accuracy, sensitivity, specificity, F1 score, Matthew’s Correlation Coefficient (MCC) as shown in equations (20) to (24).
Table 2 compares the performance of the proposed model with that of similar papers in terms of accuracy, sensitivity, specificity, and F1-Score metrics. The highest accuracy measure is achieved by our proposed model which is 99.12%. Similarly, sensitivity and F1-Score metrics of the proposed system is greater than the other works and are 97.71% and 98.95% respectively. Xeusi Ma et al. in his paper has scored 100% specificity whereas our proposed system achieves 97.88%. It is evident from this table that the overall performance showcased by the proposed system is good and satisfactory when compared to that of existing works.
Classification Performance of proposed model and related works
Figure 11 portrays the performance of the MLP classifier in a graph format.
The value of MCC achieved by the proposed system is 98.13%. It can be observed from this representation that the proposed system performs in a superior manner to that of similar works carried out with the same objective.

Performance of the proposed model.
Confusion matrix
Confusion matrix is a way of representing the correct and incorrect classifications of the proposed system. Table 3 and 4 show the confusion matrix achieved by the proposed system of different types of thyroid carcinoma such as Papillary Thyroid Carcinoma (PTC), Follicular Thyroid Carcinoma (FTC), Anaplastic Thyroid Carcinoma (ATC) and Medullary Thyroid Carcinoma (MTC).
Confusion matrix during training phase
Confusion matrix during training phase
Confusion matrix during testing phase
During the training phase, the proposed system classifies 69 papillary thyroid carcinomas correctly and only one is misclassified as FTC. All the FTC ultrasound images have been identified accurately. Out of 80 MTC images, 77 were identified exactly and three of them were misidentified by the proposed system. Finally, in the case of ATC all images except one image were classified rightly. These misclassifications are due to the similarity found between the ultrasound images.
When testing the classifier, all the ultrasound thyroid images relating to PTC were categorized with 100% accuracy. In the case of FTC images, all 69 of them were processed correctly except one. Out of 80 MTC images, 79 were classified correctly with the exception of 1. 77 ATC images were classified accurately while 2 of them were identified as MTC and 1 as FTC. This misclassification can be attributed to the visual similarity of certain ultrasound images.
Figure 12 portrays the Receiver Operating Characteristic (ROC) curve of thyroid tumour classification. Area Under the Curve (AUC) value can be calculated as shown below in equation (25).

ROC curve.
It can be seen that the AUC values are above 0.98 for all the four types of thyroid carcinoma.
The performance of the proposed MLP model is compared with existing systems like Co-Active Adaptive Neuro Expert System (CANFES), Spatial Fuzzy C means, Deep Belief Networks, Thynet and Generative Adversarial Network (GAN) along with Long Short-Term Memory (LSTM) in terms of classification accuracy. Table 5 shows the comparison of the various models of thyroid tumour classification. The proposed MLP model shows the highest accuracy of 99.12% and is better than all the existing models.
Performance Comparison with existing methods
Performance Comparison with existing methods
This table shows that the proposed system works well and classifies thyroid cancer better than CANFES by 15.37%, Spatial Fuzzy C means by 9.92%, Deep Belief Networks by 6.92%, Thynet by 3.66% and GAN+LSTM model by 0.16%. This betterment of classification accuracy has been achieved because of the novelty present in the proposed system, feature fusion technique and proper handling of input data and employment of high-end methodologies in the design of proposed system. Figure 13 illustrates the performance of different classifiers in terms of thyroid tumor classification.

Comparative analysis of algorithms.
As observed from the results provided, the high accuracy, sensitivity, specificity, F1-score, and Matthew’s correlation coefficient of the proposed multilayer perceptron-based classification system indicate a strong ability to correctly identify and classify different types of thyroid tumors. This level of accuracy is crucial in medical diagnostics, where the early and accurate identification of tumor types can significantly impact treatment decisions and patient outcomes. The system’s ability to distinguish between tumor types with high sensitivity and specificity reduces the likelihood of false negatives and false positives, which are critical in ensuring that patients receive appropriate and timely care. The use of advanced AI techniques like CapsuleNet and EfficientNetB2 for feature extraction, and SegNet for image segmentation, demonstrates the potential of AI in enhancing the diagnostic process. These techniques allow for more pronounced analysis of ultrasound images than traditional methods, potentially revealing characteristics of thyroid tumors that might be overlooked by human analysis. This could lead to earlier detection and a better understanding of the nature of the tumor, aiding in personalized treatment planning.
Our study marks a significant advancement in medical diagnostics, introducing a novel AI-driven system for thyroid tumor classification with exceptional accuracy and efficiency. By utilizing advanced algorithms like CapsuleNet, EfficientNetB2, and SegNet, and employing the Bonobo optimization technique, our model surpasses existing methods, promising substantial improvements in early tumor detection and treatment. This breakthrough not only enhances patient outcomes and paves the way for personalized medicine but also sets a new standard in medical image analysis. It represents a pivotal step in integrating AI into healthcare, with vast implications for the future of medical diagnostics and treatment. The proposed multilayer perceptron-based classification model achieves an accuracy of 99.12%, sensitivity of 97.71%, specificity of 97.88%, F-score of 98.95% and MCC value of 98.13%. It has been proved that the proposed model gives satisfactory results and produces enhanced classification accuracy than its existing models like CANFES, spatial fuzzy C means, deep belief networks, Thynet, generative adversarial network based long short-term memory classifier etc. In terms of limitations of the work, the dataset, sourced from the Digital Database of Thyroid Ultrasound Images on Kaggle, may lack diversity in ethnic, age, gender, and geographical representation, limiting generalizability. Data augmentation techniques, including flipping, rotation, cropping, scaling, and shifting, while beneficial for enhancing the dataset, could introduce biases by making the model learn augmented features not representative of real-world variations. The choice of CapsuleNet and EfficientNetB2 for feature extraction, and SegNet for image segmentation, comes with inherent algorithmic strengths and weaknesses, potentially influencing the types of features extracted and the accuracy of segmentation. The future work of this paper can be extended to identify and classify deeper subtypes oh thyroid cancers such as Hurthle cell tumor, mixed medullary papillary cancer and other such hybrid thyroid carcinomas. Future research could also focus on several specific and actionable areas like diversifying the dataset, inclusion of thyroid ultrasound images from a wider demographic, encompassing varied ethnicities, ages, and genders, and from multiple geographic regions. This would improve the model’s generalizability and reliability across different populations. Secondly, exploring alternative data augmentation techniques that more closely mimic real-world variations in thyroid tumors could help in reducing potential biases introduced by our current methods. A focus on developing lightweight models that require less computational power can make the technology more accessible, especially in resource-limited settings. Moreover, integrating the proposed model into a clinical trial setting would provide valuable feedback on its practical utility and areas for improvement. These future directions aim not only to refine the model’s performance but also to ensure its practical applicability and ethical deployment in the field of medical imaging and diagnostics.
Declaration
Funding
The author did not receive support from any organization for the submitted work.
Conflict of interest
The author has no relevant financial or non-financial interests to disclose.
Availability of data & material
The author hereby declares that no specific data sets are utilized in the proposed work.
Code availability
Since future works are based on the custom codes developed in this work, the code may not be available from the author.
Author contributions
The author is solely responsible for the experimental works conducted in this paper, drafting of the paper and presentation of all the sections.
