论文信息
论文解读
AI 辅助整理- 方法
- FastAPI+React架构,Gemini 2.5 Flash视觉模型识别食物
- 发现
- 视觉语言服务能降低饮食记录负担,但结果应作参考而非临床测量。
- 机会点
- 可研究校准份量参考、可信食物数据库与置信度报告,提升营养估算准确性。
论文摘要
食物记录只有在足够简单、能够成为习惯时才会奏效。传统的营养项目往往要求用户浏览食物列表、选择一种食物、猜测份量,然后对一餐中的每一种食物重复这一过程。CrunchUP通过使用一张餐食照片来创建营养记录,从而解决了这一摩擦。该系统是一个完整的Web应用程序:用户上传图片或使用相机拍照,FastAPI服务对图像进行检查和标准化,Google Gemini视觉模型识别图像中可见的食物,并估算数量、热量、蛋白质、碳水化合物、脂肪和纤维。响应经过验证,转换为应用程序对象,展示给用户,并可选地存储于PostgreSQL中。个人档案中的信息包括身高、体重、年龄、性别、活动水平和健身目标。这些数值用于计算BMI、依据Mifflin–St Jeor公式计算基础代谢率、每日总能量消耗、以目标为导向的热量调整以及宏量营养素目标。这项工作之所以重要,是因为它将识别、营养估算、个人目标、餐食历史、趋势和用于决策的反馈整合到单一流程中。本报告描述了需求、文献背景、架构、数据库设计、算法、安全措施、实现、验证策略、限制以及未来的扩展。关注点分离在代码库中清晰可见:客户端具有响应式设计(React、Vite);服务与数据层已实现(FastAPI、Pydantic、SQLAlchemy);访问受到保护(JWT、bcrypt);图像经过标准化处理(Pillow);多模态输出按模式塑形(Gemini 2.5 Flash)。仪表盘整合摄入信息,并将进度数据转化为易于理解的建议。一个关键发现是,定义良好的视觉-语言服务有助于减轻饮食记录负担,但必须将其解读为参考指导,而非临床测量。未来工作需要包括校准份量参照、经验证的食物数据库、置信度报告、文化上更广泛的评估、个性化餐食推荐,以及开发基于原生应用平台“React Native”的移动应用。
全文
International Journal of Scientific Research in Computer Science Engineering and Information TechnologyCopyright © 202 6 The Author(s) : This is an open access article under the CC BY license
(http://creativecommons.org/licenses/by/4.0/)
International Journal of Scientific Research in Computer Science, Engineering and
Information Technology
ISSN : 2456-3307
Available Online at : jsrcseit.com doi : https://doi.org/10.32628/CSEIT2612569
523
Food Recognition and Nutrition Estimator Using Computer
Vision and Machine Learning
Vijayaraghavan R1, Dr. V. S. Anita Sofia2
1 PG Student, Department of Computer Applications (PG), PSG College of Arts & Science, Coimbatore, Tamil
Nadu, India
2 Associate Professor, Department of Computer Applications (PG), PSG College of Arts & Science, Coimbatore,
Tamil Nadu, India
A R T I C L E I N F O A B S T R A C T
Article History:
Accepted : 15 Sep 2026
Published: 18 Oct 2026
Food logging works when it is simple enough to become a habit. Traditional
nutrition programs often require the user to browse a list of foods, choose a
food, and guess at a portion size, and then repeat the procedure for each food
item in a meal. CrunchUP resolves that friction by using a photo of a meal to
create a nutrition record. The system is a complete web application, where a
user uploads an image or takes a picture using their camera, a FastAPI service
checks and standardizes the image, and the Google Gemini vision model
identifies the foods visible in the image and estimates the quantity, calories,
protein, carbohydrates, fat, and fibre. The response is validated, converted
into application objects, displayed to the user and optionally stored in
PostgreSQL. The information on a personal profile includes height, weight,
age, gender, activity level, and fitness goal. These values are used for the
calculation of BMI, basal metabolic rate according to Mifflin –St Jeor, total
daily energy expenditure, calorie adjustment which is goal oriented and
macronutrient targets. The work is important because it brings together
recognition, nutrition estimation, personal targets, meal history, trends and
feedback for decision making in a single stream. The report describes the
requirements, literature background, architecture, database design,
algorithms, security measures, implementation, verification strategy,
restrictions and extensions for the future. Separation of concerns is evident in
the repository: the client is responsive (React, Vite); the service and data are
implemented ( FastAPI, Pydantic, SQLAlchemy); access is protected (JWT,
bcrypt); images are normalized (Pillow); and multimodal output is schema
shaped (Gemini 2.5 Flash). The dashboard consolidates intake and translates
progress data into easy-to-understand recommendations. A key finding is that
a well-defined vision-language service can help ease recording effort in the
Publication Issue
Volume 12, Issue 5
September-October-2026
Page Number
523-536
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
524
diet, but needs to be interpreted as guidance, not a clinical measurement.
There is a need for future work including calibrated portion references,
verified food databases, confidence reporting, culturally wider evaluation,
personalised meal recommendation, and the development of a mobile app in
the native application platform "React Native".
Keywords— food recognition, nutrition estimation, computer vision,
machine learning, Gemini, FastAPI, React, dietary assessment
Introduction
There are many times a day to make diet decisions,
but information to make them is not readily accessible
when it is needed. A nutrient panel is common on
packaged food but it is not evident on home-cooked
foods, restaurant food, mixed food or regional recipes.
Manual food diaries can help increase awareness, but
require focus and accurate por-tion judgement. The
other option is a camera-based system that captures
what the user sees and provides the user with an
instant estimate. It is difficult to solve the computer -
vision problem as two visually similar meals may
contain different oils, ingredients, how they are
prepared, and how much of each ingredient goes into
the meal, and the same meal could look very different.
Therefore, to be useful, an application should include
visual reasoning, conservative communication, strong
software engineering and a history of what was
actually estimated.
Unlike a simple image classifier, CrunchUP has been
designed as a tool for food recognition and nutrition
esti-mation. The distinction matters. The purpose of
this appli-cation is to identify a meal that contains
multiple items, to indicate a general amount of each
item, to translate each amount into a number of
nutrients, to summarize the meal, and to correlate the
summary with a single target. Normally, a classifier
returns one label; this application is going to return a
summary of the meal, with several items labeled and
each item labeled with an approximate amount, which
is to be converted to multiple amounts of nutrients,
and that meal is to be related to a single target
amount. The repos -itory is thus divided into six
components: client, service, persistence,
authentication, image processing, and insight
generation. It starts with the registration and
completing profile. It goes on with meal-image
analysis, user reviews and it finishes with aggregation,
historical retrieval and a seven -day trend. This report
assumes that the repository is the implementation
baseline. and describes the interactions between its
modules.
The goal of the project is to make the process of self -
monitoring of diet more effortless and provide the
user enough context to act. Specific goals include safely
accept-ing common image formats; recognizing one,
or perhaps several, food items from a picture;
estimating quantity; computing personal energy and
macro goals; storing meals under an authenticated
user; dis -playing daily progress and weekly patterns;
and generating succinct suggestions that conform to
the remaining calorie or macronu -trient allowance.
Non-functional requirements include respon -sive
behaviour, clear errors, maintainable layering, privacy-
aware storage, reasonable performance on regular
phones and laptops. The system is intended for
education and well-ness. It is not a diagnosis,
treatment or a substitute for a dietitian. The scope
encompasses the web application in the CRUNCH-UP
repository: React 19 and Vite 8 on the client, React
Router for navigation, Axios for HTTP com-
munication, Chart.js for trends, Lucide icons for
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
525
interface cues, FastAPI for REST endpoints, Pydantic
for request and response validation, SQLAlchemy for
object-relational mapping, Google Gemini for
multimodal analysis, and PostgreSQL for durable data.
Multimodal analysis with 2.5 Flash. The report also
covers the BMI, BMR, TDEE, Goal adjustment,
Macros splitting, JWT authentication, pass -word
hashing, upload restrictions, and dashboard rules. It is
not claiming validation of the model, precision of the
photographic portion size, or equivalence of the values
that are generated with those from laboratory
analysis.
Table 1: Core Technology Stack
Layer Technology and role
Client React, Vite, Router, Axios, Chart.js
API FastAPI and Pydantic
Persistence SQLAlchemy and PostgreSQL
Vision Gemini 2.5 Flash
Security/media JWT, bcrypt, Pillow
Related Work
There has been a growing interest in recent
investigations on food-recognition in terms of the
transfer of representations learnt at scale to food
imagery. Bianco et al. investigate the generalization
of DINOv2 features within a single eval-uation
framework and remind us that evaluation on tasks
and data is more important than a single headline
accuracy [1]. That’s relevant to CrunchUP as well: A
model that knows the typical appearance of a
benchmark photo could perform differently on a dim,
cluttered, culturally distinct or homemade plate.
Thus, future testing of the project is advantageous
because it can be separated between the recognition
quality, quantity estimation and nutrient error, which
will report one combined success rate.
Borugadda and Kalluri offer a general overview of ar -
tificial intelligence, machine learning, deep learning
and computer vision applications in the food industry
[2]. They have a field-level perspective enabling them
to place the current application between classical
image processing and modern multimodal inference.
CrunchUP performs deter -ministic image checks and
resizes prior to sending semantic interpretation to a
vision-language model. This hybrid de-sign is useful:
rules are predictable and will determine the safety of
the files and the transport costs, while a large model
will deal with the open vocabulary and contextual
ambiguity, which would be expensive to encode using
hand-crafted features.
The systematic review performed by Dalakleidi et al.
is specifically about the use of image-based food-
recognition systems for dietary assessment [3]. It is a
type of visual contrast between recognition and
estimation of a category. That’s precisely why
CrunchUP is designed to keep food -item information
as well as meal totals, and to request an estimate for
quantity instead of just a name. However, the
repository is still dependent on visual inference, with-
out the explicit reference of an object or a depth
channel. The amounts in it are therefore considered
to be approxi -mate serving sizes. They need to be
compared to weighed records and absolute percentage
error must be reported for energy and each of the
macronutrients. Feng et al. present a nutrient
estimation method using RGB-D input and a con-
trastive learning approach [4]. With depth, there can
be less ambiguity because two plates with the same
projected area can have different volumes. The
comparison reveals one of the drawbacks of single
RGB photographs in CrunchUP. The web flow is
available, as it is a regular camera but without direct
geometry. An optional future mobile version may have
a depth sensor, multiple views, or an on screen
reference marker. These additions will help with
volume estimation and leave the default level of
friction as it is. path.
Gautam et al. investigate attention-based learning for
ingredients, recipes, and calories [5]. Ingredient
reasoning is particularly crucial when it comes to
composite foods, such as a curry, biryani, sandwiches
or dessert, which may seem unchanged even though
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
526
the recipe has altered the nutrition by a significant
margin. The model that crunchUP is asking questions
of is multi -modal, so that is able to identify visible
food and provide nutrition estimates; but it doesn’t
reveal separately inferred ingredients or uncertainty.
Adding likely ingredients and preparation
assumptions as extensions to the response schema,
along with an editable recipe breakdown, would make
the estimate more transpar-ent and enable users to
correct recipe information for oil, sugar, and portions.
Gelli et al. compare the mobile -phone computer -
vision dietary assessment to weighed records and 24 -
hour recall among female youth in an urban area of
Ghana [6] and, therefore, consider field validity. Their
work is a reminder, that usability and function are two
distinct things.
Laboratory performance is not the only thing that
counts; so does ecological validity. A system designed
to serve as a tool for everyday use needs to be able to
deal with local cuisine, shared plates, camera variance,
short interruptions in connectivity, and varying levels
of dietary literacy. The ability to respond and upload
pictures via the camera is a helpful base and there is
still a need for culturally diverse field studies before
generalizations can be drawn.
The technical context is extended by computer vision
in agriculture. Ghazal et al. discuss the vision
techniques in smart agriculture and precision farming
[7]. While crop monitoring is a step before the
dietary assessment, both areas are subject to the
challenges of illumination change, background
clutter, class imbalance, and translating pix -els into
decisions. The principle of project dashboard is the
last one: recognition is useful only when it leads to a
user action. In future, there may also be a link
between food choices and sustainability indicators or
the seasonal availability of food, if these are obtained
and are clearly separated from nutrient estimation.
Under conditions of controlled LED light, Li et al. are
looking into the detection of calcium deficiency using
vi-sion in lettuce grown in an indoor environment
[8]. They are in a controlled environment, whereas
consumer meal photos are lit in an uncontrolled way.
The comparison ex-plains why CrunchUP needs to
normalise images, and why it’s important to stratify
results by brightness, blur, occlu -sion and viewpoint
when evaluating images. The present pre -processing
transforms the supported images into RGB JPEG, caps
the maximum dimension to 1920 pixels and performs
a high-quality resampling. These steps will reg-ularize
transport and model input but cannot recreate lost
information in capture.
Ruchay et al. give an overview of open datasets and
com-puter vision applied using AI or generative -AI
techniques in precision livestock farming [9]. They
have a focus on datasets and reproducibility, which
applies also to food analysis. Currently, CrunchUP
incorporates a multimodal model hosted and not a
repository-specific classifier. This makes the
development time shorter and facilitates the use of
open-ended foods, but can also lead to the results
being affected by being taken up by changes in the
model, access to services and prompt behaviour.
Changes on a versioned evaluation set, recorded
prompt, model identifier and re -gression suite would
provide measurable changes and allow for repeatable
releases.
In the context of food automation, Singh et al.
introduce LaksData, an image database of salmon
fillets for vision -based food automation [10].
Controlled labels and a limited range of use are
features of domain specific datasets that can assist in
reliable automation. Consumer meal recogni-tion is
wider, uncontrolled, sacrificing for coverage. In the
future, CrunchUP might choose to operate in two
phases: a general VLM for open set recognition, and a
specialised VLM or database when a certain category
match is con -firmed. This type of routing can help to
maintain flexibility and increase accuracy of products
consumed often.
The comparison of vision -language models for
nutrient estimation and ingredient recognition is
made by Wang et al. [11]. This is the most similar
concept to CrunchUP’s in-ference layer. It emphasizes
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
527
the importance of testing both the recognition of the
meaning and the output of numbers as this can be
misleading in fluent explanations. An impor-tant
engineering protection is the application’s requirement
for JSON output, which provides for the delivery of
named fields to code downstream. Additional
protections would need to confirm numeric ranges,
look for outlandish values, indicate confidence levels,
and seek user confirmation if a meal is ambiguous.
Requirements and Feasibility
The primary actor is a person who is seeking to know
how much he or she consumes on a daily basis. The
user reg-isters an account, logs in, takes a picture of a
meal, looks at the items identified in the image, saves
the record and checks the progress. The functional
requirements along this journey are: The
authentication needs to register a unique user and
then, upon successful verification of the creden -tials,
issue a token. For profile management, age, gender,
height, weight, activity level, and goal must be entered
into the system, then BMI and daily targets must be
calculated. Meal analysis is to accept breakfast, lunch,
snack or dinner and an image of that meal with
support. Must provide item level and meal level
nutrition. Meal management should be able to list,
retrieve, create, and delete records owned by the
authenticated user. The dashboard should give an
overview of the chosen day and return a full 7 day
series, including zeros where there were no meals.
Table 2: Principal Functional Requirements
Capability Required behaviour
Identity Register, authenticate, issue token
Profile Store measures; calculate targets
Analysis Return item and meal estimates
Records Create, retrieve, filter, delete
Dashboard Daily summary and seven-day series
The repository exposes these needs as RESTful end -
points. POST /auth/register and POST /auth/login
handle identity; GET /users/me and PUT /users/me
provide ac-count maintenance. GET /profile and PUT
/profile con -trol the nutrition profile, while GET
/profile/bmi returns the detailed BMI result. POST
/meals/analyze performs image inference without an
immediate commit, allowing users to inspect results
before saving. POST /meals stores an accepted
analysis; /meals?date=date and /meals?meal-
type=meal-type filter records; /meals/{id} returns
details; and DELETE /meals/{id} removes an owned
record. GET
/dashboard/summary aggregates a selected date,
while/dashboard/weekly returns arrays for the
previous week. Non -functional requirements include
password hashing, signed tokens, ownership checks,
typed schemas, transac -tions, consistent errors,
responsive rendering, maintainable modules, retention
controls, and clear treatment of images and profile
measurements as sensitive personal data.
Table 3: Representative API Workflow
Endpoint Purpose
POST /auth/register Create identity
POST /auth/login Issue token
PUT /profile Save profile
POST /meals/analyze Preview inference
POST /meals Persist analysis
GET /dashboard/weekly Seven-day series
Technical feasibility is strong because established
com-ponents support each major function. FastAPI
supports asynchronous file handling and API
documentation; Post -greSQL handles relational
ownership and historical queries; React supports
stateful forms and charts; and Gemini pro-vides open-
vocabulary visual interpretation without a lo -cal
GPU. Operational feasibility depends on approximate
values being communicated clearly and the service
remain-ing responsive. Student -scale deployment is
economically feasible, although hosted -model
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
528
requests, image storage, database hosting, and
monitoring add cost at scale.
The primary feasibility risks are accuracy and trust.
One photograph can’t show all the ingredients or exact
weights. A model can fail to give a regional food a
name, miss an item or produce a food that is
numerically correct but factu-ally wrong. The
interface should therefore not be based on a false sense
of precision. Values should be rounded sensi-bly,
labelled as estimates and be modifiable prior to saving.
The application should remember the analyzed image
and the assumptions for a sufficient period of time for
the user to review them, but also offer a means for the
user to delete them. These controls are not for show;
they are; they have to be, requirements for
responsible use.
System Design
CrunchUP uses a client –server architecture with a
man-aged intelligence layer. The browser client owns
presen-tation, navigation, image selection, immediate
feedback, and charts. The FastAPI server handles
authentication, authorization, validation, business
rules, persistence, and AI-service orchestration. User,
profile, meal, and food-item records are stored in
normalized form in PostgreSQL. The external analysis
service is called only by the backend, pre-venting the
API key from reaching the browser. The same
endpoints can serve a React Native client.
The architecture has a conscious separation between
anal-ysis and persistence. A POST /meals/analyze call
validates the meal type and image, processes the
bytes, fetches the user’s goal and current daily intake,
calls Gemini, converts the returned entries into typed
food items, adds up the nu -trient totals and returns a
preview. At this point no database meal is created. If
the user accepts the result, then /meals is called and a
row named Meal, and its children of Food -Item rows,
are created on a single transaction. This type of design
provides for correction, canceling, and future
confidence prompts. Also, it does not allow polluted
history when scan fails or is done by mistake.
The multimodal prompt is a compact interface con -
tract. It asks to pass a JSON object with food_items
and ai_insight. Each item needs to give the following
infor-mation: food_name, estimated_quantity,
calories, protein, carbohydrates, fat, and fiber. The
prompt involves the user’s fitness purpose, today’s food
consumed (if applicable), rea-sonable amounts, and
indicates that the amounts are for the serving listed.
The model is set as being for applica-tion/json.
It then uses json.loads to unpack the response,
returning the empty result and a warning about the
parse if it doesn’t contain the structure or is not valid.
The approach is prac-tical, but there should be some
production hardening to incorporate JSON -schema
enforcement, bounds checking and retry logic for
transient failures.
The relational model is based on ownership and
compo-sition. Each User is associated with one
UserProfile and several Meals. A FoodItem is part of a
Meal that is assigned to one User. Measurements,
activity, goal, calculated BMI, and target nutrients are
all included in the profile values. These meal values
contain the type of meal, analysis time, date, image
path, total nutrients, and the AI insight. The totals
are the aggregate of FoodItem values, which will
remember the breakdown that created those totals.
There are no orphan rows in the Meal-FoodItem
relationship due to the cascade delete. Foreign keys
ensure that ownership is made explicit, and if you are
going to add summary and history queries, indexed
user and date fields would be a good scaling
enhancement.
The dashboard is not just a reporting screen. It
summa-rizes daily intake and indicates whether
calories, protein, carbohydrates, fat, and fibre are
below, near, or above their targets. For each nutrient,
it returns the amount consumed, target, remaining
amount, and a progress value capped at 100% for
display. The insight engine evaluates calorie and
protein ratios, fitness goal and meal count. It can
suggest that the user has a lot of energy left, is getting
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
529
on track, is near the daily limit, or that the user didn’t
have a meal.
The weekly series is a complete ordered sequence
from six days before the current date through today.
It summa -rizes meals by day and inserts zero totals
where no meals are recorded. This is relevant for
charts: If there are no rows in the database, do not let
the time axis collapse and do not let adjacent dates
suggest that they were sequential obser-vations. Thus,
Chart.js will be able to graph stable labels and aligned
arrays. If you want to use it for longer -term analytics,
the same should be true for weekly and monthly
buckets, where the time boundaries should be
timezone-aware and should be picked from the user’s
locale.
Figure 1 shows the logical architecture. The analysis
path and explicit boundary for review are provided in
Fig-ure 2. Figure 3 summarizes the data model. They
expose a clean flow: the client does not speak directly
to the model or database, the service layer is
responsible for the trans -formations, and there are
persistent records that are linked to an established
identity. The largest architectural depen-dency is the
external model. Should be wrapped behind an
interface to allow another provider, a more tweaked
local model or a nutrition service with retrieval, to be
substituted without rewriting routers.
Figure 1: Logical client–server architecture.
Figure 2: Analysis path with review boundary.
Figure 3: Simplified relational data model.
Methods and Calculations
Semantic analysis is preceded by image preprocessing.
The service recognizes jpg/jpeg/png/webp extensions
and MIME types. It rejects unsupported types, empty
content, and files over 10 MB. Pillow opens the bytes,
converts palettes or alpha channels to RGB when
necessary, and preserves the aspect ratio while scaling
the longest side to 1920 pixels. The image is then
compressed as an optimized JPEG at quality 85. This
pipeline regulates request size and removes format
variation without overly aggressive com -pression. A
high-quality Lanczos resampler preserves fine
boundaries better than nearest -neighbour reduction.
BMI is mass in kilograms divided by height in metres
squared: BMI = W/H 2. It is rounded to one decimal
place. The categories are underweight (below 18.5),
normal (18.5 to below 25), overweight (25 to below
30), and obese (30 or higher). BMI is a screening
indicator, not a diagnosis or a measure of body
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
530
m
composition, fat distribution, pregnancy, or athletic
build.
Daily energy begins with the Mifflin –St Jeor basal
metabolic rate. For a male profile, BMR = 10W +
6.25H - 5A + 5; for the other branch, BMR = 10W +
6.25H - 5A - 161, where W is weight in kilograms, H is
height in centime-tres, and A is age in years. An
activity factor of 1.2, 1.375, 1.55, or 1.725 is applied.
TDEE is reduced by 500 calories for weight loss,
increased by 400 calories for weight gain, and
unchanged for maintenance. Macronutrient energy
shares are 35/40/25 percent for
protein/carbohydrate/fat during weight loss, 30/45/25
percent during weight gain, and 25/50/25 percent for
maintenance. Protein and carbo -hydrate use 4 kcal/g,
fat uses 9 kcal/g, and fibre is set to 30 g.
Table 4: Nutrition Calculations
Measure Implementation rule
BMI W/H2
BMR 10W + 6.25H − 5A + c
TDEE BMR times activity factor
Goal −500, +400, or unchanged kcal
Macros 4 kcal/g protein and carbs; 9 kcal/g fat
After item inference, meal totals are calculated deter -
ministically. The server takes the returned food and
uses numbers to represent amounts of calories, protein,
carbohy-drates, fat, and fibre and adds them together.
The totals are recalculated from the items entered on
the record when the record is saved, and are not
blindly accepted from a client-supplied total.
Recalculation minimizes inconsistency and aids with
edited items. It does not confirm the nutritional truth
of each value, this is done through a food composition
database or human confirmation. However, negative
num-bers, excessive serving sizes or large calorie
counts that contradict significantly with the macro
derived energy may be rejected by plausibility rules.
The daily status is calculated by dividing consumed by
target, and multiplying by 100. Remaining is what is
left af-ter consumed, but can’t go negative in the
remainder shown, and can’t go above one hundred
percent in the remaining. This leaves the user with a
clear progress bar, but may ob-scure the amount of
overconsumption. A future answer should keep
uncapped percentage and signed difference but the UI
should be capped only for the visual bar. Insight
thresholds should also be customizable and reflected
back on dietetic input, not as universal advice.
The next-meal algorithm is designed to be
interpretable. It first checks whether the energy goal
has been achieved. Otherwise, it compares remaining
protein and carbohydrate allowances, applies minimum
gaps, considers remaining fat, and suggests a balanced
plate based on remaining calories. The rules are simple
to test and explain, but they do not ac-count for
allergies, religion, budget, cooking time, medical
needs, or recent repetition, and they use only a small
set of foods. A future recommendation module should
treat these factors as constraints and rank complete -
meal alternatives rather than generate a single
sentence.
Implementation Details
The FastAPI application is titled CrunchUP API and
uses version 1.0.0. Cross -origin middleware permits
local Vite development origins. A static upload
directory is mounted, SQLAlchemy metadata is
initialized at startup, and routers are registered for
authentication, users, profiles, meals, dashboard, and
billing. A root health endpoint returns a running-
status message. Production should use database
migrations, environment-specific origins, server-side
pay-ment credentials, verified webhooks, auditable
transaction states, and failure handling that never
compromises nutri-tion history.
Authentication generates a salted bcrypt password
hash and compares login passwords against it. JWT
access to -kens contain identity claims and an
expiration time, are signed with the configured
algorithm and secret, and use UTC timestamps.
Protected dependencies decode the token and resolve
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
531
the current user. Meal queries include the current
user identifier, preventing cross-user retrieval or dele-
tion. Production hardening should include refresh
tokens, key rotation, login throttling, password
policy, account recovery, secure browser -storage
decisions, and security logging.
Pydantic schemas are a barrier between transport data
and ORM objects. Return: Item objects and totals,
insight and image path. The major types of meals that
are allowed by persistence are meal type, optional
date, image path, insight, and a list of items. Re -
sponse validation identifies shape differences in early
stages and provides a consistent contract to the
frontend. Model validation is used to cre -ate meal
responses, which decreases manual serialization. The
API should be versioned or add a field and automated
contract tests should validate the client’s assumption.
Layered orchestration is shown in the meal router.
Val-idates against breakfast, lunch, snack, and dinner.
Uses image -validation helpers instead of having the
file logic in the route. It reads the profile, calculates
the totals of the meal of the day, builds a Gemini
service that uses a server side key, and translates any
exceptions from the ex-ternal service to a 502
response. It saves image only after successful analysis
with the unique name. It creates typed item objects,
calculates totals and generates a preview. The create
route then adds the meal to the database with a trans-
action, flushing for the generated ID, then for each
child, adding, committing, refreshing, and reloading
with joined food items.
Image names are generated by a random UUID and
add a user friendly base name, which significantly
minimizes naming conflicts. However, there is a slight
lifecycle prob-lem: an analysed image is saved even if
the user doesn’t save the preview image.
Unreferenced files should be cleaned up following a
retention period by a scheduled cleanup process.
When deployed, it is also suggested that private object
storage with signed access is used for storage, rather
than a publicly mounted directory. Content hash,
size, dimensions and creation time are to be recorded
in the metadata, and the deletion of images should be
linked to the deletion of the meal, following a
documented retention policy.
The React client is structured into components, pages,
layouts, authentication context, services, hooks and
util-ities. This will promote the reusability of
nutrient cards, upload controls, charts, history rows
and guarded routes. Axios can carry the bearer token,
and centralize error han-dling. React Router is used
for authentication, dashboard, analysis, history and
profile screens. Vite provides fast de-velopment and
optimized bundling. Appropriate navigation that
changes from a sidebar to bottom navigation on smaller
screens, as it’s suitable for a camera-focused app.
System state should be apparent to the user
throughout the analysis. The upload view must
display accepted for -mats, acceptable file size, have a
camera option (on any device that supports it), show a
preview image, and prevent duplicate submissions. It
should show progress but not give an exact time
remaining during inference. The result view should
display a list of all items detected, with the name and
quantity editable, with a total of meals per item and a
note that everything is an estimate, and provide clear
Save and Discard buttons. If it fails, it should have the
ability to differentiate between unsupported files,
authentication dates, connection failures and model
errors. It would be better to send a generic "something
went wrong", message since the API already gives a
helpful error structure.
History provides accountability and a user can use it
to view the context of a daily total. Filters (date-range,
meal-type) should update the URL and local state;
detail views should display the source image, item
breakdown, total, in-sight and analysis timestamp.
Deletion must be confirmed and automatically update
summaries. When edits are made, there should be a
clear modified timestamp or audit log kept on the
system. It would be useful to have the data exported
into a CSV and human -readable PDF so that it can be
discussed with a qualified professional and easily
moved.
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
532
The features described above for the repository are
dis-played in a conceptual interface (Figure 5) as one
illustra-tive screen. It’s not an actual screenshot of an
execution because no instance, credentials were
found, nor were any screenshots supplied in the
workspace. The design is fo-cused on making progress
a daily habit, on being transpar-ent about how much
progress is made on items, and on providing an
actionable next step. This figure should be re-placed by
actual screenshots when the application is being used
in the target environment, particularly if submission
to an institution requires proof of use.
Figure 4: Conceptual interface; not an execution
screenshot.
Testing and Evaluation
Testing should take place at the unit, integration,
contract, interface, security and model-evaluation
level. All activity multipliers, all goal adjustments, all
macro conversions, all nutrient progress, all insight
thresholds and all next -meal branches can be verified
by unit tests, and the boundaries of BMI can be
verified. The image tests should include all accepted
extensions, mismatched MIME types, empty file, files
just below and above 10 MB, alpha conversion,
portrait and landscape resizing, and corrupt bytes.
Security units need to check for password hashing,
invalid tokens, expired tokens, invalid signature and
missing claims. Tests are deterministic and should be
run on all changes.
Integration tests should create a temporary database
and exercise registration, login, profile updates, analysis,
saving, listing, filtering, detail retrieval, dashboard
aggregation, and deletion. The mocked service should
return normal outputs as well as malformed JSON,
empty items, timeouts, rate limits, and provider
errors. Contract tests should compare API schemas
with client expectations. Automated checks should be
accompanied by manual testing of focus order, labels,
colour contrast, error announcements, and chart al-
ternatives. Mobile tests should cover camera
permissions, orientation, slow connections, and
interrupted uploads.
Evaluation of the models requires a labelled dataset
that is representative of intended use, not just beautiful
food pic-tures. The following information needs to be
documented for each case: ground-truth food identity,
weighed portion, recipe/ingredient evidence, lighting,
viewpoint, device, en-ergy, macros, fibre , number of
plate items, and cuisine. There are several metrics for
measuring the recognition: item, recall, F1, and top-k
accuracy. There are two ways to measure the
quantitative aspects: mean absolute error and mean
absolute percentage error. The per -variable MAE,
MAPE, median error and number of times within
practical tolerance bands are required for the
nutrients. If mixed meals are eaten or hidden foods
are eaten, they should be reported separately.
Examples of useful foods in the acceptance set are
sim-ple single foods, foods with known packages,
multi-item meals on a plate, liquids and soups, foods
camouflaged in sauce, shared foods, low -light, partial
occlusion, and re -gional foods. Non-food images and
empty plates should be tested too by the evaluator.
The model may give a "guess" for the input when it is
not suited to it because the prompt is to try even
when the model is not sure of the answer. There is
thus a need for a confidence or abstention mecha-
nism. Actually, when you don’t have enough
information, sometimes the appropriate thing to do is
to ask for more information or another image, not
make precision.
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
533
The image preprocessing time, external inference
latency, database query time, and end-to-end response
percentiles should be the performance metrics. The
latency of the hosted model will probably dictate the
interface, and it should not feel "frozen" if it takes a
few seconds to render. The image sizes and rate
limitations for load tests should be realistic. There’s the
risk of caching, as images of meals are user-dependent,
but it’s also possible to avoid sending the same meals
over and over again with duplicate submission
protection and idempotency keys. This is where
storage tests should be used to monitor growth and
cleaning up of preview images.
Figure 5: Illustrative seven-day series with an explicit
zero.
Table 3 contains the following suggested cases and
out-comes. The cases are not based onspeculative
accuracy claims, but on the rules stored in the
repository. This is due to the fact that the workspace
did not contain a labelled evaluation output or
reproducible run log. This separation ensures that the
report does not make hypothetical state -ments as
experimental facts. The weekly series in Figure 4 is
also illustrative and intended to show the dashboard
chart, but is not intended as a statement about a
particular participant.
Table 5: Suggested Verification Cases
Case Expected outcome
Unsupported image Specific validation error
File above 10 MB Reject before inference
Valid meal Editable items and totals
Malformed model JSON No meal created
Cross-user meal ID Deny access
Day with no meals Return zero totals
Results, Discussion, and Limitations
The project fulfils the central workflow at the level of
soft-ware design. It takes an image of a meal,
normalizes it, sends it with user context to a
multimodal model, extracts structured food items, and
returns a meal plan. It records totals, provides
persistence, calculates individual objectives from a
profile, and generates daily and weekly reports. It is
more complete than a demonstration classifier
because it includes account ownership, repeated
logging, history, and actionable feedback. The
preview-before-save boundary acknowledges the
need for human oversight.
The output is also more informative than just a calorie
value. The names and the numbers of items give the
user an idea of what the model assumed. Target
protein, car -bohydrate, fat and fibre intakes are
calculated separately, allowing for a balanced
perspective. The dashboard is designed to translate
raw numbers into consumed, target, remaining and
percentage values, and the rules to translate those
values to understandable suggestions. This can ben-
efit engagement because it addresses both "what did
the system see?" and "what should I consider next?
Numeric fields can appear precise and must be treated
with care. A picture of a bowl does not necessarily
show how deep the bowl is; oil, sugar, salt and
ingredients are invisible; and recipes vary from
household to household. Using associations instead of
chemical measurement is the way of a vision -
language model. Nutrition estimates can therefore be
wrong even when recognition is correct. Rounding,
uncertainty bands, assumption display, and user
editing should be considered as part of accuracy
communi-cation. The application should not imply
that an estimated 487 kcal is known more precisely
than a range such as 450–550 kcal.
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
534
The present implementation is based on a single
external provider and model identifier. This creates
vendor, cost, la-tency, quota, and behavioural-change
risks. The README references an earlier Gemini 2.0
Flash version, while the current service code
references Gemini 2.5 Flash; the code should be
treated as the implementation baseline, and the
documentation should be updated accordingly.
The BMI and calorie formulas are general estimates.
They do not represent all ages, disabilities, pregnancy
and lactation, metabolic conditions, medications, or
athletic contexts. In the current BMR branch, gender
is binary. This limitation should be communicated
clearly and reengi-neered through inclusive profile
options and a clinically audited calculation policy.
People with medical nutrition requirements should be
referred to qualified care rather than given automated
prescriptive messages.
The phrase "add nuts" could create an allergy hazard
and may be inappropriate for some diets. Until
constraints are collected, suggestions should remain at
category level, offer alternatives, and avoid commands.
In the next version, the recommendations should be
opt-in, and there should be a way to state exclusions.
Lastly, there are no measured results in the accessible
repository for the project. The provided workspace
contains no confusion matrix, weighed -meal
comparison, latency benchmark, or usability study. So
the right conclusion is not about the respective
clinical performance but about the ability being
implemented. A strong final evaluation would be able
to recruit a diverse sample, be able to use
standardised, free-living images, compare against
weighed or database verified records, report on
subgroups error, and collect task completion data and
data on user trust.
Future Enhancements
The first call to action is a more robust meal -
suggestion program, which is our first priority. The
application should not only allow the user to choose
one sentence from the list of remaining macro
options, but also several complete menus based on the
user defined calories, protein, carbohy-drate, fat, fibre,
allergies, dietary pattern, cuisine preference, budget,
meal preparation time, and available ingredients.
Recommendations should explain why they fit, provide
por-tion information, and allow user changes. Values
should be grounded through a retrieval layer backed
by verified food-composition and recipe databases,
while a ranking model learns from accepted and
rejected suggestions. Safety filters must never contain
allergen claims or be used for allergens. A natural
extension is a React Native application. The existing
backend provides reusable RESTful endpoints, al-
lowing the mobile client to focus on camera capture,
gallery selection, secure token storage, notifications,
offline drafts, and native accessibility. Camera
guidance could show a plate outline, detect blur,
request a second angle, and in -clude a reference card.
Unreliable networks could use back-ground upload and
local queues. Push reminders should be flexible and
contextually appropriate.
Portion estimation should move from single -image
guess-ing toward evidence -based measurement.
Evidence could include a known -size reference
object, standard -plate se -lection, multiple
photographs, short video, depth data on supported
phones, and user correction through sliders or
household measures. The system may be able to learn
from repeated corrections a personal calibration. If
there is uncertainty of quantity, it should be taken to
the nutrient ranges, so that the nutrient range is a
realistic range on the dashboard. When the interval is
too big the model should refrain and ask a question.
A recognized composition database and explicit food
mapping should provide nutrition grounding. After
visual recognition, the system can search candidate
foods, find a standardized food, scale the values
according to the es -timated portion and store the
identifier of the food. If an ingredient or a recipe can
be decomposed into multiple ingredients, they can be
combined in the case of compos -ite dishes. Recipes
and fortification vary from country to country,
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
535
requiring regional databases. When user edits are
made, they should be made to the mapping without
silently changing history.
Model governance should include a fixed benchmark,
prompt versioning, provider comparison, drift
monitoring, and human review of failure clusters.
Confidence calibra-tion must be measured; it is not
implied by fluent text. A combination of a vision -
language model and specialist classifiers for common
foods and optical character recog -nition for packaged
labels could be used in an ensemble. Consented
examples of corrected results can be gathered through
active learning, but privacy-preserving policies and de-
identification are critical.
The analytics layer can be extended to weekly,
monthly and goal period trends that go beyond the 7
days. Useful views such as meal regularity, protein
distribution across meals, fibre consistency, frequently
logged foods, and uncertainty -aware energy trends.
Include CSV, PDF and, if appropriate, a standards -
based health -data format for export. It is important
that the users can mark exercise, hunger or symptoms,
but the system does not draw any con-clusion
regarding cause and effect. Explicit and revocable
authorizations must be made for clinician sharing.
Engineering improvements include database
migrations, background task queues, object storage,
antivirus scanning, observability, structured logs, rate
limiting, retry with back-off, idempotency keys,
automated backups and disaster-recovery testing. Both
backend, frontend, schema, security and accessibility
can be performed with a containerized development
and continuous integration process. CORS should be
limited in production configuration, HTTPS to be
enforced, secrets should be rotated, and a content se -
curity policy should be used. A data-retention worker
is responsible for deleting left-behind analysis images.
Future studies could examine the effect of camera-
based logging on adherence to the logging, the impact
of the ex-planation style on level of trust, and the
differences in errors of types of logging (cuisine versus
device). The assessment should involve individuals of
different levels of digital lit-eracy level and should
assess time, correction frequency, abandonment,
perceived usefulness, and inappropriate re -liance.
The success of the project should be measured in
terms of whether users can make accurate-enough
records, that they can understand uncertainty, and that
they can make safer choices with less effort.
Conclusion
CrunchUP illustrates how computer vision and
machine learning can be combined to form a real
nutrition track-ing pipeline. It shines in integration: a
responsive React UI, typed FastAPI service, secure
identity, PostgreSQL persisting, controlled image
processing, multi-modal food analysis, personal
energy calculations, itemized food log, daily overview,
weekly charts, and meaningful suggestions that can be
interpreted. The repository is well organized, and
serves as a sound basis for future development.
The analysis also reveals that convenience is not a
sub-stitute for uncertainty. There are several
different types of errors, including food recognition,
portion inference, recipe assumptions, and nutrition
mapping. The applica -tion should be presented in an
honest and forthright manner, with all the itemized
assumptions preserved to be available for correction
and without medical interpretation. Test-ing should
include a mix of normal software verification and
dataset-based testing against weighed and composition-
grounded records. Privacy and inclusivity must be
built into storage, formulas, and recommendations.
These protections can help the project develop from a
student web application into a more reliable personal
nutri-tion assistant. Calibrated portion capture,
verified nutrition databases, confidence-aware output,
production-grade op-erations, culturally diverse
testing, grounded meal sugges-tions, and a mobile
client are the most valuable next steps. The present
system establishes the required end-to-end path and
shows how a picture can become a useful, reviewable,
and actionable dietary record.
Volume 12, Issue 5 | September-October-2026 | http://ijsrcseit.com
Vijayaraghavan R et al Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., September-October-2026, 12 (5) : 523-536
536
References
[1]. S. Bianco, M. Buzzelli, G. Ciocca, F. Piccoli, and
R. Schettini, "A study on the generalization of
DINOv2 fea-tures for food recognition tasks: A
unified evaluation frame -work," Intelligent
Systems with Applications, vol. 29, Art. no.
200632, 2026, doi: 10.1016/j.iswa.2026.200632.
[2]. P. Borugadda and H. K. Kalluri, "A
comprehensive analysis of artificial intelligence,
machine learning, deep learning and computer
vision in food science," Journal of Future Foods,
vol. 6, no. 6, pp. 971 –987, 2026, doi:
10.1016/j.jfutfo.2025.07.002.
[3]. K. V. Dalakleidi, M. Papadelli, I. Kapolos, and
K. Pa -padimitriou, "Applying image -based
food-recognition sys -tems on dietary
assessment: A systematic review," Ad -vances in
Nutrition, vol. 13, no. 6, pp. 2590 –2619, 2022,
doi: 10.1093/advances/nmac078.
[4]. Y. Feng, Y. Wang, X. Wang, B. Zhao, J. Bi, S.
Han, Z. Xiao, and Y. Luo, "RGB-D food nutrient
estimation sup -ported by FLAVA contrastive
learning," Journal of Food Composition and
Analysis, vol. 150, Art. no. 108821, 2026, doi:
10.1016/j.jfca.2025.108821.
[5]. S. Gautam, S. S. Patnaik, R. V. Kush, D. Pantola,
and V. K. Mishra, "Enhancing food analysis
with attention -based deep learning:
Ingredients, recipes, and calorie estimation,"
Procedia Computer Science, vol. 260, pp. 692 –
700, 2025, doi: 10.1016/j.procs.2025.03.248.
[6]. A. Gelli, O. Nwabuikwu, B. Bannerman, G.
Ador, V. Atadze, M. Asante, et al., "Computer
vision-assisted di -etary assessment through
mobile phones in female youth in urban Ghana:
Validity against weighed records and compar -
ison with 24 -h recalls," The American Journal
of Clinical Nutrition, vol. 120, no. 5, pp. 1105 –
1113, 2024, doi: 10.1016/j.ajcnut.2024.08.011.
[7]. S. Ghazal, A. Munir, and W. S. Qureshi,
"Computer vi -sion in smart agriculture and
precision farming: Techniques and
applications," Ar -tificial Intelligence in
Agriculture, vol. 13, pp. 64 –83, 2024, doi:
10.1016/j.aiia.2024.06.004.
[8]. Z. Li, S. Karimzadeh, A. Chavanapanit, A.
Moghimi, and M. S. Ahamed, "Detection of
calcium deficiency in indoor -grown lettuce
under LED lighting using computer vision,"
Smart Agricultural Technology, vol. 12, Art. no.
101144, 2025, doi: 10.1016/j.atech.2025.101144.
[9]. A. Ruchay, V. Kolpakov, H. Guo, and A.
Pezzuolo, "Open datasets and AI/GenAI -driven
computer vision for precision livestock farming:
A bidirectional review," Com -puters and
Electronics in Agriculture, vol. 250, Art. no.
111917, 2026, doi:
10.1016/j.compag.2026.111917.
[10]. A. P. Singh, M. A. A. Fenelon, J. P. Wold, and
A. C. Leite, "LaksData: Comprehensive database
of salmon fillets images for use in vision -based
food automation ap -plications," Data in Brief,
vol. 66, Art. no. 112771, 2026, doi:
10.1016/j.dib.2026.112771.
[11]. S. Wang, G. Sheng, H. Yan, W. Min, and S.
Jiang, "A comparative study of vision -language
models for food ingredient recognition and
nutrient estimation," Current Research in Food
Science, vol. 12, Art. no. 101405, 2026, doi:
10.1016/j.crfs.2026.101405.
[12]. H. Zhou, “Implementing computer vision
technology and innovative practices in
photography education,” Sys -tems and Soft
Computing, vol. 7, Art. no. 200419, 2025, doi:
10.1016/j.sasc.2025.200419.
论文原文与出版信息
International Journal of Scientific Research in Computer Science Engineering and Information Technology