File size: 4,758 Bytes
f0bfa55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
---

license: mit
tags:
- health
- fitness
- calorie-prediction
- tensorflow
- wellness
datasets:
- synthetic
metrics:
- mae
- rmse
library_name: tensorflow
pipeline_tag: tabular-regression
---


# 🏃‍♂️ VitaMind AI - Calorie Goal Predictor

**Personalized daily calorie recommendations using AI**

## Model Description

VitaMind AI predicts optimal daily calorie intake based on:
- Demographics (age, gender, height, weight)
- Activity metrics (steps, heart rate)
- Lifestyle factors (sleep, stress, mood)
- Activity level (sedentary to athlete)

## Performance

- **MAE**: 75 kcal
- **RMSE**: 95 kcal  
- **MAPE**: 3.2%
- **R² Score**: 0.89

## Quick Start

```python

from huggingface_hub import hf_hub_download

import tensorflow as tf

import joblib

import numpy as np



# Download model

model = tf.keras.models.load_model(

    hf_hub_download(repo_id="developerPratik/vitamind-calorie-predictor", filename="model.keras")

)

scaler = joblib.load(

    hf_hub_download(repo_id="developerPratik/vitamind-calorie-predictor", filename="scaler.joblib")

)

encoders = joblib.load(

    hf_hub_download(repo_id="developerPratik/vitamind-calorie-predictor", filename="encoders.joblib")

)



# Example prediction

user_data = {

    'age': 30, 'weight': 75, 'height': 175, 'steps': 8000,

    'heart_rate': 72, 'sleep_hours': 7.5, 'stress_level': 4,

    'activity_level': 'Active', 'gender': 'M', 'mood': 'happy'

}



# Feature engineering

bmi = user_data['weight'] / ((user_data['height'] / 100) ** 2)

good_sleep = 1 if user_data['sleep_hours'] >= 7 else 0

high_stress = 1 if user_data['stress_level'] >= 7 else 0

activity_scores = {'Sedentary': 1, 'Lightly Active': 2, 'Active': 3, 'Very Active': 4, 'Athlete': 5}



# Encode

activity_encoded = encoders['activity_level'].transform([user_data['activity_level']])[0]

gender_encoded = encoders['gender'].transform([user_data['gender']])[0]

mood_encoded = encoders['mood'].transform([user_data['mood']])[0]



# Create feature vector (14 features)

features = np.array([[

    user_data['age'], user_data['weight'], user_data['height'],

    user_data['steps'], user_data['heart_rate'], user_data['sleep_hours'],

    user_data['stress_level'], bmi, activity_encoded, gender_encoded,

    mood_encoded, good_sleep, high_stress, activity_scores[user_data['activity_level']]

]])



# Predict

features_scaled = scaler.transform(features)

calories = model.predict(features_scaled, verbose=0)[0][0]

print(f"Recommended daily calories: {calories:.0f} kcal")

```

## Model Architecture

```

Input (14 features)


Dense(256) + BatchNorm + Dropout(0.3)


Dense(128) + BatchNorm + Dropout(0.3)  [Residual Connection]


Dense(128) + BatchNorm + Dropout(0.3)


Dense(64) + BatchNorm + Dropout(0.2)


Output (1 - calories)

```

**Total Parameters**: ~85,000

## Features

| Feature | Type | Description |
|---------|------|-------------|
| age | int | Age in years (18-100) |
| weight | float | Weight in kg (40-150) |
| height | float | Height in cm (140-220) |
| steps | int | Daily steps (0-30000) |
| heart_rate | int | Resting heart rate (50-120) |

| sleep_hours | float | Hours of sleep (3-12) |
| stress_level | int | Stress rating (1-10) |

| bmi | float | Calculated BMI |

| activity_level | str | Sedentary/Lightly Active/Active/Very Active/Athlete |
| gender | str | M/F |
| mood | str | happy/neutral/sad/anxious |
| good_sleep | binary | 1 if sleep >= 7 hours |

| high_stress | binary | 1 if stress >= 7 |
| activity_score | int | 1-5 based on activity level |



## Limitations



⚠️ **Important Disclaimers**:

- For educational/wellness purposes only

- NOT a substitute for professional medical advice

- Individual metabolism varies significantly

- Does not account for medical conditions

- Consult healthcare providers for medical decisions



## Training Details



- **Framework**: TensorFlow 2.15

- **Training samples**: 5,000 synthetic

- **Validation split**: 15%

- **Test split**: 15%

- **Optimizer**: Adam (lr=0.001 with ReduceLROnPlateau)

- **Loss**: MSE

- **Regularization**: L2 (0.001) + Dropout + BatchNorm

- **Early stopping**: Patience=30



## License



MIT License - Free for commercial and personal use



## Citation



```bibtex

@software{vitamind_ai_2025,

  author = {{Your Name}},

  title = {{VitaMind AI Calorie Predictor}},

  year = {2025},

  publisher = {Hugging Face},

  url = {{https://huggingface.co/developerPratik/vitamind-calorie-predictor}}

}

```



## Contact



- **Issues**: Open an issue on this model's discussion page

- **Email**: your.email@example.com



---



Built with ❤️ using TensorFlow and scikit-learn