AI-supported tuberculosis detection and medical education
This research explored how two complementary areas of artificial intelligence can be combined to address these challenges: computer vision for the analysis of chest X-ray images and Retrieval-Augmented Generation (RAG) for providing educational information grounded in medical literature.
Part of the research presented in this success story was carried out by Nikola Kavarić as part of his MSc thesis in Software Engineering at the Faculty for Information Systems and Technologies, University of Donja Gorica.
CHALLANGE
Tuberculosis remains an important global health challenge, where timely detection and access to reliable medical information are essential. Chest X-ray imaging is widely used in the assessment of pulmonary disease, but its interpretation requires specialist expertise, while access to such expertise may be limited in some settings. At the same time, patients, students, and healthcare professionals increasingly need efficient access to trustworthy and understandable medical information.
SOLUTION
A modular AI prototype was developed that combines image-based tuberculosis detection with an educational RAG component.
The computer vision module included a custom Convolutional Neural Network (CNN) for binary classification of chest X-rays as normal or tuberculosis-related, together with YOLOv7 and YOLOv8 models for exploring the localization of pathological regions. Publicly available chest X-ray datasets were prepared and processed for model development, with particular attention to dataset balancing, augmentation, and separation of training, validation, and test data.
The CNN model achieved 97% accuracy on the test dataset, demonstrating the potential of deep learning for automated analysis of chest X-rays within the scope of the experiment. The YOLO models further demonstrated the concept of localizing potentially relevant regions, although their results also highlighted the importance of larger and better-balanced annotated datasets for future development.
Alongside the visual component, a RAG-based educational prototype was implemented. Instead of relying only on knowledge embedded in a large language model, the system retrieves relevant information from a local collection of medical documents and uses it as context when generating responses. This provides a foundation for interactive educational tools in which users can ask questions about tuberculosis and receive answers grounded in selected medical literature.

GPU-accelerated computing supported experimentation and training of the deep-learning models. The CNN development was performed in a Google Colab environment using an NVIDIA Tesla T4 GPU, together with Python-based machine-learning frameworks including TensorFlow, Keras, and PyTorch.
The resulting work demonstrates a modular approach in which computer vision and generative AI technologies can complement each other: one component analyses medical imagery, while another provides literature-grounded educational information. At this stage, the system should be regarded as a research and educational prototype rather than a clinically validated diagnostic system.
BENEFITS
- Automated chest X-ray analysis, with the CNN achieving 97% accuracy on the test dataset used in the study.
- Exploration of lesion localization through YOLO-based object detection models, providing a basis for further research with larger annotated datasets.
- Integration of computer vision and generative AI within a modular prototype addressing both image analysis and access to medical information.
- Literature-grounded educational assistance through RAG, reducing reliance on unconstrained language-model responses.
- A foundation for future AI-supported educational tools for students, healthcare professionals, and other users interested in tuberculosis.
- Development of practical AI and advanced-computing competencies, demonstrating how GPU computing can support experimentation with multiple deep-learning architectures in healthcare-related research.

