Logistic Regression from Scratch for Pneumonia Detection in Chest X-Rays Built a binary classific...Logistic Regression from Scratch for Pneumonia Detection in Chest X-Rays Built a binary classific...
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
Logistic Regression from Scratch for Pneumonia Detection in Chest X-Rays Built a binary classification model from scratch (no ML libraries — implemented gradient descent and the loss function manually) to detect pneumonia from chest X-ray images, for a Numerical Methods course project.
Preprocessing: converted each X-ray into a 32x32 grayscale image, flattened into a normalized vector, and balanced the training set to have equal numbers of NORMAL and PNEUMONIA cases to avoid class bias.
Model: binary classifier using a tanh-based activation function, trained via gradient descent with manually derived partial derivatives (no autograd).
Process: tested 5 different learning rates (alpha = 0.0001 to 0.5) to find the best trade-off between convergence speed and stability, tracking MSE on both train and test sets across iterations.
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started