Spaces:
Sleeping
Sleeping
|
Download README.md from ftmhr/Grp2_CardioLens: direct link, hf CLI and curl.
- Browser
- Download file 4.97 kB
-
https://huggingface.co/spaces/ftmhr/Grp2_CardioLens/resolve/main/README.md
- Command line
-
hf download hf://spaces/ftmhr/Grp2_CardioLens/README.md
-
curl -L -o README.md https://huggingface.co/spaces/ftmhr/Grp2_CardioLens/resolve/main/README.md
4.97 kB
| title: CardioLens ECG Detective | |
| sdk: gradio | |
| sdk_version: 5.49.1 | |
| python_version: "3.11" | |
| app_file: app.py | |
| # CardioLens ECG Detective | |
| Interface: original CardioLens Gradio layout and controls by member 3, integrated with the ECG model and evidence functions. | |
| Academic demonstration. Use the included project ECGs and fictional history. | |
| 1. **Examine:** the original CPU waveform CNN predicts rhythm labels. On three included | |
| demonstrations only, the frozen Qwen FAST/SLOW adapter reads the same lead-II | |
| image used in validation. XQRS candidate detections from lead II and a second lead (V2 first, with V1, I or V5 as fallback) are | |
| checked for agreement, then shown on a separate plot with four numbered consecutive gaps. These candidate locations | |
| and timing estimates are not a validated ECG measurement or signal-quality test. | |
| 2. **Explain:** ask where the timing evidence appears, what a label means, or | |
| whether the models agree. Clinical Detective chooses a follow-up from fixed | |
| questions using the case history. The app supplies the factual response from | |
| recorded results and user history. | |
| 3. **Report:** candidate beat timing, restricted image result, model-suggested rhythm, user-reported history and limitations. | |
| The report is assembled from the active case; no findings are generated from scratch. | |
| The three cases deliberately include two earlier correct visual predictions and | |
| one error. They illustrate behaviour, not a new accuracy estimate. The FAST/SLOW | |
| adapter got 56/64 correct on a balanced, selected development panel. It does not | |
| classify normal-rate recordings, AFIB or other rhythms, and is not run on arbitrary | |
| uploads. The CNN has a separate 12-label task. No photo digitization, PR/QT measurements, or general ECG diagnosis is supported. | |
| ## Clinical Detective review | |
| The app chooses an ECG review priority based on missing timing, disagreement, or the CNN's rhythm suggestions. Follow-up questions depend on the case. Explicit answers about movement, rest/activity, or symptoms during the recording can change the next review step. Free text stays in the history and can inform question selection. These suggestions are for reviewing the existing ECG. | |
| Educational ECG references: [ESC supraventricular tachycardia guideline](https://academic.oup.com/eurheartj/article/41/5/655/5556821) and [ACC/AHA atrial fibrillation guideline](https://professional.heart.org/en/science-news/2023-acc-aha-accp-hrs-guideline-for-the-diagnosis-and-management-of-atrial-fibrillation). | |
| ## Reading the output | |
| The default chat starts with the rhythm suggestion, estimated rate and one case-specific review step. ECG evidence contains the plotted gaps and technical model details. The report is an editable review draft: recording, reported clinical context, measured findings, impression and next review step. A relevant disagreement is included; demo-only model status and calibration notes stay in ECG evidence. | |
| ## Showcase checklist | |
| - Choose a demo from Previous cases, click Analyse ECG, and open ECG evidence. Check that the numbered gaps match the trace. | |
| - In Clinical Detective, answer one follow-up with fictional history. Ask what you said and where the timing estimate came from. | |
| - Generate the report. Check that timing, image output, CNN suggestion and history are separate. | |
| - Click + to start a new case and check that the old conversation clears. On a waveform upload, confirm the image model is not applied. | |
| - Treat a FAST/SLOW mismatch as a finding to review, not a diagnosis. The QRS extension is not included. | |
| ## Running | |
| Use a compatible CUDA GPU for the visual model. Install requirements, then | |
| run `python app.py` or use the Gradio Space configuration above. The pinned | |
| base weights are downloaded on first use. The CPU CNN and template flow can | |
| run without CUDA, but that does not demonstrate the image task. Test the | |
| actual hosting environment before the showcase. No Space has been published | |
| by this package. | |
| ## Sources | |
| - Wagner, Strodthoff, Bousseljot, Samek, and Schaeffter (2022), | |
| PTB-XL v1.0.3, [PhysioNet](https://physionet.org/content/ptb-xl/1.0.3/), | |
| DOI 10.13026/kfzx-aw45, CC BY 4.0. The included records are prepared | |
| 100 Hz waveforms and rendered lead-II plots. Keep the dataset attribution and licence. | |
| - [Qwen2.5-VL-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct): | |
| base revision is in demo_manifest.json. Review the upstream licence before publishing. | |
| - [WFDB XQRS](https://wfdb.readthedocs.io/en/latest/processing.html) candidate beat detector. | |
| ## Lead-II QRS duration estimate | |
| Analysis automatically estimates candidate lead-II boundaries and durations. Ask the Detective about a span or the median duration. The model is unchanged from the LUDB training and PTB-XL transfer experiments. PTB-XL duration agreement within 20 ms of ECGDeli was 70.9%; agreement was lower for longer estimates. No wide-QRS flag, clinical measurement, or change to the rhythm classifier. | |