Application of Food Nutrient Composition Analysis and Computer
Algorithm in Nutrition Recommendation System
Shuliang Liu and Jinxu Gao
Weifang Engineering Vocational College, 262500, China
Keywords: Food Nutrient Analysis, Computer Algorithms, Apriori Algorithm, Nutrition Recommendation System
Application.
Abstract: This paper studies the application of food nutrition composition and computer algorithm in nutrition
recommendation system, and uses the Apriori algorithm in computer algorithm to optimize the nutrition
recommendation results. In the process of research, this paper designs a nutritional recommendation computer
algorithm based on Apriori, further improves it, and then realizes a nutritional recommendation system based
on food nutrient analysis and Apriori algorithm based on the integration of various components. In addition,
the system is used for practical applications. According to the experimental data, the recommended
combination of high protein and low fat has met the needs of 85% of users, and the recommended combination
of high fiber and low carb water can effectively help control blood sugar. Comprehensive analysis shows that
the system can provide accurate dietary recommendations based on in-depth nutritional analysis to improve
the health of users.
1 INTRODUCTION
In recent years, due to the enhancement of Chinese
people's health awareness, personalized nutrition
recommendations have become a research hotspot.
There are researchers who can solve the problem of
personalized meal recommendations based on
manual calculations, but these methods are inefficient
and cannot meet individual needs (Beecher, 2024).
Some researchers also use statistical methods, such as
simple regression analysis, to make nutritional
recommendations, but their ability to analyze
complex nutrient combinations is limited (Beltramo,
and Bast, et al. 2023). In addition, some traditional
rule-based systems can provide some
recommendations, but they cannot be adjusted in time
according to the dynamic needs of users (Dunlop, and
Cunningham, et al. 2025). In this paper, computer
algorithms, especially Apriori association rule
mining, are used to analyze the nutritional
composition of food and make personalized
recommendations (Lara-Arevalo, and Laar, et al.
2024). The algorithm can efficiently process large-
scale nutrition data and further generate accurate
recommendations based on individual needs
(Marchese, and Hendrie, et al. 2024). This round
mainly analyzes the relationship between the
enhancement of people's health awareness and the
demand for personalized nutrition recommendation,
and puts forward the shortcomings of data statistical
methods and rule-based traditional systems in the
pertinence of nutrition recommendation, and at the
same time, introduces the value of food nutrition
composition analysis and computer algorithm in
nutrition recommendation, and then determines the
research on the system.
2 RELATED WORKS
2.1 Advantages of Computer
Algorithms
In the food nutrient analysis and nutrition
recommendation system, computer algorithms are
extremely crucial. Based on accurate data processing
and efficient computer technology, the system can
quickly parse huge nutrient data sets (Martins, and
Magnusson, et al. 2023). Computer algorithms
provide the basis for the calculation and analysis of
complex food nutrients and related data, and
effectively improve the accuracy and efficiency of
332
Liu, S. and Gao, J.
Application of Food Nutrient Composition Analysis and Computer Algorithm in Nutrition Recommendation System.
DOI: 10.5220/0013541000004664
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 3rd International Conference on Futuristic Technology (INCOFT 2025) - Volume 1, pages 332-338
ISBN: 978-989-758-763-4
Proceedings Copyright © 2025 by SCITEPRESS Science and Technology Publications, Lda.
nutrient composition analysis and prediction based on
mechanism optimization and machine learning
methods (Pickford, and McCormack, et al. 2022). In
recommendation systems, common algorithms
include regression analysis, clustering algorithms,
and association rule mining, which are conducive to
discovering hidden patterns in food nutrition content
data and generating targeted recommendations. The
introduction of computer algorithms, especially those
based on data mining, has greatly improved the ability
of the system to process large-scale complex data on
food nutrition content (Silveira, and Valler, et al.
2024). These algorithms can accurately predict the
nutritional composition of food based on the user's
historical data, and have certain learning and
optimization capabilities. Based on continuous
updates and adjustments, the system can revise the
mechanism according to real-time data to ensure the
dynamic update and optimization of recommendation
results. This ability to self-regulate makes the
application of computer algorithms in nutritional
recommendation systems extremely critical (Svarc,
and Jensen, et al. 2022).
2.2 Apriori Algorithm Can be Used for
Estimation of the Frequency of
Occurrence of Nutrient
Combinations
Among many computer algorithms, Apriori
algorithm is an important association rule mining
algorithm, which can find frequent item sets from
large data sets and generate association rules based on
these item sets. It is based on a recursive approach to
find frequently occurring combinations in the data,
such as the nutritional composition of a food, and then
identify effective recommendation patterns (Víquez,
and Morales, et al. 2022). The algorithm first defines
the degree of support, which is mainly used to
measure the frequency of occurrence of one nutrient
combination , and the confidence level, which
measures the probability of another ingredient
appearing when there is a particular nutrient
combination. In the nutrition recommendation
system, the Apriori algorithm provides data support
for personalized dietary recommendations based on
the screening of high-support and high-confidence
combinations of nutrients. Compared to other
traditional algorithms, the Apriori algorithm can
efficiently process multi-dimensional data and
generate personalized nutrition recommendations for
users. The advantage is that it can mine high-value
correlation information from the big data set, and use
this information to optimize the recommendation
mechanism of the system.
3 METHODS
3.1 The Structure of Each Component
of the Nutrition Recommendation
System
The research in this paper needs to construct a
nutritional recommendation system, which includes
six components, each of which has its own content
that needs to be responsible. Specifically, the task of
the data collection component is to collect data
related to the user's food nutrients, such as the user's
dietary history, physical fitness information,
nutritional needs, etc. The widget is based on an
interface to obtain the nutritional content data of food
products, and then maintain the integrity and
accuracy of the data. In addition, the widget interfaces
with external databases, allowing the latest food data
to be updated in real time. The task of the data
preprocessing component is to clean, standardize and
structure food nutrition data to ensure that the data
format is uniform. Data preprocessing mainly focuses
on the processing of missing values, outliers and
standardized nutrient composition data. It is also
possible to select key food ingredients relevant to
nutritional analysis based on feature extraction,
preparing them for subsequent analysis. The task of
the Association Rule Mining component is to apply
the Apriori algorithm to perform frequent itemset
mining and association rule generation. It can be
based on a set minimum level of support and
confidence to provide insight into potential
associations between food nutrients. Another task is
to export the association rules of nutrients to provide
stable, reliable, and comprehensive data support for
personalized recommendations. The task of the
recommendation engine component is to apply the
mined association rules to generate nutritional
recommendations according to the user's individual
needs. The recommendation engine provides users
with suitable food recommendations based on the
user's health goals, such as the user's fat loss goals,
muscle gain goals, etc. It can adjust the recommended
regimen in real-time to meet the different dietary
needs of users. The task of the User Feedback widget
is to collect user feedback on the recommendation
results and apply their feedback to system
optimization. Users can provide feedback on
recommended foods based on ratings, evaluations,
Application of Food Nutrient Composition Analysis and Computer Algorithm in Nutrition Recommendation System
333
etc. User feedback data is fed into the Associated
Rule widget to improve recommendation accuracy
and user experience. The task of the system
management component is to manage and monitor the
system as a whole, such as algorithm tuning, data
update, user management, etc. It ensures the stable
operation of the system and monitors the system
performance, such as recommendation accuracy, user
satisfaction, etc. The system administrator can adjust
the system parameters based on this widget to further
optimize the functionality of the system.
3.2 Mining of Frequent Itemsets and
Design of Computer Algorithms for
Nutritional Recommendations
In the frequent itemset mining stage, the algorithm
mechanism needs to mine the frequent component
combinations from a large number of food nutrient
data. The nutritional content of each food, such as
proteins, fats, carbohydrates, vitamins, minerals, etc.,
can be considered as an item. Apriori taps into these
frequent combinations of nutrients by progressively
filtering out the most supportive items. See Eq. (1) for
this.
|T(X)|
Support(X)
|T|
=
(1
)
In this formula,
()
Support X
refers to the
degree of support of item X, which is the frequency
of occurrence of the nutrient item set in all foods.
()
TX
Refers to the number of transactions that
contain item set X, in this case the number of foods
containing a specific combination of nutrients.
T
Refers to the total number of transactions, which is
the total number of all food samples. Based on this
formula, it is possible to calculate the degree of
support for each nutrient combination and identify the
nutrient combinations that occur frequently. For
example, if the combination of high protein and high
fiber is more supportive, it proves that this
combination is frequent in many foods and can be
used as a basis for nutritional recommendations.
After you've identified a frequent itemset, the next
step is to build an association rule. Association rules
are used to explore potential relationships between
nutrients, such as whether a food containing one
ingredient is often accompanied by another. The
strength of this relationship is measured based on the
calculation confidence, for which see Eq. (2).
Support(X Y)
Confidence(X Y)
Support(X)
=
(2
)
In this formula,
Confidence(X Y)
refers to
the probability that a food containing
X is another
nutrient at the same time
Y given a combination of
nutrients.
Support(X Y)
Refers to X Y is the
proportion of food products that contain both and in
the data.
Support(X Y)
Refers to the support of
the itemset
X . Is based on the calculation confidence,
it is possible to identify strong associations between
nutrients, such as certain high-protein foods that are
often found to be present with low-fat nutrients, and
corresponding association rules can be generated for
nutrition recommendations.
After the rules are generated, the associated rules
are filtered and refined. Lift is a key indicator of the
strength of association rules, which measures the
actual relevance of a combination of nutritional
recommendations. For this, see Eq. (3).
Confidence(X Y)
Lift(X Y)
Support(Y)
=
(3
)
In this formula,
Lift(X Y)
refers to the
degree of lift, which represents
X
Y
is the actual
correlation between and .
Confidence(X Y)
Refers to the confidence level of the rule.
()
Support Y
Refers to the degree of support of item
(Y), which is the proportion of nutrients in a food
Y
. If the lift is greater than 1, there is a strong positive
correlation between the two nutrients and can be used
for nutritional recommendations. For example, if the
system finds that a high-protein food is often
accompanied by a low-fat ingredient and has a high
degree of lifting, it can consider this combination as
part of the recommendation.
3.3 Further Improvement of The
Computer Algorithm for
Nutritional Recommendation
At this stage, the system generates and optimizes
association rules based on frequent scans of nutrient
data. Specifically, it is necessary to optimize the
support, confidence, and promotion thresholds of
rules to ensure that the rules generated by the system
have high relevance and reliability. Training on
multiple food samples allows the system to find high-
INCOFT 2025 - International Conference on Futuristic Technology
334
frequency and high-confidence nutrient combinations
to improve the accuracy of recommendations. For
example, the system will generate personalized
nutrition recommendations based on the user's dietary
history, recommending high-fiber foods to
supplement the user's daily missing nutrients.
In order to improve the efficiency and accuracy of
the mechanism, the generated association rules
should be pruned in the optimization stage. Rule
pruning is based on setting minimum confidence and
lift thresholds to remove redundant, meaningless
rules. For example, some rules have a higher
confidence level of less than 1, indicating that the
nutrient content of these rules is not strongly
correlated. For this, see Eq. (4).
{
Prune(X Y) Confidence(X Y)1 if 0 otherwise \ = ≥τ
(4)
In this formula, the
τ
is pruning threshold is the
minimum confidence level that is set. Based on
pruning, it can reduce useless association rules and
improve the computational efficiency of the nutrition
recommendation mechanism. For example, the
system can delete food combinations with low
confidence and weak relevance, and retain rules that
are beneficial to the user's health.
Rule merging is another important step in
improving the mechanism, based on the expansion
and merging of similar rules, the system can generate
more flexible and diverse nutrition recommendations.
For example, two similar combinations of nutrients
can be combined into a new, more extensive
recommendation rule, allowing users to have a more
diverse nutritional choice. See Eq. (5) for this.
Combine(X Y, X Y) X X Y
12 12
=∪
(5)
In this formula, X,X
12
refers to a combination
of different nutrient ingredients that can be combined
to generate a new rule. Based on the consolidation of
rules, the system will increase the flexibility of
recommendations and provide comprehensive
nutritional recommendations based on the
combination of nutrients in different foods.
In the process of improving the mechanism, it is
also necessary to evaluate the mechanism so that the
generated association rules and recommendation
results can meet the expected accuracy and user
satisfaction. Commonly used evaluation metrics are
accuracy, recall, and F1 score. See Eq. (6) for this.
Precision Recall
F
Precision Recall
12
×
+
(1)
In this formula,
Precision
refers to the precision
rate, which indicates the correct proportion of the
recommended nutrient content.
Recall
refers to the
recall rate, which is the proportion of the nutrient that
the system correctly recommends in the user's actual
needs.
Based on the evaluation of the accuracy and
recommendation effect of the system, the parameters
of the mechanism can be further optimized, and the
overall performance of the system can be improved
based on this. For example, if the system finds that
certain recommended rules have low F1 scores, they
will need to be readjusted.
3.4 Integration of the Various
Components of the Nutrition
Recommendation System
In this step, it is necessary to combine the various
components of the nutrition recommendation system
to ensure the smooth flow of data for food nutrition
content analysis and achieve accurate personalized
recommendations. To this end, the data acquisition
component will obtain the user's dietary data and food
nutrition content in real time from external databases
and sensors, and these data will be comprehensively
processed by the data preprocessing component to
become data that is more in line with the system
requirements. The processed data is transferred to the
Association Rule Mining widget, which is tasked
with analyzing the correlation of nutrients in food
using the Apriori algorithm and generating frequent
itemsets and association rules that meet the health
needs of the user. These rules will be passed to the
recommendation engine artifact to provide users with
personalized nutrition recommendations. After that,
the user feedback component will play an effective
role, which will collect feedback data such as user
satisfaction with the recommended food and the
actual effect, and return all this information to the
association rule mining model, and then realize the
update of the rules and the optimization of one set.
Then, the system management component will
coordinate the operation of each component in a
unified manner, and monitor the performance
indicators of the system, such as recommendation
accuracy, response speed and user satisfaction, which
can ensure that the nutrition recommendation system
continues to adapt to the needs of users. Based on this,
the entire nutrition recommendation system can
adjust the recommendation content in real time, and
give more accurate and personalized nutritional
analysis and recommendations.
Application of Food Nutrient Composition Analysis and Computer Algorithm in Nutrition Recommendation System
335
4 RESULTS AND DISCUSSIONG
4.1 Background of the Case
In this application case, this paper uses a food
nutrition analysis and nutrition recommendation
system based on the Apriori algorithm to accurately
analyze the nutritional needs of different user groups,
such as athletes, diabetic patients, the elderly, and
ordinary adults, to achieve personalized
recommendations. According to their different
nutritional needs, the system analyzes the most
suitable combination from the nutrient content of the
food and generates corresponding dietary
recommendations. These combinations generally
contain a variety of nutrients, such as proteins, fats,
carbohydrates, etc., covering 4 types of foods with
high nutrient content. For example, chicken breast
contains 31.0g of protein, 3.6g of fat, etc.
Table 1: Food nutrient composition data
Name of
the foo
d
Protein (g) Fat (g) Carbohydrates
(g)
Chicken
Breast
31.0 3.6 0
Cauliflower 2.8 0.4 6
Brown
Rice
3.5 1.0 22
Avocado 2.0 15.0 9
Table I shows the nutritional content data of the
foods analyzed by the recommendation system, such
as chicken breast is rich in protein, avocado is more
fat, and brown rice is higher in carbohydrates, which
provide the basis for the system's nutritional
recommendations. The process of recommending
nutritional components is shown in Figure 1.
Figure 1: The process of recommending nutritional
components.
4.2 The Recommended Effect of
Nutritional Components
Table 2: Types of users and nutritional needs
User type Protein
requirement (g)
Carbohydrate
requirement
(g)
Fat requirement
(g)
Jock 150 300 70
Diabetic 60 150 60
Senior
Citizen
50 200 65
Ordinary
Adults
70 250 75
Table 2 shows the daily nutritional requirements
for different user types, such as athletes who need
more protein and people with diabetes who need to
limit carbohydrate intake. Based on these needs, the
system generates personalized dietary
recommendationsThe distribution of nutrients is
shown in Figure 2.
Figure 2: The distribution process of nutritional
components.
The nutritional analysis can be integrated with
computers to better recommend ingredients.
4.3 The Overall Effectiveness of the
Nutrient Recommendation System
A comprehensive analysis of the data in the above
three tables shows that the system can be significantly
applied to different user groups. Specifically, high-
protein foods, such as chicken breast, are commonly
INCOFT 2025 - International Conference on Futuristic Technology
336
used in athletes' dietary recommendations, with a
90% accuracy rate for systematically recommended
protein intake. In addition, the system recommended
a high-fiber, low-carbohydrate food combination for
diabetic patients, as shown in Table 3.
Table 3: Association Rule Mining Results
Nutritional Composition
Combination
Support Confidence Lift
High in protein, low in fat 0.52 0.80 1.25
High in fiber, low in carbs 0.43 0.75 1.30
High protein, high fiber 0.48 0.78 1.35
High in vitamin C 0.35 0.60 1.18
Table 3 shows that the nutritional
recommendation system designed in this design has a
high degree of support and confidence based on the
combination of nutrients generated by association
rule mining, such as the combination of high protein
and low fat, so as to provide practical and efficient
nutritional recommendations for athletes and weight
control users with a support level of 0.43 and a
confidence level of 0.75 to ensure effective blood
glucose control. Moreover, dietary recommendations
for the elderly and ordinary adults also show the
effectiveness of the system, The analysis of
nutritional components is shown in Figure 3.
Figure 3: Analysis of nutritional components
From Figure 3, it can be seen that in the process
of recommending nutritional components, the
nutritional components are relatively reasonable and
can meet the actual needs. The fat intake is
systematically optimized to ensure that the daily fat
intake is controlled within a healthy range. User
feedback showed that the system-recommended food
combinations were effective in improving the balance
of nutrient intake, with 80% of users achieving
significant improvements in weight control, blood
sugar regulation, and overall health. Overall, the
nutrition recommendation system is based on an in-
depth analysis of the nutritional content of food to
provide accurate and personalized nutrition
recommendations for different user groups. Its
powerful association rule mining and high-support
and confidence combination recommendation can
finally achieve the user's health goals the final
recommended nutritional composition is shown in
Figure 4.
Figure 4: The final recommended nutritional content.
5 CONCLUSIONS
This paper verifies the efficient application of food
nutrient analysis and computer algorithm in nutrition
recommendation system. Based on the Apriori
algorithm, the system can quickly and accurately
analyze complex nutrient combinations in food and
provide precise dietary recommendations based on
user needs. The results show that the algorithm
performs well in processing large-scale nutrition data
and meeting personalized health needs, and provides
strong technical support for the realization of
personalized nutrition management. Moreover, the
system is flexible enough to dynamically adjust based
on user health feedback and continuously optimize
recommendations. This shows that food nutrition
analysis combined with computer algorithms can be
widely used in the field of health management and
improve the effect of personalized recommendation.
The data content of this paper is still relatively
limited, so it has certain limitations and needs to be
further studied in the future.
REFERENCES
Beecher, G.R. (2024). Evolution of food composition
knowledge in the United States from its beginning.
Journal of Food Composition and Analysis, 126.
Beltramo, B., Bast, A., Diliën, H., de Boer, A. (2023).
Nutrient composition of fresh produce-Assessing
variability between European countries to substantiate
Application of Food Nutrient Composition Analysis and Computer Algorithm in Nutrition Recommendation System
337
nutrition and health claims. Journal of Food
Composition and Analysis, 118.
Dunlop, E., Cunningham, J., Adorno, P., Fatupaito, S.,
Johnson, S.K., Black, L.J. (2025). Development of an
updated, comprehensive food composition database for
Australian-grown horticultural commodities. Food
Chemistry, 463.
Lara-Arevalo, J., Laar, A., Chaparro, M.P., Drewnowski,
A. (2024). Nutrient-Dense African Indigenous
Vegetables and Grains in the FAO Food Composition
Table for Western Africa (WAFCT) Identified Using
Nutrient-Rich Food (NRF) Scores. Nutrients, 16(17).
Marchese, L.E., Hendrie, G.A., McNaughton, S.A.,
Brooker, P.G., Dickinson, K.M., Livingstone, K.M.
(2024). Comparison of the nutritional composition of
supermarket plant-based meat and dairy alternatives
with the Australian Food Composition Database.
Journal of Food Composition and Analysis, 129.
Martins, V.A., Magnusson, N., Laska, M. (2023). Go for
Lipids! Food Preferences and Nutrient Composition in
Zoo-Housed White-Faced Sakis, <i>Pithecia
pithecia</i>. International Journal of Primatology,
44(2), 341-356.
Pickford, C., McCormack, L., Liu, Y.B., Eicher-Miller,
H.A. (2022). US Department of Agriculture Food
Composition Databases, the Food and Nutrient
Database for Dietary Studies 2013-2014, and the
National Nutrient Database for Standard Reference
Version 28 Yield Significantly Different Nutrient
Totals of Food Items from Eight Midwestern Food
Pantry Inventories. Journal of the Academy of Nutrition
and Dietetics, 122(7), 1326-+.
Silveira, P., Valler, I.W., Hirano, Z.M.B., Dada, A.N.,
Laska, M., Salazar, L.T.H. (2024). Food preferences
and nutrient composition in captive Southern brown
howler monkeys, <i>Alouatta guariba clamitans</i>.
Primates, 65(2), 115-124.
Svarc, P.L., Jensen, M.B., Langwagen, M., Poulsen, A.,
Trolle, E., Jakobsen, J. (2022). Nutrient content in
plant-based protein products intended for food
composition databases. Journal of Food Composition
and Analysis, 106.
Víquez, C.H., Morales, J.C., Castro, M.M., Herrera, C.C.
(2022). Analysis of methodological components and
available resources in Costa Rica to generate food
composition data. Journal of Food Composition and
Analysis, 106.
INCOFT 2025 - International Conference on Futuristic Technology
338