Heart sound signal detection method and device, equipment and storage medium
By using two heart sound signal detection models based on positive and negative samples and positive samples, the output similarity information is compared to improve the accuracy of heart sound signal detection, the problem of insufficient abnormal signal detection in the prior art is solved, and higher detection is achieved Accuracy and process simplification.
Patent Information
- Application Number
- CN202411302856.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-11-22
AI Technical Summary
The prior art is difficult to effectively detect abnormal heart sound signals, resulting in insufficient accuracy in heart sound signal detection.
Two heart sound signal detection models are used. The first model is trained based on positive and negative samples, and the second model is trained based on positive samples. By comparing the similarity information output from the two, the normal or abnormal heart sound signal is determined.
Improve the accuracy of heart sound signal detection, especially in abnormal signal detection, simplifies the detection process and reduces the cost of negative sample collection.
Smart Images

Figure CN119007745A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a heart sound signal detection method, device, equipment and storage medium. Background Art
[0002] In the field of artificial intelligence, heart sound signals can be analyzed through machine learning models to distinguish normal heart sound signals from abnormal heart sound signals to identify the health status of the heart. However, the reality is that most of the acquired heart sound signals are normal heart sound signals, and there are few abnormal heart sound signals, and the abnormal heart sound signals are also different. The machine learning model trained based on limited heart sound signal training samples can detect normal heart sound signals more accurately, but it is difficult to effectively detect abnormal heart sound signals.
[0003] Therefore, how to improve the accuracy of heart sound signal detection has become an urgent problem to be solved. Summary of the invention
[0004] The present application provides a heart sound signal detection method, device, equipment and storage medium, aiming to improve the accuracy of heart sound signal detection.
[0005] To achieve the above object, the present application provides a heart sound signal detection method, the heart sound signal detection method comprising:
[0006] Acquiring a heart sound signal to be detected;
[0007] Input the heart sound signal into a trained first heart sound signal detection model and a trained second heart sound signal detection model to obtain first output data of the first heart sound signal detection model and second output data of the second heart sound signal detection model; wherein the first heart sound signal detection model is trained based on positive and negative samples, and the second heart sound signal detection model is trained based on positive samples;
[0008] Determining output similarity information between the first heart sound signal detection model and the second heart sound signal detection model according to the first output data and the second output data;
[0009] A detection result of the heart sound signal is obtained according to the output similarity information, where the detection result includes normal / abnormal.
[0010] In addition, to achieve the above-mentioned purpose, the present application also provides a heart sound signal detection device, the heart sound signal detection device comprising:
[0011] An acquisition module, used for acquiring the heart sound signal to be detected;
[0012] a processing module, configured to input the heart sound signal into a trained first heart sound signal detection model and a trained second heart sound signal detection model, and obtain first output data of the first heart sound signal detection model and second output data of the second heart sound signal detection model; wherein the first heart sound signal detection model is trained based on positive and negative samples, and the second heart sound signal detection model is trained based on positive samples;
[0013] an analysis module, configured to determine output similarity information between the first heart sound signal detection model and the second heart sound signal detection model according to the first output data and the second output data;
[0014] The recognition module is used to obtain the detection result of the heart sound signal according to the output similarity information, and the detection result includes normal / abnormal.
[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a computer device, the computer device comprising a memory and a processor;
[0016] The memory is used to store computer programs;
[0017] The processor is used to execute the computer program and implement the above-mentioned heart sound signal detection method when executing the computer program.
[0018] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned heart sound signal detection method are implemented.
[0019] The present application discloses a heart sound signal detection method, apparatus, device and storage medium. The method obtains a heart sound signal to be detected, inputs the heart sound signal into a trained first heart sound signal detection model and a trained second heart sound signal detection model, obtains first output data of the first heart sound signal detection model, and second output data of the second heart sound signal detection model, wherein the first heart sound signal detection model is trained based on positive and negative samples, and the second heart sound signal detection model is trained based on positive samples, and then determines output similarity information of the first heart sound signal detection model and the second heart sound signal detection model based on the first output data and the second output data, determines whether the heart sound signal is normal or abnormal based on the output similarity information, and improves the accuracy of heart sound signal detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 is a schematic flow chart of the steps of a heart sound signal detection method provided in an embodiment of the present application;
[0022] Figure 2 is a schematic block diagram of the structure of a first heart sound signal detection model provided in an embodiment of the present application;
[0023] Figure 3 is a schematic block diagram of the structure of a second heart sound signal detection model provided in an embodiment of the present application;
[0024] Figure 4 It is a schematic diagram of a model training process of a first heart sound signal detection model and a second heart sound signal detection model provided in an embodiment of the present application;
[0025] Figure 5 is a schematic flowchart of a step of determining output similarity information between the first heart sound signal detection model and the second heart sound signal detection model according to the first output data and the second output data provided by an embodiment of the present application;
[0026] Figure 6 is a schematic block diagram of a heart sound signal detection device provided in an embodiment of the present application;
[0027] Figure 7 It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0030] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0031] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0032] Heart sound recognition is a method of analyzing heart activity using sound signal processing technology. It usually involves using a stethoscope or other sound capture device (such as a recording device) to record the sounds made by the heart, and then analyzing these sounds through a specific algorithm (such as a machine learning algorithm) to identify the health of the heart. Heart sound recognition can be used to diagnose a variety of heart diseases, such as arrhythmias, heart valve diseases, etc.
[0033] The process of traditional heart sound recognition usually includes steps such as sound collection, signal preprocessing, heart sound segmentation, feature extraction, pattern recognition, classification diagnosis, and post-processing. First, use a stethoscope or recording device to record the heart sound signal on the user's chest; then, preprocess the heart sound signal by filtering and other methods to improve the analysis quality. Then, the heart sound signal is segmented into a single heartbeat cycle, and key features such as frequency and amplitude are extracted. After that, a machine learning algorithm is applied to identify and classify the heart sound signal to distinguish between normal heart sound signals and abnormal heart sound signals. Finally, a diagnostic suggestion is provided based on the recognition results, and further evaluation and confirmation by the doctor may be required. The whole process is automated and aims to improve the accuracy and efficiency of heart disease diagnosis. However, the reality is that most of the acquired heart sound signals are normal heart sound signals, and there are few abnormal heart sound signals, and the abnormal heart sound signals are also different. The machine learning model trained based on limited heart sound signal training samples can accurately detect normal heart sound signals, but it is difficult to effectively detect abnormal heart sound signals.
[0034] In order to solve the above problems, the embodiments of the present application provide a heart sound signal detection method, apparatus, device and storage medium for improving the accuracy of heart sound signal detection.
[0035] See also Figure 1 , Figure 1 1 is a flow chart of a heart sound signal detection method provided in an embodiment of the present application. The method can be applied to a computer device, and the application scenario of the method is not limited in the present application.
[0036] like Figure 1As shown, the heart sound signal detection method specifically includes steps S101 to S104.
[0037] S101. Acquire a heart sound signal to be detected.
[0038] The heart sound signal to be detected may be a heart sound signal collected in real time, or may be a stored historical heart sound signal.
[0039] For example, a stethoscope or other sound capturing device, such as a recording device, may be used to collect heart sounds, thereby obtaining the heart sound signal to be detected.
[0040] In some embodiments, in order to obtain more accurate detection results, the heart sound signal is preprocessed to obtain a processed heart sound signal, wherein the preprocessing includes but is not limited to denoising processing, signal amplitude normalization processing, etc.
[0041] Exemplarily, a bandpass filter is first used to remove high-frequency noise and low-frequency noise outside the heart sound signal, and then the filtered heart sound signal is resampled based on a standard sampling rate (such as 16kHZ), and the amplitude of the resampled heart sound signal is normalized to a numerical range of 0 to 1. After that, the continuous heart sound signal is segmented into independent signal segments of equal length. Optionally, in order to make the transition between signal segments smoother during the segmentation process, a certain time length of signal segment overlap is set, that is, there is a partial overlap between two adjacent signal segments, and the signal segment obtained after processing is used as the heart sound signal to be detected.
[0042] S102. Input the heart sound signal into a trained first heart sound signal detection model and a trained second heart sound signal detection model to obtain first output data of the first heart sound signal detection model and second output data of the second heart sound signal detection model; wherein the first heart sound signal detection model is trained based on positive and negative samples, and the second heart sound signal detection model is trained based on positive samples.
[0043] Exemplarily, the first heart sound signal detection model is a binary classification model, such as a binary classification model based on a convolutional neural network and a transformer. Figure 2As shown, the first heart sound signal detection model is composed of a feature encoder based on a convolutional neural network, a transformer layer, a feature compressor, and a fully connected layer. Among them, the feature encoder includes multiple (for example, seven) time series convolution modules, each of which is composed of a one-dimensional convolution layer, a normalization layer, and a GELU (Gaussian Error Linear Units, activation function) layer. For example, the step sizes of the one-dimensional convolution layers corresponding to the seven time series convolution modules are 5, 2, 2, 2, 2, 2, 2, respectively, and the corresponding convolution kernels are 10, 3, 3, 3, 3, 2, 2, and the number of hidden channels is 64, 128, 128, 128, 256, 256, 256, respectively. In practice, after passing through the above modules of the feature encoder, the data at the sampling point level can be converted to the frame level, and each frame represents 25ms of data, that is, a matrix of size (N, number of frames, 256), where N represents the batch size. The extracted frame-level features are then processed through multiple layers (e.g. 8 layers) of transformer layers, where each transformer layer consists of a multi-head (e.g. 8-head) self-attention layer, a fully connected layer, and a normalization layer. After the transformer layer, the output feature dimension is a matrix of size (N, number of frames, 256). For the frame-level feature compressor, a pooling layer based on the attention mechanism is used to compress the frame-level features. For example, the features of each time frame are first compressed into one dimension through two layers of full connection, and then passed through a softmax layer to obtain its weighted coefficient, and then the features of different time frames are weighted averaged to obtain the frame-level features for final classification. Finally, the final classification result is output through a fully connected layer.
[0044] It should be noted that the above parameters can be adjusted according to actual needs.
[0045] The second heart sound signal detection model is similar to the first heart sound signal detection model, except that the second heart sound signal detection model and the first heart sound signal detection model contain different numbers of transformer layers, for example, the number of transformer layers of the second heart sound signal detection model is 4. In addition, the second heart sound signal detection model does not contain the fully connected layer used to output the final classification result.
[0046] For example, Figure 3As shown, the second heart sound signal detection model is composed of a feature encoder based on a convolutional neural network, a transformer layer, and a feature compressor. Among them, the feature encoder includes multiple (for example, seven) time series convolution modules, each of which is composed of a one-dimensional convolution layer, a normalization layer, and a GELU (Gaussian Error Linear Units, activation function) layer. After passing through the above modules of the feature encoder, the data at the sampling point level can be converted to the frame level, and each frame represents 25ms of data, that is, a matrix of size (N, number of frames, 256), where N represents the batch size. Then, the extracted frame-level features are processed through multiple layers (for example, 4 layers) of transformer layers. After passing through the transformer layer, the output feature dimension is a matrix of size (N, number of frames, 256). For the frame-level feature compressor, a pooling layer based on the attention mechanism is used to compress the frame-level features and output the heart sound features.
[0047] Before calling the first heart sound signal detection model and the second heart sound signal detection model, the first heart sound signal detection model and the second heart sound signal detection model are firstly trained to obtain the trained first heart sound signal detection model and the trained second heart sound signal detection model.
[0048] In some embodiments, Figure 4 As shown, step S105 to step S107 may be included before step S102.
[0049] S105, collecting normal heart sound signals and abnormal heart sound signals;
[0050] S106, preprocessing the normal heart sound signal to generate a positive sample, and preprocessing the abnormal heart sound signal to generate a negative sample;
[0051] S107. Performing model training on the first heart sound signal detection model according to the positive samples and the negative samples to obtain the trained first heart sound signal detection model; and performing model training on the second heart sound signal detection model according to the positive samples to obtain the trained second heart sound signal detection model.
[0052] The collected heart sound signals, including normal heart sound signals and abnormal heart sound signals, are preprocessed. Exemplarily, a bandpass filter is first used to remove high-frequency noise and low-frequency noise outside the heart sound signal. Taking into account that heart sound signals from different sources have different sampling rates, the heart sound signals with different sampling rates are first resampled to a standard sampling rate (such as 16kHZ). The amplitude of the resampled heart sound signal is then normalized to a numerical range of 0 to 1. Afterwards, the continuous heart sound signal is divided into independent signal segments of equal length. Optionally, in order to make the transition between signal segments smoother during the segmentation process, a certain length of signal segment overlap is set, that is, there is a partial overlap between two adjacent signal segments.
[0053] For the preprocessed normal heart sound signal, a first label is marked to generate a positive sample, wherein the first label represents a normal heart sound signal. For the preprocessed abnormal heart sound signal, a second label is marked to generate a negative sample, wherein the second label represents an abnormal heart sound signal.
[0054] After obtaining positive samples and negative samples, the first heart sound signal detection model is trained using the positive samples and negative samples to train a classification model for classifying normal heart sound signals and abnormal heart sound signals until the first heart sound signal detection model converges to obtain a trained first heart sound signal detection model.
[0055] Exemplarily, for the first heart sound signal detection model, weighted cross entropy is used for training, and the loss function of the first heart sound signal detection model is defined as follows:
[0056]
[0057] Among them, L cls represents the loss function value of the first heart sound signal detection model; w represents the weighted weight, which is set according to the category of positive and negative samples; y i is the input of the first heart sound signal detection model; p i is the output of the first heart sound signal detection model.
[0058] After the first heart sound signal detection model is trained, the parameters of the first heart sound signal detection model are frozen, and the first heart sound signal detection model is used as a teacher model for training the second heart sound signal detection model.
[0059] For the second heart sound signal detection model, positive samples are used to train the second heart sound signal detection model, and a model that is only used to extract heart sound features is trained as a student model until the second heart sound signal detection model converges to obtain a trained second heart sound signal detection model.
[0060] The training of the second heart sound signal detection model is quite different from that of the first heart sound signal detection model. First of all, the goal of the second heart sound signal detection model is to model the normal heart sound signal, that is, to learn the compression features of the normal heart sound signal. Therefore, the training goal of the second heart sound signal detection model is to minimize the difference in the prediction features of the normal heart sound signal between the first heart sound signal detection model and the second heart sound signal detection model. Furthermore, the correlation between the outputs of some layers (such as 2, 4, 6, and 8 layers) in the transformer layer of the first heart sound signal detection model and the transformer layer of the second heart sound signal detection model, as well as the correlation measure between the outputs of the feature compressor are used as loss functions. Exemplarily, the consistency correlation coefficient is selected to measure the similarity, and the loss function of the second heart sound signal detection model is defined as follows:
[0061]
[0062] Among them, L sim represents the loss function value of the second heart sound signal detection model, μ1 represents the mean value of the output data of the first heart sound signal detection model, μ2 represents the mean value of the output data of the second heart sound signal detection model, σ1 represents the standard deviation of the output data of the first heart sound signal detection model, σ2 represents the standard deviation of the output data of the second heart sound signal detection model, σ 12 Represents the covariance corresponding to the output data of the first heart sound signal detection model and the output data of the second heart sound signal detection model.
[0063] The output data of the first heart sound signal detection model includes but is not limited to the output features of some layers (such as 2, 4, 6, and 8) in the transformer layer of the first heart sound signal detection model and the output features of the feature compressor of the first heart sound signal detection model. The output data of the second heart sound signal detection model includes but is not limited to the output features of the transformer layer of the second heart sound signal detection model and the output features of the feature compressor of the second heart sound signal detection model.
[0064] For the sake of ease of description, the output data of the first heart sound signal detection model will be referred to as the first data, the mean corresponding to the first data will be referred to as the first mean, the standard deviation corresponding to the first data will be referred to as the first standard deviation, the output data of the second heart sound signal detection model will be referred to as the second data, the mean corresponding to the second data will be referred to as the second mean, and the standard deviation corresponding to the second data will be referred to as the second standard deviation.
[0065] Exemplarily, for the output features of each layer, the corresponding multiple loss function values can be calculated according to the loss function of the second heart sound signal detection model, and the average of the multiple loss function values can be determined as the final loss function value of the second heart sound signal detection model.
[0066] For example, a first loss function value is calculated based on the output features of layers 2, 4, 6, and 8 in the transformer layer of the first heart sound signal detection model and the output features of the transformer layer of the second heart sound signal detection model. A second loss function value is calculated based on the output features of the feature compressor of the first heart sound signal detection model and the output features of the feature compressor of the second heart sound signal detection model. The average of the first loss function value and the second loss function value is calculated, and the average is determined as the final loss function value of the second heart sound signal detection model.
[0067] Based on the trained first heart sound signal detection model and the second heart sound signal detection model, the heart sound signal to be detected obtained in step S101 is input into the trained first heart sound signal detection model and the trained second heart sound signal detection model, and the input heart sound signal is subjected to feature extraction by the first heart sound signal detection model and the second heart sound signal detection model respectively, where the features include output features of intermediate layers such as the transformer layer, to obtain first output data of the first heart sound signal detection model and second output data of the second heart sound signal detection model.
[0068] S103: Determine output similarity information between the first heart sound signal detection model and the second heart sound signal detection model according to the first output data and the second output data.
[0069] Exemplarily, the output similarity information of the first heart sound signal detection model and the second heart sound signal detection model includes similar parameter values.
[0070] It is understandable that for normal heart sound signals, there is a high degree of similarity between the features extracted by the first heart sound signal detection model and the features extracted by the second heart sound signal detection model. However, for abnormal heart sound signals, because the second heart sound signal detection model has not been trained with abnormal heart sound signals, there is a large difference between the features of the abnormal heart sound signals extracted by the second heart sound signal detection model and the features of the abnormal heart sound signals extracted by the first heart sound signal detection model.
[0071] In some embodiments, Figure 5 As shown, step S103 may include sub-step S1031 and sub-step S1032.
[0072] S1031. Determine a loss function value of the second heart sound signal detection model according to the first output data and the second output data;
[0073] S1032. Determine the similarity parameter value according to the loss function value.
[0074] Exemplarily, at least one corresponding loss function value is determined based on the output features of the intermediate layers such as the transformer layer of the first heart sound signal detection model and the second heart sound signal detection model. If the loss function value includes one, the single loss function value is determined as the final loss function value of the second heart sound signal detection model. If the loss function value includes multiple loss function values, the average of the multiple loss function values is determined as the final loss function value of the second heart sound signal detection model.
[0075] In some embodiments, determining the loss function value of the second heart sound signal detection model based on the first output data and the second output data includes: calculating a first mean and a first standard deviation corresponding to the first output data, a second mean and a second standard deviation corresponding to the second output data, and a covariance corresponding to the first output data and the second output data; determining the loss function value based on the first mean, the second mean, the first standard deviation, the second standard deviation and the covariance.
[0076] Exemplarily, according to the output features of the intermediate layers such as the transformer layer of the first heart sound signal detection model, the first mean and the first standard deviation corresponding to the output features are calculated. According to the output features of the intermediate layers such as the transformer layer of the second heart sound signal detection model, the second mean and the second standard deviation corresponding to the output features are calculated. And according to the output features of the intermediate layers such as the transformer layer of the first heart sound signal detection model and the second heart sound signal detection model, the corresponding covariance between the output features of the two models is calculated.
[0077] Afterwards, based on the calculated first mean, second mean, first standard deviation, second standard deviation and covariance, a loss function value of the second heart sound signal detection model is determined.
[0078] In some embodiments, determining the loss function value according to the first mean, the second mean, the first standard deviation, the second standard deviation and the covariance includes: according to the formula Calculate the loss function value; where L sim represents the loss function value, μ1 represents the first mean, μ2 represents the second mean, σ1 represents the first standard deviation, σ2 represents the second standard deviation, σ 12 Denotes the covariance.
[0079] For details, please refer to the aforementioned introduction to the model training of the second heart sound signal detection model, which will not be repeated here.
[0080] After the loss function value of the second heart sound signal detection model is calculated, similarity parameter values corresponding to the outputs of the first heart sound signal detection model and the second heart sound signal detection model are determined according to the loss function value.
[0081] In some embodiments, determining the similarity parameter value according to the loss function value includes: according to the formula S=1-L sim , calculate the similarity parameter value; where S represents the similarity parameter value, L sim Represents the loss function value.
[0082] That is, based on the heart sound signal to be detected, the loss function value L of the second heart sound signal detection model is obtained. sim After that, calculate 1-L sim , and determine the calculated difference as the similarity parameter value corresponding to the output of the first heart sound signal detection model and the second heart sound signal detection model.
[0083] S104. Obtain a detection result of the heart sound signal according to the output similarity information, where the detection result includes normal / abnormal.
[0084] It can be understood that, since the second heart sound signal detection model is trained with normal heart sound signals, the larger the similarity parameter value, the more likely the heart sound signal to be detected is a normal heart sound signal, and the smaller the similarity parameter value, the more likely the heart sound signal to be detected is an abnormal heart sound signal. Therefore, it can be determined whether the heart sound signal to be detected is a normal heart sound signal or an abnormal heart sound signal based on the obtained similarity parameter value.
[0085] In some embodiments, the detection result of the heart sound signal is obtained based on the output similarity information, including: if the similarity parameter value is greater than or equal to a preset threshold, determining that the heart sound signal is normal; if the similarity parameter value is less than the preset threshold, determining that the heart sound signal is abnormal.
[0086] It should be noted that the preset threshold can be flexibly set based on the output results of the samples during model training according to actual needs, and is not specifically limited in this application.
[0087] If the obtained similarity parameter value is greater than or equal to the preset threshold, it is determined that the heart sound signal to be detected is normal; otherwise, if the obtained similarity parameter value is less than the preset threshold, it is determined that the heart sound signal to be detected is abnormal.
[0088] From the above introduction, we can see that compared with traditional methods, this method not only improves the problem of high cost of collecting negative samples in the process of heart sound signal detection, but also can achieve more generalized anomaly detection of heart sound signals with only limited negative samples. In addition, the end-to-end detection method greatly simplifies the detection process, which reduces the errors that may be introduced in the process and is more convenient for industrial deployment.
[0089] In the above embodiment, by acquiring the heart sound signal to be detected, the heart sound signal is input into a trained first heart sound signal detection model and a trained second heart sound signal detection model, and the first output data of the first heart sound signal detection model and the second output data of the second heart sound signal detection model are obtained, wherein the first heart sound signal detection model is trained based on positive and negative samples, and the second heart sound signal detection model is trained based on positive samples, and then the output similarity information of the first heart sound signal detection model and the second heart sound signal detection model is determined based on the first output data and the second output data, and the heart sound signal is determined to be normal or abnormal based on the output similarity information, thereby improving the accuracy of heart sound signal detection.
[0090] See also Figure 6 , Figure 6 It is a schematic block diagram of a heart sound signal detection device provided in an embodiment of the present application. The heart sound signal detection device can be configured in a computer device to execute the aforementioned heart sound signal detection method.
[0091] like Figure 6 As shown, the heart sound signal detection device 1000 includes: an acquisition module 1001 , a processing execution module 1002 , an analysis module 1003 , and a recognition module 1004 .
[0092] An acquisition module 1001 is used to acquire a heart sound signal to be detected;
[0093] The processing module 1002 is used to input the heart sound signal into a trained first heart sound signal detection model and a trained second heart sound signal detection model to obtain first output data of the first heart sound signal detection model and second output data of the second heart sound signal detection model; wherein the first heart sound signal detection model is trained based on positive and negative samples, and the second heart sound signal detection model is trained based on positive samples;
[0094] An analysis module 1003, configured to determine output similarity information between the first heart sound signal detection model and the second heart sound signal detection model according to the first output data and the second output data;
[0095] The identification module 1004 is used to obtain the detection result of the heart sound signal according to the output similarity information, and the detection result includes normal / abnormal.
[0096] In one embodiment, the output similarity information includes similarity parameter values, and the analysis module 1003 is further used to:
[0097] determining a loss function value of the second heart sound signal detection model according to the first output data and the second output data;
[0098] The similarity parameter value is determined according to the loss function value.
[0099] In one embodiment, the analysis module 1003 is further used for:
[0100] Calculate a first mean and a first standard deviation corresponding to the first output data, a second mean and a second standard deviation corresponding to the second output data, and a covariance corresponding to the first output data and the second output data;
[0101] The loss function value is determined according to the first mean, the second mean, the first standard deviation, the second standard deviation and the covariance.
[0102] In one embodiment, the analysis module 1003 is further used for:
[0103] According to the formula Calculating the loss function value;
[0104] Among them, L sim represents the loss function value, μ1 represents the first mean, μ2 represents the second mean, σ1 represents the first standard deviation, σ2 represents the second standard deviation, σ 12 Denotes the covariance.
[0105] In one embodiment, the analysis module 1003 is further used for:
[0106] According to the formula S = 1-L sim , calculate the similarity parameter value;
[0107] Wherein, S represents the similarity parameter value, L sim Represents the loss function value.
[0108] In one embodiment, the heart sound signal detection device 1000 further includes a training module for:
[0109] Collect normal heart sound signals and abnormal heart sound signals;
[0110] Preprocessing the normal heart sound signal to generate a positive sample, and preprocessing the abnormal heart sound signal to generate a negative sample;
[0111] The first heart sound signal detection model is trained according to the positive samples and the negative samples to obtain the trained first heart sound signal detection model; and the second heart sound signal detection model is trained according to the positive samples to obtain the trained second heart sound signal detection model.
[0112] In one embodiment, the identification module 1004 is further configured to:
[0113] If the similarity parameter value is greater than or equal to a preset threshold, it is determined that the heart sound signal is normal;
[0114] If the similarity parameter value is less than the preset threshold, it is determined that the heart sound signal is abnormal.
[0115] Among them, each module in the above-mentioned heart sound signal detection device 1000 corresponds to each step in the above-mentioned heart sound signal detection method embodiment, and its function and implementation process will not be repeated here one by one.
[0116] The heart sound signal detection device 1000 can execute the heart sound signal detection method provided in the embodiment of the present application, and therefore can achieve the beneficial effects that can be achieved by the heart sound signal detection method provided in the embodiment of the present application. Please refer to the previous embodiments for details and will not be repeated here.
[0117] The method and apparatus of the present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0118] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in the form of a computer program. Figure 7 Runs on the computer device shown.
[0119] See also Figure 7 , Figure 7 It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application.
[0120] See also Figure 7 The computer device includes a processor and a memory connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0121] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0122] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any one of the heart sound signal detection methods.
[0123] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0124] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0125] Acquiring a heart sound signal to be detected;
[0126] Input the heart sound signal into a trained first heart sound signal detection model and a trained second heart sound signal detection model to obtain first output data of the first heart sound signal detection model and second output data of the second heart sound signal detection model; wherein the first heart sound signal detection model is trained based on positive and negative samples, and the second heart sound signal detection model is trained based on positive samples;
[0127] Determining output similarity information between the first heart sound signal detection model and the second heart sound signal detection model according to the first output data and the second output data;
[0128] A detection result of the heart sound signal is obtained according to the output similarity information, where the detection result includes normal / abnormal.
[0129] In one embodiment, the output similarity information includes a similarity parameter value, and the processor, when implementing the step of determining the output similarity information of the first heart sound signal detection model and the second heart sound signal detection model according to the first output data and the second output data, is configured to implement:
[0130] determining a loss function value of the second heart sound signal detection model according to the first output data and the second output data;
[0131] The similarity parameter value is determined according to the loss function value.
[0132] In one embodiment, when the processor determines the loss function value of the second heart sound signal detection model according to the first output data and the second output data, it is configured to implement:
[0133] Calculate a first mean and a first standard deviation corresponding to the first output data, a second mean and a second standard deviation corresponding to the second output data, and a covariance corresponding to the first output data and the second output data;
[0134] The loss function value is determined according to the first mean, the second mean, the first standard deviation, the second standard deviation and the covariance.
[0135] In one embodiment, when the processor implements determining the loss function value according to the first mean, the second mean, the first standard deviation, the second standard deviation, and the covariance, it is configured to implement:
[0136] According to the formula Calculating the loss function value;
[0137] Among them, L sim represents the loss function value, μ1 represents the first mean, μ2 represents the second mean, σ1 represents the first standard deviation, σ2 represents the second standard deviation, σ 12 Denotes the covariance.
[0138] In one embodiment, when the processor implements the determining of the similarity parameter value according to the loss function value, it is configured to implement:
[0139] According to the formula S = 1-L sim , calculate the similarity parameter value;
[0140] Wherein, S represents the similarity parameter value, L sim Represents the loss function value.
[0141] In one embodiment, before implementing the step of inputting the heart sound signal into a trained first heart sound signal detection model and a trained second heart sound signal detection model to obtain first output data of the first heart sound signal detection model and second output data of the second heart sound signal detection model, the processor is configured to implement:
[0142] Collect normal heart sound signals and abnormal heart sound signals;
[0143] Preprocessing the normal heart sound signal to generate a positive sample, and preprocessing the abnormal heart sound signal to generate a negative sample;
[0144] The first heart sound signal detection model is trained according to the positive samples and the negative samples to obtain the trained first heart sound signal detection model; and the second heart sound signal detection model is trained according to the positive samples to obtain the trained second heart sound signal detection model.
[0145] In one embodiment, the output similarity information includes a similarity parameter value, and the processor, when implementing the step of obtaining the detection result of the heart sound signal according to the output similarity information, is configured to implement:
[0146] If the similarity parameter value is greater than or equal to a preset threshold, it is determined that the heart sound signal is normal;
[0147] If the similarity parameter value is less than the preset threshold, it is determined that the heart sound signal is abnormal.
[0148] The computer device can execute the heart sound signal detection method provided in the embodiment of the present application, and therefore can achieve the beneficial effects that can be achieved by the heart sound signal detection method provided in the embodiment of the present application. Please refer to the previous embodiment for details and will not be repeated here.
[0149] An embodiment of the present application also provides a computer-readable storage medium.
[0150] The computer-readable storage medium of the present application stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned heart sound signal detection method are implemented.
[0151] The computer-readable storage medium may be an internal storage unit of the heart sound signal detection device or computer device described in the aforementioned embodiment, such as a hard disk or memory of the heart sound signal detection device or computer device. The computer-readable storage medium may also be an external storage device of the heart sound signal detection device or computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital card (Secure Digital Card, SD Card), a flash card (Flash Card), etc., equipped on the heart sound signal detection device or computer device.
[0152] Since the computer program stored in the computer-readable storage medium can execute any one of the heart sound signal detection methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the heart sound signal detection methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0153] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0154] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0155] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0156] The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and these modifications or substitutions should be included in the protection scope of the present application.
Claims
1. A heart sound signal detection method, characterized in that: The heart sound signal detection method comprises: Acquiring a heart sound signal to be detected; Input the heart sound signal into a trained first heart sound signal detection model and a trained second heart sound signal detection model to obtain first output data of the first heart sound signal detection model and second output data of the second heart sound signal detection model; wherein the first heart sound signal detection model is trained based on positive and negative samples, and the second heart sound signal detection model is trained based on positive samples; Determining output similarity information between the first heart sound signal detection model and the second heart sound signal detection model according to the first output data and the second output data; A detection result of the heart sound signal is obtained according to the output similarity information, where the detection result includes normal / abnormal.
2. The heart sound signal detection method according to claim 1, characterized in that: The output similarity information includes a similarity parameter value, and the determining, according to the first output data and the second output data, the output similarity information of the first heart sound signal detection model and the second heart sound signal detection model includes: determining a loss function value of the second heart sound signal detection model according to the first output data and the second output data; The similarity parameter value is determined according to the loss function value.
3. The heart sound signal detection method according to claim 2, characterized in that: The determining, according to the first output data and the second output data, a loss function value of the second heart sound signal detection model comprises: Calculate a first mean and a first standard deviation corresponding to the first output data, a second mean and a second standard deviation corresponding to the second output data, and a covariance corresponding to the first output data and the second output data; The loss function value is determined according to the first mean, the second mean, the first standard deviation, the second standard deviation and the covariance.
4. The heart sound signal detection method according to claim 3, characterized in that: The determining the loss function value according to the first mean, the second mean, the first standard deviation, the second standard deviation and the covariance includes: According to the formula Calculating the loss function value; Among them, L sim represents the loss function value, μ1 represents the first mean, μ2 represents the second mean, σ1 represents the first standard deviation, σ2 represents the second standard deviation, σ 12 Denotes the covariance.
5. The heart sound signal detection method according to claim 2, characterized in that: Determining the similarity parameter value according to the loss function value includes: According to the formula S = 1-L sim , calculate the similarity parameter value; Wherein, S represents the similarity parameter value, L sim Represents the loss function value.
6. The heart sound signal detection method according to claim 1, characterized in that: Before inputting the heart sound signal into a trained first heart sound signal detection model and a trained second heart sound signal detection model to obtain first output data of the first heart sound signal detection model and second output data of the second heart sound signal detection model, the method includes: Collect normal heart sound signals and abnormal heart sound signals; Preprocessing the normal heart sound signal to generate a positive sample, and preprocessing the abnormal heart sound signal to generate a negative sample; The first heart sound signal detection model is trained according to the positive samples and the negative samples to obtain the trained first heart sound signal detection model; and the second heart sound signal detection model is trained according to the positive samples to obtain the trained second heart sound signal detection model.
7. The heart sound signal detection method according to any one of claims 1 to 6, characterized in that: The output similarity information includes a similarity parameter value, and obtaining the detection result of the heart sound signal according to the output similarity information includes: If the similarity parameter value is greater than or equal to a preset threshold, it is determined that the heart sound signal is normal; If the similarity parameter value is less than the preset threshold, it is determined that the heart sound signal is abnormal.
8. A heart sound signal detection device, characterized in that: The heart sound signal detection device comprises: An acquisition module, used for acquiring the heart sound signal to be detected; a processing module, configured to input the heart sound signal into a trained first heart sound signal detection model and a trained second heart sound signal detection model, and obtain first output data of the first heart sound signal detection model and second output data of the second heart sound signal detection model; wherein the first heart sound signal detection model is trained based on positive and negative samples, and the second heart sound signal detection model is trained based on positive samples; an analysis module, configured to determine output similarity information between the first heart sound signal detection model and the second heart sound signal detection model according to the first output data and the second output data; The recognition module is used to obtain the detection result of the heart sound signal according to the output similarity information, and the detection result includes normal / abnormal.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the heart sound signal detection method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the heart sound signal detection method according to any one of claims 1 to 7 are implemented.
