Datasets:
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- image-classification
|
| 5 |
+
tags:
|
| 6 |
+
- body-composition
|
| 7 |
+
- body-fat
|
| 8 |
+
- auto-labeled
|
| 9 |
+
- efficientnet
|
| 10 |
+
- regression
|
| 11 |
+
- torso
|
| 12 |
+
- fitness
|
| 13 |
+
- health
|
| 14 |
+
pretty_name: "Gold Body Fat Dataset"
|
| 15 |
+
size_categories:
|
| 16 |
+
- 1K<n<10K
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# 🏋️ gold_label_male_torso_dataset
|
| 20 |
+
|
| 21 |
+
Dataset de torsos masculinos frontales con porcentaje de grasa corporal (WBFP) **auto-etiquetado**.
|
| 22 |
+
|
| 23 |
+
## 📊 Estadísticas del Dataset
|
| 24 |
+
|
| 25 |
+
| Métrica | Valor |
|
| 26 |
+
|---|---|
|
| 27 |
+
| **Total de muestras** | 299 |
|
| 28 |
+
| **WBFP medio** | 15.6% |
|
| 29 |
+
| **Desviación estándar** | 5.7% |
|
| 30 |
+
| **Rango** | 5.9% – 34.9% |
|
| 31 |
+
|
| 32 |
+
## 📋 Columnas del Dataset
|
| 33 |
+
|
| 34 |
+
| Columna | Tipo | Descripción |
|
| 35 |
+
|---|---|---|
|
| 36 |
+
| `image` | `Image` | Imagen PIL del torso frontal |
|
| 37 |
+
| `wbfp` | `float64` | Porcentaje de grasa corporal (WBFP) |
|
| 38 |
+
|
| 39 |
+
## 🧠 Modelo de Auto-Etiquetado
|
| 40 |
+
|
| 41 |
+
Las etiquetas auto-generadas fueron producidas usando un modelo **EfficientNetV2-M** entrenado
|
| 42 |
+
mediante **fine-tuning en dos etapas**:
|
| 43 |
+
|
| 44 |
+
- **Backbone**: EfficientNetV2-M (`torchvision/efficientnet_v2_m`) preentrenado en ImageNet
|
| 45 |
+
- **Cabeza**: `Dropout(0.418) → Linear(in→256) → ReLU → Dropout(0.209) → Linear(256→1)`
|
| 46 |
+
|
| 47 |
+
### Resultados en Test (23 muestras DEXA)
|
| 48 |
+
|
| 49 |
+
| Etapa | SEE | MAE | Pearson |
|
| 50 |
+
|-------|-----|-----|--------|
|
| 51 |
+
| Etapa 1 (solo auto-etiquetado) | 6.808 | 5.167 | 0.629 |
|
| 52 |
+
| Etapa 2 (+ fine-tuning DEXA) | **3.850** | **2.983** | **0.872** |
|
| 53 |
+
|
| 54 |
+
### Hiperparámetros (Optuna)
|
| 55 |
+
|
| 56 |
+
**Etapa 1 (auto-etiquetado):** lr=0.000206, weight_decay=0.009216, dropout=0.197
|
| 57 |
+
|
| 58 |
+
**Etapa 2 (DEXA fine-tuning):** lr=0.000105, weight_decay=0.000018, dropout=0.418
|
| 59 |
+
|
| 60 |
+
> ⚠️ **Nota**: Las 299 muestras auto-etiquetadas son **predicciones automáticas** del modelo,
|
| 61 |
+
> no mediciones reales.
|
| 62 |
+
|
| 63 |
+
## 📦 Fuentes de Datos
|
| 64 |
+
|
| 65 |
+
### Auto-etiquetado
|
| 66 |
+
Las imágenes auto-etiquetadas provienen de
|
| 67 |
+
[`MasterMIARFID/unlabeled_male_torso_dataset`](https://huggingface.co/datasets/MasterMIARFID/unlabeled_male_torso_dataset),
|
| 68 |
+
un dataset de torsos masculinos frontales recopilado y filtrado mediante:
|
| 69 |
+
- Detección de pose YOLOv8 para crop de torso
|
| 70 |
+
- Filtros CLIP para verificar que sean fotos sin camiseta y frontales
|
| 71 |
+
- Deduplicación por embeddings CLIP + FAISS
|
| 72 |
+
|
| 73 |
+
## 🔧 Uso
|
| 74 |
+
|
| 75 |
+
### Cargar desde HuggingFace Hub
|
| 76 |
+
|
| 77 |
+
```python
|
| 78 |
+
from datasets import load_dataset
|
| 79 |
+
|
| 80 |
+
dataset = load_dataset("MasterMIARFID/gold_label_male_torso_dataset")
|
| 81 |
+
|
| 82 |
+
# Ver el primer ejemplo
|
| 83 |
+
sample = dataset["train"][0]
|
| 84 |
+
print(f"WBFP: {sample['wbfp']:.1f}%")
|
| 85 |
+
sample["image"].show()
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
### Usar con PyTorch DataLoader
|
| 89 |
+
|
| 90 |
+
```python
|
| 91 |
+
from datasets import load_dataset
|
| 92 |
+
from torch.utils.data import DataLoader
|
| 93 |
+
from torchvision import transforms
|
| 94 |
+
import torch
|
| 95 |
+
|
| 96 |
+
dataset = load_dataset("MasterMIARFID/gold_label_male_torso_dataset", split="train")
|
| 97 |
+
|
| 98 |
+
transform = transforms.Compose([
|
| 99 |
+
transforms.Resize((224, 224)),
|
| 100 |
+
transforms.ToTensor(),
|
| 101 |
+
transforms.Normalize(mean=[0.485, 0.456, 0.406],
|
| 102 |
+
std=[0.229, 0.224, 0.225]),
|
| 103 |
+
])
|
| 104 |
+
|
| 105 |
+
def collate_fn(batch):
|
| 106 |
+
images = [transform(sample["image"].convert("RGB")) for sample in batch]
|
| 107 |
+
targets = [sample["wbfp"] for sample in batch]
|
| 108 |
+
return {
|
| 109 |
+
"image": torch.stack(images),
|
| 110 |
+
"wbfp": torch.tensor(targets, dtype=torch.float32),
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
dataloader = DataLoader(dataset, batch_size=32, collate_fn=collate_fn, shuffle=True)
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
## 📄 Licencia
|
| 117 |
+
|
| 118 |
+
Este dataset está licenciado bajo **CC BY-NC 4.0** (uso no comercial).
|