A weight recognition clock-in method based on cloud-edge collaboration
By using an LSTM network optimized based on a genetic algorithm and dynamic region clustering of pressure distribution feature sets, the problem of misjudgment in weight recognition check-in methods under user data fluctuations and posture deviations is solved, achieving high-precision and stable weight recognition and correction.
Patent Information
- Application Number
- CN202511163359.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-19
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-08-19
AI Technical Summary
Existing weight recognition check-in methods lack predictive ability when faced with data fluctuation characteristics of different users or time periods, lack deep modeling of stress data, and single threshold judgment is prone to misjudgment, resulting in check-in failure or incorrect recording.
A weight prediction model was trained using a Long Short-Term Memory (LSTM) network optimized by a genetic algorithm. Dynamic region clustering was performed using a stress distribution dataset to generate a set of stress distribution features. Weight tracking was judged using health labels and difference analysis, and corrections were made when errors occurred.
It achieves high-precision weight prediction under different users and environments, reduces misjudgments caused by posture deviation, and improves the stability and accuracy of the weight recognition system.
Smart Images

Figure CN121051485B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent clock-in, in particular to a weight recognition clock-in method based on cloud-edge collaboration. BACKGROUND
[0002] In multi-scene health management, behavior attendance and home intelligent device applications, weight recognition has gradually become an important individual health status data portal. Traditional weight recognition methods usually rely on static weighing equipment for numerical reading and register results through fixed rules. However, with the improvement of intelligent hardware edge computing capability and the development of cloud model iteration capability, cloud-edge collaborative architecture is gradually introduced into various types of vital sign data collection and recognition systems to realize the coupling of real-time response and remote optimization control of data processing. Among them, combining long short-term memory network (LSTM) for weight trend prediction and combining pressure response data collected by edge devices in real time for state recognition have become the direction explored in current part of research and application scenarios.
[0003] Some existing solutions have achieved identification and correction of user abnormal data to some extent by introducing weight time series modeling or posture perception technology. For example, by inputting historical weight data into a prediction model, trend comparison and anomaly detection of current data can be achieved. For another example, by capturing the pressure change of the user standing through a sensor array, it can be determined whether the weight value is reliable. Such methods have certain advantages in improving data accuracy and enhancing system response capability, especially in clock-in application scenarios, which can reduce the clock-in failure rate caused by occasional interference and have good practical prospects.
[0004] However, the existing weight recognition clock-in method still has many shortcomings. Specifically, the weight prediction model mostly uses a fixed structure of time series network, which cannot be adaptively adjusted according to the fluctuation characteristics of different users or different time period data, resulting in insufficient prediction capability when facing long-term trend changes or abnormal fluctuations. Secondly, although pressure data collection has been used to assist in judgment, it lacks deep modeling of the spatial structure and response characteristics, and cannot establish an effective mapping between stability and prediction bias. Further, the weight determination logic mostly uses a single threshold judgment, lacks a comprehensive judgment mechanism that integrates prediction results, current measurement and user posture state, and is prone to misjudgment in critical states, thereby causing clock-in failure or false records. SUMMARY
[0005] To solve the above technical problems, the present application provides a weight recognition clock-in method based on cloud-edge collaboration.
[0006] A weight recognition clock-in method based on cloud-edge collaboration, the method comprising:
[0007] S11, collect sample weight data to train a weight prediction model, the weight prediction model adopts a long short-term memory network optimized based on a genetic algorithm;
[0008] S12, collect weight initial measurement values and pressure distribution data sets, perform dynamic regional clustering on the pressure distribution data sets, and generate a pressure distribution feature set;
[0009] S13, compare the weight initial measurement values with a preset weight threshold value to generate a health label;
[0010] S14, calculate a health analysis difference value between the weight initial measurement value and its adjacent weight threshold value, if the health analysis difference value is greater than or equal to a predetermined error value, perform weight check-in, take the weight initial measurement value as a weight check-in value, and upload the weight check-in value and the corresponding health label to the cloud for storage, if the health analysis difference value is less than the error value, perform step S15;
[0011] S15, retrieve historical weight check-in values of a user in the past seven days and input the historical weight check-in values into the weight prediction model to generate a predicted weight value, calculate a deviation value between the predicted weight value and the weight initial measurement value, generate a corrected weight value according to the deviation value and the pressure distribution feature set, and take the corrected weight value as a new weight initial measurement value;
[0012] S16, repeatedly perform steps S13-S15, when weight check-in is performed in step S14, or when the number of cycles reaches a predetermined upper limit of cycles, terminate the cycle.
[0013] Further, the training steps of the weight prediction model are as follows:
[0014] S111, periodically collect weight data of multiple users as sample weight data, each set of weight data includes a time stamp and a weight value corresponding to the time stamp, the data collection period is once a day, and the collected sample weight data is standardized and preprocessed;
[0015] S112, based on the preprocessed weight values from the nth day to the n+7th day, predict and generate a predicted weight value on the n+8th day;
[0016] S113, before training starts, initialize the weights and biases of each layer of the LSTM network using uniform distribution, and initially set the activation function of each layer of the LSTM network to ReLU;
[0017] S114, collect the actual body weight value on the n+8th day through the edge device, generate training sample data containing the pre-processed body weight values from the n th day to the n+7th day and the actual body weight value on the n+8th day, divide the training sample data into a sample training set and a sample test set, and take the actual body weight value on the n+8th day and the predicted body weight value on the n+8th day as loss optimization data, and based on the loss optimization sample data and the sample training set, perform weight prediction training through the LSTM network;
[0018] S115, based on the genetic algorithm, independently configure the activation function of each gate unit of the LSTM network to optimize the activation function configuration to generate the optimal activation function configuration;
[0019] S116, during the training process of the LSTM network, the Adam optimizer is used to optimize the network parameters;
[0020] S117, model verification is performed on the LSTM network, and the LSTM network with an output less than or equal to a preset test error threshold is output as a weight prediction model.
[0021] Further, the step of independently configuring the activation function of each gate unit of the LSTM network for optimization is:
[0022] a1, initialize the population: generate an original population based on the activation function configuration, each individual in the original population represents an activation function configuration, the candidate activation function includes {ReLU, Leaky ReLU, ELU}, and each individual is randomly assigned in the population;
[0023] a2, fitness evaluation: based on each activation function configuration, the network is trained and the loss function is calculated, and the fitness value is obtained according to the generated loss function;
[0024] a3, selection: based on the tournament selection method, randomly select individuals for "competition", and select the two individuals with the highest fitness values as the parents and the mothers to enter the mating pool according to the fitness value size;
[0025] a4, crossover: the parents and the mothers are subjected to a crossover operation to generate new offspring individuals;
[0026] a5, mutation: the individuals in the new population are subjected to mutation processing, and the activation function configuration of the individual is randomly changed;
[0027] a6, after the crossover and mutation operations are completed, a new generation of population is generated, the new population replaces the original population, and step a2 is returned to perform the next round of fitness evaluation;
[0028] a7, repeating steps a2-a6 until any of the termination conditions is reached, outputting the activation function configuration represented by the individual with the highest fitness value as the optimal activation function configuration of the LSTM network, the termination conditions including a first termination condition and a second termination condition; the first termination condition: the fitness value of an individual in the population reaches a preset termination threshold; the second termination condition: based on a preset maximum number of iterations of the genetic algorithm, if the maximum number of iterations is reached, the algorithm terminates.
[0029] Further, the step of optimizing the network parameters using the Adam optimizer is:
[0030] b1, based on the partial derivative of the loss function with respect to the network parameters, calculating the gradient of the network parameters in the first iteration;
[0031] b2, based on the gradient of the network parameters in the first iteration, obtaining the first moment estimate and the second moment estimate in the second iteration;
[0032] b3, based on the loss function change amount of the network in the first iteration and the second iteration, dynamically adjusting the learning rate in the second iteration;
[0033] b4, updating the network parameters in the second iteration according to the first moment estimate, the second moment estimate, and the adjusted learning rate.
[0034] Further, the step of dynamically region clustering the pressure distribution dataset includes:
[0035] S121, constructing a pressure sampling matrix: constructing a pressure sampling matrix in chronological order according to the pressure sampling data collected by the edge device and the initial body weight measurement value;
[0036] S122, constructing an initial high-response region label map: based on the pressure sampling matrix, obtaining the maximum pressure response value of each pressure sensor within a time window, and based on the maximum pressure response value, constructing a high-response sensor index set, and generating an initial region label map according to the high-response sensor index set;
[0037] S123, dynamic clustering: based on the pressure sampling matrix, the region label map, and the high-response sensor index set, constructing a pressure distribution feature set.
[0038] Further, the step of generating the pressure distribution feature set is:
[0039] c1: according to the pressure sampling matrix, the average pressure response value of each sensor in the time window is calculated, and the sensor average response center matrix is constructed according to a plurality of average pressure response values;
[0040] c2: based on the high response sensor index set, the average pressure response value of the sensor in the high response sensor index set is extracted, and the response difference value between any two sensors is calculated;
[0041] c3: compare the response difference value with the preset difference threshold value to generate a connection edge set, construct a graph structure based on the connection edge set and the high response sensor index set, and divide the graph structure into connected subgraphs to generate a cluster set;
[0042] c4: according to the average response value of the sensor in each cluster, the pressure distribution characteristics of the cluster are calculated, and a pressure feature set is constructed based on a plurality of pressure distribution characteristics.
[0043] Further, the health markers include overweight markers, lean markers and normal markers;
[0044] The body weight threshold includes a body weight lean determination threshold and a body weight overweight determination threshold;
[0045] The logic for generating health markers is:
[0046] Compare the initial body weight value with the body weight threshold value, if the initial body weight value is less than or equal to the body weight lean determination threshold, generate a lean marker;
[0047] If the initial body weight value is greater than the body weight lean determination threshold and less than the body weight overweight determination threshold, generate a normal marker;
[0048] If the initial body weight value is greater than or equal to the body weight overweight determination threshold, generate an overweight marker.
[0049] Further, the step of checking in weight is:
[0050] S141, based on the initial body weight value, the body weight lean determination threshold and the body weight overweight determination threshold, the body weight threshold value close to the initial body weight value is obtained, and the absolute value of the difference between the initial body weight value and the body weight threshold value is calculated as a health analysis difference value;
[0051] S142, compare the health analysis difference value with the predetermined error value, if the health analysis difference value is greater than or equal to the error value, it is determined that it meets the check-in requirement, and the weight check-in is carried out; If the health analysis difference value is less than the error value, the weight check-in is not carried out.
[0052] Further, the step of generating a corrected body weight value according to the deviation value and the pressure distribution feature set is:
[0053] S151, difference calculation is performed on the predicted body weight value and the current body weight initial measurement value to generate a deviation value;
[0054] S152, minimum-maximum normalization processing is performed on the pressure distribution features based on the pressure distribution feature set to generate normalized pressure features, and an exponential mapping is performed on the normalized pressure features to generate a dynamic correction weight coefficient;
[0055] S153, a corrected body weight value is generated according to the deviation value and the dynamic correction weight coefficient.
[0056] A body weight recognition clock-in system based on cloud-edge collaboration is used to execute any one of the body weight recognition clock-in methods based on cloud-edge collaboration, and the system comprises:
[0057] A model training module is used to collect sample body weight data to train a body weight prediction model, and the body weight prediction model adopts a long short-term memory network optimized based on a genetic algorithm;
[0058] A feature analysis module is used to collect a body weight initial measurement value and a pressure distribution data set, and dynamic region clustering is performed on the pressure distribution data set to generate a pressure distribution feature set;
[0059] A health analysis module is used to compare the body weight initial measurement value with a preset body weight threshold to generate a health label;
[0060] A clock-in judgment module is used to calculate a health analysis difference value of the body weight initial measurement value and a body weight threshold adjacent thereto, and if the health analysis difference value is greater than or equal to a predetermined error value, body weight clock-in is performed, the body weight initial measurement value is taken as a body weight clock-in value, and the body weight clock-in value and the corresponding health label are uploaded to a cloud end for storage; if the health analysis difference value is less than the error value, a body weight correction module is triggered;
[0061] The body weight correction module is used to call historical body weight clock-in values of a user in the past seven days and input the historical body weight clock-in values into the body weight prediction model to generate a predicted body weight value, calculate a deviation value of the predicted body weight value and the body weight initial measurement value, generate a corrected body weight value according to the deviation value and the pressure distribution feature set, and take the corrected body weight value as a new body weight initial measurement value;
[0062] A circulation module is used to re-trigger the health analysis module, the clock-in judgment module and the body weight correction module and execute the modules in sequence, and when the clock-in judgment module performs body weight clock-in or when a circulation number reaches a predetermined upper limit of the circulation, the circulation is terminated.
[0063] Compared with the prior art, the body weight recognition clock-in system based on cloud-edge collaboration has the following beneficial effects:
[0064] The present application aims at the problem that the traditional body weight prediction model is easy to fall into local optimization when processing long-period user body weight fluctuation data, and a long short-term memory network structure is constructed by fusing a genetic algorithm optimization strategy, so as to overcome the limitation that the existing model cannot establish a stable prediction path when facing non-stable samples, and by introducing an adjustable activation function configuration mechanism, the system can adaptively adjust the sensitivity and response function of the time series modeling under the condition that the user's body shape, age, and basic body weight and other parameters are significantly different, so as to dynamically obtain the optimal memory parameters without relying on prior structure design, so that the prediction model not only has high-precision output capability, but also has cross-user group adaptability, and provides a reliable and continuous prediction benchmark for the overall check-in system.
[0065] Under this prediction benchmark, the present application further solves the problem of 'process fluctuation interference' in the measurement process, and by constructing a dynamic regional clustering mechanism based on a pressure response graph structure, a stability index can be extracted from the sensor response difference caused by the user's standing posture, which is intended to make up for the blind area when only relying on numerical deviation for check-in judgment, avoid misjudgment of the body weight initial measurement value deviation as an abnormality due to posture deviation, and in the construction process, by maximum response identification, connected subgraph division and clustering cluster statistical feature extraction, a discriminative local pressure pattern is obtained in the spatial distribution, and a weight mapping channel is constructed based on this, so that the model can embed the correction process of the body weight prediction error into the spatial distribution dynamic control mechanism, thereby improving the result stability of the body weight recognition system in multiple environment scenarios.
[0066] In summary, by fusing the adaptive adjustment of the prediction model and the dynamic modeling of the pressure distribution, the present application realizes the accurate identification and stable correction of abnormal body weight in the body weight check-in process. BRIEF DESCRIPTION OF DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art based on these drawings.
[0068] Figure 1 A flowchart of a body weight recognition check-in method based on cloud edge cooperation provided for embodiment 1 of the present application;
[0069] Figure 2 A module diagram of a body weight recognition check-in system based on cloud edge cooperation provided for embodiment 2 of the present application. DETAILED DESCRIPTION
[0070] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0071] Embodiment 1
[0072] Please refer to Figure 1 The embodiment disclosed provides a weight recognition clock-in method based on cloud edge cooperation, and the method comprises the following steps:
[0073] S11, sample weight data is collected to train a weight prediction model, and the weight prediction model adopts a long short-term memory network optimized based on a genetic algorithm;
[0074] It should be noted that the expanded data set is input into the weight prediction model for training. The present application adopts a time series prediction model based on a long short-term memory network (LSTM) for extracting time series features in historical weight data, so that the network can more effectively capture long-term dependency information when facing complex or fluctuating weight data, and ensure the accuracy of weight prediction.
[0075] Specifically, the training steps of the weight prediction model are as follows:
[0076] S111, the weight data of multiple users is collected by an edge device periodically as sample weight data, each weight data comprises a time stamp and a weight value corresponding to the time stamp, and the collected sample weight data is standardized and pretreated;
[0077] The standardization pretreatment formula is represented as:
[0078]
[0079] Among them, is the weight value after pretreatment, is the weight value in the original collected sample weight data, is the mean of the original collected weight value, is the standard deviation of the original collected weight value;
[0080] It should be noted that the data collection period can be but is not limited to once a day, and the edge device for collecting weight data is an intelligent weight scale. Through standardization processing, the weight prediction model can converge more easily and improve the training efficiency.
[0081] S112, target value generation: based on the preprocessed weight values from the nth day to the n+7th day, predict and generate the predicted weight value of the n+8th day;
[0082] is expressed as:
[0083]
[0084] wherein, is the predicted weight data of the n+8th day, is an integer greater than 0, is a mapping function of the LSTM model, used to represent that the weight prediction model generates the predicted weight data of the 8th day through the sample weight data of the past 7 days, is the preprocessed weight value from the nth day to the n+7th day.
[0085] S113, initialization of the weights and biases of the LSTM network: before the start of training, the weights and biases of each layer of the LSTM network are initialized with a uniform distribution, and the activation function of each layer of the LSTM network is initially set to ReLU;
[0086] is expressed as:
[0087]
[0088] wherein, is the weight of the n+8th day, is initialized according to a uniform distribution, and the value range is [ ], is the number of neurons of the previous layer;
[0089] is the bias of the n+8th layer, initialized to 0.
[0090] S114, model training: through the edge device, the actual weight value of the n+8th day is collected, the preprocessed weight values from the nth day to the n+7th day are taken as the input of the LSTM network, and the actual weight value of the n+8th day is taken as the output of the LSTM network, so as to generate training sample data containing the preprocessed weight values from the nth day to the n+7th day and the actual weight value of the n+8th day, and the training sample data is divided into a sample training set and a sample test set;
[0091] the actual weight value of the n+8th day and the predicted weight value of the n+8th day are taken as loss optimization data, and the data group numbers of the loss optimization sample data and the training sample data are both ;
[0092] based on the loss optimization sample data and the sample training set, the weight prediction training is performed through the LSTM network;
[0093] The formula for calculating the loss function of an LSTM network is as follows:
[0094]
[0095] in, For the first The actual weight value of the data for loss optimization. For the first Predicted weight values based on loss optimization data. The preferred number is the total number of training samples. ≥100, wherein the ratio of the number of samples in the training set to the number of samples in the test set is 7:3;
[0096] It should be noted that LSTM networks can learn the temporal features in weight data, capture long-term dependencies, and thus predict future weight data. During training, mean squared error (MSE) is used as the loss function to minimize the difference between the predicted weight value and the actual weight value.
[0097] S115, Activation function optimization: Based on the genetic algorithm, the activation function configuration of each gate unit of the LSTM network is optimized independently to generate the optimal activation function configuration;
[0098] It should be noted that each gating unit, including the LSTM network, includes input gates, forget gates, output gates, and cell state gates.
[0099] Specifically, the steps for activation function optimization are as follows:
[0100] a1, Initialize the population: Generate the original population based on the activation function configuration. Each individual in the original population represents an activation function configuration. Candidate activation functions include {ReLU, Leaky ReLU, ELU}. Each individual is randomly assigned in the population.
[0101] It is important to understand that, assuming the population size is P, then P activation function configurations will be generated.
[0102] a2, Fitness Evaluation: Based on each activation function configuration, train the network and calculate the loss function, and calculate the fitness value based on the generated loss function;
[0103] Represented as:
[0104]
[0105] in, For loss function, This is the fitness value;
[0106] a3, Selection: Based on tournament selection, randomly select from the population. Each individual performs a "race", and the two individuals with the highest fitness values are selected as the parents and the mother into the mating pool;
[0107] a4, crossover: the parents and the mother are crossed to generate new offspring individuals;
[0108] It should be noted that the crossover operation can use single-point crossover, two-point crossover or uniform crossover, and the new offspring individuals will become part of the next generation population;
[0109]
[0110] a6, after the crossover and mutation operations, a new generation population is generated, the new population replaces the original population, and step a2 is returned to perform the next round of fitness evaluation;
[0111] a7, repeat steps a2-a6 until any termination condition is reached, output the activation function configuration represented by the individual with the highest fitness value as the optimal activation function configuration of the LSTM network, and the termination condition includes a first termination condition and a second termination condition;
[0112] The first termination condition is that the fitness value of an individual in the population reaches a preset termination threshold;
[0113] The second termination condition is based on a preset maximum number of iterations of the genetic algorithm, and if the maximum number of iterations is reached, the algorithm terminates;
[0114] Preferably, the maximum number of iterations is 100 or 500, and the maximum number of iterations is set based on the fitness value corresponding to the minimum value of the historical experimental loss function as a benchmark;
[0115] It should be noted that the fitness value of an individual in the population reaching the preset threshold indicates that the most suitable activation function configuration is found, and the activation function configuration in the LSTM network needs to be multiple, and the optimal activation function configuration is selected based on each layer.
[0116] S116, LSTM parameter optimization: in the training process of the LSTM network, the Adam optimizer is used to optimize the network parameters;
[0117] Specifically, the steps for optimizing the activation function configuration of each gate unit of the LSTM network are as follows:
[0118] b1, based on the partial derivative of the loss function with respect to the network parameters, the gradient of the network parameters is calculated;
[0119] is represented as:
[0120]
[0121] wherein, is the network parameter of the th iteration, is the loss function is the gradient of the network parameter of the th iteration, is the partial derivative of the loss function with respect to the network parameter of the th iteration; b2, based on the gradient of the network parameter of the th iteration, obtains the first moment estimate and the second moment estimate of the
[0122] th iteration; The first moment estimate calculation formula is represented as:
[0123]
[0124]
[0125] wherein, is the first moment estimate of the th iteration, is the first moment estimate of the th iteration, is a predetermined first decay rate, preferably, is set to 0.9;
[0126] The second moment estimate calculation formula is represented as:
[0127]
[0128] wherein, is the second moment estimate of the th iteration, is the second moment estimate of the th iteration, is a predetermined second decay rate, preferably, is set to 0.999;
[0129] It should be noted that the first decay rate and the second decay rate are set by data analysts;
[0130] b3, based on the loss function variation of the network th iteration and the th iteration, dynamically adjusts the learning rate of the th iteration;
[0131] is represented as:
[0132]
[0133] wherein, is the learning rate of the network in the th iteration, is the initial learning rate, is the learning rate of the network in the th iteration, is the cumulative square sum of the loss function variation, is the loss function variation in the th iteration, is a constant to prevent division by zero error, preferably, is set to , is a control constant, preferably, 0 < 1, is the loss function variation of the network in the th iteration and the th iteration, the calculation formula of ;
[0134] It should be noted that: is used to smooth the learning rate adjustment to prevent the learning rate from fluctuating sharply, is used to control the adjustment range of the loss function variation on the learning rate;
[0135] b4, according to the first moment estimation, the second moment estimation and the adjusted learning rate, updates the network parameter in the th iteration;
[0136] is represented as:
[0137]
[0138] wherein, is a constant, preferably, is set to
[0139] It should be noted that: is a constant set to avoid division by zero error, mainly to ensure the stability of network parameter update; further, the setting of the first decay rate , the second decay rate , the control constant , the constant , and the initial learning rate are the optimal empirical values based on historical data experimental results, wherein , Reference the classic Adam optimizer recommended value, , , Then the initial learning rate is determined based on experimental adjustment Determine the optimal value by cross-validation method;
[0140] S117, based on the sample test set, the LSTM network is verified, and the LSTM network with an error threshold less than or equal to the preset test error is output as the weight prediction model.
[0141] S12, collect the weight initial measurement value and pressure distribution data set of the clock-in user, the pressure distribution data set contains the pressure sampling data of each sampling point of the pressure sensor array, and the pressure distribution data set is dynamically regionally clustered to generate a pressure distribution feature set;
[0142] It should be noted that: the weight initial measurement value and the pressure distribution data set of the clock-in user are collected by the edge device;
[0143] Specifically, the step of dynamically regionally clustering the pressure distribution data set comprises:
[0144] S121, constructing a pressure sampling matrix: according to the pressure sampling data and the weight initial measurement value collected by the edge device, a pressure sampling matrix is constructed in time sequence;
[0145] Set the pressure sampling data set at time ;
[0146]
[0147] In the formula, is the pressure value collected by the i-th pressure sensor at time , is the pressure sampling data set at time , is the total number of sensors in the pressure sensor array, is the sampling time, ;
[0148] Construct a pressure sampling matrix of continuous frame sampling data, denoted as
[0149]
[0150] Wherein, each row of the pressure sampling matrix corresponds to the pressure sampling data at a time, and each column is a time sequence sampling sequence of a sensor;
[0151] S122, constructing an initial high-response area label graph: based on the pressure sampling matrix, obtaining the maximum pressure response value of each pressure sensor in the time window, and constructing a high-response sensor index set based on the maximum pressure response value, and generating an initial area label graph according to the high-response sensor index set;
[0152] It should be noted that the time window is the corresponding time period in step S121 , ];
[0153] The formula for calculating the maximum response value is:
[0154]
[0155] Among them, is the maximum pressure response value of the i-th sensor in the time window , , ];
[0156] Based on a plurality of maximum pressure response values, a high-response sensor index set is constructed.
[0157] Indicated as:
[0158]
[0159] In the formula, is the high-response sensor index set, is a predetermined high-response determination threshold;
[0160] It should be noted that the high-response determination threshold Is set based on the historical maximum pressure response value;
[0161] According to the high-response sensor index set, an initial area label point is generated for each sensor, and an initial area label graph is constructed based on the initial area label point.
[0162] The logic representation of generating an initial area label point is:
[0163]
[0164] It should be noted that the initial area label graph is used to represent the spatial position of the high-response sensor in the array;
[0165] S123, dynamic clustering: based on the pressure sampling matrix, the area label graph and the high-response sensor index set, a pressure distribution feature set is constructed.
[0166] Specifically, the generation steps of the pressure distribution feature set are:
[0167] c1: Calculate the average pressure response value of each sensor within the time window based on the pressure sampling matrix, and construct the sensor average response center matrix based on multiple sets of average pressure response values;
[0168] Represented as:
[0169]
[0170]
[0171] In the formula, For the first Each sensor in the time window [ , The average pressure response value within ] The center matrix of the average response of the sensor. For time window [ , The number of sampling times within ] For the first Each sensor at time Pressure value;
[0172] c2: Based on the high-response sensor index set, extract the average pressure response value of the sensors in the high-response sensor index set, and calculate the response difference value between any two sensors;
[0173] Represented as:
[0174]
[0175] In the formula, For the high-response sensor index set, the first The sensor and the first The response differences of each sensor;
[0176] It should be noted that: This represents any two sensors within the high-response sensor index set;
[0177] c3: Compare the response difference value with the preset difference threshold to generate a set of connecting edges. Construct a graph structure based on the set of connecting edges and the set of high-response sensor indexes, and divide the graph structure into connected subgraphs to generate a set of clusters.
[0178] The logical formula for generating the edge set is:
[0179]
[0180] in, The set of connecting edges that satisfy the connection conditions. The predetermined difference threshold;
[0181] It should be noted that: Set by the analyst;
[0182] The graph structure is represented as:
[0183]
[0184] For the graph structure, the vertices are the set of high-response sensors , and the edges are the set of connection edges that satisfy the connection condition.
[0185] A set of clustering clusters is generated and represented as:
[0186]
[0187] Wherein, is the set of clustering clusters, is the th clustering cluster, is the total number of clustering clusters.
[0188] c4: According to the average response value of the sensors in each clustering cluster, the pressure distribution feature of the clustering cluster is calculated, and a set of pressure features is constructed based on multiple sets of pressure distribution features.
[0189] The pressure distribution feature calculation formula is represented as:
[0190]
[0191] Wherein, , is the pressure distribution feature of the th clustering cluster, is the number of sensors in the clustering cluster .
[0192] A set of pressure distribution features is constructed and represented as:
[0193]
[0194] Wherein, is the set of pressure distribution features.
[0195] S13, user weight health analysis: compare the weight initial measurement value with the preset weight threshold value to generate a health mark, the health mark including an overweight mark, a lean mark and a normal mark.
[0196] Specifically, the weight threshold value includes a weight lean determination threshold value and a weight overweight determination threshold value.
[0197] It should be noted that the two threshold values can be preset by a standardization algorithm based on user height, age and other characteristics, or set in the user profile;
[0198] Specifically, the logic for generating the health label is:
[0199] The initial weight measurement value is compared with the weight threshold value. If the initial weight measurement value is less than or equal to the weight thinness determination threshold value, a thinness label is generated.
[0200] If the initial weight measurement value is greater than the weight thinness determination threshold value and less than the weight overweight determination threshold value, a normal label is generated.
[0201] If the initial weight measurement value is greater than or equal to the weight overweight determination threshold value, an overweight label is generated.
[0202] which can be expressed as:
[0203]
[0204] In the formula, is the health label of the current clock-in user, is the initial weight measurement value, , respectively, the weight thinness determination threshold value and the weight overweight determination threshold value.
[0205] S14, user clock-in determination: calculate the health analysis difference value of the initial weight measurement value and the weight threshold value adjacent thereto. If the health analysis difference value is greater than or equal to a predetermined error value, perform weight clock-in through the edge device, and upload the initial weight measurement value as the weight clock-in value to the cloud together with the health label for storage. If the health analysis difference value is less than the predetermined error value, proceed to step S15;
[0206] Specifically, the logic for performing weight clock-in is:
[0207] S141, calculate the health analysis difference value: based on the initial weight measurement value, the weight thinness determination threshold value and the weight overweight determination threshold value, obtain the weight threshold value close to the initial weight measurement value, and calculate the absolute value of the difference between the initial weight measurement value and the weight threshold value as the health analysis difference value;
[0208] which can be expressed as:
[0209]
[0210] In the formula, is the health analysis difference value, is the initial weight measurement value, is the weight threshold value, including the weight thinness determination threshold value and the weight overweight determination threshold value ;
[0211] It should be noted that the health analysis difference value of the body weight initial measurement value and the adjacent body weight threshold value is calculated, and the determination standard of the "adjacent body weight threshold value" is:
[0212] Based on the absolute value of the body weight initial measurement value minus the body weight overweight determination threshold value and the absolute value of the body weight initial measurement value minus the body weight underweight determination threshold value, the size comparison of the absolute values of the two groups of difference values is performed, and the body weight threshold value corresponding to the group of difference value absolute value with smaller value is taken as the "adjacent body weight threshold value". If the body weight initial measurement value is equal to the body weight overweight determination threshold value or the body weight underweight determination threshold value, the body weight threshold value equal to the body weight initial measurement value is directly taken as the "adjacent body weight threshold value";
[0213] S142, punch card determination: comparing the health analysis difference value with the predetermined error value, if the health analysis difference value is greater than or equal to the error value, it is determined that the punch card requirement is met, and the body weight punch card is performed; if the health analysis difference value is less than the error value, the body weight punch card is not performed.
[0214] It should be noted that when the health analysis difference value is less than the error value, in order to avoid misjudgment caused by slight value fluctuation and improve the robustness and reliability of the punch card result, it is necessary to further analyze whether the body weight initial measurement value of the punch card user is measured accurately, so as to improve the data stability and health reliability of the identification.
[0215] S15, body weight measurement data correction: the past seven days of historical body weight punch card values of the user are retrieved through the cloud and input into the body weight prediction model to generate a predicted body weight value, the deviation value of the predicted body weight value and the body weight initial measurement value is calculated, the corrected body weight value is generated according to the deviation value and the stress distribution characteristic set, and the corrected body weight value is taken as a new body weight initial measurement value;
[0216] Specifically, the step of generating the corrected body weight value according to the deviation value and the stress distribution characteristic set is:
[0217] S151, difference calculation is performed on the predicted body weight value and the current body weight initial measurement value to generate a deviation value;
[0218] It is expressed as:
[0219]
[0220] In the formula, is the predicted body weight value, is the deviation value;
[0221] S152, based on the stress distribution characteristic set, minimum-maximum normalization processing of the stress distribution characteristic is performed to generate a normalized stress characteristic, and an exponential mapping is performed on the normalized stress characteristic to generate a dynamic correction weight coefficient;
[0222] The calculation formula of the normalized stress characteristic is expressed as:
[0223]
[0224] wherein, is the normalized pressure feature value of the i-th cluster, is the minimum pressure distribution feature value in all cluster, is the maximum pressure distribution feature value in all cluster;
[0225] The calculation formula of the exponential mapping of the normalized pressure feature is:
[0226]
[0227] wherein, is the dynamic correction weight coefficient, is the sum of the exponential mapping of the normalized pressure features of all clusters, is the exponential amplification factor for adjusting the sensitivity of the pressure response difference, preferably, ;
[0228] It should be noted that the design of the exponential mapping formula is based on the idea of Softmax function, and the nonlinear mapping of the exponential function is used to highlight the pressure features of the clusters with larger differences, so that the pressure instability features in the user standing process can be significantly amplified and used to correct the prediction error, thereby improving the robustness and reliability of the body weight correction result;
[0229] For the convenience of understanding this step, an example is given:
[0230] Specifically, the total number of clusters is set to 3, and the normalized pressure features include 0.2, 0.5 and 0.9 respectively, is set to 3;
[0231] Calculate the exponential term, denoted as:
[0232]
[0233]
[0234] Calculate the sum of the exponential mapping, denoted as: , which is the calculation content of ;
[0235] Calculate the normalized weight, denoted as:
[0236]
[0237]
[0238]
[0239] The dynamic correction weight coefficient is calculated and expressed as:
[0240]
[0241]
[0242] wherein the dynamic correction weight coefficient is a continuous variable between 0 and 1, used to reflect the user's standing stability, and the dynamic correction weight coefficient is based on the difference in pressure distribution when the user is standing, thereby nonlinearly adjusting the prediction error and further generating a more reliable and stable corrected weight value;
[0243] Briefly explained, the closer to 1, the deviation value is determined to be fully trusted, and the corrected weight value approaches the predicted weight value; the closer to 0, the deviation is determined to be untrusted, and the output result approaches the initial weight value; and the closer to 0.5, it can be considered that the current pressure distribution is slightly unstable, and a compromise correction is selected;
[0244] S153, generating a corrected weight value according to the deviation value and the dynamic correction weight coefficient;
[0245] expressed as:
[0246]
[0247] wherein, is the corrected weight value.
[0248] S16, weight correction cycle: repeating steps S13-S15, when weight check-in is performed in step S14, or when weight check-in is not performed in step S14 and the cycle number reaches the predetermined upper limit of the cycle, the cycle is terminated; preferably, the upper limit of the cycle is set to 3;
[0249] The corrected weight value of the last cycle is input into step S13 as the initial weight value to generate a health mark and perform weight check-in, and the corrected weight value is uploaded to the cloud as the weight check-in value and the corresponding health mark is stored;
[0250] It should be noted that setting the upper limit of the cycle to 3 can ensure the correction effect while controlling the calculation delay.
[0251] Embodiment 2
[0252] Please refer to Figure 2As shown, based on the unified invention concept, the embodiment discloses a weight recognition clock-in system based on cloud edge collaboration, which comprises a model training module S21, a feature analysis module S22, a health analysis module S23, a clock-in judgment module S24, a weight correction module S25 and a cycle module S26.
[0253] Specifically, the model training module S21 is used to collect sample weight data to train a weight prediction model, and the weight prediction model adopts a long short-term memory network based on a genetic algorithm optimization.
[0254] The feature analysis module S22 collects weight initial measurement values and a stress distribution data set, performs dynamic regional clustering on the stress distribution data set, and generates a stress distribution feature set.
[0255] The health analysis module S23 compares the weight initial measurement values with a preset weight threshold to generate a health label.
[0256] The clock-in judgment module S24 calculates a health analysis difference value between the weight initial measurement values and the adjacent weight threshold, and if the health analysis difference value is greater than or equal to a predetermined error value, weight clock-in is performed, the weight initial measurement values are taken as weight clock-in values, and the weight initial measurement values and the corresponding health label are uploaded to the cloud for storage, and if the health analysis difference value is less than the error value, the weight correction module is triggered.
[0257] The weight correction module S25 retrieves historical weight clock-in values of a user in the past seven days and inputs the historical weight clock-in values into the weight prediction model to generate a predicted weight value, calculates a deviation value between the predicted weight value and the weight initial measurement values, generates a corrected weight value according to the deviation value and the stress distribution feature set, and takes the corrected weight value as a new weight initial measurement value.
[0258] The cycle module S26 re-triggers the health analysis module, the clock-in judgment module and the weight correction module and executes them in sequence, and when the clock-in judgment module performs weight clock-in or when the cycle number reaches a predetermined upper limit of the cycle, the cycle is terminated.
[0259] The above-described embodiments only describe the preferred embodiments of the present application, and do not limit the scope of the present application. Without departing from the design spirit of the present application, various modifications and improvements to the technical solutions of the present application made by those skilled in the art shall fall within the protection scope of the claims of the present application.
Claims
1. A weight recognition and attendance tracking method based on cloud-edge collaboration, characterized in that, The method includes: S11, Collect sample weight data to train the weight prediction model. The weight prediction model uses a long short-term memory network optimized based on a genetic algorithm. S12: Collect initial weight measurements and stress distribution datasets, perform dynamic region clustering on the stress distribution dataset, and generate a set of stress distribution features. S13, compare the initial weight measurement with the preset weight threshold to generate a health marker; S14, calculate the health analysis difference between the initial weight measurement value and its nearest weight threshold. If the health analysis difference is greater than or equal to the predetermined error value, then perform weight check-in, use the initial weight measurement value as the weight check-in value, and upload it to the cloud for storage along with the corresponding health tag. If the health analysis difference is less than the error value, then proceed to step S15. S15: Retrieve the user's historical weight check-in values for the past seven days and input them into the weight prediction model to generate a predicted weight value. Calculate the deviation between the predicted weight value and the initial weight measurement value. Generate a corrected weight value based on the deviation value and the set of stress distribution characteristics, and use the corrected weight value as the new initial weight measurement value. S16, repeat steps S13 to S15. When weight is recorded in step S14, or when the number of cycles reaches the predetermined upper limit, the cycle is terminated.
2. The weight recognition and attendance method based on cloud-edge collaboration according to claim 1, characterized in that, The training steps for the weight prediction model are as follows: S111: Regularly collect weight data from multiple users as sample weight data. Each set of weight data includes a timestamp and the corresponding weight value. The data collection cycle is once a day. The collected sample weight data is standardized and preprocessed. S112, based on the preprocessed weight values from day n to day n+7, predict the predicted weight value for day n+8; S113, Before training begins, the weights and biases of each layer of the LSTM network are initialized using a uniform distribution, and the activation function of each layer of the LSTM network is initially set to ReLU; S114: Collect the actual weight value on day n+8 through an edge device, generate training sample data containing the preprocessed weight values from day n to day n+7 and the actual weight value on day n+8, divide the training sample data into a training set and a test set; and use the actual weight value on day n+8 and the predicted weight value on day n+8 as loss optimization data, and train the weight prediction through an LSTM network based on the loss optimization sample data and the training set. S115, based on the genetic algorithm, optimizes the activation function configuration of each gate unit of the LSTM network independently to generate the optimal activation function configuration; S116, During the training of the LSTM network, the Adam optimizer is used to optimize the network parameters; S117, perform model validation on the LSTM network, and use the LSTM network whose output is less than or equal to the preset test error threshold as the weight prediction model.
3. The weight recognition and attendance method based on cloud-edge collaboration according to claim 2, characterized in that, The steps for optimizing the activation function configuration of each gated unit in the LSTM network independently are as follows: a1, Initialize the population: Generate the original population based on the activation function configuration. Each individual in the original population represents an activation function configuration. Candidate activation functions include {ReLU, Leaky ReLU, ELU}. Each individual is randomly assigned in the population. a2, Fitness Evaluation: Based on each activation function configuration, train the network and calculate the loss function, and calculate the fitness value based on the generated loss function; a3, Selection: Based on tournament selection, randomly select from the population. Individuals compete to select the two individuals with the highest fitness values as the father and mother to enter the mating pool. a4, Crossover: Perform a crossover operation on the parent and parent to generate new offspring individuals; a5, Mutation: Mutate individuals in the new generation population to randomly change the activation function configuration of the individuals; a6. After the crossover and mutation operations are completed, a new generation of population is generated, the original population is replaced by the new population, and the process returns to step a2 for the next round of fitness evaluation. a7. Repeat steps a2 to a6 until any termination condition is met. Output the activation function configuration represented by the individual with the highest fitness value as the optimal activation function configuration of the LSTM network. The termination conditions include a first termination condition and a second termination condition. The first termination condition is: the fitness value of an individual in the population reaches a preset termination threshold. The second termination condition is based on the preset maximum number of iterations of the genetic algorithm. If the maximum number of iterations is reached, the algorithm terminates.
4. The weight recognition and attendance method based on cloud-edge collaboration according to claim 3, characterized in that, The steps for optimizing network parameters using the Adam optimizer are as follows: b1, based on the partial derivatives of the loss function with respect to the network parameters, calculate and obtain the first... The gradient of the network parameters in the next iteration; b2, based on the first The gradient of the network parameters in the nth iteration is obtained. The first-order moment estimate and second-order moment estimate of each iteration; b3, based on network... The second iteration and the first The change in the loss function in the nth iteration, for the nth iteration The learning rate is dynamically adjusted in each iteration; b4, based on the first moment estimate, second moment estimate, and adjusted learning rate, update the... The network parameters for the next iteration.
5. The weight recognition and attendance method based on cloud-edge collaboration according to claim 4, characterized in that, The steps for dynamic region clustering of a pressure distribution dataset include: S121, Construct a pressure sampling matrix: Based on the pressure sampling data collected by the edge device and the initial weight measurement, construct a pressure sampling matrix ordered by time. S122, Construct an initial high-response region label map: Based on the pressure sampling matrix, obtain the maximum pressure response value of each pressure sensor within the time window, construct a high-response sensor index set based on the maximum pressure response value, and generate an initial region label map based on the high-response sensor index set; S123, Dynamic Clustering: Based on the pressure sampling matrix, region label map and high-response sensor index set, construct a pressure distribution feature set.
6. The weight recognition and attendance method based on cloud-edge collaboration according to claim 5, characterized in that, The steps for generating the pressure distribution feature set are as follows: c1: Calculate the average pressure response value of each sensor within the time window based on the pressure sampling matrix, and construct the sensor average response center matrix based on multiple sets of average pressure response values; c2: Based on the high-response sensor index set, extract the average pressure response value of the sensors in the high-response sensor index set, and calculate the response difference value between any two sensors; c3: Compare the response difference value with the preset difference threshold to generate a set of connecting edges. Construct a graph structure based on the set of connecting edges and the set of high-response sensor indexes, and divide the graph structure into connected subgraphs to generate a set of clusters. c4: Calculate the pressure distribution characteristics of the clusters based on the average response values of the sensors in each cluster, and construct a pressure feature set based on multiple sets of pressure distribution characteristics.
7. The weight recognition and attendance method based on cloud-edge collaboration according to claim 6, characterized in that, The health markers include overweight markers, underweight markers, and normal health markers; The weight thresholds include the underweight determination threshold and the overweight determination threshold; The logic for generating health markers is as follows: The initial weight measurement is compared with the weight threshold. If the initial weight measurement is less than or equal to the underweight judgment threshold, an underweight label is generated. If the initial weight measurement is greater than the underweight threshold and less than the overweight threshold, a normal label is generated. If the initial weight measurement is greater than or equal to the overweight threshold, an overweight marker is generated.
8. The weight recognition and attendance method based on cloud-edge collaboration according to claim 7, characterized in that, The logic for tracking weight is as follows: S141, based on the initial weight measurement value, the underweight judgment threshold and the overweight judgment threshold, obtain a weight threshold that is close to the initial weight measurement value, and calculate the absolute value of the difference between the initial weight measurement value and the weight threshold as the health analysis difference value. S142, compare the health analysis difference with the predetermined error value. If the health analysis difference is greater than or equal to the error value, it is determined that the check-in requirements are met and the weight check-in is carried out. If the health analysis difference is less than the error value, then weight tracking will not be performed.
9. The weight recognition and attendance method based on cloud-edge collaboration according to claim 8, characterized in that, The steps for generating corrected weight values based on deviation values and pressure distribution characteristics are as follows: S151, calculate the difference between the predicted weight value and the current initial weight value to generate a deviation value; S152, based on the pressure distribution feature set, performs minimum-maximum normalization processing on the pressure distribution features to generate normalized pressure features, and performs exponential mapping on the normalized pressure features to generate dynamic correction weight coefficients. S153 generates a corrected weight value based on the deviation value and the dynamic correction weight coefficient.
10. A cloud-edge collaborative weight recognition and attendance system, used to execute the cloud-edge collaborative weight recognition and attendance method according to any one of claims 1-9, characterized in that, The system includes: Model training module: used to collect sample weight data to train the weight prediction model. The weight prediction model adopts a long short-term memory network optimized based on genetic algorithm. Feature analysis module: Collects initial weight measurements and stress distribution datasets, performs dynamic region clustering on the stress distribution dataset, and generates a set of stress distribution features; Health Analysis Module: Compares the initial weight measurement with a preset weight threshold to generate a health marker; Check-in determination module: Calculate the health analysis difference between the initial weight measurement value and the nearest weight threshold. If the health analysis difference is greater than or equal to the predetermined error value, then check in for weight, use the initial weight measurement value as the weight check-in value, and upload it to the cloud for storage along with the corresponding health tag. If the health analysis difference is less than the error value, then trigger the weight correction module. The weight correction module retrieves the user's historical weight check-in values from the past seven days and inputs them into the weight prediction model to generate a predicted weight value. It calculates the deviation between the predicted weight value and the initial weight measurement value, generates a corrected weight value based on the deviation value and the stress distribution feature set, and uses the corrected weight value as the new initial weight measurement value. Loop Module: Re-trigger the health analysis module, check-in judgment module, and weight correction module and execute them in sequence. The loop terminates when the check-in judgment module performs a weight check-in or when the number of loops reaches the predetermined loop limit.
Citation Information
Patent Citations
Weight measuring method for stabilizing weight value under human body shaking condition
CN112082633A
Personalized dynamic feedback control of body weight
US20130198214A1