Methods, media, and equipment for personalized dietary recommendations for patients with enteritis

By analyzing the dynamic correlation between time-series physiological data and dietary components, convolutional neural networks and hidden Markov models are used to identify intestinal status, establish a symptom triggering probability matrix, and dynamically update dietary strategies. This addresses the individual differences in dietary management for patients with enteritis, achieving precise dietary intervention and restoration of diversity.

CN121393763BActive Publication Date: 2026-03-13FUJIAN UNIV OF TRADITIONAL CHINESE MEDICINE
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, dietary management for patients with enteritis lacks individualized adjustment mechanisms, and traditional static dietary recommendations are difficult to adapt to dynamic changes in intestinal function, resulting in limited accuracy and timeliness of dietary interventions.

Method used

By integrating time-series physiological data with dynamic correlation analysis of dietary components, convolutional neural networks are used to identify food components and cooking methods, hidden Markov models are combined to identify intestinal state switching nodes, a symptom trigger conditional probability matrix is ​​established, and dietary strategies are dynamically updated through online reinforcement learning mechanisms to generate personalized dietary plans.

Benefits of technology

It achieves precise matching of dietary recommendations with individual gut health, enhances the personalization and adaptability of dietary management, effectively controls the risk of symptom triggering, and promotes the gradual restoration of dietary diversity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121393763B_ABST
    Figure CN121393763B_ABST
Patent Text Reader

Abstract

This invention discloses a method, medium, and device for personalized dietary recommendations for patients with enteritis. It continuously collects dietary image data, temporal data of physiological states, and subjective symptom feedback data. A convolutional neural network is used to deconstruct food components and identify cooking methods from the dietary images, generating structured dietary vectors. A hidden Markov model is used to analyze the temporal data of physiological states, constructing an individualized physiological rhythm map. A symptom trigger conditional probability matrix is ​​established based on a multimodal association mining algorithm. Exploratory dietary plans are generated based on the user's real-time physiological state and the conditional probability matrix. The conditional probability matrix is ​​dynamically updated through an online reinforcement learning mechanism. Finally, a personalized list of dietary restrictions and a list of safe explorations are periodically output. This invention achieves precise matching between dietary recommendations and individual intestinal state fluctuations by integrating temporal physiological features and dynamic association analysis of dietary components, effectively improving the personalization and adaptability of dietary intervention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical and health information technology, specifically to a method, medium, and device for personalized dietary recommendations for patients with enteritis. Background Technology

[0002] Chronic enteritis, a common digestive system disease, often requires strict dietary management during treatment. Currently, clinical dietary guidance for enteritis patients largely relies on general nutritional principles or advice from doctors based on limited clinical experience, lacking a dynamic adjustment mechanism tailored to individual differences. While wearable devices and mobile health applications provide access to patients' daily physiological parameters and dietary records, a quantitative correlation between these multi-source data and individual symptom responses has not yet been effectively established. Especially for patients with cyclical fluctuations in intestinal function, traditional static dietary recommendations struggle to adapt to dynamic changes in their physiological state, limiting the accuracy and timeliness of dietary interventions. Therefore, how to extract individualized patterns of intestinal status from temporal physiological data and dietary records, and generate dynamically optimized dietary strategies accordingly, has become a key issue in improving the effectiveness of dietary management for enteritis patients. Summary of the Invention

[0003] In view of the above problems, the present invention provides a method, medium and device for personalized dietary recommendations for patients with enteritis. By integrating time-series physiological data with dynamic correlation analysis of dietary components, it realizes the generation of adaptive dietary strategies based on individual intestinal state fluctuations, solving the problem that existing dietary recommendations are difficult to adapt to the dynamic physiological changes of patients.

[0004] To achieve the above objectives, in a first aspect, this application provides a method for personalized dietary recommendations for patients with enteritis, comprising:

[0005] Continuously collect users' dietary image data, physiological state time series data, and subjective symptom feedback data. The physiological state time series data includes at least heart rate variability parameters and sleep quality parameters.

[0006] Based on dietary image data, a convolutional neural network is used to deconstruct food components and identify cooking methods, generating a structured dietary vector that includes the content of stimulants and the texture features of food.

[0007] Physiological state time-series data are input into the time-series pattern analysis module. The time-series pattern analysis module identifies the switching nodes between the user's stable and vulnerable intestinal state through a hidden Markov model, and constructs an individualized physiological rhythm map.

[0008] Based on structured dietary vectors, individualized physiological rhythm maps, and historical symptom feedback data, a symptom triggering conditional probability matrix is ​​established through a multimodal association mining algorithm. The conditional probability matrix represents the quantitative risk of various dietary components triggering symptoms under different physiological states.

[0009] When the system detects that the user is in a stable gut phase and the risk estimate of a specific food in the conditional probability matrix is ​​lower than the adaptive threshold, an exploratory diet plan containing recommended dosage and compatibility suggestions is generated.

[0010] Based on symptom feedback data after users implement exploratory diet plans, the conditional probability matrix is ​​dynamically updated through an online reinforcement learning mechanism to form a continuous evolutionary model of individual diet tolerance.

[0011] Based on the updated conditional probability matrix and real-time physiological data, personalized dietary taboo lists and safety exploration lists are generated periodically, and dynamic dietary strategies are output to users through a visual interactive interface.

[0012] Furthermore, based on dietary image data, convolutional neural networks are used to deconstruct food components and identify cooking methods, generating structured dietary vectors that include stimulant content and food texture features, including:

[0013] In the image preprocessing stage, multi-scale feature enhancement and background interference removal are performed on the input food image data, and feature maps containing food texture features and color space distribution are extracted.

[0014] The feature map is input into a pre-trained deep convolutional neural network, and local feature extraction and global feature fusion are performed through multiple convolutional kernels to generate a semantic segmentation map of food components.

[0015] Based on semantic segmentation graphs, the main food regions in the image are located through a region proposal network, and the boundaries of overlapping food are optimized by combining an attention mechanism.

[0016] Feature encoding is performed on the optimized food regions respectively. Deep feature descriptors for each food are generated through cross-layer feature aggregation and mapped to the standard food feature space to obtain the food composition.

[0017] The deep feature descriptor is input into the cooking method classifier, which identifies the food processing method category based on surface texture features and color saturation distribution, thus obtaining the processing method.

[0018] Based on the identified food ingredients and processing methods, the stimulant content parameters in the diet are calculated using a stimulant content estimation algorithm. These stimulant content parameters include oil content, spiciness index, and fiber roughness.

[0019] The parameters of food ingredients, processing methods, and stimulant content are integrated and encoded into a fixed-dimensional structured dietary vector. Each dimension of the structured dietary vector corresponds to a dietary feature that affects intestinal response.

[0020] Furthermore, the time-series data of physiological states are input into the time-series pattern analysis module. This module uses a hidden Markov model to identify the switching nodes between the user's stable and vulnerable intestinal states, constructing an individualized physiological rhythm map, including:

[0021] In the time-series pattern analysis module, the physiological state time-series data are subjected to sliding window standardization to eliminate individual baseline differences and short-term fluctuation interference, and extract time-series feature vectors including heart rate variability frequency domain indicators and sleep structure parameters.

[0022] The temporal feature vector is input into a pre-trained Hidden Markov Model, and the transition probability of the hidden state is calculated by the forward-backward algorithm. The hidden state includes at least two physiological states: the stable period and the vulnerable period of the intestine, and the hidden state sequence is obtained.

[0023] Based on the Viterbi decoding algorithm, the hidden state sequence is backtracked to identify the key time nodes where physiological states switch and the corresponding state duration distribution.

[0024] Based on the distribution of state switching nodes and durations, an individualized physiological rhythm map representing the periodic changes in the user's intestinal state is constructed.

[0025] Furthermore, during the operation of the Hidden Markov Model, the state transition probability matrix of the Hidden Markov Model is dynamically adjusted through a Bayesian update mechanism based on newly added physiological state time series data.

[0026] Furthermore, based on structured dietary vectors, individualized physiological rhythm maps, and historical symptom feedback data, a symptom trigger conditional probability matrix is ​​established using a multimodal association mining algorithm, including:

[0027] The structured dietary vectors are timestamped with individualized physiological rhythm maps to construct a cross-modal training sample set containing dietary features, physiological states, and symptom feedback;

