File size: 4,515 Bytes
0a122b6
 
 
 
6c9d443
 
 
 
 
 
88e33a9
6c9d443
 
 
 
 
 
0a122b6
 
7252754
0a122b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
license: apache-2.0
---

<div align="center">
 <h1>Body Fat Prediction using Neural Networks</h1>
 <img src="https://img.shields.io/badge/TensorFlow-2.0+-FF6F00?style=flat&logo=tensorflow&logoColor=white"/>
 <img src="https://img.shields.io/badge/Python-3.7+-3776AB?style=flat&logo=python&logoColor=white"/>
 <img src="https://img.shields.io/badge/Keras-2.0+-D00000?style=flat&logo=keras&logoColor=white"/>
 <img src="https://img.shields.io/badge/Jupyter-Notebook-F37626?style=flat&logo=jupyter&logoColor=white"/>
 <img src="https://img.shields.io/badge/License-Apache2.0-green?style=flat"/>
</div>
<br/>

This project implements advanced neural network models for accurate prediction of body fat percentage using anthropometric measurements. Through comprehensive analysis and optimization, we've developed both full-feature and reduced-input models that achieve high accuracy while maintaining practical applicability.


## Model Details

- **Developed by:** ChanMeng666
- **Model type:** Multi-layer perceptron (MLP) neural network
- **Language(s):** Python
- **License:** Apache-2.0
- **Finetuned from model:** No - trained from scratch

## Model Description

This modelcard aims to be a base template for body fat percentage estimation using anthropometric measurements. Two variants are provided:

### Full Input Model
- 14 input features
- 20 neurons in hidden layer
- Achieves R² = 0.9724, MSE = 1.9250
- Optimal for maximum accuracy

### Reduced Input Model  
- 9 input features
- 5 neurons in hidden layer 
- Achieves R² = 0.9617, MSE = 2.6734
- Optimized for efficiency

Both models use sigmoid activation for hidden layer and linear activation for output layer.

## Uses

### Direct Use
The models can be used directly for body fat percentage estimation from anthropometric measurements:

```python
# Example usage
import tensorflow as keras

model = keras.models.load_model('best_full_model.keras')
predictions = model.predict(measurements)
```

### Downstream Use
- Integration into health and fitness applications
- Clinical body composition assessment
- Research studies on body composition
- Personal health monitoring systems

## Training Details

### Training Data
- Dataset contains anthropometric measurements including:
  - Body circumference measurements (neck, chest, abdomen, hip, thigh, knee, etc.)
  - Height and weight
  - Body density measurements
- Data split: 60% training, 20% validation, 20% test

### Training Procedure
- Optimizer: Adam with learning rate 0.1
- Loss function: Mean Squared Error
- Batch size: 32
- Early stopping with patience 100
- Random seed: 123 for reproducibility

## Evaluation

### Testing Data, Factors & Metrics
- Evaluated on 20% held-out test set
- Metrics: R² score and Mean Squared Error (MSE)
- Results validated across different body types and measurement ranges

### Model Performance
| Model Type | R² (All) | MSE (All) | R² (Test) | MSE (Test) |
|------------|----------|-----------|-----------|------------|
| Full Input | 0.9724 | 1.9250 | 0.9671 | 1.5301 |
| Reduced Input | 0.9617 | 2.6734 | 0.9394 | 2.8187 |

## Bias, Risks, and Limitations

- Models require accurate anthropometric measurements
- Performance may vary across different demographic groups
- Not intended to replace medical assessments
- Results should be interpreted by qualified professionals
- Model accuracy depends on measurement precision

## Recommendations

Users (both direct and downstream) should:
- Ensure accurate measurement techniques
- Consider using the full input model when maximum accuracy is required
- Use the reduced input model when efficiency is prioritized
- Validate results against other assessment methods
- Consider demographic and individual factors in interpretation

## Technical Specifications

### Model Architecture
- Input layer: 14 features (full) or 9 features (reduced)
- Hidden layer: 20 neurons (full) or 5 neurons (reduced) with sigmoid activation
- Output layer: 1 neuron with linear activation

### Hardware Used
- Training compatible with standard CPU
- GPU optional for faster training
- Minimal memory requirements

### Software Requirements
- TensorFlow 2.0+
- Python 3.7+
- Keras 2.0+
- NumPy
- Pandas

## Citation

If you use this model, please cite it as:
```
@software{ChanMeng666_2024_bodyfat_estimation_mlp,
  author = {ChanMeng666},
  title = {Body Fat Estimation using Neural Networks},
  year = {2024},
  publisher = {Hugging Face},
  url = {https://huggingface.co/ChanMeng666/bodyfat-estimation-mlp}
}
```