PyHealth icon indicating copy to clipboard operation
PyHealth copied to clipboard

Implement ChestXRay Age Prediction model with visualizations

Open Tycheng10 opened this issue 1 month ago • 5 comments

Age Prediction Model from Chest X-rays

Overview This PR introduces a multi-task deep learning model for predicting patient age from chest X-ray images. The model combines regression for exact age prediction with classification into age groups, providing both precise estimates and categorical predictions.

Key Features

  • Multi-task learning combining age regression and group classification
  • DenseNet121 backbone pretrained on ImageNet
  • Transfer learning with selective layer freezing
  • Age group classification into 4 categories (Child, Young Adult, Middle Age, Elderly)
  • evaluation metrics and visualizations

Tycheng10 avatar Dec 06 '25 23:12 Tycheng10

Thank you for the feedback! I'll attempt to make these changes however my cloud environment has limitations and is incompatible with pyhealth==2.0a10, so I'll leave a comment in my code to address that

Tycheng10 avatar Dec 07 '25 18:12 Tycheng10

Thank you for the feedback! I'll attempt to make these changes however my cloud environment has limitations and is incompatible with pyhealth==2.0a10, so I'll leave a comment in my code to address that

Does installing from source work in your cloud environment? That's another way you could get access to the PyHealth CXR8 dataset implementation.

git clone [email protected]:sunlabuiuc/PyHealth.git
cd PyHealth && pip install -e .

EricSchrock avatar Dec 07 '25 18:12 EricSchrock

It does but is currently not allowing me to install certain dependencies due to some versioning issues with python that are due to the environment

Tycheng10 avatar Dec 07 '25 19:12 Tycheng10

It does but is currently not allowing me to install certain dependencies due to some versioning issues with python that are due to the environment

Have you tried Google Colab? That's what I generally use for my PyHealth contributions, so I know PyHealth successfully installs.

You may not be able to rerun your full training on the free tier, but that's actually fine in this case, as most of the PyHealth example notebooks only train for a few epochs (or even just one). The goal for example notebooks is to show how to use PyHealth, not to prove the performance of the models, so it makes sense to limit the amount of output shown so that it does not drown out the example code.

EricSchrock avatar Dec 07 '25 21:12 EricSchrock

Ive updated the PR with the modified implementation!

Tycheng10 avatar Dec 08 '25 02:12 Tycheng10