ML / 03 · Computer Vision

COVID-19 Chest X-Ray Classification

Classifying chest X-ray images into diagnostic categories, while specifically testing how image preprocessing choices change what a neural network actually learns.

TensorFlowKerasANNComputer visionImage preprocessing
69.2%test accuracy
69.2%test recall
78.0%train accuracy (best)
4preprocessing variants tested

The problem

Chest X-ray classification is a common deep-learning benchmark, but raw model accuracy alone hides an important engineering question: which image representation actually gives the network usable signal? Color channels can just as easily encode scanner artifacts as clinical information.

Approach

Four artificial neural networks were trained on the identical architecture, varying only the input preprocessing: raw RGB images, grayscale conversion, and Gaussian-blurred variants. Each was evaluated on matched train, validation, and held-out test splits so the comparison isolates the effect of preprocessing rather than architecture.

Preprocessing comparison

InputTrain accuracyValidation accuracy
RGB (baseline)44.0%44.0%
Grayscale — selected78.0%76.0%

The grayscale model was carried to the held-out test set, scoring 69.2% accuracy, 69.2% recall, 69.5% precision, 69.2% F1 — a meaningful drop from validation, which the notebook flags directly as a generalization gap worth further regularization work rather than papering over.

Key insight

The RGB model essentially failed to learn (44% ≈ near-random for this class balance), while the grayscale conversion alone nearly doubled effective accuracy. Color channels were adding noise, not signal — a reminder that preprocessing choices can matter more than architecture tuning.

View source notebook ↗ Back to all projects