1 Introduction

Chest conditions such as infiltration, pneumonia, effusion, atelectasis, cardiomegaly, and pneumothorax are significant global health concerns. Detecting these disorders early is crucial due to the influence of lifestyle and environmental factors. However, accurately diagnosing these conditions based on symptoms alone is challenging for healthcare professionals. Therefore, computer-based decision-support systems play a vital role. The healthcare sector generates a vast amount of information, including clinical evaluations, patient reports, treatments, follow-up meetings, and drug data. Unfortunately, inadequate information management has hindered the quality of data associations. To address this issue, data mining becomes essential for forecasting diseases. With the continuous growth of medical data, reliable analysis has proven beneficial for early patient treatment. Consequently, it is necessary to develop efficient techniques that enable practical and effective handling and concentration of information as data volumes expand. In summary, the early identification and accurate diagnosis of chest disorders rely on the utilisation of computer-based decision support systems. Leveraging data mining and efficient information management becomes crucial to harnessing the increasing volume of medical data and improving patient outcomes [1], as shown in Fig. 1.

Fig. 1
figure 1

X-ray images of diagnosis categories

As a result of big data innovations in the biomedical and healthcare industries, accurate medical data analysis aids in early illness diagnosis, patient care, and community services. When the medical data used in the study is of poor quality, the study's accuracy is reduced. Additionally, certain localised infections have varied presentations in different places, which may make it more difficult to predict when outbreaks can happen. The recommended approach provides machine learning methods for precise disease incidence forecasting in prone-to-disease populations [2]. Using symptoms reported by users or by patients, the "disease prediction using machine learning" approach predicts diseases. The algorithm processes the user's symptoms before producing a chance that the disease will manifest [3]. Healthcare should be more individualised, predictive, preventive, and interactive, and AI may significantly advance these goals. Based on an evaluation of the achievements, we forecast that AI will keep its momentum to develop and mature as a powerful tool for biomedicine [4]. AI has lately made substantial advances in medicine, notably in the field of medical imaging, which is frequently used to identify and treat diseases of the brain, heart, lungs, and other organs [5]. Today, machine learning is pervasive, and one may utilise it frequently throughout the day without even realising it. We have two types of data structured and unstructured data. The structured data includes laboratory data as well as the patient's fundamental information, such as age, gender, and dietary preferences. While the patient's description of their illness and the doctor's notes on their examinations, diagnosis, etc. make up the unstructured text data [1], Using healthcare data that is both organised and unstructured, CNN conducts classification. Other machine learning algorithms, however, are slow to calculate, only work with structured data, and are lazy since they store all of the data as a training dataset and use intricate calculation methods. We are utilising the full power of machine learning to keep track of patient wellness. Machine learning models may be used to build models that quickly clean, analyse, and deliver outcomes from data. By using this strategy, physicians will select accurate diagnoses for their patients, who will then receive accurate treatment, raising the standard of patient healthcare. Healthcare is the ideal setting in which to bring machine learning to the medical field [3, 6]. This study focuses on enhancing the prediction accuracy of common thoracic diseases by employing modified fuzzy-based neural networks. Thoracic disorders affecting the heart, lungs, mediastinum, oesophagus, chest wall, major vessels, and diaphragm pose significant global health challenges. The aim is to improve early detection and diagnosis using a combination of fuzzy logic techniques and neural networks. The proposed approach involves constructing an objective fuzzy model integrated with clustering algorithms to enhance the accuracy of the prediction system. Historical data on prevalent thoracic diseases is collected from online sources to train the prediction engine. Application-specific data is carefully selected and processed to include relevant inputs required for the prediction system. Through pre-processing steps that involve data related to thoracic diseases, normalisation using fuzzification, employing a DenseNet-based model trained to analyse chest X-rays and identify disease patterns, and de-fuzzifying output values, the study aims to accurately identify and spatially localise frequently occurring thoracic diseases. The evaluation of the model demonstrates promising results, achieving impressive accuracy after some epochs with minimal training and validation loss. The utilisation of modified fuzzy-based neural networks offers a robust and effective approach for predicting common thoracic diseases. The outcomes of this study contribute to the advancement of early detection, precise diagnosis, and improved patient care in the field of thoracic medicine.

2 Related work

