--- title: Phronesis Medical Report Generator emoji: ๐Ÿง  colorFrom: green colorTo: gray sdk: gradio sdk_version: 5.4.0 app_file: app.py pinned: false short_description: 'REPORT GEN AND CLASSIFICATION MODEL ' --- # ๐Ÿง  Phronesis: Medical Image Diagnosis & Report Generator **Phronesis** is a multimodal AI tool that classifies medical CT scan images (DICOM or standard formats) and generates diagnostic reports using a combination of video classification and medical language generation. --- ## ๐Ÿš€ Demo Upload a set of DICOM (`.dcm`, `.ima`) or image (`.png`, `.jpg`) files representing slices of a CT scan. The model will: - ๐Ÿท๏ธ Predict a class: **acute**, **normal**, **chronic**, or **lacunar** - ๐Ÿ“‹ Generate a short **radiology report** [Live App โ†’](https://huggingface.co/spaces/baliddeki/phronesis-ml-endpoint) --- ## ๐Ÿ—๏ธ Model Architecture - **Vision Backbone**: `3D ResNet-18` pretrained on Kinetics-400 - **Language Head**: `BioBART v2` (pretrained biomedical seq2seq model) - **Bridge Module**: Custom `ImageToTextProjector` to align visual features with the language model - **CombinedModel**: Unified architecture for classification + report generation --- ## ๐Ÿงช Tasks - **Image Classification**: Categorizes brain CT scans into one of four classes. - **Report Generation**: Produces diagnostic text conditioned on image features. --- ## ๐Ÿ–ผ๏ธ Input Format - Minimum 1, maximum ~30 image slices per scan. - Acceptable file formats: - DICOM (`.dcm`, `.ima`) - PNG, JPEG The model will sample or pad the series to 16 frames for temporal context. --- ## ๐Ÿ“ฆ Dependencies This app uses: - `torch` - `transformers` - `torchvision` - `huggingface_hub` - `pydicom` - `gradio` - `PIL`, `numpy` --- ## ๐Ÿ” Notes - This demo loads a private model from the Hugging Face Hub. Set your `HF_TOKEN` as a secret for the space if needed. - Do **not use for real clinical decisions** โ€“ intended for research/demo only. --- ## ๐Ÿ™‹โ€โ™‚๏ธ Credits Developed by [@baliddeki](https://huggingface.co/baliddeki) Model weights: [`baliddeki/phronesis-ml`](https://huggingface.co/baliddeki/phronesis-ml) Language model: [`GanjinZero/biobart-v2-base`](https://huggingface.co/GanjinZero/biobart-v2-base) --- ## ๐Ÿ“„ License MIT or Apache 2.0 (add yours here)