a-albiol commited on
Commit
d57ea6e
·
verified ·
1 Parent(s): 1f5355b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +228 -97
README.md CHANGED
@@ -1,199 +1,330 @@
1
  ---
 
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
 
 
11
 
12
  ## Model Details
13
 
14
  ### Model Description
15
 
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
 
28
- ### Model Sources [optional]
 
 
 
 
29
 
30
- <!-- Provide the basic links for the model. -->
31
 
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
 
36
  ## Uses
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
  ### Direct Use
41
 
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
 
44
- [More Information Needed]
 
 
 
45
 
46
- ### Downstream Use [optional]
47
 
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
 
50
- [More Information Needed]
 
 
 
51
 
52
  ### Out-of-Scope Use
53
 
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
 
56
- [More Information Needed]
 
 
 
 
57
 
58
  ## Bias, Risks, and Limitations
59
 
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
 
62
- [More Information Needed]
 
 
 
 
63
 
64
- ### Recommendations
65
 
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
 
 
 
67
 
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
 
70
- ## How to Get Started with the Model
 
 
 
 
71
 
72
- Use the code below to get started with the model.
73
 
74
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
  ## Training Details
77
 
78
  ### Training Data
79
 
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
 
84
- ### Training Procedure
 
 
85
 
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
 
88
- #### Preprocessing [optional]
89
 
90
- [More Information Needed]
91
 
 
 
 
 
 
92
 
93
  #### Training Hyperparameters
94
 
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
 
 
 
 
 
 
 
 
 
96
 
97
- #### Speeds, Sizes, Times [optional]
98
 
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
 
 
100
 
101
- [More Information Needed]
102
 
103
- ## Evaluation
 
 
 
104
 
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
 
107
  ### Testing Data, Factors & Metrics
108
 
109
  #### Testing Data
110
 
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
 
115
  #### Factors
116
 
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
 
 
120
 
121
  #### Metrics
122
 
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
 
 
 
126
 
127
  ### Results
128
 
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
 
141
  ## Environmental Impact
142
 
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
 
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
 
 
 
 
146
 
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
 
155
  ### Model Architecture and Objective
156
 
157
- [More Information Needed]
 
 
 
 
 
 
158
 
159
  ### Compute Infrastructure
160
 
161
- [More Information Needed]
162
-
163
  #### Hardware
164
 
165
- [More Information Needed]
 
 
166
 
167
  #### Software
168
 
169
- [More Information Needed]
 
 
 
 
170
 
171
- ## Citation [optional]
172
 
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
 
175
  **BibTeX:**
176
 
177
- [More Information Needed]
 
 
 
 
 
 
 
 
 
178
 
179
  **APA:**
180
 
181
- [More Information Needed]
 
 
182
 
183
- ## Glossary [optional]
 
 
 
 
 
184
 
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
 
187
- [More Information Needed]
188
 
189
- ## More Information [optional]
190
 
191
- [More Information Needed]
192
 
193
- ## Model Card Authors [optional]
194
 
195
- [More Information Needed]
196
 
197
  ## Model Card Contact
198
 
199
- [More Information Needed]
 
 
 
 
1
  ---
2
+ license: mit
3
  library_name: transformers
4
+ tags:
5
+ - fitness
6
+ - workout
7
+ - health
8
+ - text-generation
9
+ - t5
10
+ - flan-t5
11
+ - exercise
12
+ - personalized
13
+ - seq2seq
14
+ language:
15
+ - en
16
+ - es
17
+ datasets:
18
+ - onurSakar/GYM-Exercise
19
+ - niharika41298/gym-exercise-data
20
+ - yuhonas/free-exercise-db
21
+ pipeline_tag: text2text-generation
22
+ widget:
23
+ - text: 'Generate a workout for: {"training_phase": "weight_loss", "motivation": "wellbeing", "special_situation": "none"}'
24
+ example_title: "Weight Loss Workout"
25
+ - text: 'Generate a workout for: {"training_phase": "muscle_gain", "motivation": "self_improvement", "special_situation": "none"}'
26
+ example_title: "Muscle Building Workout"
27
+ - text: 'Generate a workout for: {"training_phase": "cardio_improve", "motivation": "medical_recommendation", "special_situation": "injury_recovery"}'
28
+ example_title: "Cardio Recovery Workout"
29
  ---
30
 
31
+ # AthenAI - AI-Powered Personalized Workout Generator
 
 
 
32
 
33
+ AthenAI is a fine-tuned FLAN-T5-base model designed to generate personalized workout routines based on user context, training goals, motivation, and special health situations. The model creates structured workout plans with multiple exercise blocks, duration estimates, and detailed instructions in JSON format.
34
 