The Nave Bayes method [3] is used to predict the disease using symptoms; the KNN algorithm is used for classification; the features with the greatest impact value are extracted using logistic regression; and the decision tree is used to break the large dataset into manageable chunks. The model's projected illness will be the system's ultimate output.

The best clinical decision-making approach was proposed by Ajinkya Kunjir, Harshal Sawant, and Nuzhat F. Shaikh [7] and uses patient history to forecast illness. They have compared the two algorithms, J48 and Naïve Bayes, based on the obstacles that are faced by the medical practitioner. And they have observed that the Naïve Bayes algorithm outperforms it with a better accuracy rate.

S. Leoni Sharmila, C. Dharuman, and P. Venkatesan [8] use the liver data set to categorise and conduct comparative research. The fuzzy neutral network offers 91% accuracy for classification in a dataset of liver diseases when compared to other machine learning techniques.

The author has come to the conclusion that, on the supplied data set, machine learning techniques like Naive Bayes and Apriori [9] are very helpful for illness detection. Here, small-volume data, such as symptoms or prior information gleaned from the physical diagnostic, is employed for prediction. This paper's limitations include the inability to take into account enormous datasets. Additionally, because medical data is increasing today, it is difficult to identify it.

A CNN-based multimodal disease risk prediction (CNN-MDRP) algorithm was put up by Chen, Hwang, Wang, and Wang [10] to forecast diseases based on a sizable amount of structured and unstructured hospital data. In contrast to CNNUDRP, which only analyses structured data, CNN-MDRP concentrates on both structured and unstructured data using a machine learning algorithm (Navie-Bayes), improving sickness prediction accuracy and speed. Big data is taken into account here.

In [11], the author develops a prediction model for thrombo-embolic stroke in which artificial neural networks are recommended to support existing diagnostic methods. The ANN design was trained using the back-propagation technique, and it has also been evaluated for different types of stroke illness. This study reveals that ANN-based stroke illness prediction increases diagnostic accuracy by 89 percent.

To forecast cardiac disease based on the dataset using the Nave Bayes and KNN algorithms. To determine the likelihood of illness, we employ a single model based on convolutional neural networks. The CNN-prediction UDRP's accuracy is more than 65%. Additionally, this technology provides solutions to common health-related queries [6].

The goal of this research is to use Grey Wolf optimization and an auto-encoder-based recurrent neural network (GWO + RNN) to forecast various illnesses. The GWO approach is used to choose the characteristics, and the RNN method is used to forecast the illnesses. The GWO approach initially greatly reduces the unwanted and redundant attributes before sending the characteristics to the RNN classifier. The results of the trial demonstrated that the GWO + RNN algorithm outperformed other methods, including the Group Search Optimizer and Fuzzy Min–Max Neural Network (GFMMNN) approaches. For the Cleveland dataset, the suggested GWO + RNN technique enhanced prediction accuracy by 16.82% [12].

Tahia Tazin and colleagues utilized a convolutional neural network (CNN) to detect brain cancers in X-ray images. Their emphasis was on enhancing accuracy, and they employed transfer learning techniques. They evaluated the model's performance based on classification accuracy, achieving 92% accuracy with MobileNetV2, 91% with InceptionV3, and 88% with VGG19. Notably, MobileNetV2 outperformed other networks in terms of accuracy. These high accuracy rates have significant implications for early tumour detection, enabling timely treatment to prevent adverse physical effects like paralysis or impairment [13].

Abdelbaki Souid and his team introduced a method for classifying lung diseases in frontal thoracic X-ray images using a modified MobileNet V2 model. They explored transfer learning in combination with metadata utilization, making use of the NIH database. Their primary comparison metric was the Area Under the Curve (AUC), and they assessed differences between classifiers. On average, they achieved an AUC of 0.81 and an accuracy rate of 90%. Their findings suggest that resampling the dataset significantly improves the model's performance [14].

3 Methodology

3.1 Fuzzification

Fuzzy logic is a soft computing method that studies reasoning systems that take into consideration truth and falsehood to various degrees. For tasks like disease diagnosis, medication selection, and real-time monitoring of patient data, fuzzy logic is well-suited for use in knowledge-based systems in medicine. Fuzzy logic modelling techniques include linear programming, nonlinear programming, geometric programming, dynamic programming, and integer programming. Using these methods in conjunction with fuzzy logic, it is possible to find an optimal point under ambiguous conditions, giving the decision-maker more options [15].

