AI Pneumonia Detector – Pneumonia detection by AI logo

AI Pneumonia Detector – Pneumonia detection by AI

Web application using artificial intelligence to analyze chest X-rays and detect pneumonia. The project compares two machine learning approaches (CNN and KNN) and allows testing models online via an interactive interface.

View site

Project description

Context

Pneumonia is a lung infection that can be detected from chest X-rays. Analysing these images usually requires the expertise of a healthcare professional, but machine learning techniques can now automate part of this detection.

AI Pneumonia Detector is a medical AI application prototype that analyses chest X-rays to identify possible pneumonia. The project uses a dataset of 5856 real X-rays provided as part of the AI/Data engineering curriculum at Epitech.

The project aims to compare different machine learning approaches for medical image classification and explore their effectiveness in detecting lung pathologies.

Problem

Medical X-ray analysis generally relies on human expertise. However, in some contexts, decision-support tools based on artificial intelligence can:

  • speed up medical image analysis
  • assist healthcare professionals
  • identify visual anomalies in X-rays.

The challenge is to train a model capable of correctly distinguishing normal chest X-rays from those showing signs of pneumonia, while assessing the reliability of predictions.

Solution

The application implements two machine learning approaches for X-ray classification:

A CNN (Convolutional Neural Network) model specialised in image analysis.

A KNN (K-Nearest Neighbors) model used as a baseline for comparison with a simpler machine learning approach.

X-rays are preprocessed into grayscale images and resized before being used for model training.

The CNN model uses a convolutional neural network architecture to automatically extract relevant visual features from the images.

A web interface then allows testing the models in real time.

Users can:

  • select sample X-rays
  • upload their own images
  • get an instant prediction (NORMAL or PNEUMONIA)
  • view the probabilities associated with each class.

Key features

  • AI analysis of chest X-rays
  • comparison of two machine learning approaches (CNN vs KNN)
  • interactive web interface to test the models
  • custom image upload for analysis
  • display of classification probabilities
  • visualisation of performance metrics.

Results

Both models were evaluated on an independent test set.

The CNN model achieves the best performance with:

  • accuracy of around 95%
  • an ROC curve with AUC close to 0.99

The KNN model reaches an accuracy of around 93%, showing that a simpler approach can already produce correct results, but remains less effective than a convolutional neural network for medical image analysis.

These results confirm the effectiveness of deep learning models for chest X-ray image classification.

Development environment

Vue.jsVue.js
TypeScriptTypeScript
Tailwind CSSTailwindCSS
PythonPython
FastAPIFastAPI

Have a similar project? Let's talk

Looking for a freelance developer to bring your idea to life? Let's discuss your web, mobile or software project together.

Contact me