35
  ## Model Details
36
 
37
  ### Model Description
38
 
39
+ AthenAI takes user context as input (training phase, motivation, special situations) and generates comprehensive workout plans tailored to individual needs. The model was trained on synthetic workout data derived from comprehensive exercise databases and can handle various fitness scenarios from weight loss to injury recovery.
 
 
 
 
 
 
 
 
 
 
40
 
41
+ - **Developed by:** a-albiol
42
+ - **Model type:** Text-to-Text Generation (Sequence-to-Sequence)
43
+ - **Language(s) (NLP):** English (primary), Spanish (secondary)
44
+ - **License:** MIT
45
+ - **Finetuned from model:** google/flan-t5-base
46
 
47
+ ### Model Sources
48
 
49
+ - **Repository:** [AthenAI GitHub Repository](https://github.com/a-albiol/AthenAI)
50
+ - **Base Model:** [google/flan-t5-base](https://huggingface.co/google/flan-t5-base)
 
51
 
52
  ## Uses
53
 
 
 
54
  ### Direct Use
55
 
56
+ AthenAI is designed for direct use in generating personalized workout routines. Users can input their training context and receive structured workout plans immediately. The model is particularly useful for:
57
 
58
+ - **Personal Fitness Applications**: Generate daily workout routines
59
+ - **Fitness Apps**: Provide adaptive exercise recommendations
60
+ - **Gym Management Systems**: Create member-specific workout plans
61
+ - **Health & Wellness Platforms**: Offer personalized fitness guidance
62
 
63
+ ### Downstream Use
64
 
65
+ The model can be integrated into larger fitness ecosystems:
66
 
67
+ - **Mobile Fitness Apps**: Backend workout generation service
68
+ - **Personal Training Software**: Assist trainers with plan creation
69
+ - **Rehabilitation Systems**: Generate recovery-focused exercise routines
70
+ - **Corporate Wellness Programs**: Provide employee fitness plans
71
 
72
  ### Out-of-Scope Use
73
 
74
+ AthenAI should not be used for:
75
 
76
+ - Medical diagnosis or treatment recommendations
77
+ - Professional medical or physiotherapy advice
78
+ - Unsupervised use for individuals with serious cardiovascular conditions
79
+ - Replacement for professional fitness consultation
80
+ - Legal or liability-bearing fitness recommendations
81
 
82
  ## Bias, Risks, and Limitations
83
 
84
+ ### Known Limitations
85
 
86
+ 1. **Exercise Database Scope**: Primarily trained on gym-based exercises, limited outdoor/home alternatives
87
+ 2. **Equipment Assumptions**: May suggest exercises without considering equipment availability
88
+ 3. **Medical Expertise**: Cannot replace professional medical or fitness consultation
89
+ 4. **Cultural Context**: Training data may reflect Western fitness practices
90
+ 5. **Language Limitations**: Optimized for English with limited Spanish support
91
 
92
+ ### Potential Biases
93
 
94
+ - **Dataset Bias**: Limited to exercises popular in online fitness communities
95
+ - **Demographic Bias**: May not adequately represent all age groups, fitness levels, or cultural backgrounds
96
+ - **Equipment Bias**: Assumes access to standard gym equipment
97
+ - **Ability Bias**: May not fully accommodate all physical limitations or disabilities
98
 
99
+ ### Recommendations
100
 
101
+ Users should be aware that AthenAI:
102
+ - Provides general fitness guidance, not medical advice
103
+ - Should be used alongside professional consultation for special health conditions
104
+ - May require human review for individuals with physical limitations
105
+ - Works best when combined with proper fitness supervision
106
 
107
+ ## How to Get Started with the Model
108
 
109
+ ### Installation
110
+
111
+ ```bash
112
+ pip install transformers torch
113
+ ```
114
+
115
+ ### Basic Usage
116
+
117
+ ```python
118
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
119
+
120
+ # Load model and tokenizer
121
+ model_name = "a-albiol/AthenAI"
122
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
123
+ model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
124
+
125
+ # Define user context
126
+ context = {
127
+ "training_phase": "weight_loss",
128
+ "motivation": "wellbeing",
129
+ "special_situation": "none"
130
+ }
131
+
132
+ # Generate workout
133
+ input_text = f"Generate a workout for: {context}"
134
+ inputs = tokenizer(input_text, return_tensors="pt")
135
+ outputs = model.generate(**inputs, max_length=512, do_sample=True, temperature=0.7)
136
+ workout = tokenizer.decode(outputs[0], skip_special_tokens=True)
137
+ print(workout)
138
+ ```
139
+
140
+ ### Input Parameters
141
+
142
+ **Training Phases:**
143
+ - `weight_loss`: Fat loss focused routines
144
+ - `muscle_gain`: Strength and muscle building
145
+ - `cardio_improve`: Cardiovascular fitness enhancement
146
+ - `maintenance`: General fitness maintenance
147
+
148
+ **Motivation Types:**
149
+ - `medical_recommendation`: Health-prescribed exercise
150
+ - `self_improvement`: Personal development goals
151
+ - `competition`: Athletic/competitive training
152
+ - `rehabilitation`: Recovery and therapy
153
+ - `wellbeing`: General wellness and mood
154
+
155
+ **Special Situations:**
156
+ - `pregnancy`: Prenatal fitness routines
157
+ - `post_partum`: Postpartum recovery workouts
158
+ - `injury_recovery`: Rehabilitation exercises
159
+ - `chronic_condition`: Adapted for chronic health issues
160
+ - `elderly_population`: Senior-friendly routines
161
+ - `physical_limitation`: Modified for disabilities
162
+ - `none`: Standard training
163
 
164
  ## Training Details
165
 
166
  ### Training Data
167
 
168
+ The model was trained on synthetic workout data generated from multiple comprehensive exercise databases:
 
 
169
 
170
+ 1. **Primary Dataset**: `onurSakar/GYM-Exercise` - Structured gym exercise data with instructions and categories
171
+ 2. **Kaggle Dataset**: `niharika41298/gym-exercise-data` - Comprehensive exercise descriptions with difficulty levels
172
+ 3. **GitHub Dataset**: `yuhonas/free-exercise-db` - Open-source exercise database with detailed instructions
173
 
174
+ **Total Training Examples**: 2000+ synthetic workout scenarios covering diverse user contexts and exercise combinations.
175
 
176
+ ### Training Procedure
177
 
178
+ #### Preprocessing
179
 
180
+ 1. **Data Extraction**: Parsed exercise data from multiple sources using regex patterns
181
+ 2. **Data Normalization**: Standardized column names and formats across datasets
182
+ 3. **Synthetic Generation**: Created workout scenarios using template-based generation
183
+ 4. **Context Mapping**: Paired user contexts with appropriate workout structures
184
+ 5. **Tokenization**: Applied FLAN-T5 tokenizer with padding and truncation
185
 
186
  #### Training Hyperparameters
187
 
188
+ - **Base Model**: google/flan-t5-base (850M parameters)
189
+ - **Training Epochs**: 1 per phase
190
+ - **Batch Size**: 8 (original) / 1 (optimized with gradient accumulation)
191
+ - **Gradient Accumulation Steps**: 8
192
+ - **Learning Rate**: 5e-5
193
+ - **Weight Decay**: 0.01
194
+ - **Training Regime**: FP16 mixed precision
195
+ - **Optimizer**: AdamW
196
+ - **Evaluation Strategy**: Steps-based (every 200/500 steps)
197
+ - **Save Strategy**: Every 500/1000 steps
198
 
199
+ #### Training Architecture
200
 
201
+ **Multi-Phase Training Approach:**
202
+ 1. **Phase 1**: Fine-tuning on Kaggle-derived synthetic data (1000 examples)
203
+ 2. **Phase 2**: Additional training on GitHub-derived synthetic data (1000 examples)
204
 
205
+ #### Speeds, Sizes, Times
206
 
207
+ - **Model Size**: ~850MB (FLAN-T5-base architecture)
208
+ - **Training Time**: ~2-4 hours per phase on Google Colab GPU
209
+ - **Inference Speed**: 0.5-1 seconds per workout (GPU), 2-5 seconds (CPU)
210
+ - **Memory Requirements**: 4-8GB RAM for inference, 12GB+ for training
211
 
212
+ ## Evaluation
213
 
214
  ### Testing Data, Factors & Metrics
215
 
216
  #### Testing Data
217
 
218
+ The model was evaluated on held-out synthetic workout data representing diverse user contexts and exercise combinations. Test cases included edge cases such as multiple special situations and complex user requirements.
 
 
219
 
220
  #### Factors
221
 
222
+ Evaluation was performed across multiple factors:
223
+ - **Training Phase Diversity**: All four training phases (weight_loss, muscle_gain, cardio_improve, maintenance)
224
+ - **Motivation Variety**: Five motivation types from medical to competitive
225
+ - **Special Situations**: Seven different special health/physical situations
226
+ - **Workout Complexity**: Varying block structures and exercise counts
227
 
228
  #### Metrics
229
 
230
+ Primary evaluation metrics included:
231
+ - **JSON Format Validity**: Structural correctness of generated workout plans
232
+ - **Context Relevance**: Appropriateness of exercises for given user context
233
+ - **Exercise Variety**: Diversity in recommended exercises across similar contexts
234
+ - **Block Structure Coherence**: Logical flow from warmup to cooldown
235
+ - **Duration Estimation Accuracy**: Realistic time estimates for workout completion
236
 
237
  ### Results
238
 
239
+ The model successfully generates valid JSON workout structures with contextually appropriate exercises. Manual evaluation showed strong performance in:
240
+ - Context understanding and exercise selection
241
+ - Workout structure and flow
242
+ - Adaptation to special situations
243
+ - Exercise variety and avoiding repetition
 
 
 
 
 
 
244
 
245
  ## Environmental Impact
246
 
247
+ Training AthenAI involved fine-tuning a pre-existing model rather than training from scratch, significantly reducing computational requirements and carbon footprint.
248
 
249
+ - **Hardware Type**: NVIDIA T4 GPU (Google Colab)
250
+ - **Hours used**: Approximately 6-8 hours total training time
251
+ - **Cloud Provider**: Google Cloud Platform (Colab)
252
+ - **Compute Region**: Variable (Colab allocation)
253
+ - **Carbon Emitted**: Estimated <5kg CO2eq (due to fine-tuning approach)
254
 
255
+ ## Technical Specifications
 
 
 
 
 
 
256
 
257
  ### Model Architecture and Objective
258
 
259
+ - **Architecture**: FLAN-T5-base (Text-to-Text Transfer Transformer)
260
+ - **Parameters**: ~850 million parameters
261
+ - **Objective**: Sequence-to-sequence generation for workout plan creation
262
+ - **Input Format**: Natural language context description
263
+ - **Output Format**: Structured JSON workout plans
264
+ - **Context Window**: 512 tokens maximum
265
+ - **Generation Strategy**: Autoregressive text generation with temperature sampling
266
 
267
  ### Compute Infrastructure
268
 
 
 
269
  #### Hardware
270
 
271
+ - **Training**: NVIDIA T4 GPU (Google Colab Pro)
272
+ - **Memory**: 16GB GPU memory, 25GB system RAM
273
+ - **Storage**: 100GB+ for datasets and model checkpoints
274
 
275
  #### Software
276
 
277
+ - **Framework**: Hugging Face Transformers 4.45.2
278
+ - **Training Library**: Hugging Face Trainer
279
+ - **Data Processing**: Pandas, Datasets 3.0.1
280
+ - **Environment**: Python 3.10, PyTorch 2.0+
281
+ - **Platform**: Google Colab with GPU acceleration
282
 
283
+ ## Citation
284
 
285
+ If you use AthenAI in your research or applications, please cite:
286
 
287
  **BibTeX:**
288
 
289
+ ```bibtex
290
+ @misc{athenai2024,
291
+ title={AthenAI: AI-Powered Personalized Workout Generator},
292
+ author={a-albiol},
293
+ year={2024},
294
+ publisher={Hugging Face},
295
+ journal={Hugging Face Model Hub},
296
+ howpublished={\url{https://huggingface.co/a-albiol/AthenAI}}
297
+ }
298
+ ```
299
 
300
  **APA:**
301
 
302
+ a-albiol. (2024). AthenAI: AI-Powered Personalized Workout Generator. Hugging Face Model Hub. https://huggingface.co/a-albiol/AthenAI
303
+
304
+ ## Glossary
305
 
306
+ - **Training Phase**: User's current fitness goal (weight loss, muscle gain, etc.)
307
+ - **Motivation**: Underlying reason for exercising (medical, competition, etc.)
308
+ - **Special Situation**: Health or physical considerations (pregnancy, injury, etc.)
309
+ - **Workout Block**: Structured section of workout (warmup, main, cooldown)
310
+ - **Fine-tuning**: Process of adapting pre-trained model to specific task
311
+ - **Synthetic Data**: Artificially generated training examples based on real exercise databases
312
 
313
+ ## More Information
314
 
315
+ For detailed implementation, training notebooks, and additional examples, visit the project repository. The model continues to evolve with community feedback and additional training data.
316
 
317
+ For technical support or questions about integration, please open an issue in the repository or contact through Hugging Face model discussions.
318
 
319
+ ## Model Card Authors
320
 
321
+ **Primary Author**: a-albiol
322
 
323
+ **Contributors**: Community feedback and testing
324
 
325
  ## Model Card Contact
326
 
327
+ For questions, feedback, or collaboration inquiries:
328
+ - **Hugging Face**: [@a-albiol](https://huggingface.co/a-albiol)
329
+ - **Model Discussions**: Use the Hugging Face model page discussion section
330
+ - **Issues**: Report technical issues through the repository issue tracker