A set's membership function, which is unaffected by the set's discrete or continuous elements, determines how fuzzy it is. The majority of the time, membership functions are expressed graphically.

The forms used to depict the graphical version of the membership function have some restrictions. Fuzzy rules are also used to illustrate fuzziness graphically. A method for resolving empirical issues based on experience rather than knowledge is the membership function. The accessibility of histograms and other probability statistics can also contribute to the building of the membership function. There are various ways to define fuzziness; similarly, there are various methods for constructing a membership function that graphically encapsulates fuzziness [16].

3.2 Dataset

We have collected the public dataset published by the NIH Clinical Center with more than 100,000 anonymized chest x-ray pictures, and their accompanying data have just been made available to the scientific community by the NIH Clinical Center. Researchers from all over the country and the world will now be able to use the datasets for training computers to detect and diagnose sickness more easily, as shown in Fig. 2. Patients will benefit in the long run because of this artificial intelligence mechanism. The National Institutes of Health created a database of more than 30,000 scans from individuals with severe lung illnesses. Participants in clinical trials at the NIH Clinical Center, the nation's biggest hospital dedicated solely to clinical research, are treated as partners in research. Prior to distribution, the dataset was thoroughly vetted to eliminate any personal information that could be used to identify a patient, as shown in Figs. 3 and 4. Although reading and diagnosing chest x-ray pictures may appear to be a straightforward process for radiologists, the problem is actually rather difficult and requires an extensive understanding of anatomy, physiology, and pathology. It's more difficult to establish a chest X-ray reading approach that takes into account all the major thoracic disorders because of these issues. With the use of this open dataset, academic and research institutions around the country may train computers to read and process massive volumes of scan data, helping to corroborate the conclusions of radiologists while also uncovering new information that could have gone unnoticed in the past. Additionally, it's possible that this cutting-edge computer technology could help patients in underdeveloped countries who lack access to radiologists read their chest x-rays and spot delayed changes that would otherwise be visible, creating a virtual radiology resident who could then be trained to read more complex images like CT and MRI [17].

Fig. 2
figure 2

Distribution normal vs Sick

Fig. 3
figure 3

Pie Chart of different identified conditions

Fig. 4
figure 4

Eight examples of thorax diseases

3.3 Pre-processing

The image must be resized and normalized before it can be processed any further; hence, one of the goals of the image pre-processing stage is to eliminate any unwanted twists that may be present in the picture. There are many different picture preprocessing techniques that may be discovered in the older literature. These techniques depend on the needs of model construction. Among them, the procedures of downsizing images, normalizing images, and converting covert levels to categorical are among the most used, as shown in Fig. 5.

Fig. 5
figure 5

Proposed Diagram

3.4 Membership functions (MFs)

