Commit Β·
6a7066b
1
Parent(s): e94a239
update: Add ajustes no README.md
Browse files- Dockerfile +2 -1
- src/main.py +11 -62
Dockerfile
CHANGED
|
@@ -11,7 +11,8 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
| 11 |
TRANSFORMERS_CACHE=/tmp/.cache/huggingface/transformers \
|
| 12 |
HUGGINGFACE_HUB_CACHE=/tmp/.cache/huggingface/hub\
|
| 13 |
PAPER_URL=https://ieeexplore.ieee.org/Xplore/home.jsp\
|
| 14 |
-
PAPER_TITLE=
|
|
|
|
| 15 |
|
| 16 |
RUN useradd -m -u 1000 user
|
| 17 |
|
|
|
|
| 11 |
TRANSFORMERS_CACHE=/tmp/.cache/huggingface/transformers \
|
| 12 |
HUGGINGFACE_HUB_CACHE=/tmp/.cache/huggingface/hub\
|
| 13 |
PAPER_URL=https://ieeexplore.ieee.org/Xplore/home.jsp\
|
| 14 |
+
PAPER_TITLE='RG-DermNet: A Multimodal Attention-Based Model with Residual Block Usage for Skin Lesion Classification'\
|
| 15 |
+
PAPER_DESCRIPTION='Skin cancer accounts for nearly one-third of all diag-\nnosed tumors worldwide, making early and accurate recognition\ncritical for improving patient outcomes. In this work, we pro-\npose RG-DermNet, a multimodal deep learning framework that\nintegrates skin lesion images with structured clinical metadata\nthrough a residual gated-attention (RG-ATT) fusion mechanism.\nThe architecture combines CNN- and Transformer-based visual\nbackbones with a lightweight one-hot encoding pipeline for meta-\ndata, enabling effective cross-modal interaction. The proposed\nmodel is evaluated using a patient-wise cross-validation protocol\nacross four dermatological datasets with heterogeneous metadata.\nOn PAD-UFES-20, using Caformer-B36 as the visual backbone,\nRG-DermNet achieves an accuracy of 0.75 Β± 0.05, balanced\naccuracy of 0.78 Β± 0.03, F1-score of 0.77 Β± 0.04, and AUC of\n0.95 Β± 0.01, outperforming existing multimodal baselines under\nthe same evaluation setting. In addition, a SHAP-based analysis\nprovides insights into the contribution of clinical metadata to\nthe modelβs predictions, supporting both performance gains and\ninterpretability.'
|
| 16 |
|
| 17 |
RUN useradd -m -u 1000 user
|
| 18 |
|
src/main.py
CHANGED
|
@@ -232,7 +232,7 @@ def build_paper_card():
|
|
| 232 |
def build_hero():
|
| 233 |
return """
|
| 234 |
<div class="hero">
|
| 235 |
-
<h1>π¬ Multimodal Skin Lesion
|
| 236 |
<p>
|
| 237 |
This interactive scientific demo presents a multimodal skin lesion analysis system that combines
|
| 238 |
clinical images and patient metadata to generate predictions and GradCAM++ explanations.
|
|
@@ -357,67 +357,6 @@ with gr.Blocks(
|
|
| 357 |
with gr.Column(elem_classes="main-shell"):
|
| 358 |
gr.HTML(build_hero())
|
| 359 |
|
| 360 |
-
with gr.Group(elem_classes="section-card"):
|
| 361 |
-
gr.Markdown("## π Paper and Scientific Context")
|
| 362 |
-
with gr.Row():
|
| 363 |
-
with gr.Column(scale=1):
|
| 364 |
-
gr.HTML(build_paper_card())
|
| 365 |
-
with gr.Column(scale=1):
|
| 366 |
-
gr.Markdown(
|
| 367 |
-
"""
|
| 368 |
-
### Scientific Context
|
| 369 |
-
|
| 370 |
-
This Space accompanies a multimodal deep learning framework for skin lesion analysis.
|
| 371 |
-
It was designed as an interactive companion to the paper, enabling direct exploration of:
|
| 372 |
-
|
| 373 |
-
- metadata-aware prediction behavior
|
| 374 |
-
- qualitative GradCAM++ attention patterns
|
| 375 |
-
- differences across pretrained multimodal attention mechanisms
|
| 376 |
-
|
| 377 |
-
The goal is to make the proposed method easier to inspect, understand, and communicate.
|
| 378 |
-
""",
|
| 379 |
-
elem_classes="soft-text",
|
| 380 |
-
)
|
| 381 |
-
|
| 382 |
-
with gr.Accordion("π Full Paper Preview", open=False):
|
| 383 |
-
gr.HTML(build_paper_embed())
|
| 384 |
-
|
| 385 |
-
with gr.Group(elem_classes="section-card"):
|
| 386 |
-
gr.Markdown("## π§ Method Pipeline")
|
| 387 |
-
|
| 388 |
-
with gr.Row():
|
| 389 |
-
with gr.Column(scale=1):
|
| 390 |
-
gr.HTML(
|
| 391 |
-
"""
|
| 392 |
-
<div class="pipeline-box">
|
| 393 |
-
<h3>Input</h3>
|
| 394 |
-
<p>Clinical image and structured patient metadata are jointly provided to the system.</p>
|
| 395 |
-
</div>
|
| 396 |
-
"""
|
| 397 |
-
)
|
| 398 |
-
with gr.Column(scale=0):
|
| 399 |
-
gr.HTML('<div class="pipeline-arrow">β</div>')
|
| 400 |
-
with gr.Column(scale=1):
|
| 401 |
-
gr.HTML(
|
| 402 |
-
"""
|
| 403 |
-
<div class="pipeline-box">
|
| 404 |
-
<h3>Multimodal Model</h3>
|
| 405 |
-
<p>Attention-based fusion integrates visual evidence with metadata-aware reasoning.</p>
|
| 406 |
-
</div>
|
| 407 |
-
"""
|
| 408 |
-
)
|
| 409 |
-
with gr.Column(scale=0):
|
| 410 |
-
gr.HTML('<div class="pipeline-arrow">β</div>')
|
| 411 |
-
with gr.Column(scale=1):
|
| 412 |
-
gr.HTML(
|
| 413 |
-
"""
|
| 414 |
-
<div class="pipeline-box">
|
| 415 |
-
<h3>Output</h3>
|
| 416 |
-
<p>The model returns a diagnosis, confidence information, and a GradCAM++ attention map.</p>
|
| 417 |
-
</div>
|
| 418 |
-
"""
|
| 419 |
-
)
|
| 420 |
-
|
| 421 |
with gr.Group(elem_classes="section-card"):
|
| 422 |
gr.Markdown("## π§ͺ Interactive Demonstration")
|
| 423 |
gr.Markdown(
|
|
@@ -502,6 +441,16 @@ The goal is to make the proposed method easier to inspect, understand, and commu
|
|
| 502 |
"""
|
| 503 |
If you reference this demo in a paper, thesis, or presentation, cite the associated manuscript
|
| 504 |
and include the Hugging Face Space as supplementary interactive material.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 505 |
""",
|
| 506 |
elem_classes="footer-note",
|
| 507 |
)
|
|
|
|
| 232 |
def build_hero():
|
| 233 |
return """
|
| 234 |
<div class="hero">
|
| 235 |
+
<h1>π¬ RG-DermNet: A Multimodal Attention-Based Model with Residual Block Usage for Skin Lesion Classification </h1>
|
| 236 |
<p>
|
| 237 |
This interactive scientific demo presents a multimodal skin lesion analysis system that combines
|
| 238 |
clinical images and patient metadata to generate predictions and GradCAM++ explanations.
|
|
|
|
| 357 |
with gr.Column(elem_classes="main-shell"):
|
| 358 |
gr.HTML(build_hero())
|
| 359 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 360 |
with gr.Group(elem_classes="section-card"):
|
| 361 |
gr.Markdown("## π§ͺ Interactive Demonstration")
|
| 362 |
gr.Markdown(
|
|
|
|
| 441 |
"""
|
| 442 |
If you reference this demo in a paper, thesis, or presentation, cite the associated manuscript
|
| 443 |
and include the Hugging Face Space as supplementary interactive material.
|
| 444 |
+
|
| 445 |
+
BibTeX:
|
| 446 |
+
|
| 447 |
+
@inproceedings{rocha2026rgdermnet,
|
| 448 |
+
title = {RG-DermNet: A Multimodal Attention-Based Model with Residual Block Usage for Skin Lesion Classification},
|
| 449 |
+
author = {Rocha, Wyctor F. and Bouzon, Pedro H. G. and Ramos, Lucas A. and Pacheco, Andre G. C. and Souza Jr., Luis A.},
|
| 450 |
+
booktitle = {International Joint Conference on Neural Networks (IJCNN)},
|
| 451 |
+
year = {2026},
|
| 452 |
+
note = {Accepted}
|
| 453 |
+
}
|
| 454 |
""",
|
| 455 |
elem_classes="footer-note",
|
| 456 |
)
|