A method and system for constructing a database of children's snack additive consumption

CN122417455BActive Publication Date: 2026-09-11TIANJIN CENT FOR DISEASE CONTROL & PREVENTION +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610840811.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-11
Publication Date
2026-09-11
Estimated Expiration
2046-06-11

AI Technical Summary

Technical Problem

现有技术中在构建数据库时,需要对样本进行清洗操作,传统的动态阈值异常值识别算法在儿童零食添加剂检测领域并不适用,由于儿童的零食摄入行为具有极强的时序波动性,周末聚会时的单次高热量、高添加剂零食摄入,在孤立的时间点上会被传统异常值识别算法判定为高异常值,然而,这种波动是正常的社会行为模式的一部分,传统动态阈值法无法区分这种正常情况,会不加区分地将所有偏离整体均值的记录同等对待,导致大量真实的、具有分析价值的极端消费样本被错误地剔除

Benefits of technology

本发明通过基于特征权重的动态识别算法与基于时间序列稳定性的自适应权重调整机制的结合,实现了异常样本的智能甄别。动态权重确保了高影响特征在风险计算中获得与其危害相匹配的关注度,基于时间序列稳定性的自适应权重调整对于饮食行为稳定的记录允许偶发的峰值出现,对于行为模式剧变的记录,本实施例的算法可以敏锐捕捉潜在的持续风险。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122417455B_ABST
    Figure CN122417455B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of food consumption data processing and analysis, and particularly relates to a method and system for constructing a children's snack additive consumption database; the present application realizes intelligent identification of abnormal samples by combining a dynamic identification algorithm based on feature weights and an adaptive weight adjustment mechanism based on time series stability. The dynamic weight ensures that high-impact features obtain attention matching their hazards in risk calculation, and the adaptive weight adjustment based on time series stability allows occasional peaks to occur for stable records of eating behavior. For records of dramatic changes in behavior patterns, the algorithm becomes alert and acutely captures potential ongoing risks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of food consumption data processing and analysis technology, and in particular to a method and system for constructing a database of children's snack additive consumption. Background Technology

[0002] Assessing children's exposure to food additives is a crucial means of preventing and controlling food safety risks, and its core foundation lies in building a high-quality database of additive consumption. Current technologies require sample cleaning during database construction. Traditional dynamic threshold outlier identification algorithms are not applicable to the detection of food additives in children's snacks. Because children's snack consumption behavior exhibits strong temporal fluctuations, a single instance of high-calorie, high-additive snack consumption during a weekend gathering might be identified as a high outlier by traditional outlier identification algorithms at an isolated point in time. However, such fluctuations are part of normal social behavior patterns, and traditional dynamic threshold methods cannot distinguish these normal situations. They indiscriminately treat all records deviating from the overall mean equally, leading to the erroneous rejection of a large number of real, analytically valuable extreme consumption samples. This not only results in the loss of valuable data but, more importantly, it can cause subsequent risk assessment models to underestimate the actual peak exposure risk, leading to overly optimistic risk assessment results and creating potential safety hazards. Summary of the Invention

[0003] To address the aforementioned technical problems, this invention provides a method and system for constructing a consumer database of children's snack additives, which solves the problems existing in the prior art.

[0004] According to one aspect of the present invention, a method for constructing a database of children's snack additive consumption is provided, the method comprising the following steps: S1: Collect children's snack consumption data through a structured questionnaire on children's snack consumption; S2: Obtain test data on additives in children's snacks; S3: Perform data preprocessing on the children's snack consumption data and the children's snack additive detection data to form a structured initial data table; S4: Use a feature weight-based outlier dynamic identification algorithm to clean the initial data table of the current sample, and delete the outlier sample when the current sample is identified as an outlier. Specifically, S4 is: S4.1: Extract several key fields from the initial data table as features of the feature set, and calculate the basic statistics of the extracted features; S4.2: Calculate the behavioral time series stability index of the current sample; S4.3: Determine the dynamic weights based on the behavioral time series stability index of the current sample; S4.4: Calculate the comprehensive anomaly score of the i-th sample based on the dynamic weights; S4.5: Calculate the dynamic threshold based on the comprehensive anomaly score, and determine the abnormal samples, deleting the samples determined to be abnormal. S5: Store the cleaned samples according to the preset database structure to build a database of children's snack additive consumption.

[0005] Preferably, in step S4.1, a feature set is selected from the initial data table, consisting of the child's age, single snack consumption amount, snack energy density, additive detection value, and the child's average intake of the same type of snack over the past 72 hours; then the mean and standard deviation of the extracted features are calculated as basic statistics. Among them, features mean The calculation formula is: ; In the formula, N is the total number of samples. Let be the j-th feature value of the i-th sample.

[0006] Each feature Standard deviation The calculation formula is: .

[0007] Preferably, in S4.2, the coefficient of variation of the average intake of the same type of snack by the child in the current sample over the past 72 hours with respect to its baseline statistic is calculated; The behavioral time series stability index of the current sample is calculated based on the coefficient of variation.

[0008] Preferably, the formula for calculating the coefficient of variation is: ; In the formula, The coefficient of variation is the average intake of the same type of snack by the child in the current sample i over the past 72 hours. This represents the child's average intake of similar snacks over the past 72 hours; Preferably, calculating the behavioral time series stability index of the current sample based on the coefficient of variation specifically involves mapping the coefficient of variation to a stability index within the [0, 1] interval, using the following formula: ; In the formula, Let α be the time series stability index of the behavior of the current sample i, and let α be the adjustment factor.

[0009] Preferably, in step S4.3, a basic weight is determined for each feature of the feature set; Determine the adjustment factor for each feature of the feature set; Calculate the final dynamic weights.

[0010] Preferably, the formula for calculating the adjustment factor is: ; In the formula, Let β be the adjustment factor for sample i, and β be the adjustment intensity factor.

[0011] Preferably, the formula for calculating the final weight is: ; In the formula, Let be the weight of the j-th feature of the i-th sample, where j = 1, 2, 3, 4, 5. The basic weights of the j-th feature are: The adjustment factor for sample i, Let m be the base weight of the m-th feature, and m be the summation index.

[0012] Preferably, in step S4.5, the formula for calculating the dynamic threshold is: ; In the formula, Let be the dynamic threshold for the i-th sample. The mean of the comprehensive anomaly scores. denoted as the standard deviation of the comprehensive anomaly score.

[0013] According to another aspect of the present invention, a system for constructing a database of children's snack additive consumption is provided. The system employs the aforementioned method for constructing a database of children's snack additive consumption, and the system includes: The consumer data collection module is used to collect children's snack consumption data through a structured questionnaire on children's snack consumption. The detection data acquisition module is used to acquire detection data on additives in children's snacks; The data preprocessing module is used to perform data preprocessing operations on the children's snack consumption data and the children's snack additive detection data to form a structured initial data table; The abnormal sample identification module is used to perform data cleaning operations on the initial data table of the current sample using an outlier dynamic identification algorithm based on feature weights, and to delete the abnormal sample when the current sample is identified as an abnormal sample. The database construction module is used to store the cleaned samples according to a preset database structure to build a database of children's snack additive consumption.

[0014] The embodiments of the present invention have the following technical effects: This invention achieves intelligent identification of abnormal samples by combining a dynamic identification algorithm based on feature weights with an adaptive weight adjustment mechanism based on time series stability. Dynamic weights ensure that high-impact features receive attention commensurate with their hazard in risk calculations, while the adaptive weight adjustment based on time series stability allows for occasional peaks in records of stable dietary behaviors, and for records of drastic behavioral changes, the algorithm in this embodiment can keenly capture potential persistent risks. Attached Figure Description

[0015] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0016] Figure 1 This is a flowchart of a method for constructing a consumer database of children's snack additives provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating the data cleaning operation performed on the initial data table of the current sample using a feature weight-based outlier dynamic identification algorithm, as provided in an embodiment of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0018] Example 1, Figure 1 A flowchart illustrating a method for constructing a database of children's snack additive consumption is shown, such as... Figure 1 As shown, a method for constructing a database of children's snack additive consumption includes the following steps: S1: Collect children's snack consumption data through a structured questionnaire on children's snack consumption; The structured questionnaire on children's snack consumption was distributed through online platforms and other means, and the required fields were automatically verified to ensure the standardization of data collection.

[0019] Specifically, the structured questionnaire on children's snack consumption includes basic information about the child, detailed information on snack consumption, and information on snack brands. The basic information about the child includes the child's ID, age (years), gender, height (cm), and weight (kg). The detailed information on snack consumption uses a combination of closed-ended questions and open-ended supplementary questions to record the snack name, consumption time, and quantity. When filling in the quantity, the structured questionnaire provides common specifications for reference, including small pack (40g), medium pack (70g), and large pack (150g), or the quantity can be directly entered in grams. The snack brand information includes the snack brand, net content, and packaging type, providing a basis for subsequent matching and testing data.

[0020] S2: Obtain test data on additives in children's snacks; In this step, data on children's additive testing is obtained through public databases, commercial testing report databases, and academic research literature databases.

[0021] The publicly available databases are food sampling information release platforms of market supervision departments. While this type of data is the most authoritative, the information granularity is relatively coarse, typically focusing on pass / fail judgments, with incomplete disclosure of quantitative test values. The commercial testing report databases are obtained through cooperation with third-party laboratories possessing CMA / CNAS accreditation, specifically procuring in-depth testing reports for certain product categories. This type of data usually contains complete qualitative and quantitative information and is the core data source for obtaining testing data on additives in children's snacks. The academic research literature databases are domestic and international academic databases such as CNKI, PubMed, and Web of Science, collecting published empirical research papers on the content of additives in children's snacks. This type of data serves as a supplement, filling data gaps for specific niche brands or regional products.

[0022] It is worth emphasizing that the process of obtaining data on children's snack additives is not a simple copy and paste. Instead, it uses web crawler scripts and API interfaces to automate the data capture and storage, and establishes metadata indexes to record the original source and collection time of each piece of data, ensuring data traceability.

[0023] S3: Perform data preprocessing on the children's snack consumption data and the children's snack additive detection data to form a structured initial data table; The preprocessing operations include key field extraction, brand information completion, and data cleaning and quality control.

[0024] The key field extraction specifically involves using a rule engine and natural language processing technology to extract key fields, including sample ID, product name, additive name, additive detection value, unit, detection standard, generation date, brand name, and report release date; child's age, single snack consumption amount, snack's energy density, and the child's average intake of similar snacks over the past 72 hours. The brand information completion involves: pre-establishing a snack database containing common snacks and their detailed ingredient lists; generating a unique ingredient vector for each snack in the database, where each dimension of the ingredient vector represents the presence or absence of a raw material or additive; performing semantic analysis on the product name field of each product in the children's snack additive detection data to extract key feature words, such as fruit flavor, gummy candy, strawberry, gel, etc., to obtain a feature word set for each product; comparing the feature word set with the products in the snack database and calculating the cosine similarity to achieve brand information completion and calibration; and data cleaning and quality control including removing qualitative data below the detection limit and correcting unit inconsistencies by converting all detection values ​​to international standard units.

[0025] S4: Use a feature weight-based outlier dynamic identification algorithm to clean the initial data table of the current sample, and delete the outlier sample when the current sample is identified as an outlier. Traditional dynamic threshold outlier detection algorithms are not applicable to the detection of additives in children's snacks. Children's snack consumption behavior exhibits strong temporal fluctuations. A single instance of consuming high-calorie, high-additive snacks during a weekend gathering might be flagged as a high outlier by traditional algorithms at an isolated point in time. However, such fluctuations are part of normal social behavior patterns, and traditional dynamic threshold methods cannot distinguish these normal occurrences. They indiscriminately treat all records deviating from the overall mean the same, leading to the erroneous exclusion of a large number of genuine, analytically valuable extreme consumption samples. This not only results in the loss of valuable data but, more importantly, it can cause subsequent risk assessment models to underestimate the actual peak exposure risk, leading to overly optimistic risk assessment results and creating potential safety hazards.

[0026] To address the aforementioned shortcomings, this embodiment employs a feature-weighted outlier dynamic identification algorithm to perform data cleaning on the initial data table, building upon the standard feature-weighted dynamic identification algorithm.

[0027] Specifically, such as Figure 2 As shown, S4 specifically includes: S4.1: Extract several key fields from the initial data table as features of the feature set, and calculate the basic statistics of the extracted features; In the initial data table, the child's age, single snack consumption amount, snack energy density, additive detection value, and the child's average intake of the same type of snack in the past 72 hours are selected to form a feature set; then the mean and standard deviation of the extracted features are calculated as basic statistics. Among them, features mean The calculation formula is: ; In the formula, N is the total number of samples. Let be the j-th feature value of the i-th sample.

[0028] Each feature Standard deviation The calculation formula is: .

[0029] S4.2: Calculate the time series stability index of the current sample's behavior; Calculate a behavioral time series stability index for the current sample i to be evaluated. This index is used to measure whether the child's recent eating behavior is stable.

[0030] Calculate the coefficient of variation of the average intake of the same type of snack by the child in the current sample over the past 72 hours compared with its baseline statistic; The calculation formula is: ; In the formula, The coefficient of variation is the average intake of the same type of snack by the child in the current sample i over the past 72 hours. This represents the child's average intake of similar snacks over the past 72 hours.

[0031] Calculate the behavioral time series stability index of the current sample based on the coefficient of variation; The stability index, which maps the coefficient of variation to a [0, 1] interval, is calculated using the following formula: ; In the formula, Let α be the time series stability index of the current sample i, and let α be the adjustment factor. In this embodiment, the value is 0.5, which is used to control the rate of exponential decay.

[0032] When the coefficient of variation of the average intake of the same type of snack by the child in the current sample over the past 72 hours is 0, which means it is completely stable, the behavioral time series stability index of the current sample is 1. When the coefficient of variation of the average intake of the same type of snack by the child in the current sample over the past 72 hours increases, the behavioral time series stability index of the current sample decreases exponentially and approaches 0, which means it is extremely unstable.

[0033] S4.3: Determine the dynamic weights based on the time series stability index of the current sample's behavior; A basic weight is determined for each feature in the feature set; In this embodiment, the basic weight of the child's age The base weight for a single snack consumption is set to 0.1. The base weight for the energy density of snacks is set at 0.25. The base weight of the additive test value is set to 0.15. The baseline weight for the child's average intake of the same type of snack over the past 72 hours is set at 0.3. Set to 0.2.

[0034] Determine the adjustment factor for each feature of the feature set; The adjustment factor is used to amplify or reduce the effect of the base weights, and its calculation formula is as follows: ; In the formula, β is the adjustment factor for sample i, and β is the adjustment intensity factor, which is set to 0.4 in this embodiment.

[0035] Calculate the final dynamic weights; The base weights are adjusted using an adjustment factor, and the results are normalized to ensure that the sum of all feature weights is always 1; the calculation formula is as follows: ; In the formula, Let be the weight of the j-th feature of the i-th sample, where j = 1, 2, 3, 4, 5. The basic weights of the j-th feature are: The adjustment factor for sample i, Let m be the base weight of the m-th feature, and m be the summation index.

[0036] S4.4: Calculate the comprehensive anomaly score of the i-th sample based on the dynamic weights; The calculation formula is: ; In the formula, The overall anomaly score for the i-th sample is... Let be the weight of the j-th feature of the i-th sample. Let j be the feature value of the i-th sample. Features mean , Features The standard deviation.

[0037] S4.5: Calculate the dynamic threshold based on the comprehensive anomaly score, determine the abnormal samples, and delete the samples determined to be abnormal. The formula for calculating the dynamic threshold is as follows: ; In the formula, Let be the dynamic threshold for the i-th sample. The mean of the comprehensive anomaly scores. denoted as the standard deviation of the comprehensive anomaly score.

[0038] If the overall anomaly score of the current sample is greater than the dynamic threshold, the record is retained; otherwise, the current sample is determined to be an anomaly sample and is deleted.

[0039] This embodiment achieves intelligent identification of abnormal samples by combining a dynamic identification algorithm based on feature weights with an adaptive weight adjustment mechanism based on time series stability. Dynamic weights ensure that high-impact features receive attention commensurate with their hazard in risk calculation, while the adaptive weight adjustment based on time series stability allows for occasional spikes in records of stable dietary behaviors. For records of drastic behavioral changes, the algorithm can keenly capture potential persistent risks.

[0040] S5: Store the cleaned samples according to the preset database structure to build a database of children's snack additive consumption.

[0041] Design a relational database structure, using MySQL for storage, and set indexes for child IDs and snack standard codes to improve the efficiency of subsequent queries and analysis.

[0042] Example 2: The present invention also provides a system for constructing a database of children's snack additive consumption. The system employs a method for constructing a database of children's snack additive consumption as described in Example 1. The system includes: The consumer data collection module is used to collect children's snack consumption data through a structured questionnaire on children's snack consumption. The detection data acquisition module is used to acquire detection data on additives in children's snacks; The data preprocessing module is used to perform data preprocessing operations on the children's snack consumption data and the children's snack additive detection data to form a structured initial data table; The abnormal sample identification module is used to perform data cleaning operations on the initial data table of the current sample using an outlier dynamic identification algorithm based on feature weights, and to delete the abnormal sample when the current sample is identified as an abnormal sample. The database construction module is used to store the cleaned samples according to a preset database structure to build a database of children's snack additive consumption.

[0043] Example 3: The present invention also provides an electronic device, including one or more processors and a memory.

[0044] A processor can be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and can control other components in an electronic device to perform desired functions.

[0045] The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and a processor may execute the program instructions to implement a method for constructing a children's snack additive consumption database as described above in any embodiment of this application, and / or other desired functions. Various contents such as initial external parameters and thresholds may also be stored in the computer-readable storage medium.

[0046] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention.

Claims

1. A method for constructing a consumer database of children's snack additives, characterized in that, The method includes the following steps: S1: Collect children's snack consumption data through a structured questionnaire on children's snack consumption; S2: Obtain test data on additives in children's snacks; S3: Perform data preprocessing on the children's snack consumption data and the children's snack additive detection data to form a structured initial data table; S4: Use a feature weight-based outlier dynamic identification algorithm to clean the initial data table of the current sample, and delete the outlier sample when the current sample is identified as an outlier. Specifically, S4 is: S4.1: Extract several key fields from the initial data table as features of the feature set, and calculate the basic statistics of the extracted features; S4.2: Calculate the behavioral time series stability index of the current sample; S4.3: Determine the dynamic weights based on the behavioral time series stability index of the current sample; S4.4: Calculate the comprehensive anomaly score of the i-th sample based on the dynamic weights; S4.5: Calculate the dynamic threshold based on the comprehensive anomaly score, and determine anomaly samples, deleting samples determined to be anomalies; In S4.2, calculate the coefficient of variation between the average intake of the same type of snacks by the child in the past 72 hours and its basic statistics; calculate the behavioral time series stability index of the current sample based on the coefficient of variation; specifically, the calculation of the behavioral time series stability index of the current sample based on the coefficient of variation is: mapping the coefficient of variation to a stability index in the [0, 1] interval, the calculation formula is: ; In the formula, Let α be the time series stability index of the behavior of the current sample i, and let α be the adjustment factor. The coefficient of variation is the average intake of the same type of snack by the child in the current sample i over the past 72 hours. S5: Store the cleaned samples according to the preset database structure to build a database of children's snack additive consumption.

2. The method for constructing a consumer database of children's snack additives according to claim 1, characterized in that, In step S4.1, the child's age, single snack consumption amount, snack energy density, additive detection value, and the child's average intake of the same type of snack in the past 72 hours are selected from the initial data table to form a feature set; then the mean and standard deviation of the extracted features are calculated as basic statistics. Among them, features mean The calculation formula is: ; In the formula, N is the total number of samples. Let j be the feature value of the i-th sample; Each feature Standard deviation The calculation formula is: 。 3. The method for constructing a consumer database of children's snack additives according to claim 2, characterized in that, The formula for calculating the coefficient of variation is: ; In the formula, Let be the coefficient of variation of the average intake of the same type of snack by the child in the current sample i over the past 72 hours. This represents the child's average intake of similar snacks over the past 72 hours.

4. The method for constructing a consumer database of children's snack additives according to claim 1, characterized in that, In step S4.3, a basic weight is determined for each feature of the feature set; Determine the adjustment factor for each feature of the feature set; Calculate the final dynamic weights.

5. The method for constructing a consumer database of children's snack additives according to claim 4, characterized in that, The formula for calculating the adjustment factor is: ; In the formula, β is the adjustment factor for the current sample i, and β is the adjustment intensity factor.

6. The method for constructing a consumer database of children's snack additives according to claim 5, characterized in that, The final weight is calculated using the following formula: ; In the formula, Let be the weight of the j-th feature of the i-th sample, where j = 1, 2, 3, 4, 5. is the basic weight of the j-th feature.

7. The method for constructing a consumer database of children's snack additives according to claim 1, characterized in that, In S4.5, the formula for calculating the dynamic threshold is: ; In the formula, Let be the dynamic threshold for the i-th sample. The mean of the comprehensive anomaly scores. denoted as the standard deviation of the comprehensive anomaly score.

8. A system for constructing a consumer database of children's snack additives, characterized in that, The system employs a method for constructing a consumer database of children's snack additives as described in any one of claims 1-7, and the system comprises: The consumer data collection module is used to collect children's snack consumption data through a structured questionnaire on children's snack consumption. The detection data acquisition module is used to acquire detection data on additives in children's snacks; The data preprocessing module is used to perform data preprocessing operations on the children's snack consumption data and the children's snack additive detection data to form a structured initial data table; The abnormal sample identification module is used to perform data cleaning operations on the initial data table of the current sample using an outlier dynamic identification algorithm based on feature weights, and to delete the abnormal sample when the current sample is identified as an abnormal sample. The database construction module is used to store the cleaned samples according to a preset database structure to build a database of children's snack additive consumption.

Citation Information

Patent Citations

  • Abnormity detection method, system and device based on global reachability density and adaptive threshold mechanism and medium

    CN120470317A

  • Food safety risk analysis method and system based on big data

    CN120598349A