[0028] Feature space mapping is performed on the cross-modal training sample set, and the correlation weights of dietary stimulus features and physiological state features in the latent space are established through canonical association analysis algorithm.

[0029] Based on correlation weights, a conditional random field model is used to construct a probability dependency graph between dietary components, physiological states and symptom triggering.

[0030] The conditional probability distribution in the probability dependency graph is solved by maximum likelihood estimation, and the symptom trigger conditional probability matrix is ​​generated. The row dimension of the trigger conditional probability matrix represents different physiological states, and the column dimension represents the characteristics of various dietary stimuli.

[0031] A time decay factor is introduced into the symptom trigger condition probability matrix, and its weight contribution is dynamically adjusted according to the time distance of historical samples.

[0032] The symptom trigger conditional probability matrix is ​​optimized by using the expectation-maximization algorithm to minimize the KL divergence between the predicted conditional probability values ​​and the actual symptom feedback data.

[0033] Furthermore, a time decay factor is introduced into the symptom trigger condition probability matrix, dynamically adjusting its weight contribution based on the time proximity of historical samples, including:

[0034] A time-weighted allocation model based on a hyperbolic decay function was constructed. The decay coefficient of the time-weighted allocation model is positively correlated with the update cycle of the user's gut microbiota.

[0035] For each historical sample in the training sample set, a time decay weight is calculated. Recent samples are given a higher weight coefficient, while the weight of distant samples decreases inversely with the square of time.

[0036] In the process of calculating conditional probability, the time decay weight is weighted and fused with the sample feature vector to generate a time-weighted training sample feature distribution.

[0037] The sliding time window mechanism dynamically filters effective training samples, retaining only historical samples with time decay weights greater than a preset threshold for model training.

[0038] Establish a time-sensitivity verification mechanism to periodically examine the contribution of the time decay factor to the symptom prediction accuracy, and automatically adjust the decay coefficient when the contribution is lower than the adaptive threshold.

[0039] The optimized time decay factor is integrated into the update process of the symptom trigger conditional probability matrix.

[0040] Furthermore, when the system detects that the user is in a stable gut phase and the risk estimate of a specific food in the conditional probability matrix is ​​below an adaptive threshold, an exploratory diet plan is generated, including recommended dosages and compatibility suggestions, including:

[0041] Obtain the current physiological state cycle of the user and the corresponding probability matrix of symptom triggering conditions, and filter the set of candidate foods with risk estimates lower than the dynamic threshold;

[0042] For each food in the candidate food set, the safe intake dose range is calculated using a dose-response relationship model based on its historical intake records and symptom feedback data.

[0043] Based on the duration and intensity of the user's current stable gut condition, a fuzzy logic algorithm is used to adaptively adjust the safe intake dose range and generate a recommended dose.

[0044] Based on the principle of complementary food components, we matched the recommended doses of candidate foods with complementary ingredients that have a mucosal protective effect to construct a complex dietary combination that reduces intestinal irritation.

[0045] Based on user dietary preference data, the flavor compatibility of complex dietary combinations is optimized to generate exploratory dietary plans that include specific ingredient ratios, cooking method suggestions, and consumption timing.

[0046] Furthermore, based on symptom feedback data after users implement exploratory diet plans, the conditional probability matrix is ​​dynamically updated through an online reinforcement learning mechanism to form a continuous evolutionary model of individual dietary tolerance, including:

[0047] The symptom feedback data after users implemented the exploratory diet plan was encoded into immediate reward signals for reinforcement learning, and the strength of the immediate reward signals was negatively correlated with the severity of symptoms;

[0048] Using the current symptom trigger conditional probability matrix as the initial parameters of the policy network, the policy gradient algorithm is used to explore the optimization direction of adjusting food risk estimation under specific physiological states.

[0049] Based on the results of the immediate reward signal and the exploratory diet plan, the temporal difference learning algorithm is used to update the state-action value function. The state of the state-action value function corresponds to the combination of physiological state and dietary characteristics, and the action of the state-action value function corresponds to the adjustment operation of risk assessment.

[0050] The historical exploration records and corresponding rewards are stored through an experience replay mechanism, and the policy network is updated in batches by periodically sampling training data.

[0051] Guided by the updated policy network, the conditional probability distribution of the corresponding entries in the symptom trigger conditional probability matrix is ​​recalibrated.

[0052] A model convergence detection mechanism is set up. When the parameter update magnitude of the policy network is lower than a preset threshold, the individual diet tolerance model is determined to have reached a stable state, and the optimized conditional probability matrix is ​​output as the current version of the continuously evolving model.

[0053] Furthermore, a historical exploration record and corresponding rewards are stored through an experience replay mechanism, and training data is periodically sampled to update the policy network in batches, including:

[0054] Construct a priority experience replay buffer and assign different sampling priorities to each historical exploration record based on the magnitude of the temporal differential error;

[0055] A stratified sampling strategy was adopted to extract training samples from the priority experience replay buffer to ensure that exploration records from different time stages and different symptom severity could participate in training in proportion.

[0056] Importance sampling weights are introduced during batch updates to correct data distribution bias caused by priority sampling;

[0057] By separating the update target of the policy network from the current policy network through a dual-network architecture, and using the target network to compute a stable temporal difference target value, the fluctuation of value estimation is reduced.

[0058] Additionally, a dynamic sampling ratio adjustment mechanism is set up to automatically increase the sampling ratio of recent exploration records when the model training loss decreases slowly;

[0059] When the stored historical exploration records exceed the capacity limit, early samples with lower information gain are prioritized for elimination, while exploration records with high training value are retained.

[0060] In a second aspect, the present invention also provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the method described in the first aspect.

[0061] In a third aspect, the present invention also provides an electronic device including a memory and a processor, the memory being used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method described in the first aspect.

[0062] Unlike existing technologies, the above-mentioned technical solution provides a method, medium, and device for personalized dietary recommendations for patients with enteritis. It continuously collects dietary image data, temporal data of physiological states, and subjective symptom feedback data; uses a convolutional neural network to deconstruct food components and identify cooking methods in the dietary images, generating structured dietary vectors; utilizes a hidden Markov model to analyze temporal data of physiological states, constructing an individualized physiological rhythm map; establishes a symptom triggering conditional probability matrix based on a multimodal association mining algorithm; generates exploratory dietary plans based on the user's real-time physiological state and the conditional probability matrix; dynamically updates the conditional probability matrix through an online reinforcement learning mechanism; and finally, periodically outputs a personalized list of dietary restrictions and a list of safe explorations. This invention, by integrating temporal physiological features and dynamic association analysis of dietary components, achieves precise matching between dietary recommendations and individual intestinal state fluctuations, effectively improving the personalization and adaptability of dietary intervention.

[0063] The above description of the invention is merely an overview of the technical solution of this application. In order to enable those skilled in the art to better understand the technical solution of this application and to implement it based on the description and drawings, and to make the above-mentioned objectives and other objectives, features and advantages of this application easier to understand, the following description is provided in conjunction with the specific embodiments and drawings of this application. Attached Figure Description

[0064] The accompanying drawings are only used to illustrate the principles, implementation methods, applications, features, and effects of specific embodiments of the present invention and other related contents, and should not be considered as limitations on this application.

[0065] In the accompanying drawings of the instruction manual:

[0066] Figure 1 This is a schematic diagram illustrating steps S101 to S107 of the method described in the specific implementation embodiment;

[0067] Figure 2 This is a schematic diagram illustrating steps S201 to S207 of the method described in the specific implementation embodiment;

[0068] Figure 3 This is a schematic diagram illustrating steps S301 to S304 of the method described in a specific implementation.

[0069] Figure 4 This is a schematic diagram illustrating steps S401 to S406 of the method described in a specific embodiment;

[0070] Figure 5 This is a schematic diagram of the structure of the electronic device described in a specific embodiment.

[0071] The reference numerals used in the above figures are explained as follows:

[0072] 1. Electronic equipment;

[0073] 11. Memory;

[0074] 12. Processor. Detailed Implementation

[0075] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.

[0076] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The term "embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment, nor does it specifically limit its independence or connection with other embodiments. In principle, in this application, as long as there are no technical contradictions or conflicts, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.

[0077] Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the use of related terms herein is merely for the purpose of describing particular embodiments and is not intended to limit this application.

[0078] In the description of this application, the term "and / or" is used to describe the logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and A and B exist simultaneously. Additionally, the character " / " in this document generally indicates that the preceding and following objects have an "or" logical relationship.

