Why I Built PortionLens: The modern pursuit of personal health has become entangled with the architecture of the internet. Many applications for tracking nutrition require a recurring monthly fee because they offload the complex task of processing data to distant, remote servers. This design requires a financial cost that feels increasingly at odds with the simple act of maintaining one's own health. I developed PortionLens to restore autonomy to the user: a calorie tracker that does not ask for subscriptions, because it does not rely on the cloud.
The Inspiration: The catalyst for this project was a basic frustration. I have tracked my calories for years, but I grew tired of the implicit trade-off required by standard applications. These apps charge a subscription to process your photos and logs, and they harvest your health data in the process. I wanted to see if it was possible to create a tool that respects the user's intelligence and their privacy. The inspiration was not to build a complex software ecosystem, but to build a simple, private, and durable utility.
How I Built It: PortionLens is built on the principle of on-device inference. Instead of sending an image of a meal to a remote server, the application utilizes models such as Gemma or Qwen directly on the phone processor. By shifting the computation from the cloud to the device, the app functions entirely offline.
The core challenge was optimizing the inference speed. We had to manage the computational complexity of the models to ensure the device did not overheat or drain the battery during a scan. By selecting highly efficient, quantized models, I kept the latency below the threshold required for a smooth user experience. I integrated Google Health to provide a centralized location for all health data, ensuring that nutrition metrics correlate with sleep and activity without ever leaving the hardware.
The Challenges: The primary challenge was technical: fitting a robust nutritional intelligence system onto a mobile device. Mobile processors have thermal and memory limitations that do not exist in cloud data centers. Building a retrieval system that can accurately identify micronutrients from an image required precise data structuring. I had to move away from heavy, external API calls and develop a local indexing system for food data. This required rigorous testing to ensure that the app remained stable and responsive even when processing high-resolution imagery.
Built With
- gemma4
- kotlin
- qwen
- react-native
- sqlite
Log in or sign up for Devpost to join the conversation.