Bioelectric signal processing method, device, equipment and medium
By constructing continuous representation labels and a composite loss function, and optimizing the machine learning model, the problem of difficulty in learning the correlation between waveform components in bioelectric signal segmentation is solved, and high-precision, well-defined signal segmentation and feature fusion are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIELU INTELLIGENT COMPUTING (SHANGHAI) TECHNOLOGY CO LTD
- Filing Date
- 2026-03-19
- Publication Date
- 2026-06-26
AI Technical Summary
Existing bioelectric signal segmentation models struggle to effectively learn the intrinsic relationships between waveform components, resulting in segmentation results with boundary jitter, spikes, and artifacts, and low feature fusion efficiency.
We construct continuous representation labels and a composite loss function, and optimize them through a machine learning model to generate continuous, complete, and clearly defined signal segmentation results.
It achieves high-precision segmentation of bioelectric signals, suppresses boundary jitter and artifacts, and improves feature fusion efficiency and robustness.
Smart Images

Figure CN122272037A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical artificial intelligence technology, and in particular to a bioelectric signal processing method, apparatus, device and medium. Background Technology
[0002] Bioelectric signals are electrical changes naturally generated by cells, tissues, or organs during the life processes of organisms, reflecting their function and state. Waveform segmentation of bioelectric signals is a key step in biomedical signal processing, and its main goal is to divide continuous electrophysiological signals into segments or waveform components with specific physiological significance.
[0003] Currently, deep learning-based segmentation methods have become the mainstream paradigm for bioelectrical signal analysis. This method typically models the signal segmentation task as a classification problem, using deep neural networks to identify and locate the start, peak, and end points of key physiological waveform components (such as P waves, QRS complexes, and T waves).
[0004] However, existing technical solutions still have the following key limitations: First, the model has difficulty in effectively capturing the intrinsic correlation and dependency between different waveform components; second, the segmentation strategy based on discrete classification lacks temporal continuity, which easily leads to problems such as spikes, artifacts and boundary jitter in the output results, thus restricting the accuracy and robustness of waveform localization; in addition, existing methods fail to fully combine the unique morphological and spectral characteristics of bioelectric signals, resulting in low efficiency of multi-scale feature fusion, thereby limiting the further improvement of the overall performance of the model. Summary of the Invention
[0005] The purpose of this application is to address the problems in existing bioelectrical signal segmentation models, such as difficulty in effectively learning the intrinsic relationships between waveform components, the presence of boundary jitter, spikes, and artifacts in the segmentation results, and low feature fusion efficiency. A bioelectrical signal processing method, apparatus, device, and medium are proposed, capable of achieving continuous, complete, and clearly defined high-precision signal segmentation.
[0006] In a first aspect, embodiments of this application provide a bioelectric signal processing method, including: Acquire bioelectric signals and divide them into bands to extract target bands; Determine the structural reference points and distance learning parameters within the target band; The distance learning parameter is the distance between any point within the target band and the structural reference point; Based on the structural reference point and distance learning parameters, continuous representation labels corresponding to the target band are generated to describe the distance change trend between any point in the target band and the structural reference point. The target band and the corresponding distance learning parameters are used as the supervision targets for training the machine learning model; Bioelectric signals are input into a machine learning model to obtain predicted output features; Calculate the composite loss function based on the predicted output features and the supervision objective; Based on the composite loss function, the parameters of the machine learning model are optimized using the backpropagation algorithm.
[0007] In some embodiments, the structural reference point is set as the midpoint of the target band; with the structural reference point as the vertex, a function field in the form of a single peak or a single valley is constructed to form a continuous characterization label corresponding to the target band. The function field is generated based on a preset function model; the function model includes at least one of the following: piecewise sine function, Gaussian function, trigonometric wave function and spline interpolation function.
[0008] In some embodiments, the target band includes a waveform region and an interval region; the function model is a piecewise sine function; The continuous characterization label exhibits a single-peak shape in the waveform region and a single-valley shape in the inter-period region; Continuous characterization labels for waveform regions The following relationship must be satisfied: ; in, It is a positive number; The time domain interval of the waveform region; Continuous characterization labels of interphase regions The following relationship must be satisfied: ; in, It is a positive number; The time domain interval of the interval region represents the time from the end of the previous waveform region. Continues to the beginning of the current waveform region .
[0009] In some embodiments, the machine learning model is an encoder-decoder architecture; wherein the encoder consists of multiple sequentially connected encoding levels, and the decoder consists of decoding levels corresponding to the number of encoding levels; Bioelectric signals are input into a machine learning model to obtain the predicted output features of each decoding level of the decoder model. The composite loss function is a weighted sum of the loss functions of each decoding layer; Based on the composite loss function, the parameters of the encoder and decoder models are optimized using the backpropagation algorithm.
[0010] In some embodiments, the machine learning model further includes an input layer for standardizing and preprocessing the bioelectrical signal to obtain a first input feature; Each coding level includes a first delivery path, a second delivery path, and a fusion path; The first transmission path is used to perform a non-parametric transformation on the first input feature to obtain the first output feature; The second transmission path is used to perform parameter transformation on the first input feature to obtain the second output feature; The fusion path is used to fuse the first input feature, the first output feature, and the second output feature to obtain the fused feature.
[0011] In some embodiments, the machine learning model further includes an index mapping cache; Construct an index mapping relationship between the first output feature and the first input feature, and store the first output feature and the corresponding index mapping relationship in the index mapping cache area; During backpropagation, the first propagation path maps the gradient of the first output feature to the first input feature based on the index mapping relationship obtained from the index mapping buffer, so as to complete the gradient backpropagation. The index mapping cache is updated with each model iteration.
[0012] In some embodiments, the first output feature includes at least one of the following obtained statistically from the first input feature: maximum value, minimum value, and median.
[0013] In some embodiments, the bioelectric signal to be processed is input into a trained machine learning model to obtain a multi-channel predicted response numerical sequence corresponding to each time point; Based on the multi-channel predicted response numerical sequence, the final band category at each time point is determined according to the preset decision rules; The decision rule is configured as follows: obtain the response values of each channel at the same time point, and determine the category of the channel with the largest response value that exceeds the preset threshold as the final band category at that time point.
[0014] Secondly, embodiments of this application provide a bioelectric signal processing device for implementing the aforementioned bioelectric signal processing method. The device comprises: an acquisition module for acquiring bioelectric signals; a processing module for inputting the bioelectric signals into a machine learning model to acquire predicted output features; calculating a composite loss function based on the predicted output features and a supervision target; and an optimization module for optimizing the parameters of the machine learning model based on the composite loss function using a backpropagation algorithm.
[0015] Thirdly, embodiments of this application provide an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the bioelectric signal processing method as described above.
[0016] Fourthly, embodiments of this application provide a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the bioelectric signal processing method as described above.
[0017] This application constructs continuous representation labels with clear morphology and gradient characteristics, providing stable and rich supervision targets for model training, thereby obtaining continuous, complete, and clearly defined segmentation results. By designing a composite loss function, while ensuring the accuracy of the predicted values, it guides the model to learn the smooth morphology and changing trends of the target field, effectively suppressing the boundary jitter, spikes, and artifacts common in traditional discrete classification methods. In addition, the constructed machine learning model can synergistically utilize the original features (first input features), deep features (second output features), and global statistical features (first output features) to fully mine the discriminative information contained in bioelectrical signals, significantly improving the efficiency and robustness of feature fusion, and enhancing the model's analytical ability and signal utilization efficiency. Attached Figure Description
[0018] Figure 1 This is a flowchart of a bioelectric signal processing method according to an embodiment of this application.
[0019] Figure 2 This is a schematic diagram comparing existing discrete labels [left] and continuous characterization labels [left] using electrocardiogram signals as a dataset, as shown in an embodiment of this application.
[0020] Figure 3 This is a schematic diagram of the prediction results when C1 and C2 are zero, according to an embodiment of this application.
[0021] Figure 4 This is a schematic diagram illustrating the principle of each coding level in the embodiments of this application. Detailed Implementation
[0022] The following specific embodiments illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Although the description of this application will be presented in conjunction with some embodiments, this does not mean that the features of this application are limited to this embodiment. On the contrary, the purpose of describing the application in conjunction with embodiments is to cover other options or modifications that may be derived based on the claims of this application. To provide a thorough understanding of this application, many specific details will be included in the following description. This application may also be implemented without using these details. Furthermore, to avoid confusion or obscuring the focus of this application, some specific details will be omitted in the description. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.
[0023] It should be noted that in this specification, similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0024] In the description of this application, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0025] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0026] This application provides a bioelectric signal processing method. This method achieves high-precision segmentation of bioelectric signals by optimizing a machine learning model, resulting in continuous, complete, and clearly defined segmentation results. Bioelectric signals typically originate from physiological activities in humans or animals, such as electroencephalogram (EEG), electrocardiogram (ECG), or electromyogram (EMG), and are characterized by their complexity and the presence of multiple frequency components. This method can effectively separate target wavebands and perform in-depth analysis, providing support for subsequent classification or prediction tasks. The following detailed description, in conjunction with the accompanying drawings and specific embodiments, will more clearly demonstrate the purpose, technical solution, and advantages of this application.
[0027] like Figure 2 As shown, it should be noted that bioelectrical signal segmentation, especially waveform localization in electrocardiograms (ECG), aims to accurately identify the start, peak, and end points of various physiological waveforms (such as P waves, QRS complexes, and T waves) in the signal, providing a foundation for subsequent advanced clinical applications such as arrhythmia diagnosis, disease screening, and risk stratification. Currently, point-by-point discrete classification methods based on deep learning have become the mainstream method for bioelectrical signal segmentation. This method models the segmentation task as a classification problem for each sampling point in a one-dimensional time-series signal, assigning predefined discrete category labels (e.g., 0-background, 1-P wave, 2-QRS complex, 3-T wave) to each time point. However, this paradigm has the following inherent technical limitations: like Figure 2 As shown on the left, discrete labels can only identify the waveform category to which the sampling point belongs, but cannot express its relative position or morphological role in the waveform. For example, the start point, peak point and end point of the P wave have different morphological meanings, but are given the same label, which makes it difficult for the network to learn the internal structure of the waveform and causes a serious loss of supervision information.
[0028] Discrete labels exhibit step jumps at waveform boundaries. This mathematical discontinuity increases the difficulty of gradient optimization and can easily lead to model oscillations in the boundary region, resulting in problems such as spikes, artifacts, and boundary blurring, which affect the accuracy and robustness of the segmentation results.
[0029] By directly feeding multi-lead signals as multi-channel inputs into the network model, the model implicitly learns the relationships between leads. This "black box" fusion lacks explicit modeling of the physiological spatial correlations between leads, making it difficult to fully utilize the potential of multi-lead information in noise suppression and feature complementarity.
[0030] like Figure 1As shown in the embodiments of this application, the bioelectric signal processing method includes: acquiring a bioelectric signal and dividing it into bands to extract a target band; determining a structural reference point and a distance learning parameter within the target band; the distance learning parameter being the distance between any point within the target band and the structural reference point; generating continuous representation labels corresponding to the target band based on the structural reference point and the distance learning parameter to describe the distance change trend between any point within the target band and the structural reference point; using the target band and the corresponding distance learning parameter as the supervision target for training a machine learning model; inputting the bioelectric signal into the machine learning model to obtain predicted output features; calculating a composite loss function based on the predicted output features and the supervision target; and optimizing the parameters of the machine learning model using a backpropagation algorithm based on the composite loss function.
[0031] like Figure 2 As shown on the right, specifically, structural reference points represent feature points within the target band that have clear geometric significance, such as local extrema (peaks, troughs), geometric centers, etc.; one or more structural reference points can exist within a target band. Discrete distance learning parameters are organized along the time axis to form a continuous representation label sequence of the same length as the target band. The design of continuous representation labels is to transform the temporal characteristics of the target band into a continuous mathematical representation, enabling machine learning models to better learn signal patterns and regularities. The distance variation trend between any point within the target band and the structural reference point can be used to predict or infer the boundary points of the target band. To address the inherent limitations of existing technologies, this application achieves a paradigm shift in supervised learning from "discrete classification" to "continuous regression." Its core innovation lies in reconstructing the target representation of supervised learning; that is, instead of defining the segmentation task as a class discrimination problem for each sampling point, it transforms it into a continuous modeling problem of geometric and topological relationships within the signal.
[0032] Specifically, this application constructs a function field for each target band. The function field is constructed based on the waveform characteristics and temporal distribution of the target band, generating continuous label values through a pre-defined function model, thereby providing supervision information for model training. This function field assigns a function value to each time point within the time domain interval, which quantitatively describes the geometric relationship or topological properties between that time point and the structural reference point. Geometric relationship encoding: Defined by the normalized distance between any point and the structural reference point, the function value changes continuously and smoothly with the distance, thus containing rich waveform morphology information.
[0033] Topological relationship encoding: By using a specific range or positive / negative attribute of function values, it distinguishes whether a time point is located inside the waveform region or outside the interval region, forming a morphological potential field with smooth transition characteristics.
[0034] This application constructs continuous representation labels with clear morphology and gradient characteristics, providing stable and rich supervision signals for model training, thereby obtaining continuous, complete, and clearly defined segmentation results. By designing a composite loss function, while ensuring the accuracy of the predicted values, it guides the model to learn the smooth morphology and changing trends of the target field, effectively suppressing the boundary jitter, spikes, and artifacts common in traditional discrete classification methods. In addition, the constructed machine learning model can fully mine the discriminative information contained in bioelectrical signals, significantly improving the efficiency and robustness of feature fusion, and enhancing the model's analytical ability and signal utilization efficiency.
[0035] In one implementation, the composite loss function is constructed by calculating the difference between the model's predicted output and the supervised target, for example, by using mean squared error as a standard to measure the numerical error between the two.
[0036] In this embodiment, the structural reference point is set as the midpoint of the target band; a function field with a single peak or single valley shape is constructed with the structural reference point as the vertex to form a continuous characterization label corresponding to the target band; the function field is generated based on a preset function model; the function model includes at least one of the following: piecewise sine function, Gaussian function, trigonometric wave function and spline interpolation function.
[0037] Specifically, the function model is configured to use the structural reference point (i.e., the midpoint of the band) as the function's extreme points (peaks or valleys), and the starting and ending points of the target band as the boundaries of the function field, generating a numerical sequence defined on the time axis of that band. The numerical trend of this sequence intuitively depicts the trend of distance changes between any point within the band and the structural reference point, with its extreme points representing the locations closest to the structural reference point.
[0038] In this embodiment, the target band includes a waveform region and an interval region. The waveform region corresponds to the effective physiological activity period in a biological signal (such as the muscle contraction period in an electromyographic signal), and the interval region corresponds to the physiological resting period in a biological signal (such as the muscle relaxation period in an electromyographic signal). The generation of continuous characterization labels can be based on a piecewise sine function model; the continuous characterization labels exhibit a single-peak shape in the waveform region and a single-valley shape in the interval region. Specifically, the temporal characteristics of the target band can be distinguished by the waveform region and the interval region. The design of continuous characterization labels requires constructing different shapes according to the characteristics of these two regions to reflect the actual laws of the signal.
[0039] Based on the piecewise sine function model, the continuous representation label of the waveform region The following relationship must be satisfied: ; in, It is a positive number; The time domain interval of the waveform region; Continuous characterization labels of interphase regions The following relationship must be satisfied: ; in, It is a positive number; The time domain interval of the interval region represents the time from the end of the previous waveform region. Continues to the beginning of the current waveform region .
[0040] To control the peak parameters and ensure that the label value reaches the expected amplitude at the peak of the waveform, To control the parameters at the trough, ensuring that label values remain low during quiescent periods, this parameterized design improves the flexibility and adaptability of the labels, especially when dealing with bioelectrical signals from different individuals or in different scenarios. By adjusting the parameters, continuous representation labels can better match the actual characteristics of the signal. This provides stable and rich supervisory signals for model training, improving the effectiveness of model training.
[0041] It should be noted that positive numbers and It must be a non-zero value. That is, when and When the value is zero, the continuous function field designed in this application will be mathematically equivalent to the standard discrete segmentation mask used in the prior art (i.e., the foreground is always 1 and the background is always 0).
[0042] In one implementation, The value range is from 2 to 5.
[0043] like Figure 3 As shown, when using this degenerate supervision target, which is equivalent to discrete labels, the model segmentation results expose the typical defects of discrete labels: since the supervision signal in the foreground region is a constant value and lacks gradient guidance pointing to the center of the waveform, the model cannot effectively learn the continuous structure and morphological features of the waveform, resulting in discontinuities and breaks in the segmentation results; in the background region, due to the lack of a clear gradient suppression signal, the model has difficulty distinguishing between the real waveform and noise disturbances, and is prone to misidentifying background noise as effective waveform components; the step abrupt change of the label at the boundary makes the model optimization process unstable and difficult to converge to a smooth solution, thus producing spikes and irregular jitters at the segmentation boundary.
[0044] In this embodiment, the machine learning model is an encoder-decoder architecture; wherein the encoder consists of multiple sequentially connected encoding levels, and the decoder consists of decoding levels corresponding to the number of encoding levels; the bioelectrical signals constituting the training set are input into the machine learning model to obtain the predicted output features of each decoding level of the decoder model; the composite loss function is the weighted sum of the loss functions of each decoding level; based on the composite loss function, the parameters of the encoder model and the decoder model are optimized through the backpropagation algorithm.
[0045] The encoder is responsible for feature extraction and compression of the input bioelectrical signal, while the decoder is responsible for mapping the compressed features to the predicted output. The encoder typically contains multiple sequentially connected encoding levels, each performing progressive abstraction and dimensionality reduction on the signal to extract its high-level features. The decoder contains corresponding decoding levels that transform the compressed features into predicted output features through progressive upsampling and feature reconstruction. Ultimately, the predicted feature values output by the model can form a continuous distribution over the time domain, corresponding to continuous representation labels.
[0046] In one implementation, the model's predicted output features are further refined into multiple decoding levels. The decoder can generate predicted output features at different decoding levels, each corresponding to a different level of abstraction of the bioelectrical signal. Analyzing these predicted output features provides a deeper understanding of the model's learning process and offers more information for subsequent loss calculations and model optimization, effectively improving the model's expressive power and prediction accuracy.
[0047] In one implementation, the decoder generates predicted output features at different decoding levels, calculates a loss value for each predicted output feature, and then sums the loss values from each decoding level with weights to form the final composite loss function. This approach ensures that the model's prediction results at different levels of abstraction are fully optimized, thereby improving overall performance. The specific method of weighting the summation can be designed according to the importance of the decoding level; for example, higher weights can be assigned to the losses of higher-level features to emphasize the model's understanding of the overall signal patterns.
[0048] In one implementation, the weighting coefficients of each decoding level in the composite loss function are dynamically adjusted based on the loss changes during training. In the early stages of training, higher weights are assigned to the losses of lower-level decoding levels to help the model quickly learn the basic features of the signal. In the later stages of training, the weights of higher-level decoding levels are gradually increased to optimize the model's ability to predict signal details. This dynamic adjustment method effectively improves training efficiency, enabling the model to converge to a better parameter state more quickly.
[0049] It should be noted that the backpropagation algorithm updates the parameter values of the encoder and decoder layer by layer by calculating the gradient of the composite loss function with respect to the model parameters, thereby gradually bringing the predicted output features of the model closer to the supervised target. The optimization process starts from the output layer of the decoder and gradually passes error information to the input layer of the encoder, ensuring that the parameters of each layer are effectively adjusted.
[0050] In one implementation, since the composite loss function includes the loss values of each decoding level, the gradient information of each level needs to be calculated separately during backpropagation. These gradients are then combined using weighting coefficients to form the final gradient update direction. This approach ensures that the model's predictive capabilities at different levels are fully optimized.
[0051] like Figure 4 As shown in the embodiments of this application, the machine learning model further includes an input layer for standardizing and preprocessing the bioelectrical signal to obtain a first input feature. Each encoding level includes a first transmission path, a second transmission path, and a fusion path. The first transmission path is used to perform non-parametric transformation on the first input feature to obtain a first output feature. The second transmission path is used to perform parametric transformation on the first input feature to obtain a second output feature. The fusion path is used to fuse the first input feature, the first output feature, and the second output feature to obtain a fused feature. The first input feature is processed in a variety of ways through different transmission paths, thereby extracting multiple features of the signal. The first and second transmission paths use different transformation methods to process the input feature, while the fusion path is responsible for integrating the processing results of different paths to form a more comprehensive feature representation. The first transmission path directly captures the global spatial distribution information between channels; the second transmission path ensures the normal propagation of the basic semantics of the first input feature, preventing the basic semantic propagation from being blocked due to the overly abstract nature of the fused feature, thus preventing the model from lacking basic capabilities. The fusion path is designed to integrate feature information from different sources to form a unified feature representation. Fusion features encompass multiple aspects of the signal, providing richer input information for subsequent coding or decoding levels.
[0052] In one implementation, the acquired bioelectrical signals undergo standardized preprocessing, which includes the following steps: Data consistency: Interpolation or downsampling techniques are used to unify bioelectrical signals from different sources to the same sampling rate, ensuring time alignment and consistency in data processing.
[0053] Signal preprocessing: The following processing steps are performed sequentially: Baseline drift correction: Digital filtering techniques such as a mean filter are used to eliminate low-frequency baseline drift generated during signal acquisition; Amplitude normalization: The Z-score normalization method is used to adjust the signal amplitude to a standard distribution with zero mean and unit variance, effectively suppressing the interference of individual differences and acquisition equipment differences on model training. For multi-channel bioelectrical signals, signal preprocessing is performed sequentially for each channel's bioelectrical signal.
[0054] Dataset partitioning: The complete dataset is divided into three mutually exclusive subsets according to a preset ratio: training set, used for learning and optimizing model parameters, adjusting network weights through backpropagation algorithm; validation set, used for hyperparameter tuning, model selection and training process monitoring to prevent overfitting; and test set, used for final evaluation of the model's generalization performance and segmentation accuracy, providing unbiased performance estimates.
[0055] Waveform region delimitation: The start and end boundary information of the target band is obtained through the following methods: expert annotation, constructing a standard reference based on professional annotations from clinicians; and algorithmic localization, using recognized waveform detection algorithms in the field (such as slope-based or template-matching methods) for automatic localization. The generated waveform boundary information will serve as the foundational ground values for constructing continuous representation labels, supporting the subsequent supervised learning process.
[0056] In one implementation, the first and second transfer paths employ a parallel processing architecture. By simultaneously performing non-parametric and parametric feature extraction operations, the computational efficiency of the feature enhancement stage is significantly improved. This parallel design fully utilizes the parallel processing capabilities of modern computing devices, effectively eliminating resource idleness caused by task dependencies in traditional serial architectures, thereby maximizing hardware utilization efficiency and accelerating the model training process.
[0057] In one implementation, the fusion path can be achieved through feature concatenation or weighted combination. Feature concatenation directly connects different features to form a higher-dimensional feature vector, while weighted combination assigns different weights to different features and then performs summation or averaging. The choice of fusion method can be adjusted according to task requirements; for example, when it is necessary to emphasize a certain feature, its weight can be increased.
[0058] In one implementation, the fused features extracted from each encoding level of the encoder are passed to the corresponding decoding level via skip connections. These fused features are first concatenated with the upsampled features from the decoder along the channel dimension, and then dimensionality reduction and feature fusion are achieved through convolution operations to finally output the predicted output features.
[0059] In this embodiment of the application, the machine learning model further includes an index mapping cache; an index mapping relationship between a first output feature and a first input feature is constructed, and the first output feature and the corresponding index mapping relationship are stored in the index mapping cache; during backpropagation, the first propagation path maps the gradient of the first output feature to the first input feature based on the index mapping relationship obtained from the index mapping cache, so as to complete the gradient backpropagation; wherein, the index mapping cache is updated in each model iteration.
[0060] The index mapping cache is a dedicated storage area designed for fast access to mapping data to support efficient gradient propagation. The mappings stored in the cache can be repeatedly accessed during each training iteration, reducing the overhead of repetitive computations. Updating the index mapping cache to fit the current iteration enables continuous optimization through backpropagation of the first output feature.
[0061] The index mapping records the positional changes of each feature element after the first input feature has passed through the first propagation path. This mapping provides the foundation for gradient propagation during subsequent backpropagation, ensuring that the gradient of the first output feature can be accurately propagated back to the corresponding position of the input feature. Specifically, when generating the first output feature, the system records the new position of each element of the input feature in the output feature in real time, forming a mapping table. For example, assuming the input feature is a vector containing 10 elements, after sorting, the element originally at position 3 might be moved to position 1 of the output feature; this positional change is recorded in the index mapping. Subsequently, during backpropagation, the system uses this mapping table to accurately assign the gradient parameters of the output feature to the corresponding positions of the input features.
[0062] It should be noted that traditional neural networks primarily rely on learnable parameters for training. This prevents mathematical calculations without learnable parameters from directly participating in gradient propagation, making it difficult to effectively integrate these operations within the neural network. This application simplifies the gradient backpropagation process through the non-parametric design of the first propagation path and index mapping relationships, ensuring that these efficient computational operations can participate in the backpropagation of the neural network, thereby improving the overall efficiency and training effect of the model. The fusion path generates a comprehensive feature representation by weighted combination of the first and second output features, enhancing the model's expressive power.
[0063] In one implementation, during backpropagation, the gradient of the fused feature is calculated according to the chain rule. When this gradient is propagated back along the first propagation path, it is first passed to the first output feature, and then accurately mapped to the corresponding position of the first input feature using the mapping relationship recorded in the index mapping buffer. When this gradient is propagated back along the second propagation path, since the parameterized feature extraction is a differentiable transformation, the calculated gradient can be directly propagated back to the first input feature. Finally, the gradients from both paths act together on the first input feature and continue to propagate back to the previous layer, thus ensuring the continuity and computational accuracy of the entire gradient backpropagation process.
[0064] In one implementation, the update frequency of the index mapping relationship is configurable to adapt to different training needs. Specifically, two strategies can be adopted: First, updating immediately after each backpropagation allows the index mapping relationship to match the rapidly changing feature extraction results in real time, suitable for scenarios with extremely high feature accuracy requirements; second, updating only after each iteration of the entire model reduces computational and storage overhead by decreasing the update frequency, suitable for scenarios where training efficiency is a priority. This flexibility ensures an optimal balance between efficiency and practicality in the update process.
[0065] In this embodiment, the first output feature includes at least one of the following obtained statistically from the first input feature: maximum value, minimum value, and median. Specifically, the first output feature can be generated by performing statistical analysis on the first input feature. Statistical indicators include maximum value, minimum value, and median, which can reflect the local features and distribution characteristics of the signal. This step bypasses the lengthy process of "learning" statistical features through a large number of parameters in traditional networks, and directly and accurately "calculates" the intrinsic statistical properties of the feature vector, providing the model with a description of its own state.
[0066] In one implementation, the maximum, minimum, or median value of the signal is calculated at each time point as a first output feature. These statistical metrics can effectively capture the local variation features of the signal, providing support for subsequent feature fusion.
[0067] In this embodiment of the application, the bioelectric signal to be processed is input into a trained machine learning model to obtain a multi-channel predicted response value sequence corresponding to each time point; based on the multi-channel predicted response value sequence, the final band category of each time point is determined according to a preset decision rule; wherein, the decision rule is configured as follows: for each time point, the response value of each channel at that point is obtained, and the category corresponding to the channel with the largest response value that exceeds a preset threshold is determined as the final band category of that time point.
[0068] Secondly, embodiments of this application provide a bioelectric signal processing device for implementing the aforementioned bioelectric signal processing method. The device comprises: an acquisition module for acquiring bioelectric signals; a processing module for inputting the bioelectric signals into a machine learning model to acquire predicted output features; calculating a composite loss function based on the predicted output features and a supervision target; and an optimization module for optimizing the parameters of the machine learning model based on the composite loss function using a backpropagation algorithm.
[0069] Specifically, the acquisition module is responsible for collecting raw signal data through external devices or sensors. The design of the acquisition module needs to ensure the integrity and accuracy of the signal, providing high-quality input data for subsequent processing. The processing module is the core processing unit of the device, responsible for feature extraction and prediction of the input signal, and evaluating model performance using a loss function. The optimization module is an important component of the device, responsible for adjusting model parameters based on the calculation results of the loss function, thereby improving the model's predictive ability.
[0070] In one implementation, the acquisition module acquires signals using a multi-channel electrode device. The device selects different numbers and layouts of electrodes depending on the application scenario; for example, when processing EEG signals, an electrode layout covering multiple areas of the head is used to obtain comprehensive signal information. The acquired signals are then digitally processed and converted into a format suitable for subsequent analysis.
[0071] In one implementation, the processing module first inputs the acquired bioelectrical signals into a machine learning model, generating predicted output features through the model's internal encoding and decoding processes. Then, based on the predicted output features and preset continuous representation labels, a composite loss function is calculated for subsequent model optimization. The design of the processing module needs to ensure computational efficiency and accuracy to support real-time signal processing requirements.
[0072] In one implementation, the optimization module optimizes parameters using a backpropagation algorithm. First, gradient information is calculated based on the composite loss function, and then the model parameters are updated according to this gradient information. The optimization process can incorporate various optimization strategies, such as momentum mechanisms or adaptive learning rates, to improve optimization performance.
[0073] Thirdly, embodiments of this application provide an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the bioelectric signal processing method as described above.
[0074] Fourthly, embodiments of this application provide a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the bioelectric signal processing method as described above.
[0075] Example 1: In this embodiment, the bioelectrical signals used are from publicly available electrocardiogram (ECG) databases, such as the Lobachevsky University Electrocardiography Database (LUDB) and the QT Database (QTDB). The ECG signal dataset is divided into training, validation, and test sets. The training set includes 12-lead ECG recordings of various arrhythmias and pathological conditions to ensure the model's generalization ability.
[0076] First, all ECG signals undergo standardized preprocessing, including the following steps: Data standardization: Using interpolation or downsampling techniques, all ECG signals are standardized to the same sampling rate, such as 500Hz.
[0077] Signal preprocessing: The following processing steps are performed sequentially on the ECG signal of each lead: Baseline drift correction: Digital filtering techniques such as the mean filter are applied to eliminate low-frequency baseline drift generated during signal acquisition; Amplitude normalization: The Z-score normalization method is used to adjust the signal amplitude to a standard distribution with zero mean and unit variance, suppressing the interference of individual differences and acquisition equipment differences on model training.
[0078] Waveform region delimitation: The start and end boundary information of target wavebands such as P wave, QRS complex, and T wave are obtained through the following methods: expert annotation, constructing a standard reference based on professional annotations from clinicians; and algorithm localization, using recognized waveform detection algorithms in the field (such as slope-based or template-matching methods) for automatic localization. The generated waveform boundary information will serve as the foundational ground values for constructing continuous representation labels, supporting the subsequent supervised learning process.
[0079] Secondly, a continuous function field is constructed based on a piecewise sine function, exhibiting a single peak in the waveform region and a single valley in the interval region. (Continuous representation label for the waveform region) The following relationship must be satisfied: This function is in the interval The above forms a baseline of 1 and a peak value of 1+. A smooth single peak.
[0080] Continuous characterization labels of interphase regions The following relationship must be satisfied: This function forms a smooth single valley during the interval.
[0081] in, =1, =3.
[0082] Next, a machine learning model based on an encoder-decoder architecture is constructed. This model also includes an input layer for standardizing and preprocessing the training set ECG signals and outputting a first input feature. The dimensions of this first input feature can be represented by batch size, number of channels, and sequence length. The "number of channels" dimension corresponds to the lead dimension of the ECG signal, with each channel representing a feature of one lead. The encoder contains multiple sequentially connected encoding levels, and the decoder contains decoding levels corresponding to the number of encoding levels. Each encoding level has a first transmission path, a second transmission path, and a fusion path. The second transmission path includes a convolutional module (e.g., a residual block).
[0083] The training set of ECG signals is input into the model. The first propagation path calculates the maximum, minimum, and median values of all leads at the same time point; these statistics together constitute the first output feature, which captures the global spatial distribution information among leads. The convolutional module of the second propagation path performs independent deep feature extraction on the features of each lead, aiming to capture the conventional morphological features within each lead; it outputs a second output feature with the same dimension as the first input feature. The first input feature, first output feature, and second output feature are concatenated along the channel dimension, and then dimensionality reduction and information integration are performed through a 1x1 convolutional layer. Finally, a fused feature is generated. The fused features extracted from each encoding level are passed to the corresponding decoding level through skip connections; these fused features are first concatenated with the features upsampled by the decoder along the channel dimension, and then dimensionality reduction and feature fusion are achieved through convolution operations, finally outputting the predicted output feature.
[0084] Obtain the predicted output features corresponding to each decoding level; calculate the corresponding loss value for each predicted output feature of the decoding level, and sum the loss values of all decoding levels in a weighted manner to construct a composite loss function.
[0085] Optimize the parameters of the encoder and decoder to obtain a well-trained machine learning model.
[0086] The test set of ECG signals is input into a trained machine learning model to obtain multi-channel predicted response numerical sequences at each time point; the category corresponding to the channel with the largest response value that exceeds a preset threshold is determined as the final band category at that time point.
[0087] To objectively evaluate the effectiveness of the proposed method, comparative and ablation experiments were designed, and the following two evaluation indicators were used for quantitative analysis: Average Dice coefficient: used to measure the degree of overlap between the model segmentation results and the real labels in the bands, reflecting the integrity of the overall segmentation; Average boundary F1 score: Used to evaluate the accuracy of the segmentation boundary. This metric is highly sensitive to errors in the boundary position and can effectively capture the accuracy of boundary positioning.
[0088] As shown in Table 1, the comparative experiments in this application were compared with two representative baseline models based on discrete classification paradigms. "Baseline: U-Net + classification loss" represents the standard deep learning method, and "SOTA: SwinUNet + classification loss" represents the current state-of-the-art method using the advanced Swin Transformer architecture.
[0089] Experimental results demonstrate that this application, through fundamental innovation in the supervised learning paradigm, achieves significant improvements in both key evaluation metrics, exhibiting a performance advantage that is clearly superior to existing technologies. It is worth emphasizing that even when the comparison model employs a more robust network architecture, this application still demonstrates outstanding performance, particularly in the clinically valuable boundary F1 score, fully validating the significant advantages of this method in generating accurate and reliable waveform boundaries.
[0090] Table 1 Comparison of experimental results
[0091] As shown in Table 2, ablation experiments were conducted on the same network architecture to independently verify the respective contributions of the two core innovations of this application (function field coding and the first transmission path).
[0092] The results show that: When the function field encoding is removed and the traditional hard-label classification loss is used, the model performance deteriorates significantly, with the average boundary F1 score dropping by 5.0 percentage points. This result fully demonstrates that the function field encoding proposed in this application is key to solving the boundary instability problem.
[0093] When the first transmission path is removed, the model performance also shows a significant drop in fine-grained boundary definition. This indicates that the fusion module can effectively mine the spatial correlation between multiple leads, thereby improving segmentation accuracy and boundary integrity.
[0094] Quantitative analysis through ablation experiments confirmed that the two core technologies of this application both have independent and significant performance contributions, and their synergistic effect jointly promotes the overall improvement of model performance.
[0095] Table 2 Ablation Experiment Results
[0096] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A bioelectric signal processing method, characterized in that, include: Acquire bioelectric signals and divide them into bands to extract target bands; Determine the structural reference points and distance learning parameters within the target band; The distance learning parameter is the distance parameter between any point in the target band and the structural reference point; Based on the structural reference point and the distance learning parameters, a continuous representation label corresponding to the target band is generated to describe the distance change trend between any point in the target band and the structural reference point. The target band and the corresponding distance learning parameters are used as the supervision targets for training the machine learning model; The bioelectric signal is input into the machine learning model to obtain the predicted output features; Based on the predicted output features and the supervision target, calculate the composite loss function; Based on the composite loss function, the parameters of the machine learning model are optimized using the backpropagation algorithm.
2. The bioelectric signal processing method as described in claim 1, characterized in that, The structural reference point is set as the midpoint of the target band; with the structural reference point as the vertex, a function field in the form of a single peak or a single valley is constructed to form a continuous characterization label corresponding to the target band. The function field is generated based on a preset function model; The function model includes at least one of the following: piecewise sine function, Gaussian function, trigonometric wave function, and spline interpolation function.
3. The bioelectric signal processing method as described in claim 2, characterized in that, The function model is a piecewise sine function; The target band includes a waveform region and an interval region; The continuous characterization label exhibits a single-peak shape within the waveform region and a single-valley shape within the interval region. Continuous characterization label for the waveform region satisfies the following relation: ; wherein is a normal number; is a time domain interval of the waveform region; Continuous characterization label for the interval region satisfies the following relation: ; wherein is a normal number; is a time domain interval of the interval region, indicating a time interval from an end time point of a previous waveform region to a start time point of a current waveform region .
4. The bioelectric signal processing method as described in claim 1, characterized in that, The machine learning model is an encoder-decoder architecture; wherein the encoder consists of multiple sequentially connected encoding levels, and the decoder consists of decoding levels corresponding to the number of encoding levels; The bioelectric signal is input into the machine learning model to obtain the predicted output features of each decoding level of the decoder; The composite loss function is a weighted sum of the loss functions of each of the decoding layers; Based on the composite loss function, the parameters of the encoder and decoder are optimized using the backpropagation algorithm.
5. The bioelectric signal processing method as described in claim 4, characterized in that, The machine learning model also includes an input layer for standardizing and preprocessing the bioelectric signal to obtain a first input feature; Each of the aforementioned coding levels includes a first transmission path, a second transmission path, and a fusion path; The first transmission path is used to perform a non-parametric transformation on the first input feature to obtain the first output feature; The second transmission path is used to perform parameterized transformation on the first input feature to obtain the second output feature; The fusion path is used to fuse the first input feature, the first output feature, and the second output feature to obtain a fused feature.
6. The bioelectric signal processing method as described in claim 5, characterized in that, The machine learning model also includes an index mapping cache; Construct an index mapping relationship between the first output feature and the first input feature, and store the first output feature and the corresponding index mapping relationship in the index mapping cache area; During backpropagation, the first transmission path maps the gradient of the first output feature to the first input feature based on the index mapping relationship obtained from the index mapping buffer, so as to complete the gradient backpropagation. The index mapping cache is updated during each model iteration.
7. The bioelectric signal processing method as described in claim 5, characterized in that, The first output feature includes at least one of the following obtained statistically from the first input feature: maximum value, minimum value, and median.
8. The bioelectric signal processing method as described in claim 1, characterized in that, The bioelectric signal to be processed is input into the trained machine learning model to obtain a multi-channel predicted response numerical sequence corresponding to each time point; Based on the multi-channel predicted response numerical sequence, the final band category at each time point is determined according to the preset decision rules; The decision rule is configured as follows: obtain the response values of each channel at the same time point, and determine the category corresponding to the channel with the largest response value that exceeds a preset threshold as the final band category at that time point.
9. A bioelectric signal processing apparatus for implementing the bioelectric signal processing method according to any one of claims 1 to 8, characterized by, The device includes: The acquisition module is used to acquire bioelectrical signals; The processing module is used to input the bioelectric signal into the machine learning model to obtain the predicted output features; and to calculate the composite loss function based on the predicted output features and the supervision target. An optimization module is used to optimize the parameters of the machine learning model based on the composite loss function using a backpropagation algorithm.
10. An electronic device, comprising: include: Memory, used to store computer programs; A processor for executing the computer program to implement the bioelectric signal processing method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, Used to store a computer program; wherein, when the computer program is executed by a processor, it implements the bioelectric signal processing method as described in any one of claims 1 to 8.