A method and system for detecting abnormalities of arteriovenous fistula based on reversible audio-visual transformation and diffusion model
Through reversible audio-visual transformation and diffusion model, the tremor of the fistula is converted into an amplitude spectrum and denoising and reconstructing it. Combining the high-frequency attention mechanism and multi-cluster Gaussian clustering, the accuracy and anti-interference problems of traditional models in fistula stenosis detection are solved, achieving more efficient abnormal detection.
Patent Information
- Application Number
- CN202510807919.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-06-17
AI Technical Summary
Traditional deep learning models have low accuracy and poor anti-interference ability in detecting stenosis status of arteriovenous fistula, making it difficult to effectively identify complex tremolo data of internal fistula.
Reversible audio-visual transformation is used to convert the internal fistula tremor into amplitude spectrum and phase spectrum, and denoising and reconstruction is performed through the diffusion model, combining the multi-cluster Gaussian clustering model and the high-frequency attention mechanism to achieve abnormal detection.
The accuracy and anti-interference ability of fistula stenosis detection are improved, and the accuracy of feature extraction and abnormal pattern recognition of fistula tremor is significantly improved.
Smart Images

Figure CN120304789B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical health monitoring, and in particular to a method and system for detecting anomalies of an arteriovenous fistula based on reversible audio-visual transformation and a diffusion model. Background Art
[0002] Arteriovenous fistulas are the lifeline of hemodialysis patients. Fistula tremor offers the advantages of simplicity and noninvasiveness in detecting stenosis. Currently, fistula stenosis detection and assessment are largely manual, with accuracy highly constrained by the tester's experience and skills. This leads to high reliance on specialized expertise and subjective assessment criteria. Using machines to autonomously and objectively identify fistula tremor is crucial for early warning of stenosis.
[0003] Currently, research teams at home and abroad have explored the use of fistula tremors to identify fistula stenosis. For example, patent CN118749925 discloses an arteriovenous fistula monitoring bracelet that uses a tremor sensor and a blood flow sound sensor combined with a deep learning network to provide abnormality warnings. A team from Cornell University Medical School (npj DigitalMedicine, (2023) 6:163) proposed converting fistula tremors into mel-spectrograms and combining them with a classic deep learning network to determine the degree of fistula stenosis. However, the distribution of arteriovenous fistula data is often complex, with multimodal and non-Gaussian characteristics. Traditional deep learning models are susceptible to interference from environmental noise when modeling such complex distributions, resulting in poor discrimination performance. Therefore, improving the accuracy and anti-interference ability of fistula stenosis detection has become a pressing technical challenge. Summary of the Invention
[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a method and system for detecting arteriovenous fistula anomalies based on reversible audio-visual transformation and diffusion model, which can effectively solve the problems of low model accuracy and poor anti-interference ability of traditional fistula stenosis state abnormality detection algorithm, so as to improve the accuracy of fistula stenosis state detection.
[0005] In a first aspect, the present application provides a method for detecting anomalies of an arteriovenous fistula based on reversible audio-visual transformation and a diffusion model, characterized in that the method comprises the following steps:
[0006] Step S10, collecting fistula tremor samples and establishing a sample database;
[0007] Step S20, pre-processing the fistula tremor sound sample;
[0008] Step S30, converting the pre-processed fistula tremor sound sample into an amplitude spectrum and a phase spectrum using a reversible audio-visual conversion;
[0009] Step S40, inputting the amplitude spectrum into the diffusion model trained with normal samples, and generating an amplitude spectrum that matches the normal sample distribution through denoising and reconstruction;
[0010] Step S50, combining the reconstructed amplitude spectrum with the original phase spectrum and restoring it into a reconstructed fistula tremor sound sample by using a reversible audio-visual transformation;
[0011] In step S60, the original and reconstructed fistula tremor samples are divided into frequency bands, the reconstruction error and energy characteristics of the samples are extracted and standardized, a multi-cluster Gaussian clustering model is trained after standardization, and a threshold is set based on the log-likelihood value to implement abnormal classification and determine fistula stenosis.
[0012] Furthermore, the step S10 of establishing the sample database includes the following specific methods:
[0013] Step S11, collecting the fistula tremor signal using a high-sensitivity capacitive sensor;
[0014] Step S12, classifying and labeling the fistula tremor samples;
[0015] Step S13: convert the classified and labeled internal fistula tremor samples into a unified format and store them in a sample database, and establish a sample management system.
[0016] Furthermore, the step S20 pre-processes the fistula tremor sound sample, including the following specific methods:
[0017] Step S21, performing noise reduction processing on the fistula tremor sound sample through an adaptive filter;
[0018] Step S22, performing frequency band gain adjustment on the fistula tremor sound sample by short-time Fourier transform to enhance the signal;
[0019] Step S23, normalizing the fistula tremor sound samples using a minimum-maximum normalization method;
[0020] Step S24 , normalizing the normalized fistula tremor sound samples and performing an abnormal point correction operation.
[0021] Furthermore, the step S30 converts the fistula tremor sound sample into an amplitude spectrum and a phase spectrum using short-time Fourier transform, including the following specific methods:
[0022] Step S31: convert the normalized and outlier-processed fistula tremor samples into a complex spectrum using short-time Fourier transform. ;
[0023] Among them, the complex spectrum The amplitude spectrum can be separated and phase spectrum ;
[0024] Step S32, the complex spectrum Separated amplitude spectrum and phase spectrum Perform frequency domain cropping to obtain a truncated spectrum and ;
[0025] Step S33, the truncated amplitude spectrum and phase spectrum Perform bilinear interpolation resampling respectively to resample it into a fixed-dimensional amplitude spectrum and phase spectrum ;
[0026] Step S34, the amplitude spectrum obtained above and phase spectrum Normalize it to compress its value range to .
[0027] Furthermore, the key parameters of the short-time Fourier transform process are saved, including the selected window function type, window length, frame shift step, number of Fourier transform points, etc. At the same time, the amplitude spectrum after fixed dimension is saved and phase spectrum The minimum and maximum values of ) to recover the original spectrum information and restore the time-domain audio signal when performing the inverse short-time Fourier transform operation.
[0028] Furthermore, the step S40 performs denoising and reconstruction operations on the original amplitude spectrum to generate a reconstructed amplitude spectrum, including the following specific methods:
[0029] Step S41: The normalized two-dimensional amplitude spectrum obtained in step S34 is Expressed as , and perform a forward diffusion process on it, defining a series of gradually increasing noise scale parameters ( ). Constructing conditional probability distribution , through the formula recursion, we can get Sampling to get an image at any time step , the calculation formula is:
[0030] ,
[0031] in, is the cumulative attenuation factor, is the noise sampled from a standard normal distribution.
[0032] Furthermore, the spectrum is divided into sub-regions in the frequency dimension , apply different noise perturbation parameters to each sub-region Generate noisy images , where a larger noise scale is set for the high-frequency area.
[0033] Step S42: Build a noise prediction network based on U-Net and input the noisy amplitude spectrum , output noise residual estimate .
[0034] Furthermore, we introduce a high-frequency attention mechanism and set the feature map ,pass Calculate frequency values and define frequency weighting function , construct the attention weight tensor ,through Obtain high-frequency enhanced feature maps to guide the model to focus on high-frequency areas.
[0035] Step S43, training the noise prediction network, using the amplitude spectrum samples of the fistula tremor labeled as "normal" for learning, and inputting the spectrum Sampling time steps by forward diffusion Noise spectrum ,Will and The noise prediction results are sent to the network .
[0036] Specifically, the network is trained using the logarithmic domain mean square error loss function (log-MSE), and the loss function is calculated as:
[0037] ,
[0038] in, is the original amplitude spectrum, is the reconstructed amplitude spectrum predicted by the model, A smoothing term to prevent zero values in logarithmic calculations.
[0039] Step S44, using the deterministic sampling strategy in Denoising Diffusion Implicit Models (DDIM), the initial Gaussian noise image Start the reverse diffusion process and gradually restore a clear amplitude spectrum , where the deterministic sampling formula is:
[0040] ,
[0041] in, is the noise attenuation coefficient of the current diffusion step, is the cumulative retention factor, is a random disturbance from a standard normal distribution.
[0042] Furthermore, the step S50 uses inverse short-time Fourier transform to restore and reconstruct the fistula tremor sound sample, including the following specific methods:
[0043] Step S51: reconstruct the amplitude spectrum Perform the anti-normalization operation to restore its amplitude in the original physical quantity space.
[0044] Step S52: Denormalize the amplitude spectrum obtained in step S51 , and the phase spectrum recorded in step S33 Fusion, through Constructing a complex spectrogram ,in is the timeframe index, is the frequency index, Is an imaginary unit.
[0045] Step S53: complex spectrum Perform inverse short-time Fourier transform to restore the time domain tremolo signal. Specifically, the discrete inverse Fourier transform can be used to obtain the time domain signal segment corresponding to each frame ( , is the number of Fourier transform points).
[0046] Furthermore, the frame shift method is used to overlap and add the signal segments of each frame (Overlap-Add, OLA) to form a complete time domain signal ,in is the frame shift step length, is the total number of frames, is the window function.
[0047] Specifically, the inverse short-time Fourier transform adopts the same parameter settings as the forward short-time Fourier transform in step S30, such as window function type, window length, frame shift step, and Fourier transform point number, to ensure the reversibility and physical consistency of the forward and inverse transforms.
[0048] Furthermore, the step S60 classifies the sound sample as abnormal, including the following specific methods:
[0049] Step S61: divide the original and reconstructed fistula tremor sounds into frequency bands, calculate the reconstruction error and energy characteristics of each frequency band, and establish a feature vector ;
[0050] Step S62, normalize the features of large-scale normal samples, and train a multi-component Gaussian mixture model to fit the normal distribution features. Principle, set anomaly detection threshold ;
[0051] Step S63: Calculate the log-likelihood value corresponding to the frequency band feature of the sample to be detected, and compare it with the anomaly detection threshold. Compare, determine whether there is an abnormality, and output the result.
[0052] In a second aspect, the present application further provides an arteriovenous fistula anomaly detection system based on reversible audio-visual transformation and diffusion model, characterized in that the system comprises:
[0053] The acquisition module uses a capacitive sensor to collect samples of the fistula tremor sound produced by blood flowing through the fistula. Professionals will determine the state of the fistula stenosis, mark relevant information, and establish a sample database;
[0054] A preprocessing module, performing preprocessing such as noise reduction, signal enhancement, and normalization on the fistula tremor sound sample;
[0055] a reversible audio-visual conversion module, which converts the fistula tremor sound sample into a complex spectrum using short-time Fourier transform and its inverse transform, separates the amplitude spectrum and phase spectrum, combines the reconstructed amplitude spectrum after the image reconstruction module with the original phase spectrum, and restores the reconstructed fistula tremor sound sample through inverse short-time Fourier transform;
[0056] The image reconstruction module adds noise to the amplitude spectrum through a forward diffusion process, defines a series of gradually increasing noise scale parameters, divides the spectrum into sub-regions in the frequency dimension and applies different noise perturbation parameters, with a larger noise scale set in the high-frequency region. It then uses a denoising network based on U-Net and embedded in a high-frequency attention mechanism to perform reverse denoising, generating a reconstructed amplitude spectrum that matches the normal sample distribution.
[0057] The detection module decomposes the original and reconstructed fistula tremor samples into frequency bands and extracts the reconstruction error and energy ratio characteristics of each frequency band; uses a multi-component Gaussian mixture model to model the characteristic distribution of normal samples and The log-likelihood threshold is set according to the principle; by comparing the log-likelihood value of the test sample with the threshold, it is determined whether it is abnormal and the result is output.
[0058] The present invention provides a method and system for detecting arteriovenous fistula anomalies based on reversible audio-visual transformation and diffusion model, which has the following beneficial effects:
[0059] 1. An adaptive filter is used to reduce the noise of sound samples. By dynamically adjusting the filter parameters, the environmental noise components are efficiently eliminated, and targeted enhancement is applied to high-frequency abnormal areas, making subtle turbulence signals significantly stand out in the spectrum graph, thereby highlighting the subtle features of the fistula tremor. This enables the model to stably extract key tremor features in different clinical or life scenarios, effectively improving the system's resistance to interference and overall robustness.
[0060] 2. The one-dimensional tremolo signal is converted into a two-dimensional spectrogram through short-time Fourier transform, so that the local time-frequency characteristics and frequency components of the audio are presented in the form of a spatialized "image". The diffusion model can directly learn the energy distribution patterns of the time-frequency dual dimension in the normal spectrogram, and is sensitive to abnormal frequency components or energy distribution deviations that persist throughout the entire audio segment, as well as abnormal patterns, thus avoiding the feature ambiguity caused by long sequence dependencies in time domain modeling. Compared to the feature aliasing problem caused by the stacking of information within a fixed time length when directly modeling the time domain signal, the frequency domain two-dimensional modeling achieves the feature decoupling of "time position-frequency component" by dynamically converting the time domain into a frequency domain spatial distribution, preventing abnormal features from being masked by normal signals in the same frequency band, and significantly improving the model's accuracy in capturing consistent abnormal patterns throughout the entire audio segment.
[0061] 3. The diffusion model is used to reconstruct the amplitude spectra of normal samples. By introducing a high-frequency attention mechanism, the model is guided to focus on abnormal features in high-frequency areas, and a logarithmic loss function is used to amplify the error weights of low-amplitude high-frequency components. This allows the model to pay more attention to rare high-frequency abnormal patterns in normal samples. Even in the presence of noise, it can accurately identify spectral differences with weak amplitude but significant pathological significance, effectively avoiding missed detections caused by low signal amplitude or noise masking, and significantly improving the robustness and accuracy of anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. 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 any creative work.
[0063] Figure 1 The figure is a schematic diagram of the overall process of an arteriovenous fistula abnormality detection method based on reversible audio-visual transformation and diffusion model provided in an embodiment of the present invention.
[0064] Figure 2 The figure is an overall schematic diagram of an arteriovenous fistula abnormality detection system based on reversible audio-visual transformation and diffusion model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0065] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While the accompanying drawings illustrate exemplary embodiments of the present invention, it should be understood that these examples are provided to more fully convey the scope of the present invention to those skilled in the art. It should be understood that the flowcharts shown in the accompanying drawings are illustrative only and do not necessarily include all content and operations / steps, nor do they necessarily need to be executed in the order described.
[0066] Embodiments of the present application provide a method for detecting arteriovenous fistula anomalies based on reversible audio-visual transformation and a diffusion model. This method can be applied to servers and embedded devices. The server can be a standalone server or a server cluster.
[0067] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0068] Reference Figure 1 The present application provides a method for detecting anomalies of an arteriovenous fistula based on reversible audio-visual transformation and diffusion model, the method specifically comprising steps S10 to S60:
[0069] Step S10, collecting fistula tremor samples and establishing a sample database;
[0070] Step S20, pre-processing the fistula tremor sound sample;
[0071] Step S30, converting the pre-processed fistula tremor sound sample into an amplitude spectrum and a phase spectrum using a reversible audio-visual conversion;
[0072] Step S40, inputting the amplitude spectrum into the diffusion model trained with normal samples, and generating an amplitude spectrum that matches the normal sample distribution through denoising and reconstruction;
[0073] Step S50, combining the reconstructed amplitude spectrum with the original phase spectrum and restoring it into a reconstructed fistula tremor sound sample by using a reversible audio-visual transformation;
[0074] In step S60, the original and reconstructed fistula tremor samples are divided into frequency bands, the reconstruction error and energy characteristics of the samples are extracted and standardized, a multi-cluster Gaussian clustering model is trained after standardization, and a threshold is set based on the log-likelihood value to implement abnormal classification and determine fistula stenosis.
[0075] based on Figure 1 In the embodiment shown, in this embodiment, step S10 includes:
[0076] In step S11, a highly sensitive capacitive sensor is used to collect vibration signals generated by blood flowing through the fistula. During acquisition, the sensor must be in close contact with the fistula site to minimize external interference. For each patient, multiple signal acquisitions are performed at different time points throughout the treatment cycle to ensure diverse sample data.
[0077] In step S12, physicians with extensive clinical experience in vascular access jointly evaluate the collected samples, classifying them as abnormal (throat stenosis present) and normal (no stenosis or stenosis within the normal range). Each sample is annotated with information such as the patient ID, collection time, and diagnosis. This information is verified by both physicians and then entered into the system.
[0078] In step S13, the original tremor signals are uniformly converted into WAV files with 16-bit / 4kHz sampling. A MySQL relational database is used to store the sample data, and a metadata table containing the following fields is established: signal file path, basic patient information (gender, age), acquisition parameters (sensor model, gain setting), and diagnostic label (normal / abnormal). A comprehensive database management system is also established to facilitate subsequent querying, updating, and maintenance of the sample data, as well as to support subsequent data analysis and model training.
[0079] based on Figure 1 In the embodiment shown, in this embodiment, step S20 includes:
[0080] Step S21, denoising the fistula tremor sound sample by using an adaptive filter, wherein the output of the filter of the adaptive filter is and error signal The calculation formula is:
[0081] ,
[0082] ,
[0083] in, is the transpose of the filter weight coefficient vector, is the reference noise signal.
[0084] The gain vector of the adaptive filter , weight vector The inverse matrix of the input signal correlation matrix The update formula is:
[0085] ,
[0086] ,
[0087] ,
[0088] in, is the step size factor, It's the forgetting factor. is the input signal vector, is the filter weight coefficient vector, is the reference noise signal, is the filter output. is the inverse matrix of the input signal correlation matrix, is the input signal vector, is the error signal.
[0089] By continuously iteratively updating the weight vector and the inverse of the covariance matrix , minimizing the sum of squares of the error signals, thereby achieving adaptive filtering of the fistula tremor signal. This method, applied to real-time monitoring and analysis of fistula tremor, can improve the signal-to-noise ratio and extract more accurate features.
[0090] In step S22, a signal enhancement method based on time-frequency analysis is used to enhance the signal of the sample to highlight the subtle features of the fistula tremor, which facilitates subsequent image conversion and analysis.
[0091] Furthermore, a short-time Fourier transform (SFT) was performed on the noise-reduced fistula tremor samples to obtain the signal's energy distribution across time and frequency. Based on the energy concentration of fistula tremor in specific frequency bands, the gain of the signal within these bands was adjusted to increase its energy amplitude, making it more prominent in the time-frequency spectrum.
[0092] Specifically, it is assumed that the characteristic frequency band of fistula tremor is , the corresponding frequency Range , according to the pre-set gain factor , adjust the time-frequency spectrum value within the frequency band:
[0093] ,
[0094] in, is the gain factor. In this embodiment, is set to 2, is the denoised signal The time spectrum after short-time Fourier transform is represents the timeframe index, Indicates frequency index.
[0095] Furthermore, the adjusted time-frequency spectrum Perform inverse short-time Fourier transform to obtain time domain enhanced signal The specific calculation formula is as follows:
[0096] ,
[0097] in, To reconstruct the time domain enhanced signal, is the number of sampling points of the signal, is the number of time frames, Frequency the number of is the adjusted time-frequency spectrum.
[0098] Step S23: performing a normalization operation on the samples using a minimum-maximum normalization method.
[0099] Specifically, since different samples may still have significant differences in signal amplitude, energy, and other characteristics after the previous noise reduction and enhancement processes, the signals are normalized to unify the dimensions and data range to adapt to the subsequent imaging process.
[0100] Specifically, for the fistula tremor sound sample signal , and set its maximum value to , the minimum value is , the normalized signal is , and its calculation formula is:
[0101] ,
[0102] Specifically, through the above steps, the signal amplitude is normalized to the interval, ensuring that different samples are subsequently converted under the same numerical scale, avoiding deviations in the imaging results due to large differences in the original data, and ensuring the stability and comparability of the imaging process.
[0103] Step S24, the fistula tremor sound sample after preliminary preprocessing is expressed as ,in is the number of samples. First, calculate the mean of the series and standard deviation , and the calculation formulas are:
[0104] ,
[0105] ,
[0106] Furthermore, according to the above mean and standard deviation , standardize the original time series to obtain standardized samples .
[0107] Furthermore, in order to eliminate the impact of extreme outliers, The sample point is corrected to .in, is a sign function, that is, when the input value is greater than 0, the output is 1; when it is equal to 0, the output is 0; when it is less than 0, the output is -1. Specifically, in this embodiment, the threshold is set to 3.
[0108] based on Figure 1 In the embodiment shown, in this embodiment, step S30 includes:
[0109] Step S31: normalize and process the time series after outliers Convert to frequency domain representation. Specifically, short-time Fourier transform is used to transform Perform frequency domain analysis to obtain a complex spectrum , and its calculation formula is:
[0110] ,
[0111] in, represents the window function, Indicates the time point of the current frame center, represents the frequency index, is the number of Fourier transform points, is the window function length.
[0112] Specifically, in the embodiment of the present invention, the window function is set to:
[0113] ,
[0114] in, is the discrete time index, is the window function length.
[0115] Specifically, in the embodiment of the present invention, the window function length is Set to 512, the number of Fourier transform points Set to 1024.
[0116] Furthermore, from the complex spectrum The amplitude spectrum can be separated and phase spectrum .
[0117] Step S32, the complex spectrum Separated amplitude spectrum and phase spectrum Perform frequency domain cropping. Since in this embodiment, we only focus on the frequency domain information in the frequency range of 0-8000 Hz, the sampling rate set by the short-time Fourier transform in step S32 is and the number of Fourier transform points , calculate the actual frequency corresponding to each frequency point, the calculation formula is:
[0118] , ,
[0119] in, is the frequency index, Specifically, in the embodiment of the present invention, the sampling rate is set to 16000Hz.
[0120] Furthermore, keep all the Hz frequency index, and the amplitude spectrum and phase spectrum Crop to get the truncated spectrum and .
[0121] Step S33, the truncated amplitude spectrum and phase spectrum Perform bilinear interpolation resampling respectively to resample it into a fixed-dimensional amplitude spectrum and phase spectrum Specifically, in the embodiment of the present invention, the fixed dimension is set to .
[0122] Specifically, let the original spectrum size be , the target spectrum size is , for any pixel position in the target spectrum , its corresponding floating point coordinates in the original spectrum are:
[0123] ,
[0124] Find the four adjacent pixels in the original spectrum , and calculate the interpolation value , the calculation formula of the interpolation value is:
[0125] ,
[0126] in, , , represents the interpolated value at the target pixel position, Represents the values of four adjacent points in the original spectrum.
[0127] Perform the above operations on all pixels to complete the resampling of the amplitude spectrum and phase spectrum, and finally obtain the amplitude spectrum of fixed dimensions respectively. and phase spectrum .
[0128] Step S34, the above obtained and Normalize it to compress its value range to ,get and Specifically, the normalization calculation formula is as follows:
[0129] ,
[0130] ,
[0131] in, 、 are the minimum and maximum values of the amplitude spectrum before normalization, 、 are the minimum and maximum values of the phase spectrum before normalization.
[0132] Furthermore, to ensure the consistency and traceability of spectrum restoration during audio reconstruction, this embodiment also records key parameters in the short-time Fourier transform process, including the selected window function type, window length, frame shift step, number of Fourier transform points, etc. At the same time, the amplitude spectrum after fixed dimension is saved. and phase spectrum The minimum and maximum values of ) to recover the original spectral information and restore the time domain audio signal when performing the inverse short-time Fourier transform operation.
[0133] based on Figure 1 In the embodiment shown, in this embodiment, step S40 reconstructs the two-dimensional amplitude spectrum, including:
[0134] Step S41, forward diffusion process. The normalized two-dimensional amplitude spectrum obtained in step S30 is Expressed as ,in and Represent the horizontal and vertical coordinates of the image respectively, and the image size is . Define a series of gradually increasing noise scale parameters ,in ,in is the total number of diffusion steps. In this embodiment, the number of diffusion steps is Take 1000.
[0135] Specifically, the noise scaling coefficient for each time step is defined as , construct the following conditional probability distribution to realize the noise addition process of the two-dimensional amplitude spectrum:
[0136] ,
[0137] in, , represents the unit covariance matrix.
[0138] Furthermore, through the formula recursion, the diffusion process can be directly derived from Sampling to get an image at any time step :
[0139] ,
[0140] in, is the cumulative attenuation factor.
[0141] In order to improve the model's ability to respond to abnormal high-frequency structures, in this embodiment, the spectrum is divided into multiple sub-regions in the frequency dimension direction. , and apply different noise perturbation parameters to each sub-region , to generate a noisy image :
[0142] ,
[0143] in, is from the standard normal distribution The noise sampled in .
[0144] Specifically, a larger noise scale is set for the high-frequency region to enhance its disturbance sensitivity.
[0145] Step S42: In the reverse denoising process, it is necessary to denoise and reconstruct the noisy amplitude spectrum generated by each diffusion step. To this end, a random noise component contained in the noisy image for predicting each step is constructed. The noise prediction network is based on U-Net, consisting of a symmetrical encoder and decoder, and a high-frequency attention mechanism is embedded in all skip connection layers to enhance the model's ability to model high-frequency tremor structures.
[0146] Specifically, the input of the noise prediction network is the current diffusion time step Noisy amplitude spectrum under , the output is the corresponding noise residual estimate ,in is the network parameter.
[0147] Furthermore, to enhance the network's ability to model features in high-frequency structural regions, this embodiment introduces a high-frequency attention mechanism into the U-Net architecture. This mechanism constructs weighted factors along the frequency axis to guide the network's enhanced perception of high-frequency information, thereby more effectively identifying typical high-frequency abnormalities in tremor, such as abnormal blood flow and turbulence characteristics.
[0148] Specifically, let the feature map of a certain jump connection in the network be a tensor ,in Indicates the number of channels, represents the frequency axis dimension, Indicates the time axis dimension. The sampling rate is set to , then The actual frequency value corresponding to the frequency index is:
[0149] ,
[0150] In this embodiment, a frequency weighting function is also set , used to mark the attention intensity at each frequency position. It is defined as follows:
[0151] ,
[0152] in, is the high frequency enhancement factor. In this embodiment, The value range is The above frequency weights are expanded in the channel dimension and broadcast along the time dimension to construct a shape of The attention weight tensor The weight tensor is the same as the original feature map Perform element-by-element multiplication to obtain the high-frequency enhanced feature map , which is calculated as follows:
[0153] ,
[0154] The enhancement operation does not change the structure and parameters of the network, but is only embedded as a modulation module in the feature propagation path, effectively guiding the model to strengthen its attention to high-frequency areas, improving the ability to characterize high-frequency anomalies in the tremor audio spectrum without introducing additional complexity.
[0155] In step S43, the noise prediction network is trained to accurately estimate the Gaussian noise component added during each diffusion step, thereby supporting spectrogram reconstruction during the inverse diffusion process. This training process uses only "normal" samples of the fistula tremor amplitude spectrum for supervised learning to capture the normal distribution characteristics of the spectrogram.
[0156] During the training phase, the input spectrogram Randomly sample diffusion time steps according to the forward diffusion process , get Noise spectrum of the step The diffusion process satisfies the following form:
[0157] ,
[0158] in, represents a noisy image sampled from a standard normal distribution, Cumulative retention factor, The diffusion process is The noise ratio of the step.
[0159] Afterwards, With the diffusion time step Send them to the network together and output the noise prediction results , used to restore the frequency domain structure of the original spectrogram.
[0160] By minimizing the above loss function, the model is guided to learn the mapping relationship of recovering the noise residual from the noisy image, so that it has the ability to denoise and thus achieve accurate reconstruction of the spectrogram.
[0161] In this embodiment, to improve the model's sensitivity to high-frequency, low-amplitude regions in the tremolo audio spectrogram, the logarithmic mean square error (log-MSE) loss function is used as the training objective, replacing the conventional MSE loss function. This enhances the model's fitting ability in low-amplitude regions, especially high-frequency components. The log-MSE loss function is defined as follows:
[0162] ,
[0163] in, is the original spectrum, is the reconstructed spectrum predicted by the model. To prevent zero values from appearing in the logarithmic calculation, a smoothing term is used to avoid instability when the input value is zero or extremely small. By minimizing the log-MSE loss function, the network is guided to focus on the modeling accuracy of low-amplitude regions in the spectrogram, thereby improving sensitivity to abnormal tremor characteristics and providing more discriminative results for the subsequent anomaly detection module.
[0164] Step S44: After completing the model training, the deterministic sampling strategy in Denoising Diffusion Implicit Models (DDIM) is used to extract the initial Gaussian noise image. Start the reverse diffusion process and gradually restore a clear amplitude spectrum .
[0165] Specifically, let the initial random noise spectrum be , the diffusion time step is from Decrease to At each time step, the trained noise prediction network is used to predict the current noisy spectrogram. Perform denoising estimation and calculate the corresponding residual , and update the spectrum accordingly. The iterative calculation method is as follows:
[0166] ,
[0167] in, is the noise attenuation coefficient of the current diffusion step, is the cumulative retention factor, represents a random disturbance from a standard normal distribution.
[0168] Furthermore, in this embodiment, in order to speed up the inference process and improve the reconstruction stability, the interval sampling step size is set under the DDIM framework, that is, using less than Iterate the process step by step to make the generation process converge to a stable spectrum efficiently.
[0169] Specifically, the iterative process starts from to Execute in sequence, and finally output the reconstructed spectrum with the same size and frequency range as the original amplitude spectrum .
[0170] based on Figure 1 In the embodiment shown, in this embodiment, step S50 restores the tremolo sample based on inverse short-time Fourier transform, including:
[0171] Step S51, reconstructing the amplitude spectrum in step S44 Perform denormalization to restore its amplitude in the original physical quantity space. The denormalization operation calculation formula is as follows:
[0172] ,
[0173] in, is the reconstructed amplitude spectrum after denormalization, is the normalized reconstructed amplitude spectrum, and They are the amplitude spectra after fixed dimension recorded in step S30 Minimum value of With the maximum value .
[0174] Step S52: The amplitude spectrum after denormalization in step S51 is The phase spectrum after the dimension is fixed in step S33 Perform fusion and construct a reconstructed complex spectrum graph .in, represents the timeframe index, Represents the frequency index. The calculation method of the reconstructed complex spectrum is as follows:
[0175] ,
[0176] in, represents the imaginary unit, To reconstruct the complex spectrum, it contains amplitude and phase information in the frequency domain.
[0177] Step S53: reconstruct the complex spectrum Perform inverse short-time Fourier transform to obtain the final restored time domain tremolo signal , where n is the sampling point index.
[0178] Specifically, the complex spectrum diagram reconstructed in step S52 is , through discrete inverse Fourier transform, the time domain signal segment corresponding to each frame is obtained , and its calculation formula is:
[0179] ,
[0180] in, is the number of Fourier transform points, Indicates time frame The corresponding signal segment has a length of The real part sequence of .
[0181] In order to ensure the continuity between frames and eliminate edge effects, the embodiment of the present invention uses a frame shift method to overlap and sum the signal segments of each frame to form a complete time domain signal. , and its reconstruction formula is:
[0182] ,
[0183] in, is the frame shift step length, is the total number of frames, is the window function, For the The signal segment obtained by frame inverse transformation. The sum of all overlapping positions constitutes the final restored audio signal .
[0184] Furthermore, in order to maintain consistency with the forward short-time Fourier transform operation in step S30, the parameters such as the window function type, window function length, frame shift step, and Fourier transform points used in the inverse short-time Fourier transform are completely consistent with those in the short-time Fourier transform to ensure the reversibility and physical consistency of the forward and inverse transforms.
[0185] based on Figure 1 In the embodiment shown, in this embodiment, step S60 includes:
[0186] Step S61, the original fistula tremor sound sample Instead of reconstructing the fistula tremor sample Multi-dimensional feature extraction and fusion are performed. In order to effectively characterize the reconstruction characteristics of the signal in different frequency bands, a finite unit impulse response (FIR) filter bank that satisfies the Nyquist sampling theorem is used to decompose the signal into frequency bands. The designed filter bank divides the signal into low frequency band (0-200Hz), mid frequency band (200-800Hz) and high frequency band (800-8000Hz) by different cutoff frequencies. The transfer function of the frequency band filter is defined as:
[0187] ,
[0188] in, is the filter coefficient of the corresponding frequency band, is the filter order.
[0189] Furthermore, the root mean square error (RMSE) between the original signal and the reconstructed signal is calculated for each of the three frequency bands mentioned above to measure the fidelity of the reconstruction quality within the frequency band. The formula is as follows:
[0190] ,
[0191] in, Indicates the The set of sampling points corresponding to the frequency band, is the number of points in the set.
[0192] At the same time, in order to reflect the energy distribution characteristics of the reconstructed signal in each frequency band, its energy proportion is calculated:
[0193] ,
[0194] in, is the total number of signal sampling points.
[0195] Furthermore, the above six features Combined into the original feature vector , and the Z-Score method is used to perform standardization based on the statistics of normal samples in the training set to obtain the normalized feature vector Among them, the mean vector used in the standardization process is and standard deviation vector The statistical results of normal samples from the training set ensure that the features of each dimension have balanced weights in model training and avoid training bias caused by dimensional differences.
[0196] In step S62, the normalized normal sample feature vector set is further , the expectation-maximization (EM) algorithm is used to train a Gaussian mixture model (GMM) with 5 components to model the distribution of normal samples in the feature space. The probability density function of the model is:
[0197] ,
[0198] in, For the The weight of the components (satisfying ), and are the mean and covariance matrices of the component respectively.
[0199] Maximize the log-likelihood function of the training sample by iteration:
[0200] ,
[0201] Optimize the model parameter set Among them, in the E step of the EM algorithm, according to the current parameter estimate, the probability that each sample belongs to the The posterior probability of each Gaussian component is obtained; in the M step, the samples are weighted according to the above responsibility, and the parameter estimates of each component are updated, including the mean, covariance and weight coefficient.
[0202] Specifically, in the embodiment of the present invention, the number of components It is set to 5, that is, 5 Gaussian components are used to model the characteristic distribution of normal samples.
[0203] After the model training is completed, the log-likelihood values of all normal samples are calculated to obtain their mean and standard deviation
[0204] Furthermore, according to the 3σ principle, the anomaly detection threshold is set .
[0205] In step S63, for any sample to be tested, its feature vector is first extracted and normalized to , and then calculate its log-likelihood value under the GMM model If the log-likelihood value is lower than the threshold τ, the sample is determined to be abnormal; otherwise, it is normal.
[0206] Furthermore, to quantify the degree of abnormality, its standardized log-likelihood ratio is calculated: ,
[0207] when It indicates that the sample deviates significantly from the normal distribution, and the greater the degree of abnormality.
[0208] Furthermore, the final output results include three items: classification label (normal / abnormal), abnormality index (Z value) and feature contribution. Among them, the feature contribution is calculated by calculating the absolute value of the gradient of the log-likelihood function for each feature component. The obtained information is used to quantitatively measure the influence of each frequency band feature on the classification results, thereby providing auxiliary information with explanatory and reference value for clinical practice.
[0209] Reference Figure 2 The present application also provides an arteriovenous fistula anomaly detection system based on reversible audio-visual transformation and diffusion model, characterized in that the system includes:
[0210] The acquisition module uses a capacitive sensor to collect samples of the fistula tremor sound produced by blood flowing through the fistula. Professionals will determine the state of the fistula stenosis, mark relevant information, and establish a sample database;
[0211] A preprocessing module, performing preprocessing such as noise reduction, signal enhancement, and normalization on the fistula tremor sound sample;
[0212] a reversible audio-visual conversion module, which converts the fistula tremor sound sample into a complex spectrum using short-time Fourier transform and its inverse transform, separates the amplitude spectrum and phase spectrum, combines the reconstructed amplitude spectrum after the image reconstruction module with the original phase spectrum, and restores the reconstructed fistula tremor sound sample through inverse short-time Fourier transform;
[0213] The image reconstruction module adds noise to the amplitude spectrum through a forward diffusion process, defines a series of gradually increasing noise scale parameters, divides the spectrum into sub-regions in the frequency dimension and applies different noise perturbation parameters, with a larger noise scale set in the high-frequency region. It then uses a denoising network based on U-Net and embedded in a high-frequency attention mechanism to perform reverse denoising, generating a reconstructed amplitude spectrum that matches the normal sample distribution.
[0214] The detection module decomposes the original and reconstructed fistula tremor samples into frequency bands and extracts the reconstruction error and energy ratio characteristics of each frequency band; uses a multi-component Gaussian mixture model to model the characteristic distribution of normal samples and The log-likelihood threshold is set according to the principle; by comparing the log-likelihood value of the test sample with the threshold, it is determined whether it is abnormal and the result is output.
[0215] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Those skilled in the art should understand that the present invention is not limited by the above embodiment. The above embodiment and description only describe the principles of the present invention. Various changes and improvements may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and improvements fall within the scope of the invention claimed. Therefore, the scope of protection of the present application shall be based on the scope of protection of the claims.
Claims
1. A method for processing fistula tremor data based on reversible audio-visual conversion and diffusion model, characterized in that: The steps include: Step S10, establishing a fistula tremor sound sample database; Step S20, pre-processing the fistula tremor sound sample; Step S30, converting the pre-processed fistula tremor sound sample into an amplitude spectrum and a phase spectrum using a reversible audio-visual conversion; Step S40, inputting the amplitude spectrum into the diffusion model trained with normal samples, and generating an amplitude spectrum that matches the normal sample distribution through denoising and reconstruction; Step S50, combining the reconstructed amplitude spectrum with the original phase spectrum and restoring it into a reconstructed fistula tremor sound sample by using a reversible audio-visual transformation; Step S60, calculating the reconstruction error and energy characteristics of the original and reconstructed fistula tremor samples by frequency band, forming feature vectors, training a multi-cluster Gaussian clustering model, and setting a threshold based on the log-likelihood value to achieve abnormal classification; Wherein, the step S40 includes the following steps: Step S41, defining gradually increasing noise scale parameters for the original amplitude spectrum , construct the conditional probability distribution and recursively sample the noisy image through the formula, and apply different noise perturbations in the frequency dimension division area, setting a larger noise scale in the high-frequency area; Step S42: construct a noise prediction network based on U-Net, introduce a high-frequency attention mechanism, construct an attention weight tensor through frequency value calculation and frequency weighting function, and enhance the model's attention to high-frequency areas; Step S43: Using the amplitude spectrogram sample labeled "normal" for training, generating a noisy spectrogram through forward diffusion and inputting it into the network, and training the noise prediction network using the logarithmic domain mean square error loss function; Step S44, using a deterministic sampling strategy, performing an inverse diffusion process starting from the initial Gaussian noise image, and gradually restoring a clear reconstructed amplitude spectrum through a deterministic sampling formula; The logarithmic domain mean square error loss function in step S43 is: , in, is the original amplitude spectrum, is the reconstructed amplitude spectrum predicted by the model, To prevent the occurrence of zero-valued smoothing terms in logarithmic calculations, and are the horizontal and vertical coordinates of the amplitude spectrum; The deterministic sampling formula in step S44 is: , Where t is the time step in the reverse diffusion process, For the time step The noisy amplitude spectrum of is the noise attenuation coefficient of the current diffusion step, is the cumulative retention factor, is the noise prediction result, For the time step Preset noise scale parameters, represents a random disturbance from a standard normal distribution; Wherein, the step S50 includes the following steps: Step S51, performing denormalization processing on the reconstructed amplitude spectrum to restore the original amplitude; Step S52, fusing the denormalized reconstructed amplitude spectrum with the resampled phase spectrum to construct a reconstructed complex spectrum containing amplitude and phase information; Step S53, performing an inverse short-time Fourier transform on the complex spectrogram, generating a complete time-domain reconstructed audio signal by discrete inverse Fourier transform and frame-shifted overlap-addition, and using the same inverse short-time Fourier transform parameters as the forward short-time Fourier transform to ensure reversibility; Wherein, the step S60 includes the following steps: Step S61: divide the original and reconstructed fistula tremor sounds into frequency bands, calculate the reconstruction error and energy characteristics of each frequency band, and establish a feature vector ; Step S62: normalize the features of large-scale normal samples, train a multi-component Gaussian mixture model, fit the normal distribution features, and set the anomaly detection threshold based on the 3σ principle. ; Step S63: Calculate the log-likelihood value corresponding to the frequency band feature of the sample to be detected, and compare it with the anomaly detection threshold. Compare, determine whether there is an abnormality, and output the result.
2. The method for processing fistula tremor data based on reversible audio-visual conversion and diffusion model according to claim 1, characterized in that: The step S20 includes the following steps: Step S21, performing noise reduction processing on the fistula tremor sound sample through an adaptive filter; Step S22, performing frequency band gain on the fistula tremor sound sample by short-time Fourier transform to enhance the signal; Step S23, normalizing the fistula tremor sound samples using a minimum-maximum normalization method; Step S24 , normalizing the normalized fistula tremor sound samples and performing an abnormal point correction operation.
3. The method for processing fistula tremor data based on reversible audio-visual conversion and diffusion model according to claim 2, characterized in that: The step S22 performs frequency band gain adjustment on the fistula tremor sound sample by short-time Fourier transform, and the calculation formula is: , in, is the adjusted time spectrum of the fistula tremor, The frequency corresponding to the characteristic frequency band of fistula tremor scope, is the gain factor, The denoised fistula tremor signal The time spectrum after short-time Fourier transform is represents the timeframe index, Indicates frequency index; The time-domain enhanced signal is obtained by inverse short-time Fourier transform of the adjusted time-frequency spectrum: , in, To reconstruct the time domain fistula tremor enhancement signal, is the number of sampling points of the fistula tremor signal, is the number of time frames, Frequency The number of 4. The method for processing fistula tremor data based on reversible audio-visual conversion and diffusion model according to claim 1, characterized in that: The step S30 includes the following steps: Step S31, converting the normalized and outlier-processed fistula tremor sound samples into an amplitude spectrum and a phase spectrum using short-time Fourier transform; Step S32, performing frequency domain cropping on the amplitude spectrum and the phase spectrum; Step S33, performing bilinear interpolation resampling on the truncated amplitude spectrum and phase spectrum respectively; Step S34: normalize the resampled amplitude spectrum and phase spectrum.
5. An arteriovenous fistula abnormality detection system based on reversible audio-visual transformation and diffusion model, used to execute the fistula tremor sound data processing method based on reversible audio-visual transformation and diffusion model according to any one of claims 1 to 4, characterized in that: include: An acquisition module is used to collect fistula tremor samples and establish a sample database containing annotation information; A preprocessing module, configured to perform noise reduction, signal enhancement, and normalization preprocessing operations on the internal fistula tremor sound sample; a reversible audio-visual conversion module, configured to convert the fistula tremor sound sample into a complex spectrum, separate the spectrum into an amplitude spectrum and a phase spectrum, combine the reconstructed amplitude spectrum generated by the image reconstruction module with the original phase spectrum, and restore the reconstructed fistula tremor sound sample through an inverse transformation; An image reconstruction module is used to apply multi-scale noise perturbations to the amplitude spectrum, perform step-by-step image reconstruction based on a diffusion model, and introduce an attention mechanism to improve the modeling capability of high-frequency regions, thereby generating a reconstructed spectrum that conforms to the normal sample distribution; The detection module is used to perform frequency analysis and feature extraction on the original and reconstructed tremor samples, construct frequency band error and energy ratio feature vectors, train the abnormality discrimination model and set the discrimination threshold to achieve abnormal identification and result output of the internal fistula stenosis state.
Citation Information
Patent Citations
Arteriovenous fistula three-dimensional model construction device and method
CN120000250A
Screening diagnostic technique for arteriovenous fistula stenosis in patients with end-stage chronic renal disease
RU2508544C1