Hiyerarşik dikkatli kayan pencere yöntemi ile klinik metinlerin BERT tabanlı sınıflandırılması
BERT based classification of clinical texts using the hierarchical attention based sliding window method
- Tez No: 1028513
- Danışmanlar: DR. ÖĞR. ÜYESİ MUHAMMED KOTAN
- Tez Türü: Yüksek Lisans
- Konular: Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve Kontrol, Computer Engineering and Computer Science and Control
- Anahtar Kelimeler: Belirtilmemiş.
- Yıl: 2026
- Dil: Türkçe
- Üniversite: Sakarya Üniversitesi
- Enstitü: Fen Bilimleri Enstitüsü
- Ana Bilim Dalı: Bilişim Sistemleri Mühendisliği Ana Bilim Dalı
- Bilim Dalı: Belirtilmemiş.
- Sayfa Sayısı: Belirtilmemiş.
Özet
Yapay zekâ teknolojileri, sağlık sektöründe özellikle hastalık teşhisi, tedavi planlaması ve karmaşık test verilerinin işlenmesi gibi süreçlerde giderek daha merkezi ve dönüştürücü bir rol üstlenmektedir. Bu bağlamda, yapay zekanın büyük veri kümelerini analiz etme yeteneği, elektronik sağlık kayıtlarında (EHR) yer alan kapsamlı ve yapılandırılmamış tıbbi bilgilerin hızlı, kesin ve verimli bir şekilde değerlendirilmesini kolaylaştırmaktadır. Tıbbi doğal dil işleme (NLP) alanında temel bir çalışma alanı olan klinik metin sınıflandırması, otomatik tanı belirleme, hasta triyajının iyileştirilmesi ve klinik karar destek sistemlerinin oluşturulmasında doğrudan uygulamalara sahiptir. Bununla birlikte, belirli alanlarda başarı gösteren transformer tabanlı dil modellerinin karşılaştığı temel yapısal sorun, sabit uzunluktaki girdi sınırlamasıdır (512 token sınırlaması). Teşhis için gerekli olan klinik bulguların ve semptom kalıplarının metnin başında sınırlı kalmayıp metin boyunca dağınık olduğu cerrahi notlar, taburculuk özetleri ve radyoloji raporları gibi uzun belgelerin işlenmesi, kesintiye neden olan bir kısıtlama getirir; bu da modelin anlamsal tutarlılığı sağlama yeteneğini engeller ve önemli ölçüde bağlam kaybına yol açar. Bu çalışma, uzun klinik metinlerin işlenmesiyle bağlantılı önemli bağlamsal bilgi kaybını azaltmayı amaçlamaktadır; kayan pencere segmentasyon yaklaşımı ve hiyerarşik dikkat mekanizmasını içeren geliştirilmiş bir BioClinicalBERT modelini sunmaktadır. Bu entegre yöntem, yerel bağlamı ve cümleler arası bağlantıları korumak için uzun metinleri üst üste binen alt segmentlere böler ve ardından bu segmentleri hiyerarşik bir dikkat katmanı aracılığıyla belge düzeyinde birleştirerek küresel bir anlamsal temsil oluşturur. MTSamples veri seti üzerinde kapsamlı deneysel araştırmalar yapılmış ve klinik veri setlerinde yaygın olan sınıf dengesizliği sorununun, sentetik azınlık aşırı örnekleme tekniği (SMOTE) uygulanarak etkili bir şekilde azaltıldığı gösterilmiştir. Önerilen modelin etkinliği ve literatürdeki konumu, altı adet klasik makine öğrenmesi modeli, beş adet geleneksel derin öğrenme modeli ve altı adet transformer tabanlı dil modeli dahil olmak üzere çeşitli temel modellerle karşılaştırılarak değerlendirilmiştir. Kayan pencere segmentasyonu ve hiyerarşik dikkat mekanizmalarına dayanan BioClinicalBERT mimarisi, beş katlı çapraz doğrulama yöntemi kullanılarak doğrulanmış ve %89,15 ortalama doğruluk, %90,45 kesinlik, %88,60 hassaslık ve %89,52 F1 skoru elde ederek tüm karşılaştırma kategorilerini geride bırakmıştır. Geleneksel dil modelleri ile önerilen çerçeve arasındaki önemli performans farkı, uzun belgelerin kapsamlı analizi için kayan pencere segmentasyonu ve hiyerarşik dikkat mekanizmalarını entegre etmenin etkinliğini açıkça ortaya koymaktadır. Sonuçlar, bağlamı koruyan segmentasyon yöntemlerinin alanına özgü önceden eğitilmiş dil modelleriyle entegre edilmesinin, kapsamlı klinik metinler için oldukça etkili sınıflandırma sistemleri ürettiğini göstermektedir. Bu modellerin hastane bilgi sistemlerine entegre edilmesinin, otomatik triyaj süreçlerini hızlandıracağı ve evrak işleriyle ilgili olarak hekimlerin üzerindeki bilişsel yükü azaltarak klinik karar destek sistemlerini geliştireceği beklenmektedir.
Özet (Çeviri)
Artificial intelligence technologies are gaining an increasingly pivotal and transformative role in healthcare, especially in areas such as disease diagnosis, treatment planning and analysis of complex test data. The digitalisation of healthcare services has resulted in a huge growth of unstructured clinical narratives in electronic health records. Accurate and actionable diagnostic information extracted from these large repositories is of paramount importance for improving patient outcomes, optimising hospital workflows and facilitating evidence-based clinical decision making. Structured clinical texts are a basic requirement for healthcare professionals with the aim of properly planning and monitoring treatments. Yet, the increasing complexity of modern healthcare delivery and patient interaction has significantly worsened the documentation burden on medical staff. This important administrative load has traditionally been directly delegated to physicians and nurses, with unintended consequences being a significant reduction in direct patient care time. In today's clinical practice, physicians are increasingly tasked with splitting their limited cognitive attention and time between direct communication with the patient and the meticulous entry of data into electronic medical records. Such division not only undermines the depth and empathy of the doctor-patient relationship, but also threatens the completeness and accuracy of clinical documentation. Also, poor documentation has negative consequences from the patient's perspective. In particular, in the context of complex or chronic disease trajectories, incomplete, inconsistent or poorly structured medical data often lead to repetitive information requests, fragmented treatment processes and severe disruptions in the continuity of care across different medical specialists. This has led to increasing concerns among all stakeholders in the healthcare ecosystem about the burden of clinical documentation as it has a direct impact on the quality of point-of-care interactions. These systemic problems highlight the critical importance of systematic clinical record keeping where patient information is sorted into standardised, highly understandable formats. Structured documentation naturally improves interoperability between different health systems, strongly facilitates evidence-based clinical decisions and importantly enables secondary uses of data including population health analytics and overall healthcare research. It facilitates consistent, accurate and retrievable recording of important clinical observations such as diagnosis, prescriptions, allegories and follow-up instructions. The use of medical secretaries, human or digital, has become a prominent strategy to reduce such administrative costs and improve the efficiency of workflow. These professionals specialise in working with physicians by documenting patient encounters in real time, enabling physicians to shift their focus away from entering data and back to the patient. Medical scribes partner directly with the physician during the consultation, entering key information such as medical history, symptomatology, physical examination findings and treatment plan directly into the electronic health records. However, despite evidence that the presence of medical secretaries significantly increases physician satisfaction, optimises overall productivity and significantly reduces the time spent on administrative paperwork, this human-centered approach has some major limitations. Healthcare data is heavily regulated by strict privacy regulations such as the Health Insurance Portability and Accountability Act (HIPAA) which limits its exchange, access and broad use of third-party staff. Moreover, annotating clinical texts is very resource-intensive, as it requires deep domain expertise, making the data labelling process prohibitively expensive. This inherent limitation in data availability seriously hinders the development and fine-tuning of deep learning models that naturally rely on large amounts of well-labeled data for efficient training. This fundamental problem is exacerbated by the inherently imbalanced nature of medical data. Certain diseases or sub-domains of medicine are often under-represented, inevitably leading to algorithmic bias and degraded model performance in real-world settings. Moreover, the constant threat of variable quality of documentation and potential staff shortages that are characteristic of human-based approaches, presents a pressing and indisputable demand to develop fully automatic and highly reliable clinical text processing systems. Clinical text classification is a core research area of medical natural language processing with immediate and high-impact applications to automated diagnosis detection, improvement of patient triage protocols, and development of advanced clinical decision support systems. However, the computational challenge of extracting semantic meaning from medical narratives is non-trivial. Traditional natural language processing methods, while effective in broad, general-domain applications, often fall short of expected performance metrics when applied to the complex nuances of clinical texts. These classical methods tend to work on single, isolated units of words, completely ignoring the hierarchical nature of medical knowledge and the important contextual dependencies that are strictly necessary for proper clinical interpretation. To surpass these limitations, the research community began to explore more sophisticated computational paradigms, rigorously testing a wide variety of algorithms based on the principles of traditional machine learning and conventional deep learning. Within the frame of traditional machine learning models, algorithms like Logistic Regression, Support Vector Machines, Decision Trees, XGBoost, LightGBM and Gradient Boosting were extensively tested using features vectorized by TF-IDF. The investigations showed that, ensemble based gradient boosting methods structurally outperformed linear and singular tree models in capturing the features within the text data. Conventional deep learning architectures such as Convolutional Neural Networks, Long Short-Term Memory networks, Bidirectional LSTMs and Gated Recurrent Units were also evaluated. It was found that even if recurrent networks are able to handle sequential data, the best performance from the traditional deep learning methods was obtained by a hybrid architecture that merges the contextual understanding of Bidirectional LSTMs with the feature extraction abilities of Convolutional Neural Networks. The greatest breakthrough in natural language processing, however, has been the creation of pre-trained Transformer-based language models. These models have revolutionised the natural language processing tasks. However, these models have considerable limitations in the highly specialised healthcare industry. Transformers trained on general-domain data usually fail to understand domain-specific medical terms, temporal relationships between clinical events, and complex narrative structures that are unique to different medical specialities. For example, radiology reports often use rigid structured formats with predictable components whereas surgical operative notes often contain long, free-flowing procedural descriptions with highly specialised terminology. The dramatic differences in the standards of documentation present a major challenge for traditional classification approaches that treat all clinical texts as equal. However, for all the attempts to mitigate these limitations with domain-specific pre-training resulting in specialised models such as ClinicalBERT and BioClinicalBERT, a major structural shortcoming remains: the fixed-length input constraint, better known as the 512-token limit. Processing long clinical documents such as detailed operative notes or comprehensive discharge summaries is a disruptive limitation because the essential clinical findings and complex patterns of symptoms needed for accurate diagnosis are rarely found at the start of the text but rather are distributed sporadically throughout the entire document. Cutting these documents at the 512 token mark always degrades the model's ability to maintain global semantic coherence, and leads to a substantial, often catastrophic, loss of diagnostic context. To systematically address these multifaceted challenges, this study leveraged the comprehensive MTSamples (Medical Transcription Samples) dataset, which spans a broad spectrum of clinical texts across a range of medical specialities. The dataset underwent a series of rigors preprocessing steps, including the systematic removal of special characters and unnecessary whitespace, conversion to lowercase, and the careful elimination of non-informative stop words. To tackle the problem of excessive sparsity of data and to guarantee a robust model training without losing important clinical insights, the original forty granular medical specialities were logically merged into four main clinical macro-categories. The dataset had a severe class imbalance, which is a common phenomenon of medical corpora and often leads to biassed predictions, so the data was subjected to the Synthetic Minority Over-sampling Technique (SMOTE). It is worth noting that the SMOTE technique was only applied to the training folds during cross-validation to avoid data leakage and overly optimistic invalid performance estimation. This succeeded in achieving cross-class balance while maintaining the integrity of the validation and testing phases. This study, built on this rigorously prepared data foundation, proposes a new, improved architectural framework to fundamentally alleviate the significant contextual information loss of processing long clinical texts. At the heart of this work is the proposal of an advanced methodology that combines a sophisticated sliding window segmentation method with a hierarchical attention mechanism applied to domain-adapted Transformer models such as BioClinicalBERT. The integration is designed to strategically split long clinical documents into a sequence of overlapping sub-segments, carefully preserving local context and important inter-sentence links often lost in the normal truncation process. The Transformer model processes each segment separately, yielding localised embeddings. Then instead of simply averaging these segment representations, the architecture uses a hierarchical attention layer at document level. The attention mechanism acts as a global semantic aggregator, adaptively computing the diagnostic significance of each individual segment, and assigning higher computational weights to those parts of the text containing the most salient clinical indicators. This method efficiently models the cognitive process of a physician scanning a long medical record to identify key diagnostic criteria, generating a highly accurate and globally aware semantic representation of the entire document without being hindered by hardware-imposed token limitations. The proposed hierarchical sliding-window architecture was thoroughly assessed for its effectiveness, robustness, and literature standing by conducting comprehensive comparisons with a range of baseline models. In the rigorous evaluation, we tested six classical machine learning algorithms, five conventional deep learning architectures and six different Transformer-based language models (BERT, RoBERTa, BlueBERT, DistilBERT, ClinicalBERT and BioClinicalBERT in their default configurations). Empirical results showed that a vanilla Transformer model without the proposed segmentation architecture suffered from severe context loss in long clinical documents, leading to sub-optimal performance metrics. In contrast, the BioClinicalBERT architecture enhanced with our proposed sliding window segmentation and hierarchical attention mechanisms achieved unprecedented efficacy. The proposed framework was evaluated using a rigorous five-fold cross-validation and achieved impressive average performance scores of 89.15% accuracy, 90.45% precision, 88.60% recall, and 89.52% F1 score. The empirical evidence strongly supports the hypothesis that the combination of context preserving overlapping segmentation methods with domain-specific, pre-trained language models leads to highly robust and remarkably accurate classification systems for large amounts of clinical text. In conclusion, the study demonstrates that intelligent architectural design is the key to overcoming hardware limitations for effective analysis of unstructured medical data. The potential for future integration of such advanced, automated models into hospital information systems is enormous. We anticipate these systems will greatly speed automated patient triage, greatly increase the power of clinical decision support systems, and most importantly, greatly reduce the crushing cognitive and administrative documentation burden that currently besets healthcare professionals by reliably automating the extraction of diagnostic information from long and complicated electronic health records.
Benzer Tezler
- Improving self-attention based transformer performance for morphologically rich languages
Morfolojik açıdan zengin diller için öz dikkat tabanlı dönüştürücü performansının iyileştirilmesi
YİĞİT BEKİR KAYA
- Hazardous waste determination scale
Tehlikeli atıkların saptanması
DENİZ YALAV
Yüksek Lisans
İngilizce
1997
İstanbul Teknik ÜniversitesiÇevre Mühendisliği Ana Bilim Dalı
Yükleniyor...
- Çok ölçütlü sorun çözümüne yönelik bir bütünleşik karar destek modeli
Integrated decision aid model for multiattribute problem solving
YUSUF İLKER TOPÇU
- Fake news classification using machine learning and deep learning approaches
Makine öğrenimi ve derin öğrenme yaklaşımlarını kullanarak sahte haber sınıflandırması
SAJA ABDULHALEEM MAHMOOD AL-OBAIDI
- A Tutorial on cryptography
Kriptografi üzerine bilgisayar destekli eğitim
H.TURGUT UYAR
Yüksek Lisans
İngilizce
1992
İstanbul Teknik ÜniversitesiKontrol ve Bilgisayar Mühendisliği Ana Bilim Dalı
Yükleniyor...