Inspiration Patients currently do not have access to a simple and free way to measure their body fat ratio and visualize their body shape improvement. While AI models are powerful, asking them to blindly guess body measurements from 2D images often leads to severe inaccuracies. We realized that to truly solve the "The Body Scan" challenge and score high on Measurement and Body Fat Ratio accuracy, we needed to anchor Generative AI with real-world physical references and established medical science.What it doesElfie TrueShape is a comprehensive pipeline that transforms smartphone photos into clinical-grade insights:Ingest & Calibrate: Ingests front and profile body images along with a standard ID card/Credit card held by the user.Estimate Measurements: Uses the reference card to establish a precise Pixel-to-Centimeter ratio, extracting highly accurate circumferences for the neck, waist, and hips to estimate body measurements.Estimate Body Fat Ratio: Instead of relying on LLM hallucinations, we plug the extracted measurements into the validated US Navy Body Fat Formula to estimate body fat ratio.Future-Self Visualizer: Generates a visually altered image projecting the user's body shape once they reach their target body fat percentage.How we built itWe utilized a hybrid approach combining AI Vision and deterministic math:Frontend: Built a rapid, interactive UI using Streamlit to handle image uploads and parameter adjustments.Computer Vision: Deployed Qwen-VL via Alibaba Cloud to detect specific body keypoints and the bounding box of the reference object.Mathematical Core: Implemented Python logic to calculate real-world distances. For instance, the system calculates the final ratio using the standard clinical equation:$$\%BodyFat = 86.010 \times \log_{10}(waist - neck) - 70.041 \times \log_{10}(height) + 36.76$$Generative Visualizer: Integrated an image-to-image diffusion model controlled by the target body fat parameter to reshape the original image.Challenges we ran intoInitially, we prompted Qwen to directly estimate the body fat percentage, which resulted in high hallucination rates. We pivoted to using the LLM strictly as a vision-extractor (finding coordinates) and passing those coordinates to a deterministic Python backend. Another challenge was standardizing the lighting and angle for the reference card detection.Accomplishments that we're proud ofWe successfully bridged the gap between the probabilistic nature of AI and the strict accuracy requirements of the healthcare sector. Our solution doesn't just guess; it measures.What's next for Elfie TrueShapeWe plan to deploy a Zero-PII edge pre-processing layer to blur faces and background environments before sending data to the cloud. Ultimately, we aim to integrate this directly into the Elfie App, connecting the Future-Self Visualizer with the Gamification and rewards system to drive long-term patient adherence.

Built With

  • alibaba-cloud
  • computer
  • python
  • qwen-vl
  • streamlit
Share this project:

Updates