A deep learning-based real-time detection method and system for bowel sounds
By employing a deep learning-based method for detecting bowel sounds, utilizing log-Mel energy spectrum and a convolutional-bidirectional GRU model, combined with a specific loss function, the problems of weak fitting ability and high false alarm rate in bowel sound detection are solved. This method achieves high-precision and low-sensitivity bowel sound detection, suitable for real-time and multi-scenario applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIV OF SCI & TECH BEIJING
- Filing Date
- 2023-10-16
- Publication Date
- 2026-07-24
AI Technical Summary
Existing bowel sound detection methods have weak fitting ability, high false alarm rate, and are sensitive to thresholds. Furthermore, bowel sounds are easily drowned out by breathing sounds, talking sounds, etc., resulting in poor reproducibility of the detection.
We employ a deep learning-based approach, using a model that combines log-Mel energy spectrum feature extraction with a convolutional-bidirectional GRU, and combining Huber loss and Shape loss as objective functions. We perform feature extraction and bowel sound prediction using log-Mel energy spectrum, and set thresholds and parameters for post-processing to reduce the model's sensitivity to thresholds and prediction volatility.
It improves the accuracy and robustness of bowel sound segmentation, reduces the false alarm rate, and enhances the model's real-time computing and generalization capabilities, making it suitable for real-time bowel sound detection in different experimental subjects.
Smart Images

