Skip to content

heitorctm/PROJ-doctor_bone-AI_training

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Doctor Bone: Bone Age Estimation from X-Ray Images

Experimental study on bone age prediction from hand and wrist radiographs, comparing different convolutional neural network architectures with transfer learning. Developed at the VORTEX laboratory of Tec Unifor (Universidade de Fortaleza) in partnership with Nupem (Nuclear Research Center for Energy and Materials), following the MIDTs interdisciplinary methodology.

The system reduces the standard deviation of predictions from approximately one year to four months compared to manual radiological assessment, an activity that requires considerable clinical expertise.

Published paper: Doctor Bone: neural network training to assist bone age identification — Journal of Health Informatics, v.16, Special Edition CBIS 2024

Institutional coverage: Researchers at Tec Unifor develop AI to assess bone age in X-ray exams

Dr. Bone App


Results

Metric Value
0.9480
MAE 6.97 months

Results obtained on the test set with the best trained model. Two peer-reviewed articles published, with preliminary results presented at CBIS 2024.


Overview

[Hand and wrist X-ray]
        ↓
[Preprocessing + Gender mask]
   Male: red channel  |  Female: green channel
        ↓
[Pre-trained base model (ImageNet)]
   EfficientNetV2 / InceptionV3 / ResNet
        ↓
[Optional attention block]
   CBAM or Squeeze-and-Excitation
        ↓
[Pooling]
        ↓
[Dense layers with Dropout (configurable)]
        ↓
[Output: bone age in months (linear regression)]

The gender mask is a feature engineering technique that helps the network learn sexually dimorphic bone development patterns without adding trainable parameters.


Dataset

Split Images
Train 11,568 (75%)
Validation 1,542 (10%)
Test 2,314 (15%)
Total 15,424

The dataset combines the RSNA Radiological Society Pediatric Bone Age Challenge with 1,388 additional images. Metadata is stored in treino-validacao-teste.csv with columns id (filename), boneage (bone age in months) and male (patient sex).

Images are not included in this repository due to file volume and the sensitive nature of clinical content.


Evaluated Architectures

Family Models
EfficientNetV2 B3, S, M, L
Inception InceptionV3, InceptionResNetV2
ResNet ResNet50V2, ResNet152V2

All networks use pre-trained ImageNet weights with full fine-tuning.


Techniques

Transfer Learning and Fine-tuning ImageNet weights as starting point, with all layers unfrozen for training.

Gender-based Feature Engineering A color channel is added to the image based on patient sex, allowing the network to learn dimorphic bone development patterns.

Data Augmentation Random translation (±20% height, ±15% width), horizontal flip, rotation (±15%) and zoom (height: 20% to +10%, width: 30% to +10%).

Attention Blocks Optional per experiment: CBAM (channel and spatial attention) or Squeeze-and-Excitation.

Training Callbacks Early stopping (patience of 6 epochs), ReduceLROnPlateau (factor 0.5, patience of 2 epochs) and ModelCheckpoint with periodic and best-model saving.


Repository Structure

PROJ-02-doctor_bone/
├── doctor_bone.ipynb               # Main notebook: training and evaluation
├── treino-validacao-teste.csv      # Dataset metadata (15,424 samples)
├── auxiliar/
│   ├── arquiteturas.py             # Model definition and building
│   ├── attention_blocks.py         # CBAM and Squeeze-Excitation blocks
│   ├── callbacks.py                # Training callbacks configuration
│   ├── dataset.py                  # Image loading and preprocessing
│   ├── preprocess.py               # Preprocessing and gender mask
│   └── avaliar.py                  # Evaluation, metrics and experiment logs
└── README.md

Outputs generated during training:

redes/{NETWORK}/
├── modelos_salvos/                 # Weights saved per epoch and best model
└── log_treino/                     # Per-epoch metrics log (CSV)

log_teste/
├── log_teste.csv                   # Aggregated results across all experiments
└── previsoes/                      # Per-image predictions for each evaluated model

Installation and Usage

Requirements

pip install tensorflow pandas numpy scikit-learn matplotlib seaborn gputil efficientnet_v2

Training

jupyter notebook doctor_bone.ipynb

The notebook automatically configures the GPU, loads the CSV, applies the train/validation/test split and instantiates the selected model for training.

Experiment Configuration

The notebook is designed to systematically compare different architecture and hyperparameter combinations. Each run generates an automatic ID and results are consolidated in log_teste/log_teste.csv.

Parameter Options
Network EfficientNetV2B3, S, M, L / InceptionV3 / InceptionResNetV2 / ResNet50V2, 152V2
Epochs 100 (with early stopping)
Learning rate configurable (e.g. 0.0001)
Optimizer Adam, SGD, RMSprop
Loss MAE or MSE
Dense layers configurable (e.g. [1024, 256, 256])
Dropout configurable per layer
Attention None, SE or CBAM
Pooling Global Average, Global Max, Flatten

Team

Name Role
Heitor de Castro Teixeira Lead researcher, analysis and data science
Rodrigo Lages Barbosa Backend
Felipe Cassiano Mobile (Computer Science)
Rolf Matela Mobile (Systems Analysis and Development)
Joel Sotero da Cunha Neto Coordinator (VORTEX)
João Batista Furlan Coordinator (Nupem)

Developed at the VORTEX Laboratory of Tec Unifor in partnership with Nupem, both institutions maintained by Fundação Edson Queiroz, using the MIDTs interdisciplinary methodology.


Related Repositories


License

Property of the VORTEX Laboratory, Universidade de Fortaleza (UNIFOR).

About

"This project aims to provide a tool to assist physicians in analyzing carpal radiographs, a visual activity that requires considerable experience. By providing a diagnosis suggestion, the AI speeds up the analysis process and minimizes human errors." — João Batista Furlan, coordinator of Nupem and the Dr. Bone project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors