A non-invasive method, device, computer device and storage medium for estimating blood potassium concentration

By combining real and simulated ECG data, using deep learning models and physiological law constraint training, the accuracy and real-time problems of blood potassium concentration estimation are solved, and non-invasive and accurate blood potassium concentration monitoring is achieved, which is suitable for portable medical equipment and remote health monitoring.

CN119679424BActive Publication Date: 2025-08-01PEKING UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411932014.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-08-01
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

In the prior art, the estimation method of blood potassium concentration is insufficient, the data samples are incomplete, and non-invasive real-time monitoring cannot be achieved. The estimation method based on electrocardiogram has problems such as insufficient data and poor real-time performance.

Method used

Combining real ECG data and simulated ECG data, through deep learning model training, the convolution module, feature compression module, global feature aggregation module and classification output module are adopted to introduce constraint training of simulation laws and physiological laws, including feature alignment, joint training, adversarial learning and soft constraint methods to optimize the deep learning model.

Benefits of technology

It improves the accuracy and robustness of estimation of blood potassium concentration, enhances the recognition ability of abnormal ECG signals, and provides a reliable non-invasive estimation method for estimation of blood potassium concentration, suitable for portable medical equipment and telehealth monitoring systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119679424B_ABST
    Figure CN119679424B_ABST
Patent Text Reader

Abstract

The present invention discloses a non-invasive blood potassium concentration estimation method, device, computer device and storage medium, belonging to the technical field of blood potassium detection. Key physiological features are obtained by extracting features from real electrocardiogram data and simulated electrocardiogram data; the real electrocardiogram data and the simulated electrocardiogram data are mixed to obtain a mixed data set, and the mixed data set is divided into a training set, a validation set and a test set; a deep learning model is constructed, including a convolution module, a feature compression module, a global feature aggregation module and a classification output module; the deep learning model is trained based on the training set, and the deep learning model during the training process is evaluated based on the validation set to obtain a trained deep learning model; the test set is input into the trained deep learning model for blood potassium concentration estimation to obtain an estimation result. Thus, by combining real data and simulation data, the non-invasive blood potassium concentration is estimated through the training of a deep learning model, with high accuracy, simple method and wide application range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of blood potassium detection, and more specifically, to a non-invasive blood potassium concentration estimation method, device, computer device, and storage medium. Background Art

[0002] The blood potassium concentration is crucial for maintaining good health. The normal value range of the blood potassium concentration is 3.5 mmol / L - 5.5 mmol / L. This range helps to maintain the body's electrolyte balance, acid-base balance, and normal function of nerves and muscles. If the blood potassium concentration is lower than 3.5 mmol / L, hypokalemia may occur, while if the blood potassium concentration is higher than 5.5 mmol / L, hyperkalemia may result. Both conditions can have serious impacts on the heart and other vital organs.

[0003] Traditional methods for detecting blood potassium levels rely on regular blood chemistry tests, which are invasive and cannot provide real-time monitoring. Existing methods for estimating blood potassium based on electrocardiogram (ECG) analysis have been studied to some extent, but still suffer from problems such as insufficient accuracy, insufficient data samples, and poor real-time performance. With the rapid development of deep learning technology, more and more research has begun to attempt to use deep learning models to estimate blood potassium levels. Existing methods mainly rely on training with real data, but real data often has limited samples and is difficult to cover all changes in blood potassium levels. Summary of the Invention

[0004] 1. Technical Problems to be Solved

[0005] In view of the problems in the prior art such as insufficient accuracy in estimating blood potassium concentration and incomplete data samples, the present invention provides a non-invasive blood potassium concentration estimation method, device, computer device, and storage medium. By combining real electrocardiogram data with simulated electrocardiogram data and training through a deep learning model, the blood potassium concentration is accurately estimated, effectively improving the robustness of the deep learning model at different blood potassium concentrations and enhancing the ability to identify abnormal electrocardiogram signals.

[0006] 2. Technical Solutions

[0007] The objectives of the present invention are achieved through the following technical solutions.

[0008] A non-invasive blood potassium concentration estimation method includes the following steps:

[0009] Collect real electrocardiogram data, preprocess the real electrocardiogram data, and extract key physiological features from the real electrocardiogram data;

[0010] Generate simulated electrocardiogram data, perform data augmentation on the simulated electrocardiogram data, and extract key physiological features from the simulated electrocardiogram data;

[0011] Mix real electrocardiogram data and simulated electrocardiogram data to obtain a mixed dataset, and divide the mixed dataset into a training set, a validation set, and a test set;

[0012] Construct a deep learning model, which includes a convolutional module, a feature compression module, a global feature aggregation module, and a classification output module;

[0013] Train the deep learning model based on the training set, and evaluate the deep learning model during the training process based on the validation set to obtain a trained deep learning model;

[0014] Input the test set into the trained deep learning model for non-invasive potassium concentration estimation to obtain an estimation result.

[0015] As a further improvement of the present invention, in the deep learning model, the convolutional module extracts features from the mixed dataset to obtain deep features, the feature compression module compresses and expands the deep features to obtain enhanced deep features, the global feature aggregation module compresses the enhanced deep features into a global deep feature vector through a global average pooling layer, and the classification output module maps the global deep feature vector to the target output through a fully connected layer.

[0016] As a further improvement of the present invention, the training of the deep learning model based on the training set includes: constrained training through the signal feature loss of simulated electrocardiogram data, joint constrained training through real electrocardiogram data and simulated electrocardiogram data, constrained training through adversarial learning to fuse simulation rules, and / or soft constrained training based on physiological rules.

[0017] As a further improvement of the present invention, the specific steps of the constrained training through the signal feature loss of simulated electrocardiogram data include:

[0018] Extract key physiological features from the simulated electrocardiogram data;

[0019] Align the extracted key physiological features with the deep features learned by the deep learning model during the training process;

[0020] Constrain the deep learning model during the training process through a feature loss function.

[0021] As a further improvement of the present invention, the specific steps of the joint constrained training through real electrocardiogram data and simulated electrocardiogram data include:

[0022] For the simulated electrocardiogram data, constrain the feature learning of the deep learning model through feature loss;

[0023] For the real electrocardiogram data, optimize the classification of potassium concentration by the deep learning model through classification loss;

[0024] The characteristic loss of the simulated electrocardiogram data and the classification loss of the real electrocardiogram data are weighted and combined to form a total loss function;

[0025] The deep learning model in the training process is constrained by the total loss function.

[0026] As a further improvement of the present invention, the constrained training by fusing simulation rules through adversarial learning specifically includes the following steps:

[0027] Construct a discriminator to distinguish physiological key features and deep features;

[0028] Optimize the generator to conform to the simulation rules, where the simulation rules are the physiological rules contained in the simulated electrocardiogram data;

[0029] Construct a joint loss function through the classification loss and the adversarial loss of the generator;

[0030] The deep learning model in the training process is constrained by the joint loss function.

[0031] As a further improvement of the present invention, the soft-constraint training based on physiological rules specifically includes the following steps:

[0032] Define the soft constraint of the simulation rules;

[0033] Define a constraint loss function, and construct a total loss function through the classification loss and the constraint loss;

[0034] The deep learning model in the training process is constrained by the total loss function.

[0035] A non-invasive blood potassium concentration estimation device, comprising:

[0036] A data acquisition module, which acquires real electrocardiogram data, preprocesses the real electrocardiogram data, and extracts key physiological features in the real electrocardiogram data;

[0037] A data generation module, which generates simulated electrocardiogram data, performs data augmentation on the simulated electrocardiogram data, and extracts key physiological features in the simulated electrocardiogram data;

[0038] A data processing module, which mixes the real electrocardiogram data and the simulated electrocardiogram data to obtain a mixed data set, and divides the mixed data set into a training set, a validation set, and a test set;

[0039] A model construction module, which constructs a deep learning model, and the deep learning model includes a convolution module, a feature compression module, a global feature aggregation module, and a classification output module;

[0040] A model training module trains a deep learning model based on a training set, evaluates the deep learning model during the training process based on a validation set, and obtains a trained deep learning model;

[0041] A concentration estimation module inputs a test set into the trained deep learning model for non-invasive potassium concentration estimation and obtains an estimation result.

[0042] A computer device includes a memory and a processor. A computer program is stored on the memory and can run on the processor. It is characterized in that when the processor executes the computer program, the method described in any one of the above is implemented.

[0043] A computer-readable storage medium stores a computer program. When the computer program is run by a processor, the method described in any one of the above is executed.

[0044] 3. Beneficial effects

[0045] Compared with the prior art, the advantages of the present invention are as follows:

[0046] (1) For a non-invasive potassium concentration estimation method, device, computer device and storage medium of the present invention, by generating simulated electrocardiogram data through a biophysical model and organically combining the simulated electrocardiogram data with real electrocardiogram data, it can not only cover the problem of insufficient real electrocardiogram data samples, but also maintain the distribution characteristics of real electrocardiogram data, providing comprehensive and balanced training inputs for the deep learning model.

[0047] (2) For a non-invasive potassium concentration estimation method, device, computer device and storage medium of the present invention, during the training process of the deep learning model, a simulation law is introduced, and the deep learning model is comprehensively optimized through methods such as feature alignment, joint training, adversarial learning and soft constraints. It can not only improve the non-invasive estimation accuracy of potassium concentration, but also ensure that the estimation result has a clear physiological explanation, providing valuable reference for clinical decision-making.

[0048] (3) For a non-invasive potassium concentration estimation method, device, computer device and storage medium of the present invention, by combining a biophysical simulation model with deep learning technology, the diversity of electrocardiogram data is effectively enhanced. Especially in the non-invasive potassium concentration estimation task, the simulation data not only makes up for the defects in real data, but also can simulate electrocardiogram signals under various potassium concentrations, thereby broadening the application scope of the deep learning model, and can be widely applied to fields such as portable medical devices, remote health monitoring systems and personalized medicine, with strong practicability and wide applicability. Description of the drawings

[0049] Figure 1This is the flowchart of the non-invasive blood potassium concentration estimation method according to the embodiments of the present invention. Specific embodiments

[0050] The present invention will be described in detail below in conjunction with the accompanying drawings of the specification and specific embodiments.

[0051] Embodiment

[0052] As Figure 1 shown, a non-invasive blood potassium concentration estimation method provided by this embodiment. The method includes: collecting real electrocardiogram data, preprocessing the real electrocardiogram data, and extracting key physiological features in the real electrocardiogram data; generating simulated electrocardiogram data, performing data augmentation on the simulated electrocardiogram data, and extracting key physiological features in the simulated electrocardiogram data; mixing the real electrocardiogram data and the simulated electrocardiogram data to obtain a mixed data set, and dividing the mixed data set into a training set, a validation set, and a test set; constructing a deep learning model, the deep learning model includes a convolution module, a feature compression module, a global feature aggregation module, and a classification output module; training the deep learning model based on the training set, evaluating the deep learning model during the training process based on the validation set, and obtaining a trained deep learning model; inputting the test set into the trained deep learning model for non-invasive blood potassium concentration estimation, and obtaining an estimation result.

[0053] Specifically in this embodiment, real electrocardiogram data is collected, and the real electrocardiogram data is screened from existing public data sets. It should be noted that the real electrocardiogram data corresponds to the blood potassium concentration detection data within several hours. In the prior art, the blood potassium level is divided into three categories: hypokalemia, with a blood potassium concentration < 3.5 mmol / L; normal blood potassium, with a blood potassium concentration of 3.5 mmol / L - 5.0 mmol / L; hyperkalemia, with a blood potassium concentration > 5.0 mmol / L.

[0054] After collecting the real electrocardiogram data, it is necessary to preprocess the real electrocardiogram data. In this embodiment, the preprocessing includes filtering, normalization processing, and feature extraction.

[0055] For filtering, since real electrocardiogram (ECG) data is usually accompanied by high-frequency noise (e.g., electromagnetic interference), low-frequency noise (e.g., baseline drift), and environmental noise (e.g., electromyogram interference), these noises will seriously interfere with the detection of the waveform characteristics of real ECG data. By filtering, the noise interference in real ECG data is eliminated, and the core waveform morphology is retained, providing clear data input for subsequent steps. The specific processing methods include: (1) Using a low-pass filter (cutoff frequency 50 Hz) to remove high-frequency noise and ensure smooth edges of the ECG signal; (2) Using a band-pass filter (0.5 Hz to 50 Hz) to eliminate low-frequency drift and further remove high-frequency interference; (3) To avoid phase distortion, zero-phase filtering (e.g., two-way Butterworth filter) is adopted to ensure the integrity of the waveform on the time axis.

[0056] For normalization, after filtering, the main noises in real ECG data have been removed, but the amplitude differences may still affect the learning of key physiological characteristics by the deep learning model. Due to differences in acquisition devices, acquisition conditions, and patient individuals, the amplitudes of ECG signals in different samples may vary significantly. For example, different electrode contact qualities or the skin resistance of patients will cause amplification or reduction of the amplitude of the ECG signal. Amplitude differences will cause the deep learning model to be overly sensitive to or ignore the characteristics of some samples, affecting the stability of training. Therefore, by normalizing, the individual differences in the amplitudes of ECG signals are eliminated, the consistency of sample data is ensured, standardized input is provided for the training of the deep learning model, and the accuracy of subsequent feature calculations is ensured. The specific processing methods include: (1) Mean normalization, adjusting the mean of the ECG signal to 0 to eliminate the overall offset; (2) Standardization, adjusting the standard deviation of the ECG signal to 1 to unify the dynamic range of amplitudes and ensure that all samples are within the same scale.

[0057] For feature extraction, key physiological features reflecting the physiological laws of real electrocardiogram (ECG) data are refined through feature extraction. The key physiological features are not only used to construct the alignment basis for subsequent real and simulated ECG data, but also can explicit the physiological laws. For example, features closely related to the change in blood potassium concentration, such as QT interval and T wave shape, are extracted, enabling the deep learning model to effectively embed the physiological characteristics of simulated ECG data during the training process. At the same time, feature extraction provides clear data support for subsequent deep learning model training methods (such as physiological law constraint, joint optimization, etc.). The specific processing methods include: (1) Time-domain feature extraction, using a peak detection algorithm (such as threshold-based peak detection) to extract the P wave, QRS complex, and T wave of real ECG data; calculating the key physiological features of each waveform (such as amplitude, width, and interval); extracting statistical features such as heart rate variability (HRV), etc.; (2) Frequency-domain feature extraction, using the fast Fourier transform (FFT) to analyze the spectral characteristics of real ECG data and extract the energy distribution in low-frequency and high-frequency bands, etc.; (3) Time-frequency domain feature extraction, combining wavelet transform to extract the local changes of real ECG data in time and frequency, etc.

[0058] Thus, by preprocessing the real ECG data, interference from irrelevant ECG signals is eliminated, the standardization and consistency of the ECG signals are ensured, and key physiological features are extracted to provide high-quality data for subsequent deep learning model training.

[0059] Furthermore, simulated ECG data is generated. In this embodiment, existing biophysical models are used to generate simulated ECG data. It should be noted that the biophysical model is the basis for generating simulated ECG data and can accurately describe the cardiac electrophysiological process. By simulating the cardiac electrophysiological process through biophysical simulation models (such as the Hodgkin-Huxley model, Luo-Rudy model, and Ten Tusscher model, etc.), ECG signals under different blood potassium concentrations are generated.

[0060] Specifically, at different blood potassium concentrations, the significant changes in the conductivity of potassium ion channels and membrane potential will directly affect the action potential of myocardial cells and the manifestation of ECG signals. Therefore, it is necessary to adjust the ion concentration and electrophysiological parameters in the biophysical simulation model to generate ECG data under different blood potassium concentrations. The specific settings are as follows: normal blood potassium concentration, about 3.5 mmol / L - 5.0 mmol / L; low blood potassium concentration, about 2.0 mmol / L - 3.0 mmol / L and below; high blood potassium concentration, about 5.5 mmol / L - 6.5 mmol / L and above. At the same time, parameters related to potassium ion (K+) channels (such as potassium ion channel conductivity and resting membrane potential, etc.) are adjusted to simulate the influence of different potassium concentrations on cardiac action potential.

[0061] Furthermore, simulated electrocardiogram data is generated through a biophysical model. The core objective of generating simulated electrocardiogram data is to gradually simulate the formation process of electrocardiogram signals through multi-level modeling (e.g., single cell, tissue level, body surface projection), from the electrical activity at the ionic level to tissue electrical activity, and then to body surface electrocardiogram signals, ultimately generating complete electrocardiogram data covering different potassium ion concentrations. The specific steps include:

[0062] (1) Single-cell action potential simulation: Basic unit modeling

[0063] Single-cell action potential simulation is the basis for simulating cardiac electrical activity. By establishing an electrophysiological model of a single myocardial cell, the direct effects of different potassium ion concentrations on the cell membrane potential and ion channel kinetics can be captured. Single-cell action potential simulation provides kinetic parameters at the ionic level for subsequent tissue-level electrical activity and is the basic unit for simulating cardiac electrical activity. The specific methods include: using the Hodgkin-Huxley model, Luo-Rudy model, or Ten Tusscher model to simulate the action potential of a single myocardial cell and capture the effects of different potassium ion concentrations on ion channel kinetics. By adjusting the conductivity of potassium ion channels, resting membrane potential, and kinetic parameters of the repolarization process, the effects of changes in potassium ion concentration on cell membrane electrical activity can be accurately simulated. During hyperkalemia, the action potential duration (APD) shortens and the repolarization speed increases; during hypokalemia, the action potential prolongs and the repolarization speed slows down. Key physiological features are extracted during the simulation process, including the action potential duration (APD) to reflect changes in the electrical activity cycle, the maximum depolarization potential, and the repolarization slope to quantify the depolarization and repolarization characteristics of the cell membrane, providing basic data for subsequent tissue-level simulation. Thus, through single-cell action potential simulation, the electrical activity of myocardial cells is simulated at the ion channel and membrane potential levels, providing basic parameters for higher-level simulation.

[0064] (2) Two-dimensional / three-dimensional cardiac tissue electrical activity simulation: Tissue-level modeling

[0065] Based on the electroactivity of single cells, the electroactivity propagation process between cardiomyocytes is simulated through two-dimensional or three-dimensional tissue models to capture the spatio-temporal characteristics of local electroactivity. Through cardiac tissue-level simulation, the electroactivity propagation behavior at a larger spatial scale is constructed, which directly provides the basic electroactivity distribution for the generation of surface electrocardiograms. The specific methods include: using the FitzHugh-Nagumo model or the Bidomain model to simulate the electroactivity propagation between cells in cardiac tissue, and capturing the spatio-temporal propagation characteristics of electroactivity in the tissue by defining the electrical coupling between cells on a two-dimensional or three-dimensional grid. By adjusting the potassium ion channel parameters, the effects of different blood potassium concentrations on the electroactivity propagation are simulated, especially the abnormal propagation characteristics such as local reentry phenomena caused by hyperkalemia. The electroactivity propagation speed is extracted in the simulation to quantify the propagation changes under different blood potassium concentrations, and the potential gradient distribution is calculated to reflect the synchrony of electroactivity in cardiac tissue, providing the input data of tissue-level electroactivity for the generation of surface electrocardiogram signals. Thus, through two-dimensional / three-dimensional cardiac tissue electroactivity simulation, the single-cell simulation is extended to the tissue scale to simulate the electroactivity propagation characteristics between cells, providing the spatial distribution basis for the generation of surface electrocardiogram signals.

[0066] (3) Generation of surface electrocardiogram: Final signal modeling

[0067] By projecting the electroactivity of cardiac tissue onto the body surface, the final electrocardiogram signal is generated, covering the complete 12-lead surface electrocardiogram. The generation of surface electrocardiogram is the ultimate goal of the simulation process, and its signal characteristics are gradually transmitted and accumulated by single-cell and tissue-level simulations, finally presenting the complete characteristics of cardiac electroactivity. The specific methods include: using an electric field model (e.g., the Duchateau model) to project the electroactivity in two-dimensional or three-dimensional cardiac tissue onto the body surface to generate a complete 12-lead electrocardiogram signal. During the simulation process, by mapping the potential field of cardiac tissue to the positions of body surface leads and combining the effects of lead positions, conductivity, and body surface geometry, the effects of different blood potassium concentrations on electrocardiogram characteristics are accurately simulated. The generated electrocardiogram data can reflect the changes in the QT interval and T wave shape at a specific blood potassium level. For example, hypokalemia leads to prolongation of the QT interval and flattening of the T wave; hyperkalemia causes shortening of the QT interval and sharpness of the T wave. This process provides complete data support for the diversity of electrocardiogram characteristics and the training of deep learning models. Thus, through the generation of surface electrocardiogram, the tissue-level electroactivity is projected onto the body surface to generate a 12-lead electrocardiogram signal reflecting the overall cardiac electroactivity, and finally the simulated electrocardiogram data is obtained, presenting the characteristic changes under different blood potassium concentrations.

[0068] It should be noted that in this embodiment, after generating the simulated electrocardiogram data, data augmentation and balancing of the simulated electrocardiogram data are required. By performing data augmentation and balancing on the simulated electrocardiogram data, various changes and uncertainties in the real acquisition scenario can be simulated, thereby improving the adaptability of the deep learning model to real electrocardiogram data.

[0069] In this embodiment, to improve the generalization ability of the deep learning model, the following data augmentation methods are used to augment the simulated electrocardiogram data:

[0070] (1) Noise addition. By adding noise, the characteristics of the simulated electrocardiogram data are made closer to those of the actual acquired data. By adding Gaussian noise, low-frequency noise, and electromyogram interference to the simulated electrocardiogram data, common electronic interference, baseline drift, and muscle activity noise in the real acquisition process are simulated, making the simulated electrocardiogram data closer to the actual signal characteristics. Specifically, Gaussian noise with a standard deviation of 1%-5% of the signal mean is added, slow-changing low-frequency noise is generated using a sine wave or polynomial, and electromyogram interference is generated using high-frequency filtering (20 Hz - 100 Hz). Through noise addition, the generated simulated electrocardiogram data performs more realistically in a noisy environment, improving the robustness of the deep learning model to noise interference.

[0071] (2) Time shift processing. By simulating the offset of the starting position of the electrocardiogram signal, the robustness of the deep learning model to time alignment problems is improved. Specifically, by randomly shifting the electrocardiogram signal in time (for example, 10 ms - 50 ms), the offset of the starting position of the electrocardiogram signal is simulated, improving the adaptability of the deep learning model to time alignment problems. After time shifting, the electrocardiogram signal maintains its integrity through periodic filling or zero filling, and all leads are ensured to be translated synchronously to avoid phase deviation. Through time shift processing, the robustness of the deep learning model to temporal changes in the electrocardiogram signal can be enhanced, which is applicable to complex scenarios with large electrocardiogram cycle offsets.

[0072] (3) Amplitude adjustment and frequency change. By adjusting the amplitude and frequency of the electrocardiogram signal, electrocardiogram signals under various potassium ion concentrations are generated to simulate physiological diversity. By randomly adjusting the amplitude and frequency of the electrocardiogram waveform, physiological diversity under various potassium ion concentrations is simulated. Specifically, the amplitude of the electrocardiogram signal is adjusted as a whole or the amplitudes of the P wave, QRS complex, and T wave are adjusted individually (for example, when the potassium ion concentration is high, the T wave is elevated), and the frequency of the electrocardiogram signal is adjusted by changing the electrocardiogram signal period or using Fourier transform (FFT) band scaling (for example, the heart rate ranges from 60 bpm to 100 bpm). Through amplitude adjustment and frequency change, the generated diverse electrocardiogram signals can cover a wider range of physiological conditions, improving the learning ability of the deep learning model to dynamic changes.

[0073] (4) Interpolation technique. Generate more intermediate points between known blood potassium concentration samples to expand the coverage of the dataset. Specifically, linear interpolation, polynomial interpolation, or spline interpolation is used to generate intermediate data points between known blood potassium concentration samples, expanding the coverage of the dataset. At the same time, quality inspection is carried out to ensure the smoothness and consistency of the generated electrocardiogram signals. Through the interpolation technique, the blank areas in the blood potassium concentration distribution can be filled, making the generated simulated electrocardiogram data more continuous and uniform, and improving the estimation accuracy of the blood potassium concentration by the deep learning model.

[0074] It should be noted that to address the problems of insufficient abnormal samples and class imbalance, this embodiment adopts a data balancing strategy to improve the balance of the dataset. The data balancing strategy includes existing strategies such as undersampling, oversampling, and SMOTE. Undersampling reduces the dominant position of normal samples in the dataset by randomly selecting a part of the normal samples. Oversampling complements the number of abnormal blood potassium samples (e.g., hyperkalemia or hypokalemia) through data augmentation. SMOTE generates synthetic features of minority class samples through interpolation to further expand the data coverage. Thus, through the data balancing strategy, the training dataset can achieve class balance, avoiding the bias of the deep learning model towards normal samples and enhancing the sensitivity to rare samples.

[0075] In this embodiment, after data augmentation and balancing of the simulated electrocardiogram data, the simulated electrocardiogram data and the real electrocardiogram data are mixed to obtain a mixed dataset. By means of the mixed dataset, the simulated electrocardiogram data and the real electrocardiogram data are organically combined, which can not only cover the areas where the real electrocardiogram data samples are insufficient, but also maintain the distribution characteristics of the real electrocardiogram data, providing comprehensive and balanced training inputs for the deep learning model.

[0076] Specifically, a comprehensive dataset is constructed by mixing the simulated electrocardiogram data and the real electrocardiogram data. First, analyze the quantity distribution of different blood potassium concentration samples in the real electrocardiogram data, identify the sparse areas, and use the simulated electrocardiogram data for supplementation while maintaining the consistency of the characteristics of the two types of data. To avoid the simulated electrocardiogram data overly affecting the distribution of the real electrocardiogram data, they are mixed by setting the weight ratio of the simulated electrocardiogram data to the real electrocardiogram data (e.g., 3:1) to ensure a more comprehensive data distribution, thereby effectively avoiding the problem of underfitting of the deep learning model in certain sample categories and improving the estimation ability of the deep learning model for various blood potassium concentrations. At the same time, the deep learning model can not only learn the statistical characteristics in the actual clinical situation from the real electrocardiogram data, but also obtain clear physiological index benchmarks from the simulated electrocardiogram data. After obtaining the mixed dataset, the mixed dataset is divided into a training set, a validation set, and a test set.

[0077] Furthermore, a deep learning model is constructed. In this embodiment, the deep learning model adopts a multi-stage convolutional neural network structure, and gradually extracts the deep features of the electrocardiogram signals in the mixed dataset through stacked convolutional operations. The deep learning model includes a convolutional module, a feature compression module, a global feature aggregation module, and a classification output module.

[0078] In the convolutional module, each stage contains several one-dimensional convolutional layers (e.g., Conv1, Conv2, ..., ConvK). By sliding the one-dimensional convolutional kernel in the time dimension, local temporal features in the electrocardiogram signals (e.g., P wave, QRS complex, T wave, etc.) are extracted. After the convolutional layer, a batch normalization layer (Batch Normalization) and an activation function (e.g., ReLU activation function) are connected. The batch normalization layer and the activation function are used to accelerate the training of the deep learning model and enhance the non-linear expression ability.

[0079] In the feature compression module, as the network depth increases, the time dimension gradually decreases, and the number of feature channels gradually increases. For example, at the initial stage, the time dimension is 5000 steps. After multiple layers of convolution and pooling, the time dimension may be reduced to 39 steps, while the number of channels increases from 12 dimensions to 1024 dimensions. By gradually compressing and expanding, the feature expression ability of the deep learning model is enhanced, enabling it to capture more abstract and complex deep features.

[0080] In the global feature aggregation module, after all convolutional layers, a global average pooling layer (Global Average Pooling) is used to compress the time dimension into a global deep feature vector of a fixed size. This process not only reduces the number of parameters and prevents overfitting, but also retains the global time information for subsequent classification processing.

[0081] In the classification output module, the global feature vector is mapped to the target output through a fully connected layer (Fully Connected Layer). The output dimension is (*, 3), where * represents the batch size, that is, the number of samples input into the deep learning model at one time, and 3 corresponds to three classification tasks: hypokalemia, normal potassium, and hyperkalemia. The Softmax activation function is used to convert the output into a probability distribution for multi-class classification.

[0082] Thus, in this embodiment, the mixed dataset is input into the deep learning model. The convolutional module extracts deep features from the mixed dataset. The feature compression module compresses and expands the deep features to obtain enhanced deep features. The global feature aggregation module compresses the enhanced deep features into a global deep feature vector through the global average pooling layer. The classification output module maps the global deep feature vector to the target output through the fully connected layer.

[0083] It should be noted that in this embodiment, the deep learning model is trained with a training set, so as to construct a deep learning model that can accurately and non-invasively estimate blood potassium concentration and has physiological rationality. The deep learning model provided in this embodiment not only needs to automatically extract key physiological features from electrocardiogram (ECG) signals, but also needs to introduce the physiological laws contained in the simulated electrocardiogram data, that is, simulation laws, during the training process to constrain the learning process of the deep learning model and improve the interpretability and estimation robustness of the deep learning model for ECG signals.

[0084] Therefore, in this embodiment, an end-to-end deep learning method is adopted, and the uncharacterized mixed data set is directly input, and the deep features of the electrocardiogram data are automatically extracted and learned through a multi-layer convolutional neural network (CNN). At the same time, simulation laws are introduced, and the deep learning model is comprehensively optimized during the training stage through methods such as feature alignment, joint training, adversarial learning, and soft constraints.

[0085] During the training process, the complementary nature of real electrocardiogram data and simulated electrocardiogram data is fully considered in the input stage of the deep learning model. On the one hand, the real electrocardiogram data truly reflects the real physiological state in the clinical environment. On the other hand, the simulated electrocardiogram data generated based on the biophysical model provides a clear and controllable physiological feature reference for the deep learning model. By mixing the real electrocardiogram data and the simulated electrocardiogram data, the input data can not only retain the feature distribution of the real ECG signal, but also introduce the physiological regularity guidance contained in the simulated ECG signal during the training process.

[0086] In this embodiment, the input of the deep learning model is the preprocessed electrocardiogram signal in the training set, specifically the standard 12-lead electrocardiogram signal. The length of each electrocardiogram signal is 5000 sampling points, usually corresponding to 10 seconds of electrocardiogram data (sampling rate of 500 Hz). The dimension of the input data is defined as (*, N, 5000), where * represents the batch size, that is, the number of samples input at one time, N represents the number of leads, and its standard is 12 (which can be extended to single lead or multi-lead according to requirements), and 5000 represents the signal length, that is, the number of time points per lead.

[0087] Taking the training set as the input of the deep learning model enables the deep learning model to simultaneously perceive the differences and connections between real physiological signals and their idealized feature distributions at the initial stage of training, laying a foundation for subsequent optimization and feature extraction of the deep learning model (for example, deep feature learning of each convolutional layer, attention allocation, alignment of features with simulation laws, etc.).

[0088] During the end-to-end training of a deep learning model, although the input is the signal waveforms in the training set, the clearly defined physiological features in the simulated electrocardiogram (ECG) data (e.g., QT interval and T-wave morphology metrics) will indirectly participate in feature learning during training through specific strategies. The specific manifestations include: (1) Feature extraction of simulated ECG data. A biophysical simulation model is used to generate ECG signals under different blood potassium concentrations, and key physiological features are extracted from them, such as the QT interval (representing the action potential duration), T-wave shape (representing the repolarization process), etc. These features serve as target or constraint information to guide the deep learning model to learn the correct physiological laws. (2) Feature representation in the middle layer of the deep learning model. The deep learning model automatically extracts features through convolutional layers, and these features implicitly contain the time patterns of the ECG signals (e.g., waveform, amplitude, and frequency, etc.). Through feature alignment or a supervision mechanism, the features of the simulated ECG data are used to optimize the middle layer representation of the deep learning model, making the learning direction of the deep learning model more in line with physiological laws. (3) Feature embedding method. Strategies such as feature loss, joint training, and adversarial learning are adopted to embed the features of the simulated ECG data into the training process of the deep learning model. That is, by adding terms related to the features of the simulated ECG data to the loss function, it is ensured that the deep learning model not only performs well in classification tasks but also can capture the physiological features closely related to blood potassium concentration.

[0089] Thus, in this embodiment, through multi-dimensional feature participation methods, it is ensured that while the deep learning model has high-precision classification, it also has strong physiological interpretability and robustness.

[0090] To further improve the estimation ability and physiological consistency of the deep learning model, this embodiment adopts multi-level optimization strategies during training. In the prior art, only using classification loss may lead to overfitting of statistical features by the deep learning model and neglect the deep physiological meaning. Therefore, in this embodiment, the physiological laws contained in the simulated ECG data penetrate into the deep learning model through various training strategies. Through training strategies, the classification performance and physiological rationality of the deep learning model can be balanced, and finally an estimation model with excellent performance and interpretability can be obtained.

[0091] It should be noted that this embodiment proposes four training strategies to perform constrained training on the deep learning model, including: constrained training through the signal feature loss of the simulated ECG data, joint constrained training through real ECG data and simulated ECG data, constrained training through adversarial training to fuse simulation laws, and / or soft constrained training based on physiological laws.

[0092] Constrained training is carried out through the signal feature loss of simulated electrocardiogram data. In the training of deep learning models, relying solely on classification loss may lead to overfitting of the deep learning model and neglect potential physiological laws. By introducing key physiological features (such as QT interval and T wave shape) extracted from simulated electrocardiogram data as the learning targets of the deep learning model, the learning direction of the deep learning model can be effectively constrained, enabling it to not only have high classification accuracy but also conform to physiological rationality. The specific steps include:

[0093] (1) Extract key physiological features from simulated electrocardiogram data. To ensure that the deep learning model can follow known physiological laws during the learning process, key physiological features related to changes in blood potassium concentration need to be extracted from simulated electrocardiogram data.

[0094] S1. Use a biophysical simulation model to generate simulated electrocardiogram data. Through the biophysical simulation model, corresponding electrocardiogram signals are generated according to different blood potassium concentrations. By simulating the changes in electrocardiograms at different blood potassium concentrations through simulated electrocardiogram data, the specific impact of blood potassium concentration on cardiac electrical activity can be reflected;

[0095] S2. Extract key physiological features. Extract key physiological features related to blood potassium concentration from the generated simulated electrocardiogram data, such as QT interval, T wave amplitude, and shape. These key physiological features not only represent the basic morphology of the electrocardiogram signal but also are directly related to changes in blood potassium concentration. For example, the QT interval represents the duration of the action potential, and an increase in blood potassium concentration generally leads to a shortening of the QT interval; the T wave shape reflects the repolarization process, and changes in blood potassium concentration affect the amplitude and sharpness of the T wave.

[0096] S3. Feature extraction method. Feature extraction can be based on signal processing techniques, such as peak detection, filtering, and time-domain analysis, etc., or directly extract simulated electrocardiogram data. Through the feature extraction method, ensure that the extracted features accurately reflect the physiological changes of the electrocardiogram signal.

[0097] (2) Align the extracted key physiological features with the deep features automatically learned by the deep learning model during training to ensure that the learning direction of the deep learning model is consistent with physiological laws.

[0098] S1. Define feature representation. Define x as the electrocardiogram data; define the key physiological feature as f simulation (x), that is, through f simulation function to extract features from simulated electrocardiogram data to obtain key physiological features; define the deep features automatically learned by the deep learning model during training as f model (x), mark f model (x) as the deep feature.

[0099] S2. Calculate the feature alignment loss by computing the mean squared error (MSE) between the key physiological feature f simulation (x) and the depth feature f model (x) to define the feature alignment loss, which is expressed as:

[0100]

[0101] where, represents the feature alignment loss, ||...|| represents the Euclidean norm of the vector, which is the L2 norm in this embodiment.

[0102] S3. Feature alignment strategy: By incorporating the feature alignment loss into the total loss function, the deep learning model not only optimizes the classification accuracy during training but also approaches the physiological features defined in the simulated electrocardiogram data. The feature alignment strategy helps reduce the physiological bias that may occur in the deep learning model under unconstrained conditions and ensures that the features learned by the deep learning model are physiologically reasonable.

[0103] (3) Introduce the feature loss. After defining the feature alignment loss, it needs to be incorporated into the total loss function of the deep learning model to constrain the deep learning model during the training process.

[0104] S1. Define the total loss function by combining the classification loss during the training process of the deep learning model with the feature alignment loss to form the total loss function, which is expressed as:

[0105]

[0106] where, represents the total loss function constrained by the signal feature loss of the simulated electrocardiogram data, and λ represents the weight coefficient used to balance the weights of the classification loss and the feature loss.

[0107] S2. Selection of the weight coefficient λ: The selection of the weight coefficient λ needs to be adjusted according to the specific training situation. When increasing the weight coefficient λ, the deep learning model will pay more attention to feature alignment and enhance physiological reasonableness, but it may sacrifice some classification accuracy; when decreasing the weight coefficient λ, the opposite is true. Therefore, in practical applications, appropriate weight coefficient λ needs to be selected through methods such as cross-validation to achieve the best balance effect.

[0108] Thus, by introducing the feature loss of simulated electrocardiogram data, the physiological interpretability of the deep learning model can be significantly enhanced, making the features learned by the deep learning model closer to the simulation rules. At the same time, as an additional constraint, the feature loss can effectively prevent the deep learning model from overfitting to certain specific patterns in the training data, thereby improving the generalization ability and robustness of the deep learning model. The introduction of the feature loss not only ensures that the deep learning model follows the physiological laws, but also enables it to have stronger adaptability, and can maintain high performance and reliability in practical application scenarios with different data distributions.

[0109] For joint constraint training using real electrocardiogram data and simulated electrocardiogram data. Real electrocardiogram data contains real distribution characteristics and clinical significance, but may be noisy and complex. Simulated electrocardiogram data has clear physiological regularity and controllability, but does not fully match the real complexity. Therefore, through joint training, the deep learning model can learn standardized physiological features from simulated electrocardiogram data and learn the real distribution from real electrocardiogram data, so as to obtain a deep learning model with both performance and interpretability. In this embodiment, different loss functions are constructed for real electrocardiogram data and simulated electrocardiogram data, and their contributions are balanced during the training process. The specific steps include:

[0110] S1. For simulated electrocardiogram data, through the feature loss constrain the feature learning of the deep learning model, so that the deep learning model can learn feature representations that conform to physiological laws.

[0111] S2. For real electrocardiogram data, optimize the accuracy of the deep learning model in potassium blood concentration classification through the classification loss (e.g., cross-entropy loss).

[0112] S3. Construct a loss function, and weight and combine the feature loss of simulated electrocardiogram data and the classification loss of real electrocardiogram data to form a total loss function, which is expressed as:

[0113]

[0114] where represents the total loss function for joint constraint training using real electrocardiogram data and simulated electrocardiogram data, and both α and β represent weight coefficients, which are used to balance the contributions of the feature loss and the classification loss.

[0115] S4. For the setting of weight coefficients α and β, the setting of weight coefficients α and β needs to be adjusted according to specific task requirements and data distribution. In this embodiment, appropriate weights can be determined by methods such as cross-validation, so that the deep learning model can maintain good adaptability to the actual data distribution while learning physiological regularity features.

[0116] Thus, through the joint constrained training of real electrocardiogram data and simulated electrocardiogram data, the complementary characteristics of simulated electrocardiogram data and real electrocardiogram data can be fully utilized. Simulated electrocardiogram data provides clear physiological law guidance, while real electrocardiogram data improves the adaptability of the deep learning model to the real scenario. This complementarity helps the deep learning model achieve better performance in multiple aspects. By combining the two loss functions, the deep learning model can achieve a better balance between classification performance and physiological consistency, thus significantly improving the overall estimation ability. In addition, by using the joint training of simulated electrocardiogram data and real electrocardiogram data, the generalization ability of the deep learning model is enhanced, enabling it to better adapt to different data distributions and actual application environments, and greatly improving its application value in the actual medical environment.

[0117] For the constrained training by fusing simulation laws through adversarial training. In this embodiment, adversarial training is carried out by introducing a generator and a discriminator. The generator is used to generate representations of key physiological features, and the discriminator is used to judge whether the key physiological features come from simulated electrocardiogram data. This process makes the features learned by the deep learning model approach the physiological laws. The specific steps include:

[0118] (1) Construct a discriminator to distinguish key physiological features and deep features.

[0119] S1. The discriminator D is a binary classifier whose task is to judge whether the input features come from simulated electrocardiogram data. The discriminator needs to learn to distinguish key physiological features and deep features.

[0120] S2. Define the discriminator loss. The loss function of the discriminator aims to maximize its ability to distinguish key physiological features and deep features, which is expressed as:

[0121]

[0122] where D(·) represents the discriminator function, which is used to judge whether the input features are key physiological features or deep features, and usually outputs a probability between 0 and 1, indicating the credibility that the input features are judged as key physiological features; f simulation (x) represents the key physiological features, f model (x) represents the deep features; xreal represents real electrocardiogram data, represents the operator for taking the expectation of the distribution of real electrocardiogram data, that is, calculating the statistical average of real electrocardiogram data, x sim represents simulated electrocardiogram data, represents the operator for taking the expectation of the distribution of simulated electrocardiogram data, that is, calculating the statistical average of simulated electrocardiogram data.

[0123] S3. Training of the discriminator. During the training process, the discriminator continuously optimizes its parameters to improve its discrimination ability. At the same time, the generator, that is, the deep learning model, optimizes its parameters so that the discriminator cannot distinguish between key physiological features and deep features, thereby enabling the deep learning model to generate more physiological feature representations.

[0124] (2) Optimize the generator to conform to the simulation law. Under the adversarial learning framework, the goal of the generator is to generate features that cannot be accurately distinguished by the discriminator, so as to approach the physiological law of simulated electrocardiogram data.

[0125] S1. Goal of the generator. The generator optimizes its own parameters so that the deep features generated by the deep learning model can be considered by the discriminator as key physiological features from simulated electrocardiogram data.

[0126] S2. Define the adversarial loss of the generator. The adversarial loss function of the generator aims to minimize the discriminator's ability to distinguish the features it generates, which is expressed as:

[0127]

[0128] where, represents the adversarial loss function of the generator, which is used to train the deep learning model to generate feature representations closer to key physiological features.

[0129] S3. Optimization of the generator. By minimizing the generator loss, the deep learning model will generate more physiological feature representations that conform to the simulated electrocardiogram data, which not only improves the physiological rationality of the model features but also enhances the generalization ability of the deep learning model on real data.

[0130] (3) Joint loss function. Under the adversarial learning framework, the total loss function needs to combine the classification loss and the adversarial loss of the generator to achieve the dual optimization of classification accuracy and feature physiological rationality.

[0131] S1. Define the total loss function. Combine the classification loss and the adversarial loss to form the total loss function, which is expressed as:

[0132]

[0133] where, Represents the total loss function for constrained training by fusing simulation laws through adversarial learning. γ represents the weight coefficient, which is used to balance the weights of the classification loss and the generator loss.

[0134] S2. Setting of the weight coefficient γ. The selection of the weight coefficient γ needs to be adjusted according to specific task requirements and training situations. When the weight coefficient γ increases, the deep learning model will pay more attention to the physiological rationality of features, but it may affect the classification accuracy. When the weight coefficient γ decreases, the opposite is true. Therefore, the optimal weight coefficient γ needs to be determined through experiments to achieve the best balance effect.

[0135] Thus, through constrained training by fusing simulation laws through adversarial learning, the authenticity of features can be enhanced, and the features generated by the deep learning model can be made more in line with the simulation laws. The adversarial mechanism not only improves the physiological consistency of features but also realizes the continuous optimization of feature representation through the dynamic game process between the generator and the discriminator, thereby significantly improving the generalization ability and robustness of the deep learning model. In addition, the adversarial mechanism can effectively reduce the bias of the deep learning model on a specific data distribution, making it perform more stably and reliably in different scenarios. This method ensures that while pursuing high classification accuracy, the deep learning model continuously approaches the physiological laws, enhancing the credibility and applicability of the deep learning model in clinical applications.

[0136] For soft-constrained training based on physiological laws. Some physiological features (e.g., the relationship between QT interval and blood potassium level) have been confirmed by clinical research. These laws are added as soft-constraint conditions to the training process. Once the deep learning model's estimation violates the physiological laws, it is corrected through soft penalties. Different from hard constraints, soft constraints allow the deep learning model to freely adapt to the actual data distribution within a certain range, avoiding performance degradation of the deep learning model caused by excessive limitation. The specific steps include:

[0137] (1) Defining the soft constraints of the simulation laws. To ensure that the estimation results of the deep learning model conform to the known physiological laws, in this embodiment, the physiological laws are encoded as soft-constraint conditions. In specific implementation, corresponding physiological constraint rules need to be defined according to the influence of blood potassium concentration on electrocardiogram signals.

[0138] S1. Obtaining physiological laws, i.e., simulation laws, through a biophysical simulation model. Using the biophysical simulation model to analyze the changes in electrocardiogram signals at different blood potassium concentrations to determine relevant physiological laws. For example, when the blood potassium concentration increases, the QT interval shortens. High blood potassium accelerates the repolarization process of myocardial cells, resulting in a shortened QT interval; the T wave becomes sharp. High blood potassium concentration will increase the amplitude of the T wave and make its shape sharper. When the blood potassium concentration decreases, the QT interval prolongs. Low blood potassium concentration will slow down the repolarization process of myocardial cells, resulting in a prolonged QT interval; the T wave becomes flat. Low blood potassium concentration will reduce the amplitude of the T wave and make its shape flatter.

[0139] S2. Encode the simulation rules as constraint conditions. According to the above physiological rules, transform them into mathematical expressions or logical rules. For example, regarding the relationship between the QT interval and blood potassium concentration, if the blood potassium concentration increases, the QT interval shortens; if the blood potassium concentration decreases, the QT interval lengthens. Regarding the relationship between the T-wave shape and blood potassium concentration, if the blood potassium concentration increases, the T-wave becomes sharp; if the blood potassium concentration decreases, the T-wave becomes flat.

[0140] S3. Formalize these rules into inequality constraints and embed them into the loss function of the deep learning model as a reference for optimization.

[0141] (2) Introduce constraint loss. To apply the above physiological rules during the training process of the deep learning model, these constraint conditions need to be transformed into specific loss functions. When the estimation result of the deep learning model violates the known physiological rules, the system will automatically add a penalty loss to guide the deep learning model to adjust the estimation result.

[0142] S1. Define the constraint loss function. According to the defined physiological rules, quantify the estimation result that violates the constraint into the degree of violation and express it through the constraint loss. In this embodiment, the constraint loss is expressed as:

[0143]

[0144] Among them, represents the constraint loss, and violations represents the degree to which the estimation result of the deep learning model violates the physiological constraint. For example, in the case of hyperkalemia, if the QT interval estimated by the deep learning model does not shorten to the predetermined range, a violation occurs, and vice versa.

[0145] S2. Incorporate the constraint loss into the total loss function. The total loss function combines the classification loss and the constraint loss to form the total loss function, which is expressed as:

[0146]

[0147] Among them, represents the total loss function for soft constraint training based on physiological rules, and δ represents the penalty coefficient used to control the weight of the soft constraint loss.

[0148] S3. Implementation details of the constraint. The soft constraint allows the deep learning model to moderately deviate from the physiological rules during the optimization process to adapt to the diversity and complexity of the actual data, but will penalize behaviors that violate the rules. This approach avoids the training difficulties that may be brought about by hard constraints and ensures the flexibility of the deep learning model while following the physiological rules.

[0149] Therefore, soft-constraint training based on physiological laws can ensure that the deep learning model strictly follows known physiological laws during training, significantly improving the physiological rationality and credibility of the training results. By encoding physiological laws as soft-constraint conditions, the deep learning model can flexibly adjust during the optimization process to adapt to the diversity and complexity of actual data, without being restricted by overly strict constraints. This soft-constraint method not only maintains the flexibility of the deep learning model, enabling it to adapt to different data distributions while approaching physiological laws, but also enhances the interpretability of the estimation results of the deep learning model through explicit physiological constraints. This helps clinicians better understand and trust the decision-making process of the deep learning model, enhancing the application value of the deep learning model in actual medical decision-making.

[0150] In this embodiment, constraint training is performed through the signal feature loss of simulated electrocardiogram data. The feature loss of simulated electrocardiogram data is introduced to enhance the physiological interpretability of the deep learning model, prevent overfitting, and enable the deep learning model to learn feature representations that conform to physiological laws. Through joint constraint training of real electrocardiogram data and simulated electrocardiogram data, both simulated electrocardiogram data and real electrocardiogram data are utilized to balance regular learning and classification performance, enabling the deep learning model to maintain good adaptability to the real data distribution while learning physiological laws. Through adversarial learning to fuse simulation laws for constraint training, the adversarial learning of the generator and discriminator is used to make the features generated by the deep learning model more consistent with the physiological laws in the simulated electrocardiogram data, improving the authenticity and physiological consistency of the features. Soft-constraint training based on physiological laws encodes physiological laws as soft-constraint conditions to guide the deep learning model to follow physiological knowledge while maintaining flexibility, ensuring that the estimation results are physiologically reasonable and interpretable. Thus, in this embodiment, by performing constraint training on the deep learning model, not only can the accuracy of non-invasive blood potassium concentration estimation be improved, but also the estimation results can be ensured to have clear physiological interpretations, providing valuable references for clinical decision-making.

[0151] In this embodiment, after performing constraint training on the deep learning model, simulated electrocardiogram data at different blood potassium concentrations is used to verify the robustness of the deep learning model, testing whether the deep learning model can accurately identify local features such as QT interval prolongation and T-wave changes. The specific methods include: cross-validation, using the k-fold cross-validation method to evaluate the performance of the model at different blood potassium concentrations; confusion matrix analysis, evaluating the classification performance of the deep learning model on different classes through the confusion matrix; AUC evaluation, calculating the area under the ROC curve (AUC) to measure the overall classification ability of the deep learning model.

[0152] Furthermore, by combining simulated electrocardiogram data and real electrocardiogram data, the estimation results of the deep learning model are optimized to improve the accuracy of classification. The specific methods include: adjusting the threshold of the deep learning model, based on the output of the simulated electrocardiogram data, optimizing the decision threshold of the deep learning model in practical applications to ensure accurate non-invasive estimation of blood potassium concentration; enhancing anomaly detection, through the enhancement of simulated electrocardiogram data, the deep learning model can better identify the electrocardiogram signal characteristics at different blood potassium concentrations, especially on abnormal samples (e.g., hyperkalemia or hypokalemia); weight adjustment, according to the verification results, adjusting the weight coefficients (e.g., α, β, γ, λ, and δ) in the loss function to optimize the performance of the deep learning model.

[0153] Thus, in this embodiment, after training the deep learning model based on the training set, the deep learning model in the training process is evaluated based on the validation set to obtain a trained deep learning model. The test set is input into the trained deep learning model for blood potassium concentration estimation to obtain an estimation result. Thus, in view of the fact that in the prior art, blood potassium concentration can only be detected by invasive blood drawing, in this embodiment, only by organically combining real electrocardiogram data and simulated electrocardiogram data, based on deep learning model training, and only inputting electrocardiogram data, blood potassium concentration estimation can be achieved, thus achieving the non-invasive purpose.

[0154] This embodiment also provides a non-invasive blood potassium concentration estimation device, which includes a data acquisition module, a data generation module, a data processing module, a model construction module, a model training module, and a concentration estimation module. The data acquisition module acquires real electrocardiogram data, preprocesses the real electrocardiogram data, and extracts key physiological features from the real electrocardiogram data. The data generation module generates simulated electrocardiogram data, performs data augmentation on the simulated electrocardiogram data, and extracts key physiological features from the simulated electrocardiogram data. The data processing module mixes the real electrocardiogram data and the simulated electrocardiogram data to obtain a mixed data set, and divides the mixed data set into a training set, a validation set, and a test set. The model construction module constructs a deep learning model, and the deep learning model includes a convolution module, a feature compression module, a global feature aggregation module, and a classification output module. The model training module trains the deep learning model based on the training set, evaluates the deep learning model during the training process based on the validation set, and obtains a trained deep learning model. The concentration estimation module inputs the test set into the trained deep learning model for non-invasive blood potassium concentration estimation and obtains an estimation result. The non-invasive blood potassium concentration estimation device provided in this embodiment can implement any of the non-invasive blood potassium concentration estimation methods, and the specific working process of the non-invasive blood potassium concentration estimation device can refer to the corresponding process in the embodiment of the non-invasive blood potassium concentration estimation method. The methods and devices provided in this embodiment can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for example, the division of a certain module is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed connections or communication connections with each other can be indirect coupling or communication connections through some interfaces, devices, or units, and can also be electrical, mechanical, or other forms of connections.

[0155] This embodiment also provides a computer device. A computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the non-invasive blood potassium concentration estimation method described above.

[0156] This embodiment also provides a computer-readable storage medium. A computer-readable storage medium stores a computer program thereon, and when the computer program is run by a processor, it executes the non-invasive blood potassium concentration estimation method described in this embodiment. Among them, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or component; the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0157] The above schematically describes the present invention and its implementation manners. This description is not restrictive. Without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms. What is shown in the drawings is only one of the implementation manners of the present invention, and the actual structure is not limited thereto. Any reference numeral in the claims should not limit the claimed claim. Therefore, if those of ordinary skill in the art are inspired by it and design similar structural manners and embodiments to this technical solution without creative efforts without departing from the purpose of this creation, they shall fall within the protection scope of the present invention. In addition, the term "including" does not exclude other elements or steps, and the word "a" before an element does not exclude including "a plurality" of such elements. The plurality of elements stated in the product claims can also be implemented by one element through software or hardware. The words such as first and second are used to represent names and do not indicate any specific order.

Claims

1. A non-invasive method for estimating blood potassium concentration, comprising the following steps: Collect real electrocardiogram data, which corresponds to the blood potassium concentration detection data carried out within a preset time. Preprocess the real electrocardiogram data and extract the key physiological features in the real electrocardiogram data. The key physiological features in the real electrocardiogram data at least include the QT interval and the characteristics of the T wave shape that are closely related to the change in blood potassium concentration; Generate simulated electrocardiogram data. The generation of simulated electrocardiogram data includes complete electrocardiogram data covering different blood potassium concentrations. Perform data augmentation on the simulated electrocardiogram data and extract the key physiological features in the simulated electrocardiogram data. The key physiological features in the simulated electrocardiogram data at least include the QT interval and the T wave shape; Mix the real electrocardiogram data and the simulated electrocardiogram data to obtain a mixed data set, and divide the mixed data set into a training set, a validation set and a test set; Construct a deep learning model, which includes a convolution module, a feature compression module, a global feature aggregation module and a classification output module; Train the deep learning model based on the training set, evaluate the deep learning model during the training process based on the validation set, and obtain a trained deep learning model; Input the test set into the trained deep learning model for non-invasive blood potassium concentration estimation to obtain an estimation result; In the deep learning model, the convolution module extracts deep features from the mixed data set, the feature compression module compresses and expands the deep features to obtain enhanced deep features, the global feature aggregation module compresses the enhanced deep features into a global deep feature vector through a global average pooling layer, and the classification output module maps the global deep feature vector to the target output through a fully connected layer.

2. The non-invasive potassium ion concentration estimation method according to claim 1, wherein The training of the deep learning model based on the training set includes: constraint training through the signal feature loss of the simulated electrocardiogram data, joint constraint training through the real electrocardiogram data and the simulated electrocardiogram data, constraint training through adversarial learning to fuse simulation rules, and / or soft constraint training based on physiological rules.

3. The non-invasive potassium ion concentration estimation method according to claim 2, wherein The specific steps of the constraint training through the signal feature loss of the simulated electrocardiogram data are as follows: Extract the key physiological features from the simulated electrocardiogram data; Align the extracted key physiological features with the deep features learned by the deep learning model during the training process; Constraint the deep learning model during the training process through a feature loss function.

4. The non-invasive potassium ion concentration estimation method according to claim 2, wherein The specific steps of the joint constraint training through the real electrocardiogram data and the simulated electrocardiogram data are as follows: For the simulated electrocardiogram data, constraint the feature learning of the deep learning model through a feature loss; For the real electrocardiogram data, optimize the classification of the blood potassium concentration by the deep learning model through a classification loss; Perform weighted combination on the feature loss of the simulated electrocardiogram data and the classification loss of the real electrocardiogram data to form a total loss function; Constraint the deep learning model during the training process through the total loss function.

5. The non-invasive potassium ion concentration estimation method according to claim 2, wherein The specific steps of the constraint training through adversarial learning to fuse simulation rules are as follows: Construct a discriminator to distinguish physiological key features and deep features; Optimize the generator to conform to the simulation law, where the simulation law is the physiological law contained in the simulated electrocardiogram data; Construct a joint loss function through the classification loss and the adversarial loss of the generator; Constrain the deep learning model during the training process through the joint loss function.

6. The non-invasive potassium ion concentration estimation method according to claim 2, wherein Soft constraint training based on physiological laws, the specific steps include: Define the soft constraint of the simulation law; Define the constraint loss function, and construct the total loss function through the classification loss and the constraint loss; Constrain the deep learning model during the training process through the total loss function.

7. A non-invasive potassium ion concentration estimation device, characterized in that, Include: A data acquisition module that acquires real electrocardiogram data. The real electrocardiogram data corresponds to the potassium concentration detection data carried out within a preset time. Preprocess the real electrocardiogram data and extract the key physiological features in the real electrocardiogram data. The key physiological features in the real electrocardiogram data at least include the characteristics of the QT interval and the T wave shape that are closely related to the potassium concentration change; A data generation module that generates simulated electrocardiogram data. The generated simulated electrocardiogram data includes complete electrocardiogram data covering different potassium concentrations. Perform data augmentation on the simulated electrocardiogram data and extract the key physiological features in the simulated electrocardiogram data. The key physiological features in the simulated electrocardiogram data at least include the QT interval and the T wave shape; A data processing module that mixes the real electrocardiogram data and the simulated electrocardiogram data to obtain a mixed data set, and divides the mixed data set into a training set, a validation set, and a test set; A model construction module that constructs a deep learning model. The deep learning model includes a convolution module, a feature compression module, a global feature aggregation module, and a classification output module; A model training module that trains the deep learning model based on the training set, evaluates the deep learning model during the training process based on the validation set, and obtains a trained deep learning model; A concentration estimation module that inputs the test set into the trained deep learning model for non-invasive potassium concentration estimation to obtain an estimation result. In the deep learning model, the convolution module extracts features from the mixed data set to obtain deep features, the feature compression module compresses and expands the deep features to obtain enhanced deep features, the global feature aggregation module compresses the enhanced deep features into a global deep feature vector through a global average pooling layer, and the classification output module maps the global deep feature vector to the target output through a fully connected layer.

8. A computer device, comprising a memory and a processor, wherein a computer program capable of running on the processor is stored on the memory, characterized in that, When the processor executes the computer program, it implements the method described in any one of claims 1-6 above.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run by the processor, it executes the method described in any one of claims 1-6 above.

Citation Information

Patent Citations

  • Noninvasive blood potassium monitoring method in hysteroscopy

    CN117694978A

  • Space-based dim and small target intelligent detection method based on embedded platform

    CN117710767A