State offset identification method and system based on low-dimensional discrete perception
By using low-dimensional discrete sensing and individualized baseline models, the stability and individualized judgment problems of high-dimensional sensing schemes are solved, achieving efficient and accurate state monitoring that adapts to device drift and environmental changes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG ACAD OF SCI INST OF AUTOMATION
- Filing Date
- 2026-03-03
- Publication Date
- 2026-05-19
AI Technical Summary
Existing high-dimensional sensing solutions suffer from complex data processing, high costs, susceptibility to external environmental interference, poor stability, and a lack of individualized state determination methods, leading to frequent false alarms and missed alarms.
A low-dimensional discrete sensing method is adopted. By constructing an individualized baseline model of the target object, the state offset is identified using low-dimensional discrete feature vectors. An adaptive compensation algorithm is combined to offset environmental changes and device drift, and the baseline model is dynamically updated.
It achieves individualized high-precision condition monitoring, reduces system cost and computational complexity, improves stability and accuracy, adapts to differences in different individuals and environments, and reduces false alarm rate.
Smart Images

Figure CN122063079A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of spectral detection and intelligent sensing, and in particular to a method and system for identifying state shifts based on low-dimensional discrete sensing. Background Technology
[0002] In the fields of condition monitoring and fault early warning, high-precision condition perception is a core requirement for ensuring stable equipment operation and improving the reliability of supervision, and it is widely used in various scenarios such as industrial manufacturing, equipment maintenance, and safety supervision. Existing high-precision condition perception solutions generally rely on the acquisition and processing of high-dimensional data. However, high-dimensional perception solutions have extremely high requirements for sensor calibration accuracy and are easily affected by external environmental interference, which limits the stability of perception.
[0003] While high-dimensional sensing systems can acquire relatively rich state information, they suffer from significant technical defects and application limitations: on the one hand, the system's data processing flow is extremely complex, resulting in high costs for hardware deployment, data storage, and processing; on the other hand, they are highly susceptible to the "curse of dimensionality," meaning that under limited training samples, the constructed statistical model exhibits poor stability and high sensitivity to noise signals, making accurate state perception impossible; furthermore, during long-term continuous operation, sensors are prone to slight drift, directly leading to the failure of the sensing model and significantly increasing the system's maintenance and calibration costs.
[0004] In addition to the shortcomings of the aforementioned high-dimensional sensing solutions, existing condition monitoring equipment also has many deficiencies in its condition determination methods. Currently, existing condition monitoring equipment typically uses fixed thresholds based on industry standards or human experience to determine the equipment status. However, in practical applications, due to individual factors such as different installation foundations, varying load conditions, and inconsistent historical maintenance records, the characteristic parameters of different devices under normal operating conditions differ significantly. Using a uniform fixed threshold for determination can easily lead to false alarms and missed alarms. Summary of the Invention
[0005] To address the shortcomings and deficiencies in existing technologies, the present invention aims to provide a state offset identification method and system based on low-dimensional discrete sensing. By constructing a low-dimensional discrete feature vector of the target object, an individualized baseline model of the target object under normal conditions is established. Based on the individualized baseline model and the abnormal offset detection scheme, there is no need to pre-establish a large material database, thus solving the problems of high cost, computational complexity, and lack of individualized evaluation capabilities in existing technologies. The individualized baseline model is updated through adaptive compensation to absorb the effects of long-term equipment drift and environmental changes.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solution: In a first aspect, the present invention provides a state shift recognition method based on low-dimensional discrete sensing, comprising: Obtain low-dimensional discrete feature vectors of the target object under normal and current states; the low-dimensional discrete feature vectors are composed of the ratio and difference features of the set band pairs; Based on the low-dimensional discrete feature vectors under normal conditions, establish an individualized baseline model of the target object; Calculate the relative offset between the low-dimensional discrete feature vector in the current state and the individualized baseline model, and make a hierarchical judgment based on the relative offset and the preset judgment logic, and output the detection result. Based on the detection results and user feedback, the current low-dimensional discrete feature vectors that have no abnormalities are included in the baseline sample library. When the sample increment in the baseline sample library reaches a set value, the low-dimensional discrete feature vectors in the baseline sample library are weighted and statistically analyzed to dynamically update the individualized baseline model. During the identification process, the individualized baseline model is adaptively compensated to offset the effects of environmental changes or device drift.
[0007] As a further implementation, the target object is a liquid, and the normal state is the state in which a user normally drinks a specific liquid.
[0008] As a further implementation, the step of establishing an individualized baseline model of the target object based on the low-dimensional discrete feature vector under normal conditions specifically includes: The system acquires response data of multiple preset bands of the target object, and obtains stable response values of the bands after preprocessing; it acquires ambient light and temperature data to adaptively compensate for the stable response values; it processes the stable response values of multiple preset bands, calculates the ratio and difference features of the set band pairs, and constructs a low-dimensional discrete feature vector. The baseline center, covariance matrix, sample maturity, and baseline volatility are calculated based on the low-dimensional discrete eigenvectors, and an individualized baseline model of the liquid to be tested is established based on the above parameters. The individualized baseline model is dynamically updated after each test based on user feedback, external collaborative instructions, or time decay.
[0009] As a further implementation, the relative offset between the low-dimensional discrete feature vector in the current state and the individualized baseline model is calculated. Based on the relative offset and preset judgment logic, a hierarchical judgment is performed, and the detection result is output. Specifically, this includes: Calculate the statistical distance index between the low-dimensional discrete feature vector in the current state and the baseline center in the individualized baseline model. The system performs hierarchical judgment based on the statistical distance index and preset judgment logic, and outputs the detection results. Specifically, when the integral value of the relative offset within M consecutive sampling periods exceeds the cumulative threshold, or when the proportion of times the offset exceeds the threshold in M consecutive periods is greater than a preset proportion, it is identified as a state shift.
[0010] As a further implementation, the step of obtaining response data of multiple preset bands of the target object and obtaining a stable response value of the band after preprocessing specifically includes: using multi-band time multiplexing for discrete sampling, setting a time window and the number of samplings, and performing statistical processing on multiple sampling results of the same band to obtain a stable response value of the band.
[0011] As a further implementation, the adaptive compensation mechanism is configured to correct the individualized baseline model, including aging compensation, temperature compensation, and ambient light compensation. The aging compensation is a periodic self-calibration path based on a known standard reflectivity object, and is achieved through at least one of the following methods: physical calibration based on a standard reference object, statistical calibration based on population data, or algorithmic compensation based on a preset attenuation model.
[0012] Secondly, the present invention also provides a state offset recognition system based on low-dimensional discrete sensing, comprising: an integration module, a mobile terminal, and a communication module; wherein the integration module includes: Near-infrared light source module, used to provide light source; MEMS near-infrared sensing modules are used to acquire the optical response of a target object in a specific band. The photoelectric detection and signal acquisition module is used to acquire the light intensity signal of the target object, obtain the response data values of multiple preset bands, and obtain the stable response value of the band after preprocessing; it also acquires ambient light to perform ambient light compensation on the response data in real time. The temperature detection module is used to acquire the temperature of the sensing module and the target object in order to perform temperature compensation on the response data in real time. The processing module is used to obtain low-dimensional discrete feature vectors of the target object under normal and current states; the low-dimensional discrete feature vectors are composed of the ratio and difference features of the set band pairs; The processing module is located inside the integrated module or in the mobile terminal; The individualized baseline modeling module establishes an individualized baseline model of the target object based on the low-dimensional discrete feature vectors under normal conditions. The mobile terminal calculates the relative offset between the low-dimensional discrete feature vector in the current state and the individualized baseline model, performs hierarchical judgment based on the relative offset and preset judgment logic, and outputs the detection results. Based on the detection results and user feedback, the low-dimensional discrete feature vectors of samples without abnormalities are included in the baseline sample library. When the sample increment in the baseline sample library reaches a set value, the low-dimensional discrete feature vectors in the baseline sample library are weighted and statistically analyzed to dynamically update the individualized baseline model. During the identification process, the individualized baseline model is adaptively compensated to offset the effects of environmental changes or device drift; Wireless communication module: The integrated module establishes a connection with the mobile terminal via Bluetooth and Wi-Fi.
[0013] As a further implementation, the near-infrared light source module includes a broadband halogen lamp, a miniature infrared heating element, or a discrete LED light source array with different center wavelengths; when using an LED light source array, the system sequentially lights up different LEDs through time-division multiplexing to match the discrete characteristic bands, thereby achieving multi-band sensing without MEMS filters.
[0014] Thirdly, the present invention also provides a non-transitory computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the state offset recognition method based on low-dimensional discrete perception.
[0015] Fourthly, the present invention also provides an electronic device, comprising: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform the state offset recognition method based on low-dimensional discrete perception.
[0016] The beneficial effects of the above invention are as follows: (1) This invention provides a method for applying the "individualized baseline + abnormal deviation" model to the field of daily state deviation identification. It eliminates the need for a large pre-established material database, as the system automatically learns low-dimensional discrete features under normal conditions. Any deviation that causes spectral features to deviate from the baseline center of the individualized baseline model can be identified. Furthermore, this invention can work offline and has a fast response speed. This invention customizes individualized baseline evaluation criteria based on device status, establishing an independent state baseline for each target object, completely eliminating the limitation of a uniform threshold and accurately adapting to the inherent differences of different individuals, different devices, and different environments.
[0017] (2) This invention automatically absorbs device drift through an adaptive compensation algorithm, absorbing and compensating for changes in the response of equipment devices caused by temperature drift and aging. This allows the system to automatically adapt to slow changes in the equipment, ensuring that changes in device response do not affect the stability of the relative characteristic structure. Through a baseline progressive update mechanism, this invention enables the system to smoothly track long-term drift such as sensor aging and slow environmental changes, maintaining continuous and effective monitoring capabilities for several to several decades.
[0018] (3) By actively limiting the perception dimension, the present invention can still build a stable statistical baseline under limited sample conditions, avoid the "curse of dimensionality" problem of high-dimensional systems, and provide a fundamental guarantee for long-term adaptive monitoring.
[0019] (4) This invention not only supports a continuous monitoring mode based on time series, providing early warning of trend deviations and further reducing the false alarm rate of the system, but also optionally supports real-time status classification judgment based on single sampling, with rapid response; meeting the reliability requirements of different scenarios. The output of this invention is a level indication based on statistical deviation rather than an absolute judgment, which clarifies the technical boundaries and avoids liability risks in areas with strong supervision such as quality and safety. Attached Figure Description
[0020] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative examples and descriptions of the invention are used to explain the invention and do not constitute an undue limitation of the invention.
[0021] Figure 1 This is a flowchart of a state offset recognition method based on low-dimensional discrete sensing, according to some specific implementations of the present invention. Figure 2 This is a schematic diagram of the overall architecture of the liquid anomaly detection method according to some specific implementations of the present invention; Figure 3 This is a schematic diagram of the structure of a MEMS switchable near-infrared sensing module according to some specific embodiments of the present invention; Figure 4 This is a schematic diagram of the overall timing of multi-band time multiplexing sampling based on some specific implementations of the present invention; Figure 5 This is a schematic diagram of the construction process of the present invention based on the relative features of some specific implementations; Figure 6 This invention provides a flowchart of individualized baseline modeling and anomaly deviation determination based on some specific implementations. Figure 7 This is a schematic diagram of adaptive compensation based on some specific implementations of the present invention; Figure 8 This is a schematic diagram of the integration of a liquid anomaly detection system into a smart water cup lid according to some specific embodiments of the present invention. Detailed Implementation
[0022] Example 1: The core logic of this disclosure is independent of specific physical quantities and application areas. By configuring different sensing dimensions and target objects, it can be quickly adapted to various scenarios such as liquid detection, equipment monitoring, and environmental assessment. This disclosure provides a state shift recognition method based on low-dimensional discrete sensing, such as... Figure 1 The steps include: Step 1: Obtain the low-dimensional discrete feature vectors of the target object under normal and current states; the low-dimensional discrete feature vectors are composed of the ratio and difference features of the set band pairs; Step 2: Based on the low-dimensional discrete feature vectors under normal conditions, establish an individualized baseline model for the target object; Step 3: Calculate the relative offset between the low-dimensional discrete feature vector in the current state and the individualized baseline model, and make a graded judgment based on the relative offset and the preset judgment logic, and output the detection results; Step 4: Based on the detection results and user feedback, the current low-dimensional discrete feature vectors that have no abnormalities are included in the baseline sample library. When the sample increment in the baseline sample library reaches the set value, the low-dimensional discrete feature vectors in the baseline sample library are weighted and statistically analyzed to dynamically update the individualized baseline model. During the identification process, the individualized baseline model is adaptively compensated to offset the effects of environmental changes or device drift.
[0023] In scenarios involving liquid anomaly detection, existing smart water cup detectors can only reflect Ca²⁺. + Mg² + Na + K + Plasma concentration cannot effectively identify non-ionic anomalous substances such as unknown organic pollutants and microbial metabolites. These non-ionic anomalous substances are mostly concealed, cumulative, and highly toxic. Even at extremely low concentrations, long-term ingestion can cause irreversible damage to the human body.
[0024] Existing devices for detecting non-ionic anomalous substances use bulky instruments, such as near-infrared spectrometers, in the laboratory. Although they have high detection accuracy, they are large, expensive, and require operation in a controlled optical environment with strict requirements on temperature, humidity, and light.
[0025] Existing rapid detection devices, such as handheld / portable Raman spectrometers, are convenient, but their sensitivity is not high. Moreover, relying on spectral libraries and algorithms, they can only detect substances already in the spectral library and cannot detect unknown non-ionic anomalous substances.
[0026] As one embodiment, the specific implementation method of the state shift recognition method based on low-dimensional discrete sensing in the liquid anomaly detection scenario is as follows: For unknown pollutants or abnormal substances in daily drinking water, as long as they cause the spectral features to deviate from the baseline center of the individualized baseline model, they can be identified. In the liquid detection scenario, the state shift manifests as a change in liquid features relative to the baseline, i.e., a liquid anomaly. The steps are as follows: Figure 2 As shown: Step 1: Acquire response data of multiple preset wavelength bands of the liquid to be tested, and obtain the stable response value of the wavelength band after preprocessing; acquire ambient light and temperature data to adaptively compensate for the stable response value. Step 2: Process the stable response values of multiple preset bands, calculate the ratio and difference features of specific band pairs, and construct a low-dimensional feature vector; Step 3: Calculate the baseline center, covariance matrix, sample maturity, and baseline variability based on the low-dimensional eigenvectors, and establish an individualized baseline model for the liquid to be tested based on the above parameters; Step 4: Calculate the statistical distance index between the current low-dimensional feature vector of the liquid and the baseline center in the individualized baseline model, and make a graded judgment based on the statistical distance index and the preset judgment logic, and output the detection results; Step 5: Based on user feedback, the current low-dimensional feature vectors of liquids that have no abnormalities detected are included in the baseline sample library. When the sample increment in the baseline sample library reaches a set value, the low-dimensional feature vectors in the baseline sample library are weighted and statistically analyzed to dynamically update the individualized baseline model. During the identification process, the individualized baseline model is adaptively compensated to offset the effects of environmental changes or device drift.
[0027] S1: Perform system initialization, turn on the near-infrared light source, preheat to a stable state, reset the MEMS switchable near-infrared sensing module to the initial band, and collect ambient light background signals to read the temperature.
[0028] In some specific implementations, a MEMS switchable near-infrared sensing module is used for band selection and detection integration. This sensing module is configured with preset band stepping control logic to rapidly switch between sampling 3-20 specific discrete feature bands in the time domain via a driving voltage sequence. The sensing module contacts the liquid to be tested through a transmissive detection chamber with an optical path length of 5-15 mm, and the detection chamber has a broadband optical window with a transmittance greater than 90%. The MEMS near-infrared sensing module is configured with synchronous triggering logic. After the driving voltage deflects the micromirror to the target band, the processing module presets a mechanical stabilization window period of 5ms-20ms. The photoelectric detection and signal acquisition module starts ADC sampling within this window period to ensure the acquisition of quasi-static optical response values.
[0029] like Figure 3 As shown, a MEMS switchable near-infrared sensing module is used to switch to the i-th preset band, {i=1,2,...,n}; incident near-infrared light of 850-1700nm passes through an optical window and a fixed aperture or stop to reach the MEMS band selection unit. The MEMS band selection unit uses upper and lower reflectors to control the cavity length of the air cavity through voltage drive to obtain the preset band. The preset band is a discretely distributed pre-selected band, rather than a continuously scanned band; then, the response data of the preset band is obtained through the near-infrared detector, the analog front-end TIA, and the ADC digital signal output.
[0030] In some specific implementations, the selection of the preset wavelength bands is based on at least one of the following criteria: wavelength bands near the characteristic absorption peaks of water molecules, such as 970nm, 1200nm, and 1450nm; wavelength bands near the absorption peaks of CH bonds in organic matter, such as 1200nm, 1400nm, and 1700nm; wavelength bands that avoid strong ambient light interference, such as the visible light tail below 900nm; the number of wavelength bands is 3-12, preferably 5-8.
[0031] In some specific implementations, the recommended band combinations are: Option A: Low cost, with 3 selectable bands: 1200nm, 1450nm, and 1650nm. Option B: Standard option, with 6 selectable bands: 1100nm, 1200nm, 1350nm, 1450nm, 1550nm, and 1650nm; spaced approximately 100nm apart, balancing feature coverage and cost. Option C: High-performance option, with 10 selectable bands: 1050nm, 1150nm, 1250nm, 1350nm, 1450nm, 1550nm, 1650nm, 1750nm, 1850nm, and 1950nm; spaced 100nm apart, covering the entire near-infrared band, suitable for complex liquids.
[0032] This embodiment selects Scheme B for specific description. The band combination of Scheme B covers the first overtone region of water molecules and the characteristic absorption region of common organic pollutants. Combined with the 10mm optical path detection chamber, it can achieve extremely high detection sensitivity for non-ionic abnormal substances.
[0033] In some specific implementations, the center wavelength interval between the various bands is not less than 50 nm, preferably 50-150 nm, and more preferably 80-120 nm.
[0034] S2: Acquire response data from multiple preset bands, and obtain stable response values for the bands after preprocessing. Specifically, this includes: using multi-band time multiplexing for discrete sampling, setting a time window and sampling number in a single drinking event, and statistically processing multiple sampling results of the same band to obtain stable response values for the bands.
[0035] In some specific implementations, MEMS switchable near-infrared sensing modules are used for multi-band time-multiplexed sampling, such as... Figure 4 As shown, in a single drinking water event, response data for six wavelength bands needs to be collected, with a time window length of 0.5-5 seconds, preferably 1-3 seconds. First, the system is preheated, and the ambient light background is sampled. Then, the light source is turned on, and six discrete wavelength bands are scanned sequentially, approximately 5ms for each band. For each band, m light intensity samples are required, where m ≥ 3. Next, the m sampling results for each band are statistically processed, the influence of ambient light background and temperature is deducted, the maximum and minimum values are removed, and the average value is taken to obtain the stable response value for that band. , The reference value is typically a signal value measured against a known reference object, such as air or a standard diffuse reflector, at the same wavelength. Then, a low-dimensional discrete feature vector is constructed for anomaly detection.
[0036] Through statistical processing, the effects of systematic biases such as absolute light source intensity and detector gain were eliminated, thus... It becomes a stable and repeatable relative response value.
[0037] By using MEMS discrete band switching instead of continuous scanning spectrometers, the amount of data and computational complexity can be significantly reduced, and the system cost can be reduced to 1 / 10 to 1 / 50 of that of traditional spectrometers. The core optical module can be as small as 1 cubic centimeter, which can be integrated into an ordinary water cup lid. The power consumption is significantly reduced, with a single detection power consumption of <0.1Wh, and it can be powered by a small lithium battery for several weeks.
[0038] S3: Process the stable response values of multiple preset bands, calculate the ratio and difference features of the set band pairs, and construct a low-dimensional discrete feature vector. The low-dimensional discrete feature vector is composed of sensitive band pairs selected from a preset band set. The sensitive band pairs are formed by calculating the correlation coefficient or mutual information between each discrete band and the target state offset, and selecting the bands with the highest sensitivity ranking in the top d positions, where d is an integer between 2 and 10.
[0039] In some specific implementations, such as Figure 5 As shown, the process of constructing relative features includes: using the n band stable response values obtained from the above multi-band time multiplexing sampling. ; S31: Perform normalization processing: (1) Normalization eliminates the influence of absolute light intensity, obtains relatively stable response characteristics, improves system stability, and yields the normalized stable response value. .
[0040] S32: Perform feature calculation: Calculate the relative ratio characteristics of a specific band pair: (2) Calculate the relative difference characteristics of a specific band pair: (3) S33: Obtain the set of low-dimensional discrete eigenvectors: ; From these, the top p ratio features and top q difference features that contribute the most to distinguishing between "normal" and "abnormal" states are selected, and a low-dimensional discrete feature vector is constructed: (4) Among them, the dimension of the low-dimensional discrete eigenvectors .
[0041] In some specific implementations, the selection criteria for specific band pairs include: prioritizing bands related to the characteristic absorption peaks of the target analyte. For example: band pairs reflecting water content: 1450nm and 1300nm, with 1450nm being a strong absorption peak for water; band pairs reflecting the CH bonds of organic matter: 1700nm and 1600nm; and / or, by analyzing historical data, selecting band combinations that show the most significant differences between normal and abnormal samples; and / or, prioritizing band pairs with strong independent responses and complementary information, avoiding the selection of two bands with highly correlated spectral responses, such as adjacent bands.
[0042] In some specific implementations, the dimension of the ratio and difference features is determined in the initial stage. A relatively wide range can be set based on physical priors; for example, up to C(n,2) ratio and difference features can be derived from n bands. Using feature selection algorithms, such as those based on variance contribution rate, mutual information, or model-based feature importance ranking, p ratio features and q difference features are selected, where p and q are integers. After 6 months to 1 year of system operation, based on actual monitoring results, such as false alarm rate, false negative rate, and user feedback, the dimension selection of the low-dimensional discrete feature vector is iteratively optimized: if a certain dimension fluctuates too much over a long period... If a dimension contributes little to the deviation determination, its weight is reduced or it is removed. If a new state pattern is found that cannot be fully represented by the current dimension, a new dimension is added from the low-dimensional discrete feature vector set. A conservative strategy is adopted for dimension adjustment: at most one dimension is adjusted each time, and individualized baseline data is re-accumulated for more than 3 months after the adjustment.
[0043] To ensure the statistical stability of the covariance matrix in the individualized baseline model and avoid overfitting with a finite sample set, this embodiment constrains the dimension d of the low-dimensional discrete feature vectors and the initial sample size N, based on the multivariate statistical stability criterion: (5) Where k is a stability factor, preferably 5-10. In a preferred embodiment of this disclosure, considering the constraint that the initial sample size N in consumer electronics scenarios is typically between 100-500, the total dimension is controlled to be 5-8 dimensions. This setting ensures the algorithm's sensitivity to anomalous substances while eliminating the risk of Mahalanobis distance determination failure due to insufficient samples.
[0044] The low-dimensional discrete eigenvectors are used to characterize the overall characteristic distribution of the liquid in the near-infrared band, rather than specific physicochemical parameters. The discreteness of the low-dimensional discrete eigenvectors does not directly correspond to the content of specific components.
[0045] S4: Calculate the baseline center, covariance matrix, sample maturity, and baseline volatility based on the low-dimensional discrete eigenvectors, and establish an individualized baseline model for the liquid to be tested based on the above parameters; after each test, dynamically update the baseline model based on user feedback, external collaborative instructions, or time decay.
[0046] In some specific implementations, such as Figure 6 As shown in (1), individualized baseline modeling is performed. S41: First, perform initial modeling and collect valid test sample data from N normal drinking water tests conducted by the user. Preferred .
[0047] S42: Each detection yields a d-dimensional low-dimensional discrete feature vector V.
[0048] S43: Calculate the baseline center of the individualized baseline model : The mean vector of the historical feature vector set represents the central location of the normal liquid feature distribution and serves as the reference origin for calculating the statistical distance index. The calculation formula is as follows: (6) covariance matrix It is a d×d symmetric matrix that fully describes the discreteness of the data around the baseline center V0 and the linear correlation between different feature dimensions. The calculation formula is: ; =1,2,...,N;(7) The (i,j)th element for: (8) in Indicates the number of samples.
[0049] S44: The metadata parameters of sample maturity and volatility are used to evaluate the reliability and stability of the individualized baseline model and directly affect the adaptive threshold. Sample maturity N measures whether the number of historical samples N used to construct the individualized baseline is sufficient. The more samples, the more mature the individualized baseline, and the more reliable the statistical estimation. Maturity factor: .
[0050] Baseline volatility is used to measure the dispersion of historical normal samples. The greater the overall volatility, the wider the range of normal samples, and the threshold for judging abnormalities should be relaxed accordingly.
[0051] Composite Volatility Indicator Calculate the baseline center for all N historical samples. Mahalanobis distance {D1,D2,...,D N Then take their average. or median Comprehensive volatility indicator: or .
[0052] S45: Generate a set of hierarchical thresholds T. First, based on the characteristic that Mahalanobis distance follows or approximately follows a chi-square distribution, the basic confidence level is set: Corresponding significance level For example, 0.95 represents the upper limit of normal fluctuations; Corresponding significance level For example, 0.99 is a significantly abnormal lower limit.
[0053] Secondly, a threshold is introduced. threshold The results are derived by multiplying the baseline threshold by the maturity and volatility dynamics of two key individualized baseline models: (9) in, This is a maturity correction term. When N is small, such as N<20, Larger, can automatically widen threshold This helps avoid early oversensitivity and false alarms caused by statistical noise. This is a volatility correction term. , This is a volatility correction factor, reflecting the distribution of users' drinking habits. For individuals with complex drinking water sources, The increased size makes the detection system more inclusive.
[0054] Finally, the set of hierarchical thresholds is obtained. , The first threshold, This is the second threshold.
[0055] S46: The above parameters form the individualized baseline model parameter package: json Individualized baseline model { Baseline center: , Covariance matrix: , Metadata:{ Sample size: N, Maturity factor: , Overall volatility: CV_agg, Update timestamp: ... } } This parameter package will be stored on the device or in the cloud for use in all subsequent abnormal deviation determinations.
[0056] S5: Calculate the statistical distance index between the current low-dimensional discrete feature vector of the liquid and the baseline center in the individualized baseline model, make a graded judgment based on the statistical distance index and the preset judgment logic, and output the detection result; The statistical distance index is calculated using a distance metric algorithm, which includes, but is not limited to, Mahalanobis distance, Euclidean distance, Chebyshev distance, or divergence calculation based on probability distribution.
[0057] In some specific implementations, such as Figure 6 As shown in (2), the abnormality detection of the liquid to be tested includes: S51: Perform multi-band sampling on the liquid to be tested to obtain the low-dimensional discrete feature vector V of the liquid to be tested; S52: Reading the baseline center from the individualized baseline model Covariance Matrix ; Calculate the current low-dimensional discrete eigenvector V and the baseline center The offset distance is preferably Mahalanobis distance, which can be used to automatically eliminate covariance interference caused by the drift of different individual sensor references. (10) S53: Perform hierarchical judgment based on distance D and preset judgment logic; output hierarchical or state-based detection results; This disclosure employs a time-series-based continuous monitoring and judgment logic to further reduce false alarms caused by random noise. It is suitable for scenarios with extremely high stability requirements. For example, the logic identifies a state shift when the integral value of the Mahalanobis distance exceeds the cumulative threshold within M consecutive sampling periods, or when the proportion of times the offset, i.e., the Mahalanobis distance, exceeds the threshold within M consecutive sampling periods is greater than a preset proportion P.
[0058] Optionally, a judgment logic based on a single sampling result and an individualized baseline can also be adopted. In a single sampling, the calculated Mahalanobis distance is compared with an adaptive threshold, and the classification result is directly output. For example, when Mahalanobis distance ≤ first threshold T1: it is normal or suitable for drinking; when first threshold T1 < Mahalanobis distance ≤ second threshold T2: it is slightly abnormal or requires attention; when Mahalanobis distance > second threshold T2: it is significantly abnormal or requires discontinuation of drinking. The first threshold T1 and the second threshold T2 are adaptively determined based on the distribution characteristics of the individualized baseline model.
[0059] Inverse of the covariance matrix in Mahalanobis distance It plays a role in standardization and decorrelation, which "discounts" deviations on feature dimensions with large fluctuations, while amplifies small deviations on stable features. At the same time, it eliminates the influence of correlation between features, making the distance metric more consistent with the true distribution of the data.
[0060] Based on the detection results and user feedback, a decision will be made regarding whether to update. If an update is needed, the decision will be made to either update using online learning based on a sliding window or update using clustering-based pattern recognition.
[0061] S6: Based on user feedback, the current low-dimensional discrete feature vector of the liquid that has no abnormality detected is included in the baseline sample library. When the sample increment in the baseline sample library reaches the set value, the low-dimensional discrete feature vector in the baseline sample library is weighted and statistically analyzed to dynamically update the individualized baseline model. It also includes adaptive compensation, the adaptive compensation mechanism being configured to correct individualized baseline models or response data to offset the effects of environmental changes or device drift.
[0062] In some specific implementations, individualized baseline models need to update the baseline center and covariance. The updated baseline center often uses the exponentially weighted moving average (EWMA), which assigns higher weight to recent data. The formula is as follows: (11) in It is the forgetting factor, in this embodiment, =0.9. A more conservative covariance update strategy can be adopted, such as recalculating in batches every 50 new samples, or using a weighted covariance update algorithm, to prevent short-term abnormal fluctuations from contaminating the distribution structure.
[0063] In some specific implementations, adaptive compensation is also included, such as Figure 7 As shown, adaptive compensation includes: aging compensation, temperature compensation, and ambient light compensation, specifically including: The adaptive compensation mechanism includes aging compensation, which is performed periodically, either weekly or upon startup. This aging compensation is a periodic self-calibration path based on an object with known standard reflectivity, achieved through at least one of the following methods: physical calibration based on a standard reference, statistical calibration based on population data, or algorithmic compensation based on a preset attenuation model. Aging compensation includes: re-measuring the air spectrum to update the response benchmarks of the light source and detector; and re-measuring the pure water spectrum to update the water molecule absorption benchmarks. The air spectrum is measured using MEMS scanning of air samples, and the response benchmark R is recorded. air Update the light source and detector response benchmarks; measure the pure water spectrum using MEMS to scan pure water samples and record the response benchmark R. water The water molecule absorption standard was calibrated, the reference value database was updated, and the updated standard parameter {R} was obtained. air ,R water}
[0064] Adaptive compensation also includes temperature compensation and ambient light compensation. Temperature compensation includes updating the response data in real time based on a preset temperature coefficient. Ambient light compensation includes updating the response data in real time after deducting ambient light.
[0065] In this embodiment, temperature compensation: the temperature T of the MEMS module in the temperature sensor is read, due to the center wavelength of the MEMS filter. The change with temperature T usually exhibits a linear or second-order relationship: (12) in, For the updated center wavelength, The actual center wavelength obtained at the current temperature. and These are the temperature sensitivity coefficients, which are usually calibrated at the sensor's factory. Use a reference temperature, such as 25℃, to eliminate the shift in the center wavelength of the band caused by ambient temperature.
[0066] The updated center wavelength is used to acquire response data, and the temperature of the target object is read. The acquired response data is corrected using a comprehensive temperature compensation coefficient k to obtain response data after eliminating temperature interference. , This refers to the response data obtained from sampling.
[0067] Ambient light compensation: Sample and record the background ambient light before the light source is turned on. When statistically processing the m sampling results for each band, ambient light is subtracted and an ambient light correction is applied. The corrected response data is as follows: , This refers to the response data obtained from sampling.
[0068] The personalized baseline model is updated by comprehensively processing the above three adaptive compensation mechanisms.
[0069] Relative characteristic stability: Since the system output is a relative characteristic rather than an absolute value, the response changes of the MEMS module can be absorbed by the dynamic updates of the individualized baseline model.
[0070] S7: Alarm and report generation. Based on the identified abnormal samples, sound and light alarms are generated, abnormal information is recorded, and a detection report is generated.
[0071] In some specific implementations, the output formats include at least one of the following: color indication (green, yellow, red); sound prompts; vibration feedback; and mobile terminal push notifications.
[0072] In some specific implementations, the method described in this disclosure is applicable to the following liquid types: drinking water: tap water, mineral water, purified water, filtered water; tea beverages: green tea, black tea, oolong tea, etc.; coffee beverages; fruit juice and other transparent or semi-transparent beverages; soup liquids, where the liquid transmittance must meet the detection requirements. Optimization is performed for colored liquids such as tea, coffee, and fruit juice. First, the wavelength selection is adjusted. For colored liquids, the visible light band (400-700nm) is strongly absorbed by pigments and is therefore unsuitable as a characteristic band. Therefore, the 1200-1700nm range is selected, as this range mainly reflects the absorption of CH and OH bonds and is less affected by pigments. The number of wavelengths is increased to 10 to improve the ability to distinguish between different tea and coffee concentrations. Second, when modeling individualized baselines, users need to establish individualized baselines for different liquid types: Individualized Baseline A: Boiled water / purified water; Individualized Baseline B: Green tea; Individualized Baseline C: Coffee. During detection, users select the liquid type, which can then call up the corresponding individualized baseline model; or the liquid type can be automatically identified based on spectral characteristics. Finally, the anomaly type is further subdivided. For tea-based liquids, anomalies may include: excessive brewing time leading to excessively high levels of tea polyphenols and caffeine; the addition of foreign substances such as sugar or milk; moldy tea leaves producing microbial metabolites, etc. The system can not only determine "whether it is abnormal," but some models can also suggest "possible causes of the anomaly" based on specific components of the feature vector.
[0073] In some specific implementations, the methods described in this disclosure are applicable to a wide range of scenarios, such as daily drinking water safety monitoring in households; outdoor water source assessment during travel; water quality tracking of office water dispensers; soup quality monitoring in the catering industry; and fluid compatibility assessment for special populations (pregnant women, infants, and the elderly). The methods described in this disclosure are also applicable to fluid detection scenarios with similar individualized baseline characteristics, such as industrial liquid monitoring and oil quality testing.
[0074] In some specific implementations, this disclosure is compared with the traditional TDS electrode scheme. The results obtained based on prototype testing are shown in the table below: This disclosure utilizes the relative characteristic changes of multi-band spectra, which is sensitive to absorption changes caused by organic matter and can detect levels as low as 5 mg / L; while the TDS electrode does not respond to non-ionized organic matter and cannot detect organic pollutants. This disclosure eliminates false alarms caused by individual and regional differences through personalized baseline modeling, with a false judgment rate of <15%; while the false judgment rate of the TDS electrode is 35-50%. This disclosure transforms professional spectral detection into intuitive "red, yellow, and green" lights or suggestions, and achieves a personalized evaluation standard, reducing the difficulty of user understanding; while the output of the TDS electrode requires understanding the meaning of TDS. This disclosure has personalized adaptation capabilities and can automatically learn and update the personalized baseline model, while the TDS electrode does not have personalized adaptation capabilities.
[0075] Evaluation indicators This invention discloses a solution. TDS electrode scheme Sensitivity of organic pollutant detection Detectable at levels of 5 mg / L Unable to detect False positive rate (vs. laboratory standard) <15% 35-50% User understanding difficulty Low (Intuitive Level) Medium (Explanation of TDS meaning required) Example 2 This embodiment provides a state offset recognition system based on low-dimensional discrete sensing, employing the state offset recognition method based on low-dimensional discrete sensing described in Embodiment 1, including: an integration module, a mobile terminal, and a communication module; wherein the integration module includes: Near-infrared light source module, used to provide light source; MEMS near-infrared sensing modules are used to acquire the optical response of a target object in a specific band. The photoelectric detection and signal acquisition module is used to acquire the light intensity signal of the target object, obtain the response data values of multiple preset bands, and obtain the stable response value of the band after preprocessing; it also acquires ambient light to perform ambient light compensation on the response data in real time. The temperature detection module is used to acquire the temperature of the sensing module and the target object in order to perform temperature compensation on the response data in real time. The processing module is used to process the multi-band response values of the acquired target object; calculate the ratio and difference features of specific band pairs; and generate low-dimensional discrete feature vectors based on the multi-band optical response. The processing module is located inside the integrated module or in the mobile terminal. The individualized baseline modeling module establishes an individualized baseline model of the target object based on the low-dimensional discrete feature vectors under normal conditions. The mobile terminal calculates the relative offset between the low-dimensional discrete feature vector in the current state and the individualized baseline model, performs hierarchical judgment based on the relative offset and preset judgment logic, and outputs the detection results. Based on the detection results and user feedback, the low-dimensional discrete feature vectors of samples without abnormalities are included in the baseline sample library. When the sample increment in the baseline sample library reaches a set value, the low-dimensional discrete feature vectors in the baseline sample library are weighted and statistically analyzed to dynamically update the individualized baseline model. It also includes adaptive compensation, the adaptive compensation mechanism being configured to correct individualized baseline models or response data to offset the effects of environmental changes or device drift; Wireless communication module: The integrated module establishes a connection with the mobile terminal via Bluetooth and Wi-Fi.
[0076] In this embodiment, the near-infrared light source module in the system described in this disclosure includes a broadband halogen lamp, a miniature infrared heating element, or a discrete LED light source array with different center wavelengths. When the LED light source array is used, the system sequentially lights up different LEDs through time-division multiplexing to match the discrete characteristic bands, thereby realizing multi-band sensing without MEMS filters.
[0077] In this embodiment, the system further includes a physically isolated light-shielding cover for covering the near-infrared sensing module to eliminate ambient light interference; the temperature detection module is in close contact with the surface of the MEMS sensing unit, and the temperature data it collects is used to correct the voltage-wavelength mapping function of the MEMS filter in real time to ensure that the band drift is less than 2nm in an environment of 5℃–60℃.
[0078] In this embodiment, the system described herein is integrated into at least one of the following forms of a drinking container: lid type: the detection module is integrated inside the lid, with the light source and detector located on both sides of the lid, and detection is completed when the liquid passes through the inner cavity of the lid; bottom type: the detection module is integrated into the bottom of the cup, and the light path passes vertically upward through the liquid; sidewall type: the detection module is integrated into the sidewall of the cup, and the light path passes horizontally through the liquid; portable probe type: the detection module is an independent probe that can be inserted into any container for detection.
[0079] like Figure 8 As shown, the liquid anomaly detection system based on individualized baseline modeling described in this disclosure can be integrated into a smart water cup lid, and the hardware components of the liquid anomaly detection system include: Near-infrared light source module: Employs a wide-spectrum LED light source of 850-1700nm, such as the Osram SFH 4735 or similar devices; the light source drive circuit provides constant current control with a current accuracy of ±2%; light source warm-up time <100ms. MEMS near-infrared sensing module: Employs the Hamamatsu C14272 MEMS-FPI spectral sensor or similar devices; operating wavelength range: 1350-1650nm; configured with 6 preset wavelengths: 1370nm, 1420nm, 1470nm, 1520nm, 1570nm, 1620nm; band spacing: 50nm; band selection is voltage-controlled with a response time <10ms.
[0080] Photoelectric detection and signal acquisition module: InGaAs PIN photodiode integrated into the MEMS sensor; sampling via a 16-bit ADC at a sampling rate of 100Hz; signal amplifier gain: ×100, adjustable. Processing module: Main control chip: STM32 series 32-bit MCU or equivalent chip; operating frequency: 72MHz; built-in algorithms: feature extraction, individualized baseline modeling, and anomaly detection.
[0081] The temperature sensor uses an NTC thermistor with an accuracy of ±0.5℃; the power supply uses a 3.7V / 500mAh lithium polymer battery; wireless communication uses a Bluetooth 5.0 module; the indicator light is an RGB tri-color LED. The cup lid is made of food-grade PP material, with a detection chamber having an optical path length of 10mm and a chamber volume of approximately 0.5ml; the optical window uses sapphire or quartz glass with a light transmittance >90%@1350-1650nm; the sealing structure uses a silicone sealing ring with a waterproof rating of IPX7, and the transparent cup body does not occupy the effective volume of the main cup.
[0082] In this embodiment, the integrated module is typically embedded in the cup base or lid, while the processing module can be a local microcontroller or a mobile terminal.
[0083] Example 3: A non-transitory computer-readable storage medium is provided for storing computer instructions, which, when executed by a processor, implement the state offset recognition method based on low-dimensional discrete perception.
[0084] Example 4: An electronic device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform the state offset recognition method based on low-dimensional discrete perception.
[0085] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0086] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0087] While the specific embodiments of this disclosure have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this disclosure. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this disclosure are still within the scope of protection of this disclosure.
Claims
1. A state shift recognition method based on low-dimensional discrete sensing, characterized in that, Includes the following steps: Obtain low-dimensional discrete feature vectors of the target object under normal and current states; the low-dimensional discrete feature vectors are composed of the ratio and difference features of the set band pairs; Based on the low-dimensional discrete feature vectors under normal conditions, establish an individualized baseline model of the target object; Calculate the relative offset between the low-dimensional discrete feature vector in the current state and the individualized baseline model, and make a hierarchical judgment based on the relative offset and the preset judgment logic, and output the detection result. Based on the detection results and user feedback, the current low-dimensional discrete feature vectors that have no abnormalities are included in the baseline sample library. When the sample increment in the baseline sample library reaches a set value, the low-dimensional discrete feature vectors in the baseline sample library are weighted and statistically analyzed to dynamically update the individualized baseline model. During the identification process, the individualized baseline model is adaptively compensated to offset the effects of environmental changes or device drift.
2. The state shift recognition method based on low-dimensional discrete sensing according to claim 1, characterized in that, The target object is a liquid, and the normal state is the state in which a user normally drinks a specific liquid.
3. The state shift recognition method based on low-dimensional discrete sensing according to claim 1, characterized in that, The step of establishing an individualized baseline model for the target object based on the low-dimensional discrete feature vector under normal conditions specifically includes: The system acquires response data of multiple preset bands of the target object, and obtains stable response values of the bands after preprocessing; it acquires ambient light and temperature data to adaptively compensate for the stable response values; it processes the stable response values of multiple preset bands, calculates the ratio and difference features of the set band pairs, and constructs a low-dimensional discrete feature vector. The baseline center, covariance matrix, sample maturity, and baseline volatility are calculated based on the low-dimensional discrete eigenvectors, and an individualized baseline model of the liquid to be tested is established based on the above parameters. The individualized baseline model is dynamically updated after each test based on user feedback, external collaborative instructions, or time decay.
4. The state shift recognition method based on low-dimensional discrete sensing according to claim 1, characterized in that, Calculate the relative offset between the low-dimensional discrete feature vector in the current state and the individualized baseline model. Based on the relative offset and preset judgment logic, perform hierarchical judgment and output the detection results, specifically including: Calculate the statistical distance index between the low-dimensional discrete feature vector in the current state and the baseline center in the individualized baseline model. The system performs hierarchical judgment based on the statistical distance index and preset judgment logic, and outputs the detection results. Specifically, when the integral value of the relative offset within M consecutive sampling periods exceeds the cumulative threshold, or when the proportion of times the offset exceeds the threshold in M consecutive periods is greater than a preset proportion, it is identified as a state shift.
5. The state shift recognition method based on low-dimensional discrete sensing according to claim 3, characterized in that, The process of acquiring response data from multiple preset bands of the target object and obtaining a stable response value for that band after preprocessing specifically includes: performing discrete sampling using multi-band time multiplexing, setting a time window and the number of samplings, and statistically processing the multiple sampling results of the same band to obtain a stable response value for that band.
6. The state shift recognition method based on low-dimensional discrete sensing according to claim 1, characterized in that, The adaptive compensation mechanism is configured to correct the individualized baseline model, including aging compensation, temperature compensation, and ambient light compensation. The aging compensation is a periodic self-calibration path based on a known standard reflectivity object, and is achieved through at least one of the following methods: physical calibration based on a standard reference object, statistical calibration based on population data, or algorithmic compensation based on a preset attenuation model.
7. A state offset recognition system based on low-dimensional discrete sensing, characterized in that, include: Integration modules, mobile terminals, and communication modules; The integrated module includes: Near-infrared light source module, used to provide light source; MEMS near-infrared sensing modules are used to acquire the optical response of a target object in a specific band. The photoelectric detection and signal acquisition module is used to acquire the light intensity signal of the target object, obtain the response data values of multiple preset bands, and obtain the stable response value of the band after preprocessing; it also acquires ambient light to perform ambient light compensation on the response data in real time. The temperature detection module is used to acquire the temperature of the sensing module and the target object in order to perform temperature compensation on the response data in real time. The processing module is used to obtain low-dimensional discrete feature vectors of the target object under normal and current states; the low-dimensional discrete feature vectors are composed of the ratio and difference features of the set band pairs; The processing module is located inside the integrated module or in the mobile terminal; The individualized baseline modeling module establishes an individualized baseline model of the target object based on the low-dimensional discrete feature vectors under normal conditions. The mobile terminal calculates the relative offset between the low-dimensional discrete feature vector in the current state and the individualized baseline model, performs hierarchical judgment based on the relative offset and preset judgment logic, and outputs the detection results. Based on the detection results and user feedback, the low-dimensional discrete feature vectors of samples without abnormalities are included in the baseline sample library. When the sample increment in the baseline sample library reaches a set value, the low-dimensional discrete feature vectors in the baseline sample library are weighted and statistically analyzed to dynamically update the individualized baseline model. During the identification process, the individualized baseline model is adaptively compensated to offset the effects of environmental changes or device drift; Wireless communication module: The integrated module establishes a connection with the mobile terminal via Bluetooth and Wi-Fi.
8. A state shift recognition system based on low-dimensional discrete sensing according to claim 7, characterized in that: The near-infrared light source module includes a broadband halogen lamp, a miniature infrared heating element, or a discrete LED light source array with different center wavelengths. When using an LED light source array, the system sequentially lights up different LEDs through time-division multiplexing to match the discrete characteristic bands, thereby achieving multi-band sensing without MEMS filters.
9. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium is used to store computer instructions, which, when executed by a processor, implement the state offset recognition method based on low-dimensional discrete perception as described in any one of claims 1-6.
10. An electronic device, characterized in that, include: The device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform the state offset recognition method based on low-dimensional discrete sensing as described in any one of claims 1-6.