Modelo de clasificación binaria (fractura / normal) sobre radiografías óseas.
Desarrollado como proyecto final de Aprendizaje Computacional (Ingeniería de
Sistemas, Universidad de Córdoba).
Prueba el modelo en el Space de Hugging Face:
👉
stevenrq8/fracturas-rayos-x
1from huggingface_hub import hf_hub_download
2from tensorflow import keras
3import numpy as np
4from PIL import Image
5
6model = keras.models.load_model(
7 hf_hub_download("stevenrq8/fracturas-modelo", "best_mobilenet.keras")
8)
9
10UMBRAL = 0.310
11IMG_SIZE = (224, 224)
12
13img = Image.open("radiografia.jpg").convert("RGB").resize(IMG_SIZE)
14arr = np.asarray(img, dtype="float32")[None, ...]
15p = float(model.predict(arr).ravel()[0])
16etiqueta = "FRACTURA" if p >= UMBRAL else "NORMAL"
17print(f"{etiqueta} — P(fractura) = {p:.1%}")
El split oficial tenía 63 % de duplicados y 873 grupos con fuga entre
train/val/test. Se deduplicó y re-dividió antes del entrenamiento:
Se eligió MobileNetV2 por su mejor equilibrio entre recall, AUC y tamaño
(viable en hardware CPU gratuito).