Optimizing Fuzzy Membership Functions for Tuberculosis Diagnosis: A Comparative Study of Gaussian and Triangular Functions with PSO | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Optimizing Fuzzy Membership Functions for Tuberculosis Diagnosis: A Comparative Study of Gaussian and Triangular Functions with PSO Oluwatosin Ogunbodede, Benjamin Aribisala This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-9201866/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract In fuzzy logic‑based diagnostic systems, the shape of membership functions (MFs) significantly influences model performance. This study investigates the impact of Gaussian versus triangular MFs on tuberculosis (TB) diagnosis within a neuro‑fuzzy framework optimized by particle swarm optimization (PSO). Using a dataset of 1200 subjects (850 TB cases, 350 controls) from the Centers for Disease Control and Prevention, we compared two model variants: one with Gaussian MFs and one with triangular MFs, both optimized concurrently with neural network weights via PSO. A baseline neuro‑fuzzy model (without PSO) served as a reference. The Gaussian‑based PSO‑optimized model achieved 86% sensitivity, 79% specificity, and 85% accuracy, outperforming the triangular‑based variant (79% sensitivity, 72% specificity, 77% accuracy). Convergence analysis showed that the Gaussian model reached stable optimum within 100 iterations, whereas the triangular model required 150 iterations. Sensitivity analysis of PSO parameters revealed that a linearly decreasing inertia weight (0.9→0.4) and balanced acceleration coefficients (c₁ = c₂ = 2.0) yielded best results for both MF types. The Gaussian MFs produced smoother decision boundaries and better handled overlapping clinical categories, as reflected in higher performance. This study provides empirical evidence that Gaussian membership functions, when optimized concurrently with network weights using PSO, lead to superior diagnostic accuracy, and offers practical guidance for designing high‑performance neuro‑fuzzy medical diagnosis systems. Membership functions Gaussian triangular particle swarm optimization tuberculosis diagnosis neuro‑fuzzy systems 1. Introduction Fuzzy logic systems are widely used in medical diagnosis because they can represent uncertainty and imprecision through linguistic variables and membership functions (MFs) [1]. The shape of the MF—whether triangular, trapezoidal, or Gaussian—affects how inputs are mapped to fuzzy sets and ultimately influences diagnostic accuracy [2]. In neuro‑fuzzy systems, these MFs can be adapted through learning, but the choice of MF type remains a critical design decision. Tuberculosis (TB) diagnosis is particularly challenging due to overlapping symptoms with other respiratory diseases [3]. Computational models that combine fuzzy logic with neural networks have shown promise, yet the optimal MF type for such applications has not been systematically investigated [4,5]. Most studies use triangular MFs for simplicity, but Gaussian MFs, with their smooth transitions, may better represent clinical concepts where categories overlap [6]. This study compares the performance of Gaussian and triangular membership functions within a neuro‑fuzzy framework for TB diagnosis, where both the MF parameters and the neural network weights are concurrently optimized using particle swarm optimization (PSO). The objectives are: (1) to evaluate the impact of MF shape on diagnostic accuracy, (2) to analyze convergence behavior during PSO optimization, (3) to assess the sensitivity of PSO control parameters, and (4) to provide recommendations for MF selection in medical diagnostic systems. 2. Methodology 2.1 Neuro‑Fuzzy Model Architecture The neuro‑fuzzy model is a five‑layer adaptive network implementing a first‑order Takagi–Sugeno fuzzy inference system [7]. The input layer receives ten clinical variables (Table 1). The fuzzification layer maps each input to five linguistic terms (very mild, mild, moderate, severe, very severe) using either Gaussian or triangular MFs. Table 1: Diagnostic Variables Used in the Study Variable Description Type Alcohol/nicotine use 0=none, 1-stopped, 2=current Categorical Drug usage/addictions 0 = no, 1 = yes Categorical Immune disorder 0 = no, 1 = yes (HIV, cancer, etc.) Categorical Previous TB infection 0 = no, 1 = yes Categorical Blood pressure 0 = low, 1 = normal, 2 = high Categorical Temperature 0 = low, 1 = normal, 2 = high Categorical Pulse 0 = abnormal, 1 = normal Categorical Chest X‑ray result 0 = abnormal, 1 = normal Categorical Blood clotting test 0 = abnormal, 1 = normal Categorical Multidrug resistance 0 = no, 1 = yes Categorical 2.2 Membership Functions Gaussian MF: μ ( x )= e − ( x − c )2/2 σ 2 where c is the center and σ is the width of the curve. Triangular MF: μ ( x )=max(0,min(x-a/b-a, c-x/c-b) where a, b, and c are the left, center, and right parameters. For both MF types, initial parameters were set based on expert knowledge. For Gaussian, centers were equally spaced and widths set to 0.2; for triangular, parameters were defined to cover the input range with 50% overlap. 2.3 Particle Swarm Optimization for Concurrent Tuning PSO was used to concurrently optimize all MF parameters (centers and widths for Gaussian; a, b, c for triangular) and the consequent parameters (linear coefficients) of the neuro‑fuzzy model. The particle representation concatenated all parameters into a single vector. The fitness function was classification accuracy on the training set. PSO parameters were: swarm size = 50, max iterations = 200, c 1 = c 2 = 2.0, ω linearly decreased from 0.9 to 0.4. Each experiment was repeated 10 times. 2.4 Dataset and Evaluation Data were obtained from the Centers for Disease Control and Prevention (CDC) online TB information system [8], comprising 1200 subjects (850 TB cases, 350 controls). Data were split into training (70%) and testing (30%). Performance was evaluated using sensitivity, specificity, and accuracy. 3. Findings 3.1 Performance Comparison Table 2 shows the performance of the baseline neuro‑fuzzy model (without PSO) and the PSO‑optimized models with Gaussian and triangular MFs. Table 2: Performance Comparison on Test Set Model Sensitivity (%) Specificity (%) Accuracy (%) NF (baseline) 71 68 70 NF‑PSO (Triangular) 79 72 77 NF‑PSO (Gaussian) 86 79 85 The Gaussian‑based model significantly outperformed the triangular‑based model p < 0.01, McNemar’s test. The improvements are attributed to the smoothness of Gaussian functions, which better represent gradual transitions between symptom severity levels. 3.2 Convergence Analysis There was the convergence of the global best fitness (accuracy) over 200 iterations for both MF types. The Gaussian model reached 80% accuracy by iteration 40 and stabilized at 85% after 100 iterations. The triangular model required 150 iterations to stabilize at 77%. The standard deviation across runs was ±1.2% for Gaussian and ±2.0% for triangular, indicating greater robustness for Gaussian MFs. 3.3 Sensitivity of PSO Parameters We evaluated the effect of PSO parameters on the Gaussian model. Four configurations were tested: 1. Constant ω = 0.7, c 1 = c 2 = 2.0 2. Linear decreasing ω from 0.9 to 0.4, c 1 = c 2 = 2.0 (default) 3. Linear decreasing ω, 0.4, c 1 = 2.5, c 2 = 1.5 4. Linear decreasing ω, c 1 = 1.5, c 2 = 2.5 Table 3 presents the results. Table 3: PSO Parameter Sensitivity (Accuracy % ± SD) Configuration Accuracy (%) Constant ω = 0.7 82.3 ± 2.1 Default (decreasing ω, c1=c2=2) 85.1 ± 1.2 c1=2.5, c2=1.5 83.9 ± 1.7 c1=1.5, c2=2.5 84.5 ± 1.4 The default configuration with decreasing inertia and balanced coefficients gave the best performance for both MF types, but the Gaussian model showed higher accuracy across all configurations. 3.4 Optimized Membership Functions The Gaussian and triangular MFs for temperature (a representative input) was optimized using PSO optimization. The Gaussian MFs shifted and narrowed to better fit the data distribution, while the triangular MFs also adjusted but produced sharper boundaries. The overlapping regions in Gaussian MFs allowed smoother transitions between linguistic terms, contributing to higher diagnostic accuracy. 4. Discussion 4.1 Why Gaussian Outperforms Triangular The superior performance of Gaussian MFs can be explained by their smoothness and infinite support, which allow gradual transitions between categories. In clinical settings, symptom severity is rarely crisp; patients may fall between categories. Gaussian MFs naturally represent this fuzziness, whereas triangular MFs impose linear segments with abrupt changes at vertices [6]. The PSO algorithm effectively exploited the smoothness to fine‑tune centers and widths, achieving better alignment with the underlying data distribution. 4.2 Practical Implications For medical diagnosis systems, the choice of MF type is not trivial. This study provides empirical evidence that Gaussian MFs, when optimized concurrently with neural network weights using PSO, yield significantly higher accuracy. The computational cost is marginally higher due to more complex derivative calculations, but the performance gains justify the trade‑off. 4.3 Limitations This study used a single dataset; results may vary with different data distributions. The comparison was limited to Gaussian and triangular shapes; other shapes (trapezoidal, bell, etc.) were not tested. Additionally, the model was validated only on clinical variables; incorporating imaging data might interact differently with MF shapes. 5. Conclusion and Recommendations 5.1 Conclusion This study compared Gaussian and triangular membership functions within a PSO‑optimized neuro‑fuzzy framework for TB diagnosis. The Gaussian‑based model achieved 85% accuracy, significantly outperforming the triangular‑based model (77%). Convergence analysis showed faster and more stable optimization for Gaussian MFs. The results provide strong evidence that Gaussian membership functions are better suited for medical diagnosis tasks where categories overlap. 5.2 Recommendations Based on these findings, we recommend: 1. Prefer Gaussian MFs for neuro‑fuzzy medical diagnosis systems, especially when using global optimization techniques like PSO. 2. Use concurrent optimization of MF parameters and network weights to achieve synergy. 3. Adopt PSO with decreasing inertia weight and balanced acceleration coefficients for robust convergence. 4. Explore other smooth MF families (e.g., Cauchy, logistic) in future studies to further improve performance. References Zadeh, L. A. (1965). Fuzzy sets. Information and Control, 8(3), 338–353. Ali, O. A. M., Ali, A. Y., & Sumait, B. S. (2015). Comparison between the effects of different types of membership functions on fuzzy logic controller performance. International Journal, 76, 76–83. Dim, C. C., & Dim, N. R. (2013). Trends of tuberculosis prevalence and treatment outcome in an under‑resourced setting: the case of Enugu state, South East Nigeria. Nigerian Medical Journal, 54(6), 392. Djam, X., & Kimbi, Y. (2011). A decision support system for tuberculosis diagnosis. The Pacific Journal of Science and Technology, 12(2), 410–425. Omisore, M. O., Samuel, O. W., & Atajeromavwo, E. J. (2017). A genetic‑neuro‑fuzzy inferential model for diagnosis of tuberculosis. Applied Computing and Informatics, 13(1), 27–37. Musikasuwan, S., & Garibaldi, J. (2006). Exploring Gaussian and triangular primary membership functions in non‑stationary fuzzy sets. Proceedings of IPMU, 1654–1661. Jang, J. S. R. (1993). ANFIS: adaptive‑network‑based fuzzy inference system. IEEE Transactions on Systems, Man, and Cybernetics, 23(3), 665–685. Centers for Disease Control and Prevention. (2018). Online Tuberculosis Information System (OTIS). Available at: https://wonder.cdc.gov/TB-v2018.html Additional Declarations The authors declare no competing interests. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-9201866","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":610803874,"identity":"67ee6c83-6939-47d5-900c-0c4b40e7c4c3","order_by":0,"name":"Oluwatosin Ogunbodede","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABCUlEQVRIiWNgGAWjYJCCAxCKB4SYGfhB7IQC3Mp5MLRINoC0GODXgmCCtBiATcCjxZ69/eHhAgYbuw23ew8+eFNhLWd8fnXihwcGDPL8Ygew28JzxuDwDIa05A13ziUbzjmTbmx24+1mCaDDDGfOTsCuRSKH4TAPw+Fkgxs5ZtK8bYcTt904uwGkJcHgNi4t6Q+QtPw7XL95xtnNP/BrSTAAabGDaGk4nGDA37sNvy1ngH7hMUhLkLyRB/TLsXTDGTd4t1kkGEjg9At7e/vjzzwVNvZ8N3KBIVZjLc/ff3bzzR8VNvL80ti1QIABQ2IDnCMBVimBRzkE2COY/AcIqh4Fo2AUjIKRBQBKmGAudXiaaAAAAABJRU5ErkJggg==","orcid":"","institution":"Bells University of Technology","correspondingAuthor":true,"prefix":"","firstName":"Oluwatosin","middleName":"","lastName":"Ogunbodede","suffix":""},{"id":610803875,"identity":"759d5a17-6453-4676-ac6b-88e70a579acb","order_by":1,"name":"Benjamin Aribisala","email":"","orcid":"","institution":"Lagos State University","correspondingAuthor":false,"prefix":"","firstName":"Benjamin","middleName":"","lastName":"Aribisala","suffix":""}],"badges":[],"createdAt":"2026-03-23 14:37:12","currentVersionCode":1,"declarations":{"humanSubjects":false,"vertebrateSubjects":false,"conflictsOfInterestStatement":false,"humanSubjectEthicalGuidelines":false,"humanSubjectConsent":false,"humanSubjectClinicalTrial":false,"humanSubjectCaseReport":false,"vertebrateSubjectEthicalGuidelines":false},"doi":"10.21203/rs.3.rs-9201866/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-9201866/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":105356582,"identity":"2e8461dc-88c3-4173-a01e-2897e2136339","added_by":"auto","created_at":"2026-03-25 06:57:05","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":333495,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-9201866/v1/1c66aef2-b34c-4be6-a010-92f6795c85bf.pdf"}],"financialInterests":"The authors declare no competing interests.","formattedTitle":"\u003cp\u003eOptimizing Fuzzy Membership Functions for Tuberculosis Diagnosis: A Comparative Study of Gaussian and Triangular Functions with PSO\u003c/p\u003e","fulltext":[{"header":"1. Introduction","content":"\u003cp\u003eFuzzy logic systems are widely used in medical diagnosis because they can represent uncertainty and imprecision through linguistic variables and membership functions (MFs) [1]. The shape of the MF—whether triangular, trapezoidal, or Gaussian—affects how inputs are mapped to fuzzy sets and ultimately influences diagnostic accuracy [2]. In neuro‑fuzzy systems, these MFs can be adapted through learning, but the choice of MF type remains a critical design decision.\u003c/p\u003e\n\u003cp\u003eTuberculosis (TB) diagnosis is particularly challenging due to overlapping symptoms with other respiratory diseases [3]. Computational models that combine fuzzy logic with neural networks have shown promise, yet the optimal MF type for such applications has not been systematically investigated [4,5]. Most studies use triangular MFs for simplicity, but Gaussian MFs, with their smooth transitions, may better represent clinical concepts where categories overlap [6].\u003c/p\u003e\n\u003cp\u003eThis study compares the performance of Gaussian and triangular membership functions within a neuro‑fuzzy framework for TB diagnosis, where both the MF parameters and the neural network weights are concurrently optimized using particle swarm optimization (PSO). The objectives are: (1) to evaluate the impact of MF shape on diagnostic accuracy, (2) to analyze convergence behavior during PSO optimization, (3) to assess the sensitivity of PSO control parameters, and (4) to provide recommendations for MF selection in medical diagnostic systems.\u003c/p\u003e"},{"header":"2. Methodology","content":"\u003cp\u003e2.1 Neuro‑Fuzzy Model Architecture\u003c/p\u003e\n\u003cp\u003eThe neuro‑fuzzy model is a five‑layer adaptive network implementing a first‑order Takagi–Sugeno fuzzy inference system [7]. The input layer receives ten clinical variables (Table 1). The fuzzification layer maps each input to five linguistic terms (very mild, mild, moderate, severe, very severe) using either Gaussian or triangular MFs.\u003c/p\u003e\n\u003cp\u003eTable 1: Diagnostic Variables Used in the Study\u003c/p\u003e\n\u003ctable border=\"1\" cellspacing=\"0\" cellpadding=\"0\"\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eVariable\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eDescription\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eType\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eAlcohol/nicotine use \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0=none, 1-stopped, 2=current\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCategorical\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eDrug usage/addictions \u0026nbsp;\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0 = no, 1 = yes \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCategorical\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eImmune disorder \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0 = no, 1 = yes (HIV, cancer, etc.) \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCategorical\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003ePrevious TB infection \u0026nbsp;\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0 = no, 1 = yes \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCategorical\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eBlood pressure \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0 = low, 1 = normal, 2 = high \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCategorical\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eTemperature\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0 = low, 1 = normal, 2 = high \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCategorical\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003ePulse\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0 = abnormal, 1 = normal \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCategorical\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eChest X‑ray result \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0 = abnormal, 1 = normal \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCategorical\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eBlood clotting test \u0026nbsp; \u0026nbsp;\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0 = abnormal, 1 = normal \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCategorical\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eMultidrug resistance \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e0 = no, 1 = yes \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCategorical\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003e2.2 Membership Functions\u003c/p\u003e\n\u003cp\u003eGaussian MF: \u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eμ\u003c/em\u003e(\u003cem\u003ex\u003c/em\u003e)=\u003cem\u003ee\u003c/em\u003e\u003csup\u003e− (\u003cem\u003ex\u003c/em\u003e−\u003cem\u003ec\u003c/em\u003e)2/2\u003cem\u003eσ\u003c/em\u003e2\u003c/sup\u003e\u003c/p\u003e\n\u003cp\u003ewhere c is the center and \u003cem\u003eσ\u0026nbsp;\u003c/em\u003eis the width of the curve.\u003c/p\u003e\n\u003cp\u003eTriangular MF: \u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eμ\u003c/em\u003e(\u003cem\u003ex\u003c/em\u003e)=max(0,min(x-a/b-a, c-x/c-b)\u003c/p\u003e\n\u003cp\u003ewhere a, b, and c are the left, center, and right parameters.\u003c/p\u003e\n\u003cp\u003eFor both MF types, initial parameters were set based on expert knowledge. For Gaussian, centers were equally spaced and widths set to 0.2; for triangular, parameters were defined to cover the input range with 50% overlap.\u003c/p\u003e\n\u003cp\u003e2.3 Particle Swarm Optimization for Concurrent Tuning\u003c/p\u003e\n\u003cp\u003ePSO was used to concurrently optimize all MF parameters (centers and widths for Gaussian; a, b, c for triangular) and the consequent parameters (linear coefficients) of the neuro‑fuzzy model. The particle representation concatenated all parameters into a single vector. The fitness function was classification accuracy on the training set. PSO parameters were: swarm size = 50, max iterations = 200, c\u003csub\u003e1\u003c/sub\u003e = c\u003csub\u003e2\u003c/sub\u003e = 2.0, \u003cem\u003eω\u0026nbsp;\u003c/em\u003elinearly decreased from 0.9 to 0.4. Each experiment was repeated 10 times.\u003c/p\u003e\n\u003cp\u003e2.4 Dataset and Evaluation\u003c/p\u003e\n\u003cp\u003eData were obtained from the Centers for Disease Control and Prevention (CDC) online TB information system [8], comprising 1200 subjects (850 TB cases, 350 controls). Data were split into training (70%) and testing (30%). Performance was evaluated using sensitivity, specificity, and accuracy.\u003c/p\u003e"},{"header":"3. Findings","content":"\u003cp\u003e3.1 Performance Comparison\u003c/p\u003e\n\u003cp\u003eTable 2 shows the performance of the baseline neuro‑fuzzy model (without PSO) and the PSO‑optimized models with Gaussian and triangular MFs.\u003c/p\u003e\n\u003cp\u003eTable 2: Performance Comparison on Test Set\u003c/p\u003e\n\u003ctable border=\"1\" cellspacing=\"0\" cellpadding=\"0\"\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eModel\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eSensitivity (%)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eSpecificity (%)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eAccuracy (%)\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eNF (baseline)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e71\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e68\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e70\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eNF‑PSO (Triangular)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e79\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e72\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e77\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eNF‑PSO (Gaussian)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e86\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e79\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e85\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eThe Gaussian‑based model significantly outperformed the triangular‑based model p \u0026lt; 0.01, McNemar’s test. The improvements are attributed to the smoothness of Gaussian functions, which better represent gradual transitions between symptom severity levels.\u003c/p\u003e\n\u003cp\u003e3.2 Convergence Analysis\u003c/p\u003e\n\u003cp\u003eThere was the convergence of the global best fitness (accuracy) over 200 iterations for both MF types.\u003c/p\u003e\n\u003cp\u003eThe Gaussian model reached 80% accuracy by iteration 40 and stabilized at 85% after 100 iterations. The triangular model required 150 iterations to stabilize at 77%. The standard deviation across runs was ±1.2% for Gaussian and ±2.0% for triangular, indicating greater robustness for Gaussian MFs.\u003c/p\u003e\n\u003cp\u003e3.3 Sensitivity of PSO Parameters\u003c/p\u003e\n\u003cp\u003eWe evaluated the effect of PSO parameters on the Gaussian model. Four configurations were tested:\u003c/p\u003e\n\u003cp\u003e1. Constant \u003cem\u003eω\u003c/em\u003e= 0.7, c\u003csub\u003e1\u003c/sub\u003e = c\u003csub\u003e2\u003c/sub\u003e= 2.0\u003c/p\u003e\n\u003cp\u003e2. Linear decreasing \u003cem\u003eω\u0026nbsp;\u003c/em\u003efrom 0.9 to 0.4, c\u003csub\u003e1\u003c/sub\u003e = c\u003csub\u003e2\u0026nbsp;\u003c/sub\u003e= 2.0 \u0026nbsp;(default) \u0026nbsp;\u003c/p\u003e\n\u003cp\u003e3. Linear decreasing \u003cem\u003eω,\u0026nbsp;\u003c/em\u003e0.4, c\u003csub\u003e1\u003c/sub\u003e = 2.5, c\u003csub\u003e2\u003c/sub\u003e= 1.5\u003c/p\u003e\n\u003cp\u003e4. Linear decreasing \u003cem\u003eω,\u0026nbsp;\u003c/em\u003ec\u003csub\u003e1\u0026nbsp;\u003c/sub\u003e= 1.5, c\u003csub\u003e2\u003c/sub\u003e= 2.5\u003c/p\u003e\n\u003cp\u003eTable 3 presents the results.\u003c/p\u003e\n\u003cp\u003eTable 3: PSO Parameter Sensitivity (Accuracy % ± SD)\u003c/p\u003e\n\u003ctable border=\"1\" cellspacing=\"0\" cellpadding=\"0\"\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eConfiguration\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e\u003cstrong\u003eAccuracy (%)\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eConstant ω = 0.7\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e82.3 ± 2.1\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eDefault (decreasing ω, c1=c2=2)\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e85.1 ± 1.2\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003ec1=2.5, c2=1.5\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e83.9 ± 1.7\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003ec1=1.5, c2=2.5\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003e84.5 ± 1.4\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eThe default configuration with decreasing inertia and balanced coefficients gave the best performance for both MF types, but the Gaussian model showed higher accuracy across all configurations.\u003c/p\u003e\n\u003cp\u003e3.4 Optimized Membership Functions\u003c/p\u003e\n\u003cp\u003eThe Gaussian and triangular MFs for temperature (a representative input) was optimized using PSO optimization.\u003c/p\u003e\n\u003cp\u003eThe Gaussian MFs shifted and narrowed to better fit the data distribution, while the triangular MFs also adjusted but produced sharper boundaries. The overlapping regions in Gaussian MFs allowed smoother transitions between linguistic terms, contributing to higher diagnostic accuracy.\u003c/p\u003e"},{"header":"4. Discussion","content":"\u003cp\u003e4.1 Why Gaussian Outperforms Triangular\u003c/p\u003e\n\u003cp\u003eThe superior performance of Gaussian MFs can be explained by their smoothness and infinite support, which allow gradual transitions between categories. In clinical settings, symptom severity is rarely crisp; patients may fall between categories. Gaussian MFs naturally represent this fuzziness, whereas triangular MFs impose linear segments with abrupt changes at vertices [6]. The PSO algorithm effectively exploited the smoothness to fine‑tune centers and widths, achieving better alignment with the underlying data distribution.\u003c/p\u003e\n\u003cp\u003e4.2 Practical Implications\u003c/p\u003e\n\u003cp\u003eFor medical diagnosis systems, the choice of MF type is not trivial. This study provides empirical evidence that Gaussian MFs, when optimized concurrently with neural network weights using PSO, yield significantly higher accuracy. The computational cost is marginally higher due to more complex derivative calculations, but the performance gains justify the trade‑off.\u003c/p\u003e\n\u003cp\u003e4.3 Limitations\u003c/p\u003e\n\u003cp\u003eThis study used a single dataset; results may vary with different data distributions. The comparison was limited to Gaussian and triangular shapes; other shapes (trapezoidal, bell, etc.) were not tested. Additionally, the model was validated only on clinical variables; incorporating imaging data might interact differently with MF shapes.\u003c/p\u003e"},{"header":"5. Conclusion and Recommendations","content":"\u003cp\u003e5.1 Conclusion\u003c/p\u003e\n\u003cp\u003eThis study compared Gaussian and triangular membership functions within a PSO‑optimized neuro‑fuzzy framework for TB diagnosis. The Gaussian‑based model achieved 85% accuracy, significantly outperforming the triangular‑based model (77%). Convergence analysis showed faster and more stable optimization for Gaussian MFs. The results provide strong evidence that Gaussian membership functions are better suited for medical diagnosis tasks where categories overlap.\u003c/p\u003e\n\u003cp\u003e5.2 Recommendations\u003c/p\u003e\n\u003cp\u003eBased on these findings, we recommend:\u003c/p\u003e\n\u003cp\u003e1. Prefer Gaussian MFs for neuro‑fuzzy medical diagnosis systems, especially when using global optimization techniques like PSO.\u003c/p\u003e\n\u003cp\u003e2. Use concurrent optimization of MF parameters and network weights to achieve synergy.\u003c/p\u003e\n\u003cp\u003e3. Adopt PSO with decreasing inertia weight and balanced acceleration coefficients for robust convergence.\u003c/p\u003e\n\u003cp\u003e4. Explore other smooth MF families (e.g., Cauchy, logistic) in future studies to further improve performance.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\n\u003cli\u003eZadeh, L. A. (1965). Fuzzy sets. Information and Control, 8(3), 338\u0026ndash;353. \u003c/li\u003e\n\u003cli\u003eAli, O. A. M., Ali, A. Y., \u0026amp; Sumait, B. S. (2015). Comparison between the effects of different types of membership functions on fuzzy logic controller performance. International Journal, 76, 76\u0026ndash;83. \u003c/li\u003e\n\u003cli\u003eDim, C. C., \u0026amp; Dim, N. R. (2013). Trends of tuberculosis prevalence and treatment outcome in an under‑resourced setting: the case of Enugu state, South East Nigeria. Nigerian Medical Journal, 54(6), 392. \u003c/li\u003e\n\u003cli\u003eDjam, X., \u0026amp; Kimbi, Y. (2011). A decision support system for tuberculosis diagnosis. The Pacific Journal of Science and Technology, 12(2), 410\u0026ndash;425. \u003c/li\u003e\n\u003cli\u003eOmisore, M. O., Samuel, O. W., \u0026amp; Atajeromavwo, E. J. (2017). A genetic‑neuro‑fuzzy inferential model for diagnosis of tuberculosis. Applied Computing and Informatics, 13(1), 27\u0026ndash;37. \u003c/li\u003e\n\u003cli\u003eMusikasuwan, S., \u0026amp; Garibaldi, J. (2006). Exploring Gaussian and triangular primary membership functions in non‑stationary fuzzy sets. Proceedings of IPMU, 1654\u0026ndash;1661. \u003c/li\u003e\n\u003cli\u003eJang, J. S. R. (1993). ANFIS: adaptive‑network‑based fuzzy inference system. IEEE Transactions on Systems, Man, and Cybernetics, 23(3), 665\u0026ndash;685. \u003c/li\u003e\n\u003cli\u003eCenters for Disease Control and Prevention. (2018). Online Tuberculosis Information System (OTIS). Available at: https://wonder.cdc.gov/TB-v2018.html\u003c/li\u003e\n\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"Lagos State University","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Membership functions, Gaussian, triangular, particle swarm optimization, tuberculosis diagnosis, neuro‑fuzzy systems","lastPublishedDoi":"10.21203/rs.3.rs-9201866/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-9201866/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eIn fuzzy logic‑based diagnostic systems, the shape of membership functions (MFs) significantly influences model performance. This study investigates the impact of Gaussian versus triangular MFs on tuberculosis (TB) diagnosis within a neuro‑fuzzy framework optimized by particle swarm optimization (PSO). Using a dataset of 1200 subjects (850 TB cases, 350 controls) from the Centers for Disease Control and Prevention, we compared two model variants: one with Gaussian MFs and one with triangular MFs, both optimized concurrently with neural network weights via PSO. A baseline neuro‑fuzzy model (without PSO) served as a reference. The Gaussian‑based PSO‑optimized model achieved 86% sensitivity, 79% specificity, and 85% accuracy, outperforming the triangular‑based variant (79% sensitivity, 72% specificity, 77% accuracy). Convergence analysis showed that the Gaussian model reached stable optimum within 100 iterations, whereas the triangular model required 150 iterations. Sensitivity analysis of PSO parameters revealed that a linearly decreasing inertia weight (0.9→0.4) and balanced acceleration coefficients (c₁ = c₂ = 2.0) yielded best results for both MF types. The Gaussian MFs produced smoother decision boundaries and better handled overlapping clinical categories, as reflected in higher performance. This study provides empirical evidence that Gaussian membership functions, when optimized concurrently with network weights using PSO, lead to superior diagnostic accuracy, and offers practical guidance for designing high‑performance neuro‑fuzzy medical diagnosis systems.\u003c/p\u003e","manuscriptTitle":"Optimizing Fuzzy Membership Functions for Tuberculosis Diagnosis: A Comparative Study of Gaussian and Triangular Functions with PSO","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2026-03-25 06:56:23","doi":"10.21203/rs.3.rs-9201866/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"5cc95a11-21d2-40a1-b919-f3ef25ed4ec2","owner":[],"postedDate":"March 25th, 2026","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2026-03-25T06:56:23+00:00","versionOfRecord":[],"versionCreatedAt":"2026-03-25 06:56:23","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-9201866","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-9201866","identity":"rs-9201866","version":["v1"]},"buildId":"XKTyCvWXoU3ODBz1xrDgd","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.