Figure CN117393004B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of physiological signal detection technology, and in particular to a method and system for real-time detection of bowel sounds based on deep learning. Background Technology
[0002] Deep learning-based sound event detection is an important branch of natural language processing. It uses deep learning technology to automatically segment specific sound events within a certain time range in an audio clip. It is currently being applied to fields such as smart speakers, smart cities, and smart healthcare, and has broad development potential.
[0003] Bowel sounds (BS) are acoustic signals produced during gastrointestinal peristalsis and can be considered a biosound event. The frequency, pitch, and duration of bowel sounds can reflect the gastrointestinal function of a patient and are of great guiding significance for gastrointestinal dysfunction.
[0004] Generally, patients with intestinal obstruction have a higher frequency of bowel sounds, while those with paralytic ileus have a lower frequency, and there are differences in pitch and timbre between the two. In the medical field, traditional bowel sound monitoring is usually done manually by experienced physicians using a stethoscope, which has drawbacks such as poor reproducibility and significant subjective influence. With the advancement of the electronics industry, the digitalization of bowel sound monitoring has emerged, generating a large amount of audio data containing bowel sounds. This has made automated bowel sound detection a primary task in digital bowel sound diagnosis and treatment. However, bowel sounds are easily masked by interference from breathing sounds, talking sounds, and clothing rubbing sounds during the acquisition process; furthermore, segmentation methods based on traditional signal processing and machine learning suffer from weak fitting ability, high false alarm rates, and sensitivity to thresholds. Summary of the Invention
[0005] This invention provides a method and system for real-time detection of bowel sounds based on deep learning, in order to solve the technical problems of weak fitting ability, high false alarm rate, and sensitivity to threshold in existing bowel sound detection methods.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] On one hand, this invention provides a method for real-time detection of bowel sounds based on deep learning, comprising:
[0008] Obtain the raw signal of the bowel sounds to be detected; wherein, the raw signal is a one-dimensional audio signal;
[0009] Log-Mel energy spectrum is used as a feature extraction method, and Mel frequency transformation is used to simulate the human ear hearing effect to extract the log-Mel energy spectrum corresponding to the original signal from the original signal.
[0010] The log-Mel energy spectrum is input into a preset deep learning model to obtain the probability distribution of bowel sounds prediction;
[0011] Based on the predicted probability distribution of bowel sounds, the number of times bowel sounds were generated in the original signal was calculated.
[0012] Furthermore, the deep learning model is a deep learning model based on a combination of convolution and bidirectional GRU;
[0013] The deep learning model comprises a one-dimensional convolutional module, a bidirectional GRU module, and a fully connected layer. The one-dimensional convolutional module contains two one-dimensional convolutional layers for extracting features related to the time-frequency domain of the log-Mel energy spectrum. The bidirectional GRU module contains three bidirectional GRU layers for extracting features related to the time preceding and following bowel sounds from the features extracted by the one-dimensional convolutional module. The fully connected layer performs dimensionality transformation on the features extracted by the bidirectional GRU module to obtain the predicted probability distribution of bowel sounds.
[0014] Furthermore, the objective function of the deep learning model is a loss function based on Huber loss and Shape loss. Huber loss combines the advantages of L1 loss and MSE loss. Shape loss utilizes the shape features of the predicted probability distribution to calculate the mean α1 and variance σ1 of the bowel sound segment, and the mean α2 and variance σ2 of the background noise segment. It calculates (α1-α)1+(σ1+σ2) as the Shape loss to widen the difference in predicted probabilities between bowel sounds and background noise, reduce the volatility of continuous prediction of bowel sounds, make the predicted probability distribution closer to the true probability distribution, improve segmentation accuracy, and reduce the model's sensitivity to thresholds.
[0015] Furthermore, based on the predicted probability distribution of bowel sounds, the number of times bowel sounds were generated in the original signal was calculated, including:
[0016] Set the threshold T and parameter P;
[0017] The probability distribution of bowel sounds is statistically analyzed, and a set of consecutive prediction points greater than the threshold T is recorded as one bowel sound, thereby obtaining the number of bowel sound events N in the original signal; events with a number of prediction points less than P in the N bowel sound events are removed according to parameter P, to obtain the final number of bowel sounds.
[0018] On the other hand, the present invention also provides a deep learning-based real-time bowel sound detection system, comprising:
[0019] Bowel sound segmentation module, used for:
[0020] Obtain the raw signal of the bowel sounds to be detected; wherein, the raw signal is a one-dimensional audio signal;
[0021] Log-Mel energy spectrum is used as a feature extraction method, and Mel frequency transformation is used to simulate the human ear hearing effect to extract the log-Mel energy spectrum corresponding to the original signal from the original signal.
[0022] The log-Mel energy spectrum is input into a preset deep learning model to obtain the probability distribution of bowel sounds prediction;
[0023] The post-processing module is used for:
[0024] Based on the predicted probability distribution of bowel sounds, the number of times bowel sounds were generated in the original signal was calculated.
[0025] Furthermore, the deep learning model is a deep learning model based on a combination of convolution and bidirectional GRU;
[0026] The deep learning model comprises a one-dimensional convolutional module, a bidirectional GRU module, and a fully connected layer. The one-dimensional convolutional module contains two one-dimensional convolutional layers for extracting features related to the time-frequency domain of the log-Mel energy spectrum. The bidirectional GRU module contains three bidirectional GRU layers for extracting features related to the time preceding and following bowel sounds from the features extracted by the one-dimensional convolutional module. The fully connected layer performs dimensionality transformation on the features extracted by the bidirectional GRU module to obtain the predicted probability distribution of bowel sounds.
[0027] Furthermore, the objective function of the deep learning model is a loss function based on Huber loss and Shape loss. Huber loss combines the advantages of L1 loss and MSE loss. Shape loss utilizes the shape features of the predicted probability distribution to calculate the mean α1 and variance σ1 of the bowel sound segment, and the mean α2 and variance σ2 of the background noise segment. It calculates (α1-α2)+(σ1+σ2) as the Shape loss to widen the difference in predicted probabilities between bowel sounds and background noise, reduce the volatility of continuous prediction of bowel sounds, make the predicted probability distribution closer to the true probability distribution, improve segmentation accuracy, and reduce the model's sensitivity to thresholds.
[0028] Furthermore, the post-processing module is specifically used for:
[0029] Set the threshold T and parameter P;
[0030] The probability distribution of bowel sounds is statistically analyzed, and a set of consecutive prediction points greater than the threshold T is recorded as one bowel sound, thereby obtaining the number of bowel sound events N in the original signal; events with a number of prediction points less than P in the N bowel sound events are removed according to parameter P, to obtain the final number of bowel sounds.
[0031] In another aspect, the present invention also provides an electronic device comprising a processor and a memory; wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the above-described method.
[0032] In another aspect, the present invention also provides a computer-readable storage medium storing at least one instruction that is loaded and executed by a processor to implement the above-described method.
[0033] The beneficial effects of the technical solution provided by this invention include at least the following:
[0034] The technical solution of the present invention can reduce the sensitivity of the bowel sound segmentation model to threshold settings, reduce the volatility of the predicted probability distribution, reduce the false alarm rate and improve robustness, and significantly improve the accuracy of bowel sound segmentation results. Moreover, the lightweight design of the bowel sound segmentation model in the technical solution of the present invention enables it to have better real-time computing capabilities, and it can be used for real-time detection of bowel sounds in different experimental subjects, with strong generalization ability. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart of a deep learning-based real-time bowel sound detection method provided in an embodiment of the present invention;
[0037] Figure 2 This is a schematic diagram illustrating the change in the predicted probability value provided in an embodiment of the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0039] First Embodiment
[0040] To address the issue that bowel sounds are easily drowned out during acquisition due to interference from breathing sounds, talking sounds, and clothing rubbing sounds, and that existing segmentation methods based on traditional signal processing and machine learning suffer from weak fitting ability, high false alarm rates, and sensitivity to thresholds, this embodiment provides a real-time bowel sound detection method based on deep learning. This method can be implemented by an electronic device, such as a terminal or server. The method includes two stages: bowel sound segmentation and post-processing. Bowel sound segmentation automatically identifies the predicted probability distribution of bowel sounds in the original signal and effectively filters out background noise segments by setting a threshold. Post-processing mainly calculates the number of bowel sounds generated in the original signal based on the segmentation results. By combining these two stages, bowel sound segments and the number of bowel sounds can be obtained automatically, providing data support for assisting clinical diagnosis.
[0041] Specifically, the execution flow of this method is as follows: Figure 1 As shown, it includes the following steps:
[0042] S1, Obtain the raw signal of the bowel sounds to be detected;
[0043] The original signal is a one-dimensional audio signal.
[0044] S2, using log-Mel energy spectrum as a feature extraction method, and employing Mel frequency transformation to simulate the human ear's auditory effect, the log-Mel energy spectrum corresponding to the original signal is extracted from the original signal;
[0045] It should be noted that after the original signal is acquired, this embodiment uses log-Mel energy spectrum as the feature extraction method to extract two-dimensional time-frequency domain features from the one-dimensional audio signal. At the same time, Mel frequency transform is used instead of traditional frequency transform to simulate the human ear's auditory effect, which can improve the robustness and recognizability of the features.
[0046] S3, input the log-Mel energy spectrum into a preset deep learning model to obtain the bowel sound prediction probability distribution; it should be noted that the deep learning model in this embodiment is a deep learning model based on the combination of convolution and bidirectional gated recurrent units (GRUs); it includes a one-dimensional convolutional module, a bidirectional GRU module, and a fully connected layer; wherein, the one-dimensional convolutional module contains two one-dimensional convolutional layers, used to extract features related to the time-frequency domain of the log-Mel energy spectrum; the bidirectional GRU module contains three bidirectional GRU layers, used to fully extract the features related to the time before and after the occurrence of bowel sounds from the features extracted by the one-dimensional convolutional module; the fully connected layer is used to transform the dimensions of the features extracted by the bidirectional GRU module to obtain the bowel sound prediction probability distribution.
[0047] Furthermore, the objective function of the deep learning model is a loss function based on Huber loss and Shape loss. Huber loss combines the advantages of L1 loss and MSE loss. Shape loss utilizes the shape features of the predicted probability distribution to calculate the mean α1 and variance σ1 of the bowel sound segment, and the mean α2 and variance σ2 of the background noise segment. It calculates (α1-α2)+(σ1+σ2) as the Shape loss to widen the difference in predicted probabilities between bowel sounds and background noise, reduce the volatility of continuous prediction of bowel sounds, make the predicted probability distribution closer to the true probability distribution, improve segmentation accuracy, and reduce the model's sensitivity to thresholds.
[0048] The total loss can be optimized by executing the backpropagation algorithm.
[0049] S4, based on the probability distribution of bowel sounds, calculates the number of times bowel sounds are generated in the original signal.
[0050] Specifically, in this embodiment, the implementation process of S4 is as follows:
[0051] S41, set the threshold T and parameter P; where the threshold T ranges from 0 to 1, determined by... Figure 2 As can be seen, due to the improved robustness of the model presented in this paper, the predicted probability value begins to change around 0.9. Therefore, the T value can generally be set to greater than or equal to 0.9. The range of parameter P can be determined using the following method: assuming the model output dimension is d and the input duration is m seconds, then the duration of each prediction point is m / d seconds. Based on long-term bowel sound monitoring analysis, the shortest duration of bowel sounds is 0.05 seconds. Therefore, the minimum setting value of parameter P is 0.05d / m, and the maximum setting value generally does not exceed 10. The following example further illustrates this: the model input duration is 3 seconds, and the model output dimension is 118. Therefore, the minimum setting value of parameter P is 2. The P value can be appropriately increased according to different actual scenarios, but generally does not exceed 10.
[0052] S42, Statistically analyze the probability distribution of bowel sounds prediction, and record a set of consecutive prediction points greater than the threshold T as 1 bowel sound, thereby obtaining the number of bowel sound events N in the original signal; Based on the parameter P, remove events with a prediction point set less than P from the N bowel sound events to obtain the final number of bowel sounds.
[0053] By performing the above processing, the false alarm rate can be reduced while obtaining the number of bowel sounds, thus improving the accuracy of the algorithm.
[0054] In summary, this embodiment provides a deep learning-based real-time bowel sound detection method. This method can reduce the sensitivity of the bowel sound segmentation model to threshold settings, reduce the volatility of the predicted probability distribution, decrease the false alarm rate, and improve robustness. It significantly improves the accuracy of the bowel sound segmentation results. Moreover, the lightweight design of the bowel sound segmentation model in this embodiment enables it to have better real-time computing capabilities, making it suitable for real-time bowel sound detection in different experimental subjects, and exhibiting strong generalization ability.
[0055] Second Embodiment
[0056] This embodiment provides a deep learning-based real-time bowel sound detection system, including the following modules:
[0057] Bowel sound segmentation module, used for:
[0058] Obtain the raw signal of the bowel sounds to be detected; wherein, the raw signal is a one-dimensional audio signal;
[0059] Log-Mel energy spectrum is used as a feature extraction method, and Mel frequency transformation is used to simulate the human ear hearing effect to extract the log-Mel energy spectrum corresponding to the original signal from the original signal.
[0060] The log-Mel energy spectrum is input into a preset deep learning model to obtain the probability distribution of bowel sounds prediction;
[0061] The post-processing module is used for:
[0062] Based on the predicted probability distribution of bowel sounds, the number of times bowel sounds were generated in the original signal was calculated.
[0063] The deep learning-based real-time bowel sound detection system of this embodiment corresponds to the deep learning-based real-time bowel sound detection method of the first embodiment described above. The functions implemented by each functional module in the deep learning-based real-time bowel sound detection system of this embodiment correspond one-to-one with the process steps in the deep learning-based real-time bowel sound detection method of the first embodiment described above; therefore, they will not be described again here.
[0064] Third Embodiment
[0065] This embodiment provides an electronic device, which includes a processor and a memory; wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the method of the first embodiment.
[0066] The electronic device can vary considerably depending on its configuration or performance, and may include one or more processors (central processing units, CPUs) and one or more memories, wherein the memories store at least one instruction that is loaded by the processor and executed in accordance with the above method.
[0067] Fourth embodiment
[0068] This embodiment provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement the method of the first embodiment described above. The computer-readable storage medium may be a ROM, random access memory, CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc. The instruction stored therein can be loaded and executed by a processor in a terminal.
[0069] Furthermore, it should be noted that the present invention can be provided as a method, apparatus, or computer program product. Therefore, embodiments of the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0070] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0071] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing terminal equipment to cause a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0072] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0073] Finally, it should be noted that the above description represents a preferred embodiment of the present invention. It should be pointed out that although preferred embodiments have been described, those skilled in the art, once they understand the basic inventive concept of the present invention, can make various improvements and modifications without departing from the principles described herein. These improvements and modifications should also be considered within the scope of protection of the present invention. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.
Claims
1. A method for real-time detection of bowel sounds based on deep learning, characterized in that, include: Obtain the raw signal of the bowel sounds to be detected; wherein, the raw signal is a one-dimensional audio signal; Log-Mel energy spectrum is used as a feature extraction method, and Mel frequency transformation is used to simulate the human ear hearing effect to extract the log-Mel energy spectrum corresponding to the original signal from the original signal. The log-Mel energy spectrum is input into a preset deep learning model to obtain the probability distribution of bowel sounds prediction; Based on the predicted probability distribution of bowel sounds, the number of bowel sounds generated in the original signal is calculated. The deep learning model is a deep learning model based on the combination of convolution and bidirectional gated recurrent units (GRUs). The deep learning model comprises a one-dimensional convolutional module, a bidirectional GRU module, and a fully connected layer. The one-dimensional convolutional module contains two one-dimensional convolutional layers for extracting features related to the time-frequency domain of the log-Mel energy spectrum. The bidirectional GRU module contains three bidirectional GRU layers for extracting features related to the time preceding and following bowel sounds from the features extracted by the one-dimensional convolutional module. The fully connected layer performs dimensionality transformation on the features extracted by the bidirectional GRU module to obtain the predicted probability distribution of bowel sounds. The objective function of the deep learning model is a loss function based on Huber loss and Shape loss; whereby Huber loss combines the advantages of L1 loss and MSE loss; and Shape loss utilizes the shape features of the predicted probability distribution to calculate the average value of bowel sound segments. and variance and the average value of background noise segments. and variance ,calculate +( As a shape loss, it widens the difference in predicted probabilities between bowel sounds and background noise, reduces the volatility of continuous prediction of bowel sounds, makes the predicted probability distribution closer to the true probability distribution, improves segmentation accuracy, and reduces the model's sensitivity to thresholds.
2. The method for real-time detection of bowel sounds based on deep learning as described in claim 1, characterized in that, Based on the predicted probability distribution of bowel sounds, the number of bowel sounds generated in the original signal is calculated, including: Set the threshold T and parameter P; The probability distribution of bowel sounds is statistically analyzed, and a set of consecutive prediction points greater than the threshold T is recorded as one bowel sound, thereby obtaining the number of bowel sound events N in the original signal; events with a number of prediction points less than P in the N bowel sound events are removed according to parameter P, to obtain the final number of bowel sounds.
3. A real-time bowel sound detection system based on deep learning, characterized in that, include: Bowel sound segmentation module, used for: Obtain the raw signal of the bowel sounds to be detected; wherein, the raw signal is a one-dimensional audio signal; Log-Mel energy spectrum is used as a feature extraction method, and Mel frequency transformation is used to simulate the human ear hearing effect to extract the log-Mel energy spectrum corresponding to the original signal from the original signal. The log-Mel energy spectrum is input into a preset deep learning model to obtain the probability distribution of bowel sounds prediction; The post-processing module is used for: Based on the predicted probability distribution of bowel sounds, the number of bowel sounds generated in the original signal is calculated. The deep learning model is a deep learning model based on the combination of convolution and bidirectional GRU. The deep learning model comprises a one-dimensional convolutional module, a bidirectional GRU module, and a fully connected layer. The one-dimensional convolutional module contains two one-dimensional convolutional layers for extracting features related to the time-frequency domain of the log-Mel energy spectrum. The bidirectional GRU module contains three bidirectional GRU layers for extracting features related to the time preceding and following bowel sounds from the features extracted by the one-dimensional convolutional module. The fully connected layer performs dimensionality transformation on the features extracted by the bidirectional GRU module to obtain the predicted probability distribution of bowel sounds. The objective function of the deep learning model is a loss function based on Huber loss and Shape loss; whereby Huber loss combines the advantages of L1 loss and MSE loss; and Shape loss utilizes the shape features of the predicted probability distribution to calculate the average value of bowel sound segments. and variance and the average value of background noise segments. and variance ,calculate +( As a shape loss, it widens the difference in predicted probabilities between bowel sounds and background noise, reduces the volatility of continuous prediction of bowel sounds, makes the predicted probability distribution closer to the true probability distribution, improves segmentation accuracy, and reduces the model's sensitivity to thresholds.
4. The deep learning-based real-time bowel sound detection system as described in claim 3, characterized in that, The post-processing module is specifically used for: Set the threshold T and parameter P; The probability distribution of bowel sounds is statistically analyzed, and a set of consecutive prediction points greater than the threshold T is recorded as one bowel sound, thereby obtaining the number of bowel sound events N in the original signal; Based on parameter P, events with a prediction point set less than P among N bowel sound events are removed to obtain the final bowel sound count.