Membership Functions (MFs) are essential to the effectiveness of fuzzy representation as a whole. Fuzzy sets can't function without MFs, which are the fundamental building blocks of fuzzy set theory. They can be triangular, trapezoidal, gaussian, or any other number of shapes. The only true requirement for an MF is that it must have a value ranging from 0 to 1. The MFs may take any form as long as they map the provided data to the desired level of membership. Here, fuzzy systems provide distinct degrees of freedom. Just as there are an infinite number of ways to characterize fuzziness, there are an infinite number of ways to graphically portray the MFs that describe this fuzziness. The size and nature of the problem will solely determine which method should be used. Just as important as choosing the MF's form is setting the interval and quantity of MFs. Additionally, it is wise to think about how the data is distributed. Trial and error is typically used for MF shape, even though there is no exact strategy for choosing MFs. Depending on viewing a certain linguistic variable, MFs have different shapes. It is more a matter of intuition than of standards. An MF really just has to vary between 0 and 1 in order to be considered. Any curve that we chose based on elements like simplicity, ease, speed, and efficiency is the definition of the function. As a result, the model's performance is not greatly affected by the MF type. However, because the number of MFs influences the calculation time, it has a greater effect. Therefore, by varying the number and type of MFs, the optimal model for obtaining the maximum system performance may be identified. The optimal form to employ when using fuzzy logic as a general approximator is discussed in reference [18]. Also mentioned is the creation of a restricted interpolation method for fitting an MF to a small set of known membership values [19]. Wu [20] provides instructions on how to choose MF. Breaking the 0–1 model is the fundamental issue with situational modelling. Triangular MF can be utilised in choosing an appropriate membership function. However, if the issue is intricate and complicated, we can require a unique kind of MF. For instance, if the problem at hand is a quantum mechanical problem, a special MF is needed. One requires a lot of "experience" with the circumstances in order to make the optimal decision. Therefore, good intuition reinforced by enough experience will result in an appropriate answer. Triangular MF is frequently among the most prevalent MFs used in practice. Highly applied MFs have triangular MFs produced by straight lines. These straight-line membership functions have the advantage of being straightforward. The smoothness and simplicity of Gaussian MFs make them a popular choice for expressing fuzzy sets. These curves have the benefit of being spherical and nonzero throughout. The symmetric triangular MF with a 50% overlap should be used, followed by a tuning procedure where the left or right spread and/or overlapping can be changed. The process must go on until the results are satisfactory. The same method may be used in many forms, such as trapezoidal, bell-shaped, and so on. Trapezoid shapes represent fuzzy intervals, whereas triangles represent fuzzy integers. These forms are the most basic. The triangle can take on many different shapes as a result of linguistic modifiers, truth-functional modifiers, compositions, projections, and other operations. The choice of MF shape is actually problem-specific. It is clear from a thorough analysis of numerous pieces of literature that the triangular MF is popular because of its ease of use. When comparing different MFs for a particular activity, it is frequently seen that gaussian and triangular MFs perform similarly to and better than other types of MF. Particularly, it has been discovered that the triangular MF outperforms the Gaussian MF. When Zhao and Bose [21] examined the system's reaction to different MFs, they concluded that the triangular MF was the best option. Triangular or trapezoidal forms are easy to build and quick to compute if the shape of MFs is not a consideration. However, if one knows certain priorities for their shapes, it would be fascinating to design MFs with shapes taken from these a priori forms after some smoothing, if required. It is frequently required to carry out a design optimization procedure in order to improve their performance. The customizable parameters characterising a particular fuzzy system are adjusted in this procedure to satisfy a defined performance requirement. Fuzzy logic has a large deal of flexibility towards its initial settings in terms of MFs using metaheuristic and evolutionary optimization algorithms [22]. MFs that use various methods, such as neural networks and genetic algorithms, for classifying fuzzy variables can do so [23]. The best set of parameters for fuzzy models has been determined in numerous studies using optimization methods like particle swarm optimization and genetic algorithms [24].

3.5 Fuzzy set functions

Triangle Set Functions:

$$a_j\left(x\right)=\left\{\begin{array}{rl}1-\frac{m_j-x}{l_j},&\;if\;m_j-l_j\leq x\leq\;m_j\\1-\frac{x-m_j}{r_j},&\;if\;m_j<x\leq\;m_j+r_j\\0,&else\end{array}\right.$$
(1)

Trapezoid set Function

$$a_j\left(x\right)=\left\{\begin{array}{rl}1-\frac{{ml}_j-x}{l_j},&if\;{ml}_j-l_j<x<\;{ml}_j\\1,&if\;{ml}_j\leq x\leq{\;mr}_j\\1-\frac{x-{mr}_j}{r_j},&if\;{mr}_j<x\leq{\;mr}_j+r_j\\0,&else\end{array}\right.$$
(2)

Gaussian set Function

$${a}_{j}\left(x\right)=exp\left\{-{\left(\frac{x-{m}_{j}}{{d}_{j}}\right)}^{2}\right\}$$
(3)

Cauchy set Function

$${a}_{j}\left(x\right)={\left[1+{\left(\frac{x-{m}_{j}}{{d}_{j}}\right)}^{2}\right]}^{-1}$$
(4)

Sinx set Function

$${a}_{j}\left(x\right)={\text{sin}}\left(\frac{x-{m}_{j}}{{d}_{j}}\right)/\left(\frac{x-{m}_{j}}{{d}_{j}}\right)$$
(5)

Laplace set Function

$${a}_{j}\left(x\right)= exp\left\{-\left|\frac{x-{m}_{j}}{{d}_{j}}\right|\right\}$$
(6)

Logistic set Function

$${a}_{j}\left(x\right)=\frac{1}{{D}_{j}}\left({S}_{j}\left(x-{m}_{j}+{l}_{j}\right)-{S}_{j}\left(x-{m}_{j}-{l}_{j}\right)\right)$$
(7)

Hyperbolic tangent set function

$${a}_{j}\left(x\right)=\frac{1}{{D}_{j}}\left({\text{tanh}}\left(\frac{x-{m}_{j}+{l}_{j}}{{d}_{j}}\right)-{\text{tanh}}\left(\frac{x-{m}_{j}-{l}_{j}}{{d}_{j}}\right)\right)$$
(8)

In our proposed system, we are utilizing the trapezoid membership function to obtain the degree of risk severity of the diseases. By incorporating these severity levels into a fuzzy logic system using trapezoid membership functions, we can accurately represent the linguistic variables associated with each disease's severity. The trapezoid membership function allows for a flexible and interpretable representation of the severity levels. For each severity level, the trapezoid membership function can be defined by adjusting the parameters a, b, c, and d. These parameters determine the shape and position of the trapezoid, capturing the range and distribution of severity for each disease. Collaborating with domain experts is crucial for defining the severity levels and determining the appropriate parameters for the trapezoid membership functions. Our expertise ensures that the membership functions accurately reflect the severity grading systems and clinical understanding of each disease. Using these membership functions in a fuzzy logic system enables reasoning and decision-making based on the severity of the diseases. The system can handle uncertainty, incorporate expert knowledge, and provide interpretable results, aiding in effective diagnosis and treatment planning.

Infiltration Severity Levels:

  • Low: Represents a mild or minimal infiltration.

  • Moderate: Represents a moderate level of infiltration.

  • High: Indicates a severe or extensive infiltration.

Pneumonia Severity Levels:

  • Low: Indicates a mild or limited pneumonia infection.

  • Moderate: Represents a moderate level of pneumonia severity.

  • High: Indicates a severe or life-threatening pneumonia condition.

Effusion Severity Levels:

  • Low: Represents a small or minimal effusion.

  • Moderate: Indicates a moderate amount or extent of effusion.

  • High: Indicates a large or significant effusion.

Atelectasis Severity Levels:

  • Low: Represents a mild or localized atelectasis.

  • Moderate: Indicates a moderate extent of atelectasis.

  • High: Indicates a severe or extensive atelectasis.

Cardiomegaly Severity Levels:

  • Low: Represents a mild or minimal enlargement of the heart.

  • Moderate: Indicates a moderate degree of cardiomegaly.

  • High: Indicates a severe or significant enlargement of the heart.

Pneumothorax Severity Levels:

  • Low: Represents a small or minimal pneumothorax.

  • Moderate: Indicates a moderate extent or size of pneumothorax.

  • High: Indicates a large or life-threatening pneumothorax.

To mathematically represent a trapezoidal membership function, we consider a quadrilateral shape with two parallel sides and two non-parallel sides in Fig. 6. In fuzzy logic, this shape is used to define the boundaries of a fuzzy set. The trapezoidal membership function is defined by four parameters: a, b, c, and d, which represent the x-coordinates of the four vertices of the trapezoid. The mathematical representation of the trapezoidal membership function can be derived as follows: For x values less than or equal to a, the membership degree is 0, indicating that x is outside the trapezoid. For x values between a and b, the membership degree linearly increases from 0 to 1 as x moves from a to b. For x values between b and c, the membership degree is 1, indicating that x is within the trapezoid. For x values between c and d, the membership degree linearly decreases from 1 to 0 as x moves from c to d. For x values greater than or equal to d, the membership degree is 0, indicating that x is outside the trapezoid. By adjusting the parameters a, b, c, and d, the width, slope, and position of the trapezoidal membership function can be modified to accurately represent the linguistic variable or concept being modelled. This mathematical representation allows for precise calculations and mathematical operations within fuzzy logic systems, enabling reasoning and decision-making based on fuzzy sets and linguistic variables.

Fig. 6
figure 6

Trapezoidal membership Function

3.6 Modified DenseNet

DenseNet is a very effective tool for resolving the gradient vanishing issue, improving the propagation of feature maps, and cutting down on the number of parameters. The connections between features on the channel and all of the front layers are densely connected using dense connections. Each dense block in DenseNet is made up of numerous convolutional layers, while DenseNet as a whole is made up of multiple dense blocks. Growth rate (k) features are generated by each convolutional layer, where k is the number of feature maps that the H(x) function generates, as shown in Fig. 7.

Fig. 7
figure 7

Modified DenseNet architecture

3.7 Dense block

DenseNet was chosen for this research for several compelling reasons. First and foremost, its proficiency in deep feature learning makes it a suitable candidate for the intricate task of identifying thoracic diseases from medical images. Additionally, DenseNet's parameter efficiency is highly advantageous, as it effectively reuses features, mitigating the risk of overfitting and enhancing the model's generalization capabilities. The feature fusion capabilities within DenseNet are invaluable in combining information from different network layers, enabling the recognition of complex patterns and anomalies within thoracic images. Furthermore, the incorporation of residual connections in DenseNet contributes to efficient training, promoting faster convergence and greater training stability. Lastly, DenseNet's well-established performance in various computer vision applications, including image classification and object detection, underscores its suitability for the demanding task of medical image analysis. Consequently, the selection of DenseNet is driven by its ability to bolster the accurate identification and localization of thoracic diseases in medical images through its unique architectural strengths. DenseNet consists of dense blocks. Convolution layers make up each dense block in the image. Following the completion of a dense block, a transition layer is built in order to go on to the subsequent dense block. When a dense block is constructed, each layer is directly connected to all of the levels that follow it. As a consequence of this, each layer is given the feature maps of the layers that came before it. Each convolution layer is composed of three operations that are performed in quick succession: First, a batch normalisation (BN) action is performed, then a rectified linear unit (ReLU) operation is performed, and finally, a 3 × 3 convolution operation is performed (Conv). Dropouts can also be added, although the necessity of doing so will depend on the architecture. Down sampling layers, which cause a change in the overall size of feature maps, are a crucial component of convolutional neural networks. In order to make downsampling easier in the DenseNet architecture, it divides the network into many dense blocks that are densely connected to one another. DenseNets are able to scale naturally up to hundreds of layers without presenting any challenges in terms of optimization. For a number of computer vision tasks that rely on convolutional features, DenseNets could be an effective feature extractor. This is a result of the reduced feature redundancy and compact internal representations of DenseNets.

3.8 Advantages

  • Strong Gradient Flow

  • Efficient Parameters and Computations

  • More different Features

  • Keeps Low Complexity Features

3.9 Fuzzy DenseNet

A fuzzy neural network may be broken down into its most fundamental component, which is a three-layer feedforward network. A fuzzy input layer (fuzzification), a hidden layer containing the fuzzy rules, and a final fuzzy output layer make up this network (defuzzification). Despite the fact that fuzzy sets are often discovered in the (fuzzy) connections between layers, it is occasionally feasible to find a five-layer network with sets in the second and fourth levels. The input membership functions of the fuzzy rules are represented in the input layer; a rule in the hidden layer will become active after it has received enough input. Membership in each set is established by the relative weights that are spread throughout the layers, and these weights are what are referred to as the fuzzy sets. Like a conventional neural system, their relative weights may be changed using different training procedures. Transfer functions are generally continuous, sending actual values down the network to the output layer, where, based on the firing of fuzzy rules in the hidden layer, they are translated into degrees of membership in fuzzy sets. These interpretations are determined by the network's hidden layer. Due to the way that fuzzy neural networks combine the advantages of FL and neural networks, they are a very powerful hybrid tool. They allow for the incorporation of expert information into the system and are said to be intrinsically more intelligible due to the fact that they use fuzzy inference, which is similar to how humans make decisions [25].

Algorithm 1
figure e

Proposed algorithm

4 Experimental results

The experimental results make sense of a large number of chest x-ray pictures. We have analyzed different descriptive statistics and used them in our analysis. There has been a brief discussion of the computation and interpretation of statistics that are used to characterize the mean, median, and mode of a distribution of scores or quantities, as well as the dispersion of scores around the mean. The mean, median, and mode are among these statistics (range, standard deviation, and variance). When it comes to descriptive statistics, our objective is to provide a description that is accurate as well as efficient in terms of disease diagnosis based on fuzzy neural networks.

It ought to be abundantly evident that the sample statistics themselves are not the major focus of our attention. Their primary contribution to knowledge is the light they may cast on age-related traits and the categorization of diseases. This is where their worth resides. The fact that the control group's mean was greater or lower than the mean of the experimental group or that a sample of 10,000 anonymous individuals showed a larger proportion of illnesses such as infiltration, pneumonia, effusion, atelectasis, cardiomegaly, and pneumothorax is unimportant because of this. We are more involved with the truth that the experimental groups imply was once larger than the control group's mean. Instead, we are going to be shifting our emphasis from near vision to far vision. This means that we are going to be shifting our attention from the sample to the labels, which will define the thoracic diseases and categorize them according to the risk level. We want to know if it makes sense for us to conclude that the experimental variable had an impact or if it makes sense to forecast that thoracic illnesses would have an impact on the priority of therapy. The factual basis for the prediction of thoracic diseases with fuzzy descriptions from samples to affected person files is provided by means of the descriptive data. The histogram showing the subtypes of the diseases is shown in Fig. 8. The correlation matrix is shown in Fig. 9. The descriptive analysis of the dataset is plotted as scatter and density, as shown in Fig. 10. The distribution graph is shown in Fig. 11. The correlation matrix of the thorax diseases dataset is shown in Fig. 12, and scatter and density plots of sample distribution are shown in Fig. 13. This was accomplished with a validation procedure loss rate of less than 5%. The training loss is 0.45, and the validation loss is 0.57.

Fig. 8
figure 8

Histogram

Fig. 9
figure 9

Correlation matrix

Fig. 10
figure 10

Scatter and density plots

Fig. 11
figure 11

Distribution graphs

Fig. 12
figure 12

Correlation matrix of thorax diseases dataset

Fig. 13
figure 13

Scatter and density plots of sample distribution

Sensitivity, also known as true positive rate or recall, is a performance metric commonly used in medical diagnostics to evaluate the effectiveness of a prediction system or diagnostic test. It measures the proportion of actual positive cases that are correctly identified or "sensed" by the system.

In the context of thoracic diseases, sensitivity refers to the ability of the prediction system to correctly identify individuals who have the disease. A high sensitivity indicates that the system has a low rate of false negatives, meaning it is capable of detecting a high percentage of true positive cases.

Sensitivity is calculated using the following formula:

$${\text{Sensitivity}}={\text{TP}}/\left({\text{TP}}+{\text{FN}}\right),$$

The ROC curve is usually plotted with the true positive rate (sensitivity) on the y-axis and the false positive rate (1-specificity) on the x-axis, as shown in Fig. 14. The curve represents the model's performance across various classification thresholds. Each point on the curve corresponds to a specific threshold used to classify the X-rays as positive or negative for a particular condition. The diagonal line (y = x) in the ROC plot represents the performance of a modified DenseNet fuzzy classifier. This model will have a ROC curve that is closer to the top-left corner of the plot, indicating higher sensitivity and a lower false-positive rate across different thresholds. The closer the curve is to the top-left corner, the better the model's performance. The area under the ROC curve (AUC) is often calculated as a summary metric. The AUC provides an overall measure of the model's ability to discriminate between positive and negative cases. A higher AUC indicates better discrimination performance, with a perfect classifier having an AUC of 1, as shown in Figs. 15 and 16.

Fig. 14
figure 14

ROC curve

Fig. 15
figure 15

A Thorax disease classification using DenseNet

Fig. 16
figure 16

Training and validation Loss

5 Discussion

The publicly available dataset that was once published by the NIH medical centre consists of more than 100,000 x-ray images of the chest that have been anonymized. These images include common thoracic disorders such as infiltration, pneumonia, effusion, atelectasis, cardiomegaly, and pneumothorax. We proposed the idea of fuzzy neural network classification, which uses the DenseNet classification to detect diseases and classify them into six categories, namely infiltration as the disease with the highest risk, pneumonia as the disease with the highest risk, effusion as the disease with the intermediate risk, atelectasis as the disease with the moderate risk, cardiomegaly as the disease with the low risk, and pneumothorax as the disease with the lowest risk. These categories are decided by using the have an effect on of diseases with recognize to A feedforward network with three layers constitutes the fuzzy member function. This network (defuzzification) consists of a fuzzy input layer, which is known as "fuzzification," a hidden layer that contains the fuzzy rules, and a final fuzzy output layer.

The described prediction system for forecasting common thoracic disorders using fuzzy modeling and artificial intelligence techniques appears to have several noteworthy aspects.

  1. 1.

    Fuzzy Modelling: Fuzzy logic is a computational approach that deals with uncertainty and imprecision in data. By incorporating fuzzy modelling into the prediction system, it can handle the inherent vagueness associated with diagnosing thoracic disorders, which can vary in presentation and severity.

  2. 2.

    Objective Fuzzy Modelling: The system utilizes objective fuzzy modelling, which suggests that it employs a systematic and data-driven approach to model construction. This can enhance the accuracy and reliability of the prediction system by reducing subjectivity in the modelling process.

  3. 3.

    Combination of Clustering Algorithm and Fuzzy System Identification: The prediction system enhances prediction accuracy by combining a clustering algorithm with fuzzy system identification. Clustering algorithms can group similar data points together, which can aid in identifying patterns and relationships in the thoracic disorder data. Integrating these results with fuzzy system identification can lead to improved prediction outcomes.

  4. 4.

    Utilization of Historical Data: The system leverages historical information on common thoracic disorders downloaded from the internet to train the prediction engine. This demonstrates the utilization of real-world data to inform and improve the accuracy of the prediction system.

  5. 5.

    Chest X-ray Analysis with DenseNet: The system employs DenseNet, a deep learning model, to analyse chest X-rays. By utilizing the DenseNet-based "reading chest X-rays" method, the system aims to identify and locate common disease patterns using image-level labels. This approach can potentially automate and expedite the analysis process, aiding in the timely diagnosis of thoracic disorders.

  6. 6.

    Performance Metrics: The accuracy of the modified fuzzy-based neuro networks for the prediction of common thoracic diseases is reported to be 96% with 10 epochs, and the training and validation loss is less than 5%. These metrics suggest that the prediction system achieves a high level of accuracy and performs well in predicting common thoracic diseases.

In comparison to previous studies on chest X-ray image analysis, the proposed approach in this research achieves a notably high accuracy rate of 96%. This outperforms several other studies: Panwar et al. [26] achieved an accuracy of 95.61% using the Grad CAM technique; Heidari et al. [27] reached 94.50% with VGG16; and Alazab et al. [28] obtained an accuracy of 94.80% using CNN. Even in comparison to Abdelbaki Souid et al.'s study [14] with MobileNet V2, the proposed method demonstrates superior performance. This comparative analysis underscores the effectiveness and advancements offered by the new approach in the context of chest X-ray image analysis.

6 Conclusion

In conclusion, the utilization of fuzzy logic in combination with the robust capabilities of DenseNet has demonstrated significant potential in enhancing the accuracy of thoracic disorder diagnosis. The system we have developed, which incorporates fuzzy logic principles and leverages DenseNet, has consistently outperformed alternative methods in classification and prediction studies. This achievement is attributed to the application of a fuzzy trapezoidal membership function and centroid defuzzification technique, allowing for precise predictions based on test data. Moreover, the integration of DenseNet further elevates the system's capabilities. DenseNet, a deep learning architecture, is specifically harnessed for the analysis and feature extraction from chest X-ray images. Its unique dense connectivity pattern facilitates effective feature extraction and learning across network layers. This connectivity pattern enables feature reuse, parameter efficiency, feature fusion, and residual learning, all of which contribute to its exceptional performance in identifying and localizing common disease patterns in thoracic disorders. The amalgamation of fuzzy logic, trapezoidal membership functions, centroid defuzzification, and DenseNet empowers the system to automatically identify and classify thoracic diseases with precision. This not only streamlines accurate diagnosis but also provides valuable insights into the associated risks of the identified diseases. Throughout the training process, spanning 10 epochs, the system consistently maintains high accuracy, supported by low training and validation loss rates. This consistent performance attests to the model's proficiency in accurately predicting and classifying thoracic diseases. The proposed fuzzy-based neural network system, enhanced with DenseNet, showcases exceptional performance in predicting common thoracic diseases. The synergy of fuzzy logic principles and the potent feature extraction capabilities of DenseNet contributes to its high accuracy, robustness, and ability to handle uncertainty. This combined approach holds immense promise for aiding medical professionals in the effective diagnosis of thoracic disorders.