[0079] In this application, terms such as “first” and “second” are used only to distinguish one entity or operation from another, and do not necessarily require or imply any actual quantity, hierarchy or order relationship between these entities or operations.

[0080] Without further limitations, the use of terms such as “comprising,” “including,” “having,” or other similar open-ended expressions in this application is intended to cover non-exclusive inclusion, which does not exclude the presence of additional elements in a process, method, or product that includes the stated elements, such that a process, method, or product that includes a list of elements may include not only those defined elements but also other elements not expressly listed, or elements inherent to such a process, method, or product.

[0081] As understood in the Examination Guidelines, in this application, expressions such as "greater than," "less than," and "exceeding" are understood to exclude the stated number; expressions such as "above," "below," and "within" are understood to include the stated number. Furthermore, in the description of the embodiments in this application, "multiple" means two or more (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups" and "multiple times," unless otherwise explicitly specified.

[0082] In the description of the embodiments of this application, the space-related expressions used, such as "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "vertical," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential," indicate the orientation or positional relationship based on the orientation or positional relationship shown in the specific embodiments or drawings. They are only for the purpose of describing the specific embodiments of this application or for the reader's understanding, and do not indicate or imply that the device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.

[0083] Please see Figure 1 In a first aspect, this embodiment provides a method for personalized dietary recommendations for patients with enteritis, comprising:

[0084] S101. Continuously collect users' dietary image data, physiological state time series data and subjective symptom feedback data. The physiological state time series data includes at least heart rate variability parameters and sleep quality parameters.

[0085] S102. Based on dietary image data, use a convolutional neural network to deconstruct food components and identify cooking methods, generating a structured dietary vector containing stimulant content and food texture features;

[0086] S103. Input the physiological state time series data into the time series pattern analysis module. The time series pattern analysis module identifies the switching nodes between the user's stable and vulnerable intestinal state through the hidden Markov model and constructs an individualized physiological rhythm map.

[0087] S104. Based on structured dietary vectors, individualized physiological rhythm maps, and historical symptom feedback data, a symptom triggering conditional probability matrix is ​​established through a multimodal association mining algorithm. The conditional probability matrix represents the quantitative risk of various dietary components causing symptoms under different physiological states.

[0088] S105. When it is detected that the user is in a stable gut phase and the risk estimate of a specific food in the conditional probability matrix is ​​lower than the adaptive threshold, an exploratory diet plan containing recommended dosage and compatibility suggestions is generated.

[0089] S106. Based on the symptom feedback data after the user implements the exploratory diet plan, the conditional probability matrix is ​​dynamically updated through an online reinforcement learning mechanism to form a continuous evolution model of individual diet tolerance.

[0090] S107. Based on the updated conditional probability matrix and real-time physiological state data, periodically generate personalized dietary taboo lists and safety exploration lists, and output dynamic dietary strategies to users through a visual interactive interface.

[0091] In step S101, dietary image data refers to pre- and post-meal food images captured by the mobile device's camera, used to record the user's actual dietary intake; physiological state time-series data is obtained through continuous monitoring by wearable devices, including heart rate variability parameters reflecting the balance of the autonomic nervous system, and sleep quality parameters including indicators such as sleep duration and the proportion of deep sleep; subjective symptom feedback data is collected through standardized questionnaires, recording the severity of intestinal symptoms such as abdominal pain and bloating reported by the user. This step, through simultaneous collection of multi-source data, provides a comprehensive and personalized data foundation for subsequent analysis.

[0092] In step S102, the convolutional neural network uses a pre-trained ResNet architecture for feature extraction, and achieves hierarchical feature learning of food texture, color, and shape through multiple convolutional kernels; food component deconstruction is the process of identifying individual components by breaking down complex food ingredients in a food image; cooking method identification is based on the degree of surface charring and oil distribution features for classification; the structured dietary vector encodes the identified food components, cooking methods, and calculated stimulus content into fixed-dimensional numerical representations through a feature fusion layer, where the stimulus content is estimated using a pre-established food component database. This step achieves automated conversion from visual information to quantitative dietary features.

[0093] In step S103, the time-series pattern analysis module uses a sliding window to process physiological state time-series data, extracting feature sequences including the ratio of low-frequency to high-frequency heart rate variability and sleep efficiency; the Hidden Markov Model learns the transition patterns between two hidden states—a stable period and a vulnerable period—through training; state switching nodes are determined by decoding the most probable state sequence using the Viterbi algorithm; and the individualized circadian rhythm map displays the periodic change patterns of the user's intestinal state in a time-axis format. This step captures the dynamic fluctuation characteristics of intestinal function through time-series modeling.

[0094] In step S104, the multimodal association mining algorithm aligns data from different sources along the time dimension, establishing statistical associations between dietary characteristics, physiological states, and symptom feedback. The rows of the symptom triggering conditional probability matrix correspond to different physiological states, and the columns correspond to various dietary characteristics. The matrix element values ​​represent the conditional probability of symptoms occurring after consuming a certain dietary characteristic under a specific physiological state. This step quantifies the risk relationship between dietary components and symptom triggering through probabilistic modeling.

[0095] In step S105, the adaptive threshold is dynamically adjusted based on the user's historical symptom severity, and the threshold is appropriately relaxed during periods of bowel stability to encourage dietary diversity. The recommended dosage in the exploratory diet plan is calculated based on historical tolerance data, and the combination suggestions include ingredients with mucosal protective effects. This step achieves a gradual expansion of the dietary range while controlling risks.

[0096] The adaptive threshold is dynamically adjusted based on individual user differences. Its calculation process comprehensively considers the distribution of historical symptom severity, the duration of the current stable gut phase, and the stability of the recent conditional probability matrix. Preferably, it is obtained by weighted averaging the baseline level of symptom trigger probability over the past 30 days and introducing a safety margin coefficient based on physiological state confidence, where the safety margin coefficient is positively correlated with the duration of the stable gut phase. This threshold update cycle is synchronized with the update of the individualized physiological rhythm map to ensure the adaptability of the dietary recommendation strategy to changes in the user's current physiological state.

[0097] In step S106, the online reinforcement learning mechanism treats dietary exploration as a sequential decision-making process, uses symptom feedback as a reward signal, and adjusts the risk estimate in the conditional probability matrix through policy gradient updates; the continuous evolutionary model optimizes the prediction accuracy of individual tolerance through continuously accumulated user feedback. This step enables the system to adapt to long-term changes in the user's gut function.

[0098] In step S107, the personalized dietary taboo list outlines food combinations whose risk assessment exceeds the safety threshold under the current physiological state; the safety exploration list contains candidate foods with manageable risk and nutritional value; and the visual interactive interface uses color coding and progress display to help users understand the dietary recommendations. This step transforms complex analysis results into actionable daily dietary guidance.

[0099] This embodiment establishes a complete technical chain from data acquisition to strategy output through multi-source data fusion and machine learning algorithms, achieving precise matching between dietary recommendations and dynamic changes in individual intestinal status. Compared to traditional static dietary advice, this solution can adaptively adjust based on the user's real-time physiological state and dietary feedback, effectively improving the personalization and timeliness of dietary management for patients with enteritis, while promoting the gradual restoration of dietary diversity through a controllable dietary exploration mechanism.

[0100] Please see Figure 2 In some embodiments, based on dietary image data, a convolutional neural network is used to deconstruct food components and identify cooking methods, generating a structured dietary vector containing stimulant content and food texture features, including:

[0101] S201. In the image preprocessing stage, multi-scale feature enhancement and background interference removal are performed on the input food image data, and feature maps containing food texture features and color space distribution are extracted.

[0102] S202. Input the feature map into a pre-trained deep convolutional neural network, and use multi-layer convolutional kernels to extract local features and fuse global features to generate a semantic segmentation map of food components.

[0103] S203. Based on semantic segmentation graph, the main food regions in the image are located through a region proposal network, and the boundaries of overlapping food are optimized by combining an attention mechanism.

[0104] S204. Perform feature encoding on the optimized food regions respectively, generate deep feature descriptors for each food through cross-layer feature aggregation, and map them to the standard food feature space to obtain the food composition;

[0105] S205. Input the depth feature descriptor into the cooking method classifier, identify the food processing method category based on surface texture features and color saturation distribution, and obtain the processing method.

[0106] S206. Based on the identified food ingredients and processing methods, calculate the stimulant content parameters in the diet using a stimulant content estimation algorithm. The stimulant content parameters include oil content, spiciness index, and fiber roughness.

[0107] S207. The parameters of food ingredients, processing methods and stimulant content are integrated and encoded into a fixed-dimensional structured dietary vector. Each dimension of the structured dietary vector corresponds to a dietary feature that affects intestinal response.

[0108] In step S201, multi-scale feature enhancement refers to scaling the original food image using the Gaussian pyramid algorithm to extract local details and global contour features of the ingredients at different resolutions. Background interference removal employs semantic segmentation technology to separate the food area from irrelevant backgrounds such as tableware and tabletops, preserving complete visual information of the ingredients. Feature maps are extracted through convolution operations, where texture features reflect the surface roughness and structural regularity of the ingredients, and color space distribution records the hue and saturation distribution features of the ingredients in the HSV color model. This step improves the accuracy of subsequent recognition through image preprocessing.

[0109] In step S202, the pre-trained deep convolutional neural network adopts a ResNet-50 architecture finely tuned on a large food ingredient dataset. Its multi-layer convolutional kernels capture local texture patterns and global shape features of the food ingredients through different receptive fields. Global feature fusion is achieved through a feature pyramid network, which connects shallow detail features with deep semantic features across layers. The semantic segmentation map is generated using a fully convolutional network, labeling each pixel in the image with its corresponding food ingredient category. This step realizes the transformation from the original image to structured food ingredient information.

[0110] In step S203, the region proposal network generates candidate food regions through an anchor point mechanism and uses a non-maximum suppression algorithm to select the region proposals with the highest confidence. The attention mechanism calculates the feature weights of different regions through a spatial attention module and performs weighted optimization on the boundary pixels of overlapping regions, effectively solving the boundary blurring problem caused by food occlusion. This step provides accurate food segmentation results for subsequent feature extraction through refined region localization.

[0111] In step S204, feature encoding uses a pre-trained convolutional neural network to extract multi-layer features for each food ingredient region. Cross-layer feature aggregation fuses feature representations from different network layers through feature concatenation. After dimensionality reduction via principal component analysis, the deep feature descriptors are mapped to a standard food ingredient feature space through nearest neighbor search. This feature space contains standardized feature templates for common food ingredients. This step converts visual features into quantifiable food ingredient identifiers.

[0112] In step S205, the cooking method classifier uses a support vector machine multi-classification model to distinguish cooking methods such as steaming, boiling, frying, and grilling based on features such as the texture complexity, color uniformity, and edge sharpness of the food surface. Surface texture features are extracted using a local binary pattern operator, and color saturation distribution is obtained by statistically analyzing the saturation histogram of the image in HSV space. This step achieves automated recognition of cooking methods through visual feature analysis.

[0113] In step S206, the stimulant content estimation algorithm is calculated based on a food composition database and cooking method adjustment factors: oil content is estimated based on food type and cooking oil quantity, spiciness index is determined by identifying chili peppers and their processing degree, and fiber roughness is assessed based on food fiber content and cutting method. This step transforms the abstract concept of stimulants into quantifiable dietary parameters.

[0114] In step S207, the fusion encoding employs feature concatenation and normalization to integrate discrete food components, processing methods, and stimulus parameters into a numerical vector of a unified dimension. Each dimension corresponds to a specific dietary feature, such as the probability of presence of a specific food, processing intensity coefficient, and stimulus concentration value. The structured dietary vector generated in this step provides a standardized input format for subsequent multimodal association analysis.

[0115] This embodiment realizes a complete conversion process from food images to structured dietary vectors through deep visual analysis technology. Through multi-level image processing and feature extraction, this solution can accurately identify the ingredients and processing methods in complex meals and quantitatively assess their potential irritation to patients with enteritis. It provides a reliable data foundation for personalized dietary recommendations. Compared with manual recording methods, it has higher objectivity and scalability and can adapt to the diversity of daily dietary scenarios.

[0116] Please see Figure 3 In some embodiments, physiological state time-series data are input into a time-series pattern analysis module. This module uses a hidden Markov model to identify the switching nodes between the user's stable and vulnerable intestinal states, constructing an individualized physiological rhythm map, including:

[0117] S301. In the time-series pattern analysis module, the physiological state time-series data are subjected to sliding window standardization to eliminate individual baseline differences and short-term fluctuation interference, and extract time-series feature vectors including heart rate variability frequency domain indicators and sleep structure parameters.

[0118] S302. Input the temporal feature vector into the pre-trained Hidden Markov Model, and calculate the transition probability of the hidden state through the forward-backward algorithm. The hidden state includes at least two physiological states: the stable period and the vulnerable period of the intestine, and obtain the hidden state sequence.

[0119] S303. Based on the Viterbi decoding algorithm, perform optimal path backtracking on the hidden state sequence to identify key time nodes where physiological states switch and the corresponding state duration distribution.

[0120] S304. Based on the distribution of state switching nodes and durations, construct an individualized physiological rhythm map that characterizes the periodic changes in the user's intestinal state.

[0121] Furthermore, during the operation of the Hidden Markov Model, the state transition probability matrix of the Hidden Markov Model is dynamically adjusted through a Bayesian update mechanism based on newly added physiological state time series data.

[0122] In step S301, the sliding window normalization process segments the physiological state time-series data using a fixed-length data window and eliminates baseline differences between individuals using the z-score normalization method. Short-term fluctuations are smoothed using a moving average filtering technique. The heart rate variability frequency domain index in the time-series feature vector includes the ratio of low-frequency power to high-frequency power, reflecting the balance of the autonomic nervous system. Sleep structure parameters include the proportion of deep sleep duration and the number of sleep awakenings, used to assess the stability of sleep quality. This step extracts time-series features that effectively reflect the state of intestinal function through data preprocessing.

[0123] In step S302, the pre-trained Hidden Markov Model (HMM) is initialized with parameters using the Baum-Welch algorithm, where the hidden states correspond to two different physiological states: the stable phase and the vulnerable phase of the gut. The forward-backward algorithm recursively calculates the forward and backward probabilities to obtain the probability distribution of each hidden state under a given observation sequence. The state transition probability matrix is ​​obtained by statistically analyzing the frequency of state transitions in historical data, representing the transition patterns between different physiological states. This step achieves the inference from observed features to hidden states through a probabilistic model.

[0124] In step S303, the Viterbi decoding algorithm, based on the principle of dynamic programming, searches for the hidden state sequence most likely to generate the observation sequence by maintaining a path probability matrix and backtracking pointers. Key time nodes are determined by analyzing the locations where states change in the state sequence. The distribution of state durations is obtained by statistically analyzing the duration of consecutive identical states, reflecting the persistence characteristics of each state. This step accurately identifies the temporal patterns of physiological state changes.

[0125] In step S304, the individualized circadian rhythm map is displayed in time axis form, marking state transition nodes and the duration of each state. The map also includes confidence information of state transitions, provided by state probabilities calculated through a forward-backward algorithm. The periodic change pattern is summarized by analyzing state patterns over multiple consecutive cycles. The map constructed in this step intuitively presents the dynamic characteristics of the user's intestinal function.

[0126] During the operation of the Hidden Markov Model (HMM), the Bayesian update mechanism uses newly added physiological state time-series data as new observational evidence to update the parameters of the state transition probability matrix using the Bayesian formula. The update process considers the weight balance between old and new data, ensuring that the model can adapt to individual changes while maintaining stability. This dynamic adjustment mechanism enables the model to continuously adapt to the long-term evolution of the user's physiological state.

[0127] This embodiment achieves precise modeling of dynamic changes in intestinal function through temporal pattern analysis technology, overcoming the limitations of traditional assessment methods that rely on single-point detection and cannot capture the patterns of state transitions. The architecture of the Hidden Markov Model combined with Bayesian updates can both identify the current physiological state and adapt to the long-term evolution of individual physiological characteristics, providing an accurate temporal state judgment basis for personalized dietary recommendations. Compared with static physiological parameter assessment, this embodiment can more comprehensively reflect the fluctuating characteristics of intestinal function in patients with enteritis, laying the foundation for the formulation of dynamic dietary strategies.

[0128] Please see Figure 4 In some embodiments, based on structured dietary vectors, individualized circadian rhythm maps, and historical symptom feedback data, a symptom triggering conditional probability matrix is ​​established using a multimodal association mining algorithm, including:

[0129] S401. Align the structured dietary vector with the individualized physiological rhythm map using timestamps to construct a cross-modal training sample set containing dietary characteristics, physiological state, and symptom feedback;

[0130] S402. Perform feature space mapping on the cross-modal training sample set, and establish the correlation weights of dietary stimulus features and physiological state features in the latent space through the canonical association analysis algorithm.

[0131] S403. Based on correlation weights, a conditional random field model is used to construct a probability dependency graph between dietary components, physiological state and symptom triggering.

[0132] S404. Solve the conditional probability distribution in the probability dependency graph through maximum likelihood estimation, and generate the symptom trigger conditional probability matrix. The row dimension of the trigger conditional probability matrix represents different physiological states, and the column dimension represents the characteristics of various dietary stimuli.

[0133] S405. Introduce a time decay factor into the symptom trigger condition probability matrix and dynamically adjust its weight contribution according to the time distance of historical samples.

[0134] S406. The parameters of the symptom trigger conditional probability matrix are optimized by using the expectation-maximization algorithm to minimize the KL divergence between the predicted conditional probability values ​​and the actual symptom feedback data.

[0135] In step S401, timestamp alignment refers to matching data from different sources according to a unified time benchmark to ensure that dietary characteristics, physiological states, and symptom feedback within the same time period can be correctly correlated. Each sample in the cross-modal training sample set contains a structured dietary vector at a specific time point, the corresponding physiological state label, and subsequent symptom feedback data. This step constructs a standardized dataset that can be used for association analysis through data alignment.

[0136] Preferably, timestamp alignment employs a unified time reference management mechanism. Through automatic calibration between the smart terminal system clock and the wearable device's built-in clock, consistency is ensured between the time of food image acquisition, the time of heart rate variability parameter recording, and the time of sleep quality parameter monitoring. All data is timestamped to the second upon access to the system. When the time deviation between different data sources exceeds 30 seconds, the system automatically uses the front-end image acquisition time as the reference to interpolate and align the physiological state time-series data, forming a cross-modal training sample set with fully matched time dimensions.

[0137] In step S402, the feature space mapping projects features from different modalities onto a common feature space through a linear transformation; the canonical association analysis algorithm finds the direction of maximum correlation between dietary stimulus features and physiological state features, and the calculated correlation weights reflect the strength of the association between the two types of features in the latent space. This step identifies the most discriminative association pattern between dietary features and physiological state.

[0138] In step S403, the conditional random field model constructs an undirected probabilistic graphical model, where nodes represent dietary components, physiological states, and symptom-triggered events, and edges represent the conditional dependencies between these variables; correlation weights are used as edge weights to modulate the degree of influence of different features on symptom triggering. This step models the complex probabilistic relationships among multiple variables using a graph structure.

[0139] In step S404, maximum likelihood estimation iteratively optimizes to find the model parameters that maximize the probability of the observed data occurring; each element of the symptom trigger conditional probability matrix represents the conditional probability of symptoms occurring after ingesting a certain dietary stimulus under a specific physiological state. This step transforms the probability dependency into a quantifiable risk prediction matrix.

[0140] In step S405, the time decay factor employs an exponential decay function, dynamically adjusting sample weights based on the interval between sample collection time and the current time. Recent samples have higher weights, while the weights of older samples gradually decrease. This weight contribution adjustment ensures that the model pays more attention to recent dietary symptom association patterns. This step enables the model to adapt to the dynamic changes in individual gut function.

[0141] In step S406, the expectation-maximization algorithm optimizes the model parameters by alternately executing the expectation step and the maximization step; the KL divergence measures the difference between the predicted conditional probability distribution and the actual symptom feedback distribution, and minimizing this divergence makes the model prediction closer to reality. This step improves the accuracy of symptom trigger risk prediction through iterative optimization.

[0142] This embodiment establishes a quantitative relationship model between dietary characteristics, physiological states, and symptom triggers using multimodal association mining technology, solving the problem of accurately assessing the risk of specific foods triggering symptoms under specific physiological states. The architecture combining conditional probability matrices with time decay mechanisms can capture stable patterns of dietary-symptom associations while adapting to dynamic changes in individual intestinal function, providing a scientific quantitative basis for personalized dietary recommendations. Compared to experience-based dietary advice, this embodiment can more accurately predict the risk levels of various foods under different physiological states, effectively guiding the daily dietary choices of patients with enteritis.

[0143] In some embodiments, a time decay factor is introduced into the symptom trigger conditional probability matrix, and its weight contribution is dynamically adjusted according to the time distance of historical samples, including:

[0144] A time-weighted allocation model based on a hyperbolic decay function was constructed. The decay coefficient of the time-weighted allocation model is positively correlated with the update cycle of the user's gut microbiota.

[0145] For each historical sample in the training sample set, a time decay weight is calculated. Recent samples are given a higher weight coefficient, while the weight of distant samples decreases inversely with the square of time.

[0146] In the process of calculating conditional probability, the time decay weight is weighted and fused with the sample feature vector to generate a time-weighted training sample feature distribution.

[0147] The sliding time window mechanism dynamically filters effective training samples, retaining only historical samples with time decay weights greater than a preset threshold for model training.

[0148] Establish a time-sensitivity verification mechanism to periodically examine the contribution of the time decay factor to the symptom prediction accuracy, and automatically adjust the decay coefficient when the contribution is lower than the adaptive threshold.

[0149] The optimized time decay factor is integrated into the update process of the symptom trigger conditional probability matrix.

[0150] In this embodiment, the hyperbolic decay function is constructed using a reciprocal function to create a time-weighted allocation model. Its decay coefficient is set based on the approximately two-week to one-month update cycle of gut microbiota in medical research, ensuring that the changes in time weights are consistent with physiological realities. The core of the time-weighted allocation model is to give higher weight to recent data, thereby more accurately reflecting the current gut state's response to diet.

[0151] When calculating the time decay weight for each historical sample in the training sample set, an inverse square law is adopted, meaning the weight is inversely proportional to the square of the time interval. Specifically, using the current time as a reference, the weight of a sample further away from the current time decays more rapidly according to the inverse square law, which can effectively reduce the influence of stale data and avoid sudden weight changes.

[0152] In the process of calculating conditional probability, the weighted fusion of time decay weight and sample feature vector is achieved through element-wise multiplication. The generated time-weighted training sample feature distribution retains the original feature information and reflects the importance difference of the time dimension, ensuring that the model pays more attention to recent representative sample data during training.

[0153] The sliding time window mechanism selects only historical samples with a time decay weight greater than a preset threshold for training by setting a fixed time window. The preset threshold is dynamically adjusted according to the total number of samples and the model stability requirements. When the number of samples is sufficient, the threshold is appropriately increased to ensure data timeliness, and when the number of samples is insufficient, the threshold is decreased to maintain the model training requirements.

[0154] The time-sensitivity verification mechanism periodically calculates the contribution of the time decay factor to the symptom prediction accuracy, and evaluates its effectiveness by comparing the change in prediction accuracy before and after the introduction of time decay. When the contribution is lower than the adaptive threshold, the system automatically adjusts the decay coefficient. The adaptive threshold is dynamically set based on the historical mean and variance of the contribution.

[0155] By integrating the optimized time decay factor into the update process of the symptom trigger conditional probability matrix, and introducing a time weight term into the matrix update formula, the conditional probability calculation can adaptively reflect the latest changes in individual gut function. This integration method maintains the continuity of matrix updates while enhancing the model's adaptability to individual changes.

[0156] This embodiment addresses the impact of historical data timeliness on model prediction accuracy through a refined time decay mechanism. The architecture combining a hyperbolic decay function with time-sensitivity verification fully leverages the statistical regularities of historical data while promptly reflecting dynamic changes in individual gut function, ensuring the symptom trigger probability matrix always maintains an optimal fit to the current state. This embodiment can more accurately capture the evolutionary trend of individual dietary tolerance, providing a more reliable temporal risk assessment for personalized dietary recommendations.

[0157] In some embodiments, when a user is detected to be in a stable gut phase and the risk estimate of a specific food in the conditional probability matrix is ​​lower than an adaptive threshold, an exploratory diet plan containing recommended dosages and compatibility suggestions is generated, including:

[0158] Obtain the current physiological state cycle of the user and the corresponding probability matrix of symptom triggering conditions, and filter the set of candidate foods with risk estimates lower than the dynamic threshold;

[0159] For each food in the candidate food set, the safe intake dose range is calculated using a dose-response relationship model based on its historical intake records and symptom feedback data.

[0160] Based on the duration and intensity of the user's current stable gut condition, a fuzzy logic algorithm is used to adaptively adjust the safe intake dose range and generate a recommended dose.

[0161] Based on the principle of complementary food components, we matched the recommended doses of candidate foods with complementary ingredients that have a mucosal protective effect to construct a complex dietary combination that reduces intestinal irritation.

[0162] Based on user dietary preference data, the flavor compatibility of complex dietary combinations is optimized to generate exploratory dietary plans that include specific ingredient ratios, cooking method suggestions, and consumption timing.

[0163] In this embodiment, the physiological state cycle is identified by a hidden Markov model as the user's current gut health status, either stable or vulnerable. The symptom trigger conditional probability matrix provides risk estimates for various foods under different physiological states. The dynamic threshold is dynamically adjusted based on the user's historical symptom severity and current physiological stability, with the threshold appropriately relaxed during the gut health period to encourage dietary diversity. This step ensures the safety foundation of the exploratory diet through risk screening.

[0164] The dose-response model was established using logistic regression. By analyzing the correlation between food dosages and symptom feedback in historical intake records, it calculated the safe intake range that would not trigger symptoms. The model considered individual differences in sensitivity to different foods, providing personalized dosage recommendations for each candidate food. This step achieved a quantitative transformation from risk identification to specific dosage.

[0165] The fuzzy logic algorithm uses the duration and strength of the intestinal steady-state period as input variables, and flexibly adjusts the safe intake dose range through a fuzzy rule base. The longer the duration and the higher the stability, the more appropriate the recommended dose can be; conversely, a conservative strategy is adopted. This adjustment method respects the actual differences in individual physiological states while maintaining logical consistency in the recommendations.

[0166] The principle of food component complementarity, based on nutritional and food science knowledge, pairs potentially irritating candidate foods with ingredients that have mucosal protective effects. For example, spicy foods are paired with pectin-rich ingredients, and high-fiber foods are paired with easily digestible ingredients. This interaction between components reduces the overall dietary irritation to the intestines. This step enhances the acceptability of the dietary plan through scientific pairing.

[0167] Flavor suitability optimization, based on user dietary preference data, adjusts the seasoning methods, cooking techniques, and consumption order of complex dietary combinations while ensuring nutrition and tolerability. For example, seasoning schemes are adjusted according to users' preferences for salty and sweet flavors, and suitable processing methods are recommended based on cooking habits. This step improves adherence to the dietary plan through personalization.

[0168] This embodiment achieves the goal of gradually expanding the dietary range of patients with enteritis under safe conditions through a systematic dosage control and compatibility optimization mechanism. The dose-response model combined with fuzzy logic ensures the safety of the exploration while fully utilizing the expansion opportunities during the stable period; the dual strategy of complementary ingredients and taste optimization improves the implementation effect of the protocol from both physiological adaptability and psychological acceptability dimensions. Compared with contraindication list management, this embodiment can more scientifically guide patients in dietary exploration, promoting the restoration of dietary diversity and improvement of nutritional status.

[0169] In some embodiments, based on symptom feedback data after a user implements an exploratory diet plan, the conditional probability matrix is ​​dynamically updated through an online reinforcement learning mechanism to form a continuous evolutionary model of individual diet tolerance, including:

[0170] The symptom feedback data after users implemented the exploratory diet plan was encoded into immediate reward signals for reinforcement learning, and the strength of the immediate reward signals was negatively correlated with the severity of symptoms;

[0171] Using the current symptom trigger conditional probability matrix as the initial parameters of the policy network, the policy gradient algorithm is used to explore the optimization direction of adjusting food risk estimation under specific physiological states.

[0172] Based on the results of the immediate reward signal and the exploratory diet plan, the temporal difference learning algorithm is used to update the state-action value function. The state of the state-action value function corresponds to the combination of physiological state and dietary characteristics, and the action of the state-action value function corresponds to the adjustment operation of risk assessment.

[0173] The historical exploration records and corresponding rewards are stored through an experience replay mechanism, and the policy network is updated in batches by periodically sampling training data.

[0174] Guided by the updated policy network, the conditional probability distribution of the corresponding entries in the symptom trigger conditional probability matrix is ​​recalibrated.

[0175] A model convergence detection mechanism is set up. When the parameter update magnitude of the policy network is lower than a preset threshold, the individual diet tolerance model is determined to have reached a stable state, and the optimized conditional probability matrix is ​​output as the current version of the continuously evolving model.

[0176] In this embodiment, the encoding process of the immediate reward signal quantifies the severity of symptoms into a numerical score. The highest reward value is assigned when there are no symptoms, a moderate reward for mild symptoms, a lower reward for obvious symptoms, and a negative reward for severe symptoms. This encoding method enables the reinforcement learning system to clearly distinguish the quality of different dietary exploration outcomes, providing clear guidance for model optimization.

[0177] The policy network employs a fully connected neural network structure, using the current symptom trigger conditional probability matrix as the initial values ​​for the network weights. The policy gradient algorithm calculates the gradient of the reward signal with respect to the network parameters, guiding the network to adjust the weights in the direction of obtaining higher expected rewards. This ensures that the model performs incremental optimization based on inherited knowledge, avoiding performance fluctuations that may result from learning from scratch.

[0178] Temporal difference learning algorithms update the state-action value function by comparing value estimates of continuous states. The state is composed of physiological and dietary characteristics, while the action corresponds to fine-tuning the risk assessment of food. This algorithm iteratively updates the value estimate using the Bellman equation, gradually approximating the true risk-reward relationship. It effectively handles sequential decision-making problems and progressively optimizes long-term cumulative rewards.

[0179] The experience replay mechanism establishes a circular buffer to store historical exploration records. Each record contains a quadruple of state, action, reward, and next state. Batch data is periodically and randomly sampled from the buffer to train the policy network. This offline learning method breaks the temporal correlation between data, improving training efficiency and stability. Experience replay also prevents valuable learning samples from being quickly forgotten by preserving important exploration experiences.

[0180] After the policy network is updated, the conditional probability distribution of the network output is normalized to recalibrate the corresponding entries of the symptom trigger conditional probability matrix. The calibration process maintains the validity of the probability distribution, ensuring that the probability values ​​of all entries are between zero and one and that the sum of the probabilities in each row is one, thus transforming the learning results of the neural network into an interpretable probability matrix update.

[0181] The model convergence detection mechanism continuously monitors the update magnitude of the policy network parameters. When the norm of parameter changes is consistently below a preset threshold across multiple training epochs, the model is considered to have reached a stable state. The preset threshold is dynamically adjusted based on the network size and training stage. A larger threshold is set in the early stages of training to allow for rapid learning, while the threshold is gradually tightened in later stages to ensure sufficient convergence. This detection mechanism ensures that the model stops updating promptly after sufficient learning, avoiding overfitting.

[0182] This embodiment achieves continuous self-optimization of the conditional probability matrix through a systematic reinforcement learning framework, addressing the problem that static models cannot adapt to long-term changes in individual dietary tolerance. The combination of immediate reward encoding and temporal difference learning enables the model to learn from actual dietary exploration results, while experience replay and convergence detection ensure the stability and efficiency of the training process. This embodiment can autonomously adapt to the evolution of the user's intestinal function, forming a truly personalized, continuously evolving model, providing increasingly precise dietary guidance for patients with enteritis.

[0183] In some embodiments, a historical exploration record and corresponding reward are stored through an experience replay mechanism, and the policy network is updated in batches by periodically sampling training data, including:

[0184] Construct a priority experience replay buffer and assign different sampling priorities to each historical exploration record based on the magnitude of the temporal differential error;

[0185] A stratified sampling strategy was adopted to extract training samples from the priority experience replay buffer to ensure that exploration records from different time stages and different symptom severity could participate in training in proportion.

[0186] Importance sampling weights are introduced during batch updates to correct data distribution bias caused by priority sampling;

[0187] By separating the update target of the policy network from the current policy network through a dual-network architecture, and using the target network to compute a stable temporal difference target value, the fluctuation of value estimation is reduced.

[0188] Additionally, a dynamic sampling ratio adjustment mechanism is set up to automatically increase the sampling ratio of recent exploration records when the model training loss decreases slowly;

[0189] When the stored historical exploration records exceed the capacity limit, early samples with lower information gain are prioritized for elimination, while exploration records with high training value are retained.

[0190] In this embodiment, the priority experience replay buffer determines its sampling priority by calculating the absolute value of the temporal difference error of each historical exploration record. Samples with larger errors are considered to have higher learning value, thus obtaining a higher sampling probability. This priority allocation mechanism based on learning value can accelerate the convergence process of the policy network.

[0191] Stratified sampling categorizes historical data based on two dimensions: time period and symptom severity. This ensures that each category participates in training according to its proportion within the overall population. Time periods are divided into recent, mid-term, and long-term periods, while symptom severity is categorized into asymptomatic, mild, and obvious symptoms. Stratified sampling guarantees the representativeness of the training data and prevents the model from being biased towards specific types of training samples.

[0192] Importance sampling weights are calculated based on the ratio of a sample's actual sampling probability to its theoretical probability under uniform sampling. Weight correction eliminates data distribution bias caused by priority sampling. These weights are used as weighting coefficients for the samples during training loss calculation, ensuring unbiased gradient updates. This correction mechanism maintains the theoretical convergence guarantee of the reinforcement learning algorithm.

[0193] The dual-network architecture comprises a current policy network and a target policy network, where the target network periodically synchronizes parameters from the current network to compute stable temporal difference target values. The difference in parameter update frequencies between the two networks reduces fluctuations in value estimation and improves the stability of the training process.

[0194] A dynamic sampling ratio adjustment mechanism monitors the changing trend of the model's training loss, automatically increasing the sampling ratio of recent exploration records when the loss decreases slowly. Recent records often contain more information reflecting the current individual state, and increasing their sampling weight helps the model quickly adapt to the latest changes in dietary tolerance. This adaptive adjustment enhances the model's responsiveness to dynamic changes in individuals.

[0195] The buffer capacity management employs an information gain evaluation mechanism. When the stored records exceed the capacity limit, early samples with high overlap with existing knowledge or low learning value are prioritized for elimination. Information gain is quantified by comparing the change in model prediction uncertainty before and after sample addition during training. Retaining high information gain samples ensures the knowledge density of the experience replay buffer. This step optimizes the utilization efficiency of limited storage space through an intelligent elimination mechanism.

[0196] This embodiment significantly improves the efficiency and stability of reinforcement learning training through an optimized experience replay mechanism. The combination of priority sampling and stratified sampling accelerates the learning of important experiences while maintaining the comprehensiveness of training data; the dual-network architecture and importance sampling ensure training convergence at the algorithmic level; and the dynamic sampling ratio and intelligent elimination mechanism enable the system to adaptively manage learning resources. Compared to standard experience replay methods, this embodiment can extract knowledge more efficiently from limited dietary exploration experiences, accelerate the optimization process of individual dietary tolerance models, and provide faster and more accurate dietary recommendation services for patients with enteritis.

[0197] In a second aspect, this embodiment also provides a computer-readable storage medium storing computer program instructions thereon, which, when executed by a processor, implement the method described in the first aspect.

[0198] The computer program involved in this embodiment can be stored in a computer device readable storage medium, which includes, but is not limited to, disks, magnetic tapes, magnetic cards, floppy disks, flash memory, optical disks, optical cards, read-only memory (ROM), random access memory (RAM), erasable programmable ROM (EPROM), and electrically erasable programmable ROM (EEPROM), etc. It also includes other biological, physical, or chemical structures capable of performing similar or equivalent functions to the storage media listed above, such as DNA, RNA, proteins, and other units with information storage capabilities. In specific embodiments, the storage medium involved can be one of the above-mentioned media types or a combination of the above media types. In different embodiments, the computer program involved in the embodiment can be centrally stored in a single medium or distributed across multiple media. The memory containing the computer device readable storage medium can be non-volatile memory or random access memory. These computer device readable storage media can be built into the device or connected to the device involved in the embodiment as an external device or part of an external device. In some embodiments, the memory having a computer device readable storage medium is deployed locally; in other embodiments, the memory may be deployed remotely from the processor, for example, as a network-attached memory accessed via RF circuitry or an external port and a communication network, wherein the communication network may be the Internet, one or more intranets, a local area network (LAN), a wide area network (WLAN), a storage area network (SAN), or a suitable combination thereof, as long as computer device access to the memory is enabled. Furthermore, the computer program involved in the embodiments may be stored in plaintext / ciphertext form, or it may be designed as training data, integrated and recombined through model training and implicitly stored in the parameter states of a deep neural network or other machine learning model.

[0199] Please see Figure 5In a third aspect, this embodiment also provides an electronic device 1, including a memory 11 and a processor 12, wherein the memory 11 is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor 12 to implement the method described in the first aspect.

[0200] The processor described in this embodiment can be implemented by hardware, firmware, software, or a combination thereof. It can be a circuit, one or more of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, or a microprocessor. It also includes other physical, biological, or chemical structures that can implement the same or equivalent functions as the processors listed above, such as biological neurons, quantum computing units, DNA computing units, etc., so that the processor can execute some or all of the steps in the computer program or method involved in the various embodiments of this application, or any combination of the steps mentioned therein.

[0201] By adopting the above technical solutions, this invention differs from existing technologies and possesses the following beneficial effects: Through multi-source data fusion and machine learning technology, it achieves precise personalization and dynamic adaptability in dietary recommendations for patients with enteritis. First, by continuously collecting dietary images, time-series data of physiological states, and symptom feedback, and combining convolutional neural networks and hidden Markov models, structured dietary vectors and individualized physiological rhythm maps are constructed to quantitatively represent the dynamic characteristics of dietary components and intestinal states. Second, a multimodal association mining algorithm is used to establish a symptom trigger conditional probability matrix, accurately assessing the risk level of various foods under different physiological states. Furthermore, online reinforcement learning mechanisms are used to continuously optimize model parameters, enabling dietary recommendations to adapt to the long-term evolution of individual tolerance. Based on this, during the stable intestinal period, the system intelligently generates exploratory dietary plans containing recommended dosages and compatibility suggestions, gradually expanding dietary diversity while controlling risks. Finally, through periodically updated lists of dietary restrictions and safe explorations, it provides users with actionable dynamic dietary strategies. The above technical solutions effectively solve the problem of dietary recommendations being disconnected from the patient's real-time physiological state, significantly improving the timeliness and individual matching of dietary management, while simultaneously promoting the gradual improvement of the patient's nutritional status through a scientifically controllable dietary exploration mechanism.

[0202] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.

Claims

1. A method of personalized dietary recommendation for an enteritis patient, characterized by, Comprise: Continuously collect dietary image data, physiological state time series data and subjective symptom feedback data of the user, the physiological state time series data at least including heart rate variability parameters and sleep quality parameters; Based on the dietary image data, the food ingredient composition is decomposed and the cooking method is recognized by the convolutional neural network to generate a structured meal vector containing stimulant content and food texture characteristics; The physiological state time series data is input into the time series pattern analysis module, and the time series pattern analysis module identifies the intestinal stable period and fragile period state switching node of the user through the hidden Markov model, and constructs an individualized physiological rhythm atlas; Based on the structured meal vector, the individualized physiological rhythm atlas and the historical symptom feedback data, a symptom trigger condition probability matrix is established by a multi-modal correlation mining algorithm, and the condition probability matrix represents the quantitative risk of different physiological states under the action of each type of dietary ingredient; When it is detected that the user is in the intestinal stable period and the risk evaluation of a specific food in the condition probability matrix is lower than the adaptive threshold, an exploratory dietary regimen containing recommended dose and compatibility suggestion is generated; According to the symptom feedback data of the user after executing the exploratory dietary regimen, the condition probability matrix is dynamically updated through an online reinforcement learning mechanism to form a continuous evolution model of individual dietary tolerance; Based on the updated condition probability matrix and real-time physiological state data, a personalized dietary taboo list and a safe exploration list are periodically generated, and a dynamic dietary strategy is output to the user through a visual interactive interface; The physiological state time series data is input into the time series pattern analysis module, and the time series pattern analysis module identifies the intestinal stable period and fragile period state switching node of the user through the hidden Markov model, and constructs an individualized physiological rhythm atlas, comprising: In the time series pattern analysis module, the physiological state time series data is standardized by sliding window to eliminate individual baseline differences and short-term fluctuation interference, and a time series feature vector including heart rate variability frequency domain indicators and sleep structure parameters is extracted; The time series feature vector is input into the pre-trained hidden Markov model, and the transition probability of the hidden state is calculated by the forward-backward algorithm, the hidden state at least including intestinal stable period and fragile period, and a hidden state sequence is obtained; Based on the Viterbi decoding algorithm, the optimal path of the hidden state sequence is backtracked to identify the key time node of the physiological state switching and the corresponding state duration distribution; According to the state switching node and the duration distribution, an individualized physiological rhythm atlas representing the periodic variation rule of the user's intestinal state is constructed; And during the operation of the hidden Markov model, the state transition probability matrix of the hidden Markov model is dynamically adjusted by the Bayesian update mechanism according to the newly added physiological state time series data; Based on the structured meal vector, the individualized physiological rhythm atlas and the historical symptom feedback data, a symptom trigger condition probability matrix is established by a multi-modal correlation mining algorithm, comprising: The structured meal vector and the individualized physiological rhythm atlas are time stamped and aligned to construct a cross-modal training sample set containing dietary features, physiological states and symptom feedbacks; perform feature space mapping on the cross-modal training sample set, and establish correlation weights of dietary stimulus features and physiological state features in a latent space through a canonical correlation analysis algorithm; based on the correlation weights, construct a probability dependency graph among dietary components, physiological states, and symptom triggers using a conditional random field model; solve conditional probability distributions in the probability dependency graph through maximum likelihood estimation to generate a symptom trigger conditional probability matrix, wherein a row dimension of the symptom trigger conditional probability matrix represents different physiological states, and a column dimension represents various dietary stimulus features; introduce a time decay factor into the symptom trigger conditional probability matrix to dynamically adjust weight contributions of historical samples according to their time proximity; perform parameter optimization on the symptom trigger conditional probability matrix through an expectation maximization algorithm to minimize the KL divergence between conditional probability prediction values and actual symptom feedback data.

2. The method of personalized diet recommendation for enteritis patients according to claim 1, characterized in that, perform ingredient component decomposition and cooking method recognition on the dietary image data through a convolutional neural network to generate a structured dietary vector containing stimulus content and food texture features, including: in an image preprocessing stage, perform multi-scale feature enhancement and background interference elimination on the input dietary image data to extract a feature map containing food material texture features and color space distribution; input the feature map into a pre-trained deep convolutional neural network to perform local feature extraction and global feature fusion through multiple convolution kernels to generate a semantic segmentation atlas of food material components; based on the semantic segmentation atlas, locate main food material regions in the image through a region proposal network, and combine an attention mechanism to optimize boundaries of overlapping food materials; perform feature encoding on the optimized food material regions respectively to generate deep feature descriptors of each food material through cross-layer feature aggregation, and map the deep feature descriptors to a standard food material feature space to obtain food material components; input the deep feature descriptors into a cooking method classifier to identify processing method categories of food based on surface texture features and color saturation distribution to obtain processing methods; based on the identified food material components and processing methods, calculate stimulus content parameters in the diet through a stimulus content estimation algorithm, wherein the stimulus content parameters include oil content, spiciness index, and fiber roughness; fuse and encode the food material components, processing methods, and stimulus content parameters into a structured dietary vector of fixed dimensions, wherein each dimension of the structured dietary vector corresponds to a dietary feature affecting intestinal reactions.

3. The method of personalized diet recommendation for enteritis patients according to claim 1, characterized in that, introduce a time decay factor into the symptom trigger conditional probability matrix to dynamically adjust weight contributions of historical samples according to their time proximity, including: construct a time weight allocation model based on a hyperbolic decay function, wherein a decay coefficient of the time weight allocation model is positively correlated with an update period of intestinal flora of a user; calculate time decay weights for each historical sample in the training sample set, wherein recent samples are assigned higher weight coefficients, and weight of a long-term sample decreases inversely with the square of time; in a conditional probability calculation process, weight and fuse the time decay weights and sample feature vectors to generate a time-weighted training sample feature distribution; Dynamically filter effective training samples through a sliding time window mechanism, and only keep historical samples with time decay weight greater than a preset threshold to participate in model training; Establish a time sensitivity verification mechanism to regularly check the contribution of the time decay factor to the accuracy of symptom prediction, and automatically adjust the decay coefficient when the contribution is lower than the adaptive threshold; Integrate the optimized time decay factor into the updating process of the symptom trigger condition probability matrix.

4. The method of personalized diet recommendation for enteritis patients according to claim 1, characterized in that, When it is detected that the user is in the intestinal stable period and the risk estimate of a specific food in the condition probability matrix is lower than the adaptive threshold, generate an exploratory dietary regimen containing recommended doses and compatibility suggestions, including: Obtain the physiological state cycle of the current user and the corresponding symptom trigger condition probability matrix, and filter the candidate food set with a risk estimate lower than the dynamic threshold; For each food in the candidate food set, calculate the safe intake dose range based on its historical intake records and symptom feedback data through a dose-response relationship model; According to the current duration and intensity of the user's intestinal stable period, adaptively adjust the safe intake dose range through a fuzzy logic algorithm to generate a recommended dose; Based on the food ingredient complementarity principle, match the candidate food of the recommended dose with compatible food materials that have a mucosa protective effect to construct a composite meal combination that reduces intestinal irritation; According to the collected user dietary preference data, optimize the taste adaptability of the composite meal combination to generate an exploratory dietary regimen containing specific food material ratios, cooking method suggestions, and eating timing.

5. The method of personalized diet recommendation for enteritis patients according to claim 1, characterized in that, According to the symptom feedback data of the user after executing the exploratory dietary regimen, dynamically update the condition probability matrix through an online reinforcement learning mechanism to form a continuous evolution model of individual dietary tolerance, including: Encode the symptom feedback data of the user after executing the exploratory dietary regimen as an immediate reward signal for reinforcement learning, and the intensity of the immediate reward signal is negatively correlated with the severity of the symptoms; Take the current symptom trigger condition probability matrix as the initial parameters of the policy network, and explore the optimization direction of adjusting the food risk estimate under a specific physiological state through a policy gradient algorithm; Based on the immediate reward signal and the execution results of the exploratory dietary regimen, update the state-action value function using a time-difference learning algorithm, where the state of the state-action value function corresponds to the physiological state and the meal feature combination, and the action of the state-action value function corresponds to the adjustment operation of the risk estimate; Store historical exploration records and corresponding rewards through an experience replay mechanism, and regularly sample training data to update the policy network in batches; Under the guidance of the updated policy network, recalibrate the conditional probability distribution of the corresponding items in the symptom trigger condition probability matrix; Set up a model convergence detection mechanism, when the parameter update amplitude of the policy network is lower than the preset threshold, determine that the individual dietary tolerance model reaches a stable state, and output the optimized condition probability matrix as the current version of the continuous evolution model.

6. The method of personalized diet recommendation for enteritis patients according to claim 5, characterized in that, Store historical exploration records and corresponding rewards through an experience replay mechanism, and regularly sample training data to update the policy network in batches, including: A priority experience replay buffer is constructed, and each historical exploration record is assigned a different sampling priority according to the size of the timing difference error; A stratified sampling strategy is adopted to extract training samples from the priority experience replay buffer, ensuring that exploration records of different time stages and different symptom severities can participate in training in proportion; Importance sampling weights are introduced in the batch update process to correct the data distribution deviation caused by priority sampling; A double network architecture separation strategy is used to separate the update target of the policy network from the current policy network, and the target network is used to calculate stable timing difference target values to reduce the fluctuation of value estimation; A dynamic sampling ratio adjustment mechanism is set to automatically increase the sampling ratio of recent exploration records when the model training loss decreases slowly; When the stored historical exploration records exceed the capacity limit, the early samples with low information gain are preferentially eliminated, and exploration records with high training value are retained.

7. A computer readable storage medium having stored thereon computer program instructions, wherein, The computer program instructions, when executed by the processor, implement the method of any one of claims 1-6.

8. An electronic device comprising a memory and a processor, characterized in that The memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Personalized diet and exercise recommendation method and system and electronic equipment

    CN116994709A

  • Liver disease diagnosis and treatment strategy recommendation method based on knowledge graph, medium and equipment

    CN120564949A