Sound anomaly detection method, device, equipment and medium based on self-supervised learning
Through self-supervised learning methods, the positive sample sound data is enhanced and features are extracted, and the mean and covariance of the sound wave feature data are calculated, which solves the problem of more normal samples and fewer abnormal samples and improves the accuracy of sound anomaly detection.
Patent Information
- Application Number
- CN202411702861.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-11-25
AI Technical Summary
In existing sound anomaly detection methods, there are more normal samples and fewer abnormal samples, resulting in poor model training results and low accuracy.
A self-supervised learning method is used to obtain a positive sample sound data set for speech enhancement, train a feature extraction model, calculate the mean and covariance of the sound wave feature data, and use the standard sound wave mean and covariance to determine whether the sound data to be tested is abnormal.
The accuracy of sound anomaly detection is improved, the demand for abnormal samples is reduced, and the fault tolerance of the model and the accuracy of the detection results are enhanced.
Smart Images

Figure CN119580772B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a sound anomaly detection method, device, electronic device and readable storage medium based on self-supervised learning. Background Art
[0002] Sound anomaly detection refers to the process of detecting the sound data to be tested based on the gap between the sound data and the sound data. For example, in the field of medical devices, the sound of the pacemaker to be tested when it is working can be compared with the sound of a normal pacemaker when it is working to determine whether the pacemaker to be tested has any abnormalities.
[0003] Currently, common sound anomaly detection methods mostly collect abnormal sound data and use it to train specific models to achieve the purpose of sound anomaly detection. However, existing methods also have some problems. For example, there are many normal samples and few abnormal samples, and supervised learning cannot be directly used, resulting in poor model training results and low sound anomaly detection accuracy. Summary of the Invention
[0004] The present invention provides a sound anomaly detection method, device, electronic device and readable storage medium based on self-supervised learning, which aims to improve the accuracy of sound anomaly detection.
[0005] To achieve the above objectives, the present invention provides a method for detecting sound anomalies based on self-supervised learning, the method comprising:
[0006] Acquiring a positive sample sound data set and sound data to be tested, and performing speech enhancement on the positive sample sound data set to obtain an enhanced sample sound data set;
[0007] Using the positive sample sound data set and the enhanced sample sound data set to train a preset feature extraction model to obtain a trained feature extraction model;
[0008] Using the trained feature extraction model, the features of the positive sample sound data set and the sound data to be tested are respectively extracted to obtain a standard sound wave feature data set and sound wave feature data to be tested;
[0009] Calculating the mean and covariance of the acoustic wave feature data set respectively to obtain a standard acoustic wave mean and a standard acoustic wave covariance;
[0010] The distance between the sound wave feature data to be measured and the sound wave feature data set is calculated based on the standard sound wave mean and the standard sound wave covariance, and when the distance is greater than a preset threshold, the sound data to be measured is determined to be abnormal data.
[0011] Optionally, the using the positive sample sound dataset and the enhanced sample sound dataset to train a preset feature extraction model to obtain a trained feature extraction model includes:
[0012] Encoding the positive sample sound data in the positive sample sound data set and the enhanced sample sound data in the enhanced sample sound data set using a coding layer in a preset feature extraction model to obtain a positive sample sound coding vector and an enhanced sample sound coding vector;
[0013] Using the convolution layer in the preset feature extraction model to perform convolution operations on the positive sample sound coding vector and the enhanced sample sound coding vector, respectively, to obtain a positive sample sound feature vector and an enhanced sample sound feature vector;
[0014] According to the positive sample sound feature vector and the enhanced sample sound feature vector, a preset loss function is used to calculate the loss value between the positive sample sound data in the positive sample sound data set and the enhanced sample sound data in the enhanced sample sound data set, and the parameters of the preset feature extraction model are iteratively adjusted according to the loss value until the loss value meets the preset conditions, thereby obtaining a trained feature extraction model.
[0015] Optionally, the calculating, based on the positive sample sound feature vector and the enhanced sample sound feature vector, a loss value between the positive sample sound data in the positive sample sound dataset and the enhanced sample sound data in the enhanced sample sound dataset using a preset loss function includes:
[0016] The loss value Loss(·) between the positive sample sound data in the positive sample sound data set and the enhanced sample sound data in the enhanced sample sound data set is calculated using the following formula:
[0017]
[0018] Among them, sim represents the cosine similarity function, z i represents the positive sample sound feature vector corresponding to the i-th positive sample sound data in the positive sample sound data set, represents the enhanced sample sound feature vector of the enhanced sample sound data corresponding to the i-th positive sample sound data, z j represents the positive sample sound feature vector corresponding to the j-th positive sample sound data in the positive sample sound data set, where j≠i, and ρ represents a preset scaling parameter.
[0019] Optionally, performing speech enhancement on the positive sample sound dataset to obtain an enhanced sample sound dataset includes:
[0020] performing tone conversion on the positive sample sound data in the positive sample sound data set to obtain a first enhanced sample sound data set;
[0021] Performing audio adjustment on the positive sample sound data in the positive sample sound data set to obtain a second enhanced sample sound data set;
[0022] injecting white noise data into the positive sample sound data in the positive sample sound data set to obtain a third enhanced sample sound data set;
[0023] The first enhanced sample sound data set, the second enhanced sample sound data set, and the third enhanced sample sound data set are aggregated to obtain an enhanced sample sound data set.
[0024] Optionally, obtaining the positive sample sound data set and the sound data to be tested includes:
[0025] Obtaining positive sample sound model data and test sound model data;
[0026] Periodically scanning the positive sample sound model data and the sound model data to be tested respectively to obtain a positive sample sound discrete signal and a sound discrete signal to be tested;
[0027] Classifying the instantaneous values of the positive sample sound discrete signal and the instantaneous values of the sound discrete signal to be tested into different levels according to the magnitudes of the instantaneous values of the positive sample sound discrete signal and the instantaneous values of the sound discrete signal to be tested;
[0028] The levels of instantaneous values in the positive sample sound discrete signal and the test sound discrete signal are respectively converted into binary codes to obtain a positive sample sound data set and a test sound data set.
[0029] Optionally, respectively calculating the mean and covariance of the acoustic wave feature data set to obtain a standard acoustic wave mean and a standard acoustic wave covariance includes:
[0030] Calculating the sum vector of each acoustic wave feature data in the acoustic wave feature data set, and calculating the mean of the acoustic wave feature data set according to the number of acoustic wave feature data in the acoustic wave feature data set and the sum vector of each acoustic wave feature data, to obtain a standard acoustic wave mean vector;
[0031] Calculating a difference vector between each acoustic wave feature data in the acoustic wave feature data set and the standard acoustic wave mean, and transposing the difference to obtain a transposed difference vector;
[0032] multiplying the difference vector by the transposed difference vector to obtain a difference product vector;
[0033] The sum of the difference product vectors corresponding to each acoustic wave feature data in the acoustic wave feature data set is calculated to obtain a standard acoustic wave covariance.
[0034] Optionally, calculating the distance between the acoustic wave feature data to be measured and the acoustic wave feature data set according to the standard acoustic wave mean and the standard acoustic wave covariance includes:
[0035] Calculating a difference vector of the sound wave to be measured between the characteristic data of the sound wave to be measured and the mean vector of the standard sound wave, and transposing the difference vector of the sound wave to be measured to obtain a transposed difference vector of the sound wave to be measured;
[0036] The measured sound wave difference vector is multiplied by the inverse of the standard sound wave covariance vector, and the multiplication result is multiplied by the measured sound wave inverted difference vector to obtain the distance between the measured sound wave feature data and the sound wave feature data set.
[0037] In order to solve the above problems, the present invention further provides a sound anomaly detection device based on self-supervised learning, the device comprising:
[0038] A voice data enhancement module is used to obtain a positive sample voice data set and the voice data to be tested, and perform voice enhancement on the positive sample voice data set to obtain an enhanced sample voice data set;
[0039] A feature extraction model training module is used to train a preset feature extraction model using the positive sample sound data set and the enhanced sample sound data set to obtain a trained feature extraction model;
[0040] The sound data detection module to be tested is used to use the trained feature extraction model to respectively extract the features of the positive sample sound data set and the sound data to be tested, obtain the standard sound wave feature data set and the sound wave feature data to be tested, respectively calculate the mean and covariance of the sound wave feature data set to obtain the standard sound wave mean and the standard sound wave covariance, calculate the distance between the sound wave feature data to be tested and the sound wave feature data set based on the standard sound wave mean and the standard sound wave covariance, and when the distance is greater than a preset threshold, determine that the sound data to be tested is abnormal data.
[0041] In order to solve the above problem, the present invention further provides an electronic device, comprising:
[0042] a memory storing at least one computer program; and
[0043] The processor executes the computer program stored in the memory to implement the above-mentioned sound anomaly detection method based on self-supervised learning.
[0044] To solve the above problems, the application further provides a computer readable storage medium, wherein at least one computer program is stored in the computer readable storage medium, and the at least one computer program is executed by a processor in an electronic device to implement the above-mentioned sound anomaly detection method based on self-supervised learning.
[0045] The embodiment of the application trains the feature extraction model by using the standard sound wave data of the normal instrument, obtains the similarity and invariance of the standard sound wave data of the normal instrument by using the multi-task self-supervised model, further calculates the mean and covariance of the extracted standard sound wave feature data set, avoids the occurrence of extreme data in the normal instrument standard sound wave data, and thus causes errors in the sound anomaly detection based on self-supervised learning, improves the accuracy of the sound anomaly detection based on self-supervised learning, finally calculates the distance between the to-be-detected sound wave feature data and the sound wave feature data set, and judges whether the to-be-detected instrument is abnormal according to the distance, reduces the demand for abnormal samples during model training, and improves the accuracy of the sound anomaly detection based on self-supervised learning. Therefore, the sound anomaly detection method, device, equipment and storage medium based on self-supervised learning provided by the application can improve the accuracy of the sound anomaly detection based on self-supervised learning. BRIEF DESCRIPTION OF DRAWINGS
[0046] Figure 1 The flowchart of the sound anomaly detection method based on self-supervised learning provided by an embodiment of the application is shown in the figure.
[0047] Figure 2 And Figure 3 The detailed implementation flowchart of one step of the sound anomaly detection method based on self-supervised learning provided by an embodiment of the application is shown in the figure.
[0048] Figure 4 The module schematic diagram of the sound anomaly detection device based on self-supervised learning provided by an embodiment of the application is shown in the figure.
[0049] Figure 5 The internal structure schematic diagram of the electronic device for implementing the sound anomaly detection method based on self-supervised learning provided by an embodiment of the application is shown in the figure.
[0050] The implementation, functional features and advantages of the application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the application, and are not used to limit the application.
[0052] An embodiment of the present invention provides a method for detecting sound anomalies based on self-supervised learning. The execution subject of the method for detecting sound anomalies based on self-supervised learning includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for detecting sound anomalies based on self-supervised learning can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server may include an independent server, or may include a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0053] Reference Figure 1 FIG. 1 is a flow chart of a method for detecting anomalies of sound based on self-supervised learning according to an embodiment of the present invention. In the embodiment of the present invention, the method for detecting anomalies of sound based on self-supervised learning includes:
[0054] S1. Obtain a positive sample sound data set and sound data to be tested, and perform speech enhancement on the positive sample sound data set to obtain an enhanced sample sound data set.
[0055] In an embodiment of the present invention, the sound data included in the positive sample sound dataset may be digital sound data of a normal instrument. The sound data to be tested may be digital sound data of an instrument whose normal operation is uncertain and needs to be tested. For example, in the medical field, the normal operation of medical equipment is extremely important for diagnosis, and it is necessary to detect whether the equipment is normal through sound. Therefore, it is necessary to obtain the sound data to be tested during the operation of the equipment to detect whether the new equipment can be used normally.
[0056] In an optional embodiment of the present invention, the sound model data of the normal instrument and the instrument to be tested are converted into sound digital data that can be written into a computer using a pulse code modulation method, thereby realizing the digital-to-analog conversion of the sound waveform, so that the positive sample sound data and the sound data to be tested can be input into the model.
[0057] Specifically, refer to Figure 2 As shown, the obtaining of the positive sample sound data set and the sound data to be tested includes:
[0058] S11, obtaining positive sample sound model data and test sound model data;
[0059] S12, periodically scanning the positive sample sound model data and the sound model data to be tested, respectively, to obtain a positive sample sound discrete signal and a sound discrete signal to be tested;
[0060] S13, classifying the instantaneous values of the positive sample sound discrete signal and the instantaneous values of the sound discrete signal to be tested into different levels according to the magnitudes of the instantaneous values of the positive sample sound discrete signal and the instantaneous values of the sound discrete signal to be tested;
[0061] S14. Convert the levels of instantaneous values in the positive sample sound discrete signal and the test sound discrete signal into binary codes respectively to obtain a positive sample sound data set and a test sound data set.
[0062] In an optional embodiment of the present invention, the instantaneous voltage values of the positive sample sound model data and the sound model data to be tested can be collected continuously at fixed time intervals through high-frequency detection, and then the instantaneous voltage values are divided into different levels. The collected instantaneous voltage values are divided into different levels using the rounding principle to reduce the workload. Finally, each sampled voltage level needs to be converted into a binary code that can be recognized by the computer, thereby completing the conversion of the reference audio data into a reference audio digital signal, and then the positive sample sound data set and the sound data to be tested are written into the computer.
[0063] The embodiment of the present invention performs speech enhancement on the positive sample sound dataset to obtain an enhanced sample sound dataset, thereby enriching the types of training texts, improving the efficiency of model self-supervision, and improving the fault tolerance of the model.
[0064] Furthermore, as an optional embodiment of the present invention, performing speech enhancement on the positive sample sound dataset to obtain the enhanced sample sound dataset includes:
[0065] performing tone conversion on the positive sample sound data in the positive sample sound data set to obtain a first enhanced sample sound data set;
[0066] Performing audio adjustment on the positive sample sound data in the positive sample sound data set to obtain a second enhanced sample sound data set;
[0067] injecting white noise data into the positive sample sound data in the positive sample sound data set to obtain a third enhanced sample sound data set;
[0068] The first enhanced sample sound data set, the second enhanced sample sound data set, and the third enhanced sample sound data set are aggregated to obtain an enhanced sample sound data set.
[0069] In the embodiment of the present invention, the audio adjustment generally refers to methods such as audio fast play, audio slow play, and audio reverse play.
[0070] In the optional embodiment of the present application, the normal sample sound data is enhanced by the methods of tone conversion, audio fast play, audio slow play, audio reverse play and white noise injection to obtain enhanced sample sound data, so that the model can more accurately identify the sound data of normal instruments, thereby finding out the sound data of abnormal instruments and improving the accuracy of model sound identification.
[0071] Further, in the optional embodiment of the present application, the audio of the normal sample sound data can be adjusted by the method of manual adjustment, or the audio of the normal sample sound data can be adjusted according to the set script.
[0072] S2, training a preset feature extraction model by using the normal sample sound data set and the enhanced sample sound data set to obtain a trained feature extraction model.
[0073] In the embodiment of the present application, the preset feature extraction model can be a speech recognition model constructed based on a neural network, and can be constructed based on a Transformer structure.
[0074] In an optional embodiment of the present application, the preset feature extraction model is trained by using the normal sample sound data set and the enhanced sample sound data set to ensure the applicability of the feature extraction model, thereby improving the accuracy of the feature extraction model.
[0075] Further, as an optional embodiment of the present application, referring to FIG. 1, Figure 3 the training of the preset feature extraction model by using the normal sample sound data set and the enhanced sample sound data set to obtain a trained feature extraction model includes:
[0076] S21, encoding the normal sample sound data in the normal sample sound data set and the enhanced sample sound data in the enhanced sample sound data set by using the encoding layers in the preset feature extraction model to obtain normal sample sound encoding vectors and enhanced sample sound encoding vectors;
[0077] S22, performing convolution operations on the normal sample sound encoding vectors and the enhanced sample sound encoding vectors by using the convolution layers in the preset feature extraction model to obtain normal sample sound feature vectors and enhanced sample sound feature vectors;
[0078] S23, calculating a loss value between the normal sample sound data in the normal sample sound data set and the enhanced sample sound data in the enhanced sample sound data set by using a preset loss function according to the normal sample sound feature vectors and the enhanced sample sound feature vectors, and iteratively adjusting parameters of the preset feature extraction model according to the loss value until the loss value meets a preset condition, thereby obtaining a trained feature extraction model.
[0079] In the embodiment of the present invention, the encoding layer may be used to convert a signal into another signal that can be received by the model. The convolution layer may be used to compress the signal.
[0080] Furthermore, as an optional embodiment of the present invention, the calculating, based on the positive sample sound feature vector and the enhanced sample sound feature vector, a loss value between the positive sample sound data in the positive sample sound dataset and the enhanced sample sound data in the enhanced sample sound dataset using a preset loss function includes:
[0081] The loss value Loss(·) between the positive sample sound data in the positive sample sound data set and the enhanced sample sound data in the enhanced sample sound data set is calculated using the following formula:
[0082]
[0083] Among them, sim represents the cosine similarity function, z i represents the positive sample sound feature vector corresponding to the i-th positive sample sound data in the positive sample sound data set, represents the enhanced sample sound feature vector of the enhanced sample sound data corresponding to the i-th positive sample sound data, z j represents the positive sample sound feature vector corresponding to the j-th positive sample sound data in the positive sample sound data set, where j≠i, and ρ represents a preset scaling parameter.
[0084] In an optional embodiment of the present invention, in order to make the distribution of the loss function smoother or sharper, it is necessary to introduce a scaling parameter, where the scaling parameter is an artificially set model hyperparameter, and the value of the scaling parameter ρ is different in different scenarios.
[0085] In an optional implementation of the present invention, the positive sample sound data set and the enhanced sample sound data set are used as sample sets and input into a preset feature extraction model for training to obtain a trained feature extraction model, thereby improving the accuracy of the feature extraction model and also improving the accuracy of the sound data detection results when the instrument is abnormal.
[0086] S3. Utilize the trained feature extraction model to extract features of the positive sample sound data set and the sound data to be tested, respectively, to obtain a standard sound wave feature data set and sound wave feature data to be tested.
[0087] In an optional embodiment of the present invention, in order to determine the difference between the sound data to be tested and the positive sample sound data, the features of the positive sample sound data set and the sound data to be tested can be extracted respectively by utilizing the trained feature extraction model, thereby converting the comparison of the sound data into a conversion of feature vectors, simplifying the difficulty of comparing the sound data and improving the accuracy of the sound data comparison results.
[0088] Furthermore, as an optional embodiment of the present invention, the step of extracting the features of the positive sample sound data set and the sound data to be tested respectively using the trained feature extraction model is similar to the process of extracting the positive sample sound feature vector and the enhanced sample sound feature vector, so it is not repeated here.
[0089] S4. Calculate the mean and covariance of the acoustic wave feature data set respectively to obtain a standard acoustic wave mean and a standard acoustic wave covariance.
[0090] In detail, as an optional embodiment of the present invention, respectively calculating the mean and covariance of the acoustic wave feature data set to obtain the standard acoustic wave mean and the standard acoustic wave covariance includes:
[0091] Calculating the sum vector of each acoustic wave feature data in the acoustic wave feature data set, and calculating the mean of the acoustic wave feature data set according to the number of acoustic wave feature data in the acoustic wave feature data set and the sum vector of each acoustic wave feature data, to obtain a standard acoustic wave mean vector;
[0092] Calculating a difference vector between each acoustic wave feature data in the acoustic wave feature data set and the standard acoustic wave mean, and transposing the difference to obtain a transposed difference vector;
[0093] multiplying the difference vector by the transposed difference vector to obtain a difference product vector;
[0094] The sum of the difference product vectors corresponding to each acoustic wave feature data in the acoustic wave feature data set is calculated to obtain a standard acoustic wave covariance.
[0095] In an optional embodiment of the present invention, the mean of the acoustic wave feature data set may be calculated using the following formula to obtain the standard acoustic wave mean μ:
[0096]
[0097] Among them, z i represents the positive sample sound feature vector corresponding to the i-th positive sample sound data in the positive sample sound data set, and N represents the total amount of positive sample sound data in the positive sample sound data set.
[0098] Furthermore, in an optional embodiment of the present invention, the covariance of the acoustic wave feature dataset can be calculated using the following formula to obtain the standard acoustic wave covariance Σ:
[0099]
[0100] Among them, z i represents the positive sample sound feature vector corresponding to the i-th positive sample sound data in the positive sample sound data set, μ represents the standard sound wave mean, T represents transpose, and N represents the total amount of positive sample sound data in the positive sample sound data set.
[0101] In an optional embodiment of the present invention, since the acoustic wave feature data set cannot be completely consistent, in order to improve the fault tolerance of the acoustic wave feature data set, the mean and covariance of the acoustic wave feature data set are respectively calculated using the formula for calculating the average value and the formula for calculating the covariance, thereby reducing the error caused by the inconsistency of the acoustic wave feature data in the acoustic wave feature data set and improving the accuracy of sound anomaly detection.
[0102] S5. Calculate the distance between the sound wave feature data to be measured and the sound wave feature data set based on the standard sound wave mean and the standard sound wave covariance, and determine that the sound wave feature data to be measured is abnormal data when the distance is greater than a preset threshold.
[0103] In the embodiment of the present invention, the preset threshold may be a numerical value of different sizes set by business personnel according to different scenarios.
[0104] The embodiment of the present invention calculates the distance between the sound wave feature data to be measured and the sound wave feature data set based on the standard sound wave mean and the standard sound wave covariance, thereby solving the problem of too few abnormal samples during sound anomaly detection and inability to perform model training, and improving the accuracy of sound anomaly detection.
[0105] In an optional embodiment of the present invention, the distance between the acoustic wave feature data to be measured and the acoustic wave feature data set may be calculated using a Mahalanobis distance formula.
[0106] Furthermore, as an optional embodiment of the present invention, calculating the distance between the acoustic wave feature data to be measured and the acoustic wave feature data set based on the standard acoustic wave mean and the standard acoustic wave covariance includes:
[0107] Calculating a difference vector of the sound wave to be measured between the characteristic data of the sound wave to be measured and the mean vector of the standard sound wave, and transposing the difference vector of the sound wave to be measured to obtain a transposed difference vector of the sound wave to be measured;
[0108] The measured sound wave difference vector is multiplied by the inverse of the standard sound wave covariance vector, and the multiplication result is multiplied by the measured sound wave inverted difference vector to obtain the distance between the measured sound wave feature data and the sound wave feature data set.
[0109] Specifically, in the embodiment of the present invention, the distance S between the acoustic wave characteristic data to be measured and the acoustic wave characteristic data set can be calculated using the following formula: test :
[0110] S test =(z test -μ) T Σ -1 (z test -μ)
[0111] Among them, z test represents the characteristic data of the sound wave to be measured, μ represents the mean value of the standard sound wave, T represents transpose, and Σ represents the covariance of the standard sound wave.
[0112] In an embodiment of the present invention, when the distance between the sound wave characteristic data to be measured and the sound wave characteristic data set is larger, it means that the sound wave characteristic data to be measured is very different from the sound wave characteristic data in the sound wave characteristic data set. Therefore, the sound data to be measured is judged to be abnormal data. Conversely, when the distance between the sound wave characteristic data to be measured and the sound wave characteristic data set is smaller, it means that the sound wave characteristic data to be measured is close to the sound wave characteristic data in the sound wave characteristic data set. Therefore, the sound data to be measured is judged to be normal data.
[0113] like Figure 4 , which is a functional module diagram of the sound anomaly detection device based on self-supervised learning of the present invention.
[0114] The self-supervised learning-based sound anomaly detection device 100 described in the present invention can be installed in an electronic device. Depending on the functionality implemented, the self-supervised learning-based sound anomaly detection device 100 can include a speech data enhancement module 101, a feature extraction model training module 102, and a test sound data detection module 103. A module, also referred to as a unit, refers to a series of computer program segments that can be executed by an electronic device processor and perform a fixed function, and is stored in the electronic device's memory.
[0115] In this embodiment, the functions of each module / unit are as follows:
[0116] The speech data enhancement module 101 is used to obtain a positive sample sound data set and sound data to be tested, and perform speech enhancement on the positive sample sound data set to obtain an enhanced sample sound data set.
[0117] In an embodiment of the present invention, the sound data included in the positive sample sound dataset may be digital sound data of a normal instrument. The sound data to be tested may be digital sound data of an instrument whose normal operation is uncertain and needs to be tested. For example, in the medical field, the normal operation of medical equipment is extremely important for diagnosis, and it is necessary to detect whether the equipment is normal through sound. Therefore, it is necessary to obtain the sound data to be tested during the operation of the equipment to detect whether the new equipment can be used normally.
[0118] In an optional embodiment of the present invention, the sound model data of the normal instrument and the instrument to be tested are converted into sound digital data that can be written into a computer using a pulse code modulation method, thereby realizing the digital-to-analog conversion of the sound waveform, so that the positive sample sound data and the sound data to be tested can be input into the model.
[0119] Specifically, obtaining the positive sample sound data set and the sound data to be tested includes:
[0120] Obtaining positive sample sound model data and test sound model data;
[0121] Periodically scanning the positive sample sound model data and the sound model data to be tested respectively to obtain a positive sample sound discrete signal and a sound discrete signal to be tested;
[0122] Classifying the instantaneous values of the positive sample sound discrete signal and the instantaneous values of the sound discrete signal to be tested into different levels according to the magnitudes of the instantaneous values of the positive sample sound discrete signal and the instantaneous values of the sound discrete signal to be tested;
[0123] The levels of instantaneous values in the positive sample sound discrete signal and the test sound discrete signal are respectively converted into binary codes to obtain a positive sample sound data set and a test sound data set.
[0124] In an optional embodiment of the present invention, the instantaneous voltage values of the positive sample sound model data and the sound model data to be tested can be collected continuously at fixed time intervals through high-frequency detection, and then the instantaneous voltage values are divided into different levels. The collected instantaneous voltage values are divided into different levels using the rounding principle to reduce the workload. Finally, each sampled voltage level needs to be converted into a binary code that can be recognized by the computer, thereby completing the conversion of the reference audio data into a reference audio digital signal, and then the positive sample sound data set and the sound data to be tested are written into the computer.
[0125] The embodiment of the present invention performs speech enhancement on the positive sample sound dataset to obtain an enhanced sample sound dataset, thereby enriching the types of training texts, improving the efficiency of model self-supervision, and improving the fault tolerance of the model.
[0126] Furthermore, as an optional embodiment of the present invention, performing speech enhancement on the positive sample sound dataset to obtain the enhanced sample sound dataset includes:
[0127] performing tone conversion on the positive sample sound data in the positive sample sound data set to obtain a first enhanced sample sound data set;
[0128] Performing audio adjustment on the positive sample sound data in the positive sample sound data set to obtain a second enhanced sample sound data set;
[0129] injecting white noise data into the positive sample sound data in the positive sample sound data set to obtain a third enhanced sample sound data set;
[0130] The first enhanced sample sound data set, the second enhanced sample sound data set, and the third enhanced sample sound data set are aggregated to obtain an enhanced sample sound data set.
[0131] In the embodiment of the present invention, the audio adjustment generally refers to methods such as audio fast play, audio slow play, and audio reverse play.
[0132] In an optional embodiment of the present invention, the positive sample sound data is enhanced by tone conversion, audio fast playback, audio slow playback, audio reverse playback and white noise injection to obtain enhanced sample sound data, so that the model can more accurately identify the sound data of normal instruments, thereby finding the sound data of abnormal instruments, and improving the accuracy of the model sound recognition.
[0133] Furthermore, in an optional embodiment of the present invention, the audio adjustment of the positive sample sound data may be performed by a manual adjustment method, or the audio adjustment of the positive sample sound data may be performed according to a set script.
[0134] The feature extraction model training module 102 is used to train a preset feature extraction model using the positive sample sound data set and the enhanced sample sound data set to obtain a trained feature extraction model.
[0135] In an embodiment of the present invention, the preset feature extraction model may be a speech recognition model constructed based on a neural network, and may be constructed based on a Transformer structure.
[0136] In an optional embodiment of the present invention, the positive sample sound dataset and the enhanced sample sound dataset are used to train a preset feature extraction model to ensure the applicability of the feature extraction model, thereby improving the accuracy of the feature extraction model.
[0137] Furthermore, as an optional embodiment of the present invention, the using the positive sample sound dataset and the enhanced sample sound dataset to train a preset feature extraction model to obtain a trained feature extraction model includes:
[0138] Encoding the positive sample sound data in the positive sample sound data set and the enhanced sample sound data in the enhanced sample sound data set using a coding layer in a preset feature extraction model to obtain a positive sample sound coding vector and an enhanced sample sound coding vector;
[0139] Using a convolution layer in a preset feature extraction model to perform convolution operations on the positive sample sound coding vector and the enhanced sample sound coding vector, respectively, to obtain a positive sample sound feature vector and an enhanced sample sound feature vector;
[0140] According to the positive sample sound feature vector and the enhanced sample sound feature vector, a preset loss function is used to calculate the loss value between the positive sample sound data in the positive sample sound data set and the enhanced sample sound data in the enhanced sample sound data set, and the parameters of the preset feature extraction model are iteratively adjusted according to the loss value until the loss value meets the preset conditions, thereby obtaining a trained feature extraction model.
[0141] In the embodiment of the present invention, the encoding layer may be used to convert a signal into another signal that can be received by the model. The convolution layer may be used to compress the signal.
[0142] Furthermore, as an optional embodiment of the present invention, the calculating, based on the positive sample sound feature vector and the enhanced sample sound feature vector, a loss value between the positive sample sound data in the positive sample sound dataset and the enhanced sample sound data in the enhanced sample sound dataset using a preset loss function includes:
[0143] The loss value Loss(·) between the positive sample sound data in the positive sample sound data set and the enhanced sample sound data in the enhanced sample sound data set is calculated using the following formula:
[0144]
[0145] Among them, sim represents the cosine similarity function, z i represents the positive sample sound feature vector corresponding to the i-th positive sample sound data in the positive sample sound data set, represents the enhanced sample sound feature vector of the enhanced sample sound data corresponding to the i-th positive sample sound data, z jrepresents the positive sample sound feature vector corresponding to the j-th positive sample sound data in the positive sample sound data set, where j≠i, and ρ represents a preset scaling parameter.
[0146] In an optional embodiment of the present invention, in order to make the distribution of the loss function smoother or sharper, it is necessary to introduce a scaling parameter, where the scaling parameter is an artificially set model hyperparameter, and the value of the scaling parameter ρ is different in different scenarios.
[0147] In an optional implementation of the present invention, the positive sample sound data set and the enhanced sample sound data set are used as sample sets and input into a preset feature extraction model for training to obtain a trained feature extraction model, thereby improving the accuracy of the feature extraction model and also improving the accuracy of the sound data detection results when the instrument is abnormal.
[0148] The sound data detection module 103 to be tested is used to use the trained feature extraction model to respectively extract the features of the positive sample sound data set and the sound data to be tested, obtain the standard sound wave feature data set and the sound wave feature data to be tested, respectively calculate the mean and covariance of the sound wave feature data set to obtain the standard sound wave mean and the standard sound wave covariance, calculate the distance between the sound wave feature data to be tested and the sound wave feature data set based on the standard sound wave mean and the standard sound wave covariance, and when the distance is greater than a preset threshold, determine that the sound data to be tested is abnormal data.
[0149] In an optional embodiment of the present invention, in order to determine the difference between the sound data to be tested and the positive sample sound data, the features of the positive sample sound data set and the sound data to be tested can be extracted respectively by utilizing the trained feature extraction model, thereby converting the comparison of the sound data into a conversion of feature vectors, simplifying the difficulty of comparing the sound data and improving the accuracy of the sound data comparison results.
[0150] Furthermore, as an optional embodiment of the present invention, the step of extracting the features of the positive sample sound data set and the sound data to be tested respectively using the trained feature extraction model is similar to the process of extracting the positive sample sound feature vector and the enhanced sample sound feature vector, so it is not repeated here.
[0151] In detail, as an optional embodiment of the present invention, respectively calculating the mean and covariance of the acoustic wave feature data set to obtain the standard acoustic wave mean and the standard acoustic wave covariance includes:
[0152] Calculating the sum vector of each acoustic wave feature data in the acoustic wave feature data set, and calculating the mean of the acoustic wave feature data set according to the number of acoustic wave feature data in the acoustic wave feature data set and the sum vector of each acoustic wave feature data, to obtain a standard acoustic wave mean vector;
[0153] Calculating a difference vector between each acoustic wave feature data in the acoustic wave feature data set and the standard acoustic wave mean, and transposing the difference to obtain a transposed difference vector;
[0154] multiplying the difference vector by the transposed difference vector to obtain a difference product vector;
[0155] The sum of the difference product vectors corresponding to each acoustic wave feature data in the acoustic wave feature data set is calculated to obtain a standard acoustic wave covariance.
[0156] In an optional embodiment of the present invention, the mean of the acoustic wave feature data set may be calculated using the following formula to obtain the standard acoustic wave mean μ:
[0157]
[0158] Among them, z i represents the positive sample sound feature vector corresponding to the i-th positive sample sound data in the positive sample sound data set, and N represents the total amount of positive sample sound data in the positive sample sound data set.
[0159] Furthermore, in an optional embodiment of the present invention, the covariance of the acoustic wave feature dataset can be calculated using the following formula to obtain the standard acoustic wave covariance Σ:
[0160]
[0161] Among them, z i represents the positive sample sound feature vector corresponding to the i-th positive sample sound data in the positive sample sound data set, μ represents the standard sound wave mean, T represents transpose, and N represents the total amount of positive sample sound data in the positive sample sound data set.
[0162] In an optional embodiment of the present invention, since the acoustic wave feature data set cannot be completely consistent, in order to improve the fault tolerance of the acoustic wave feature data set, the mean and covariance of the acoustic wave feature data set are respectively calculated using the formula for calculating the average value and the formula for calculating the covariance, thereby reducing the error caused by the inconsistency of the acoustic wave feature data in the acoustic wave feature data set and improving the accuracy of sound anomaly detection.
[0163] In the embodiment of the present invention, the preset threshold may be a numerical value of different sizes set by business personnel according to different scenarios.
[0164] The embodiment of the present invention calculates the distance between the sound wave feature data to be measured and the sound wave feature data set based on the standard sound wave mean and the standard sound wave covariance, thereby solving the problem of too few abnormal samples during sound anomaly detection and inability to perform model training, and improving the accuracy of sound anomaly detection.
[0165] In an optional embodiment of the present invention, the distance between the acoustic wave feature data to be measured and the acoustic wave feature data set may be calculated using a Mahalanobis distance formula.
[0166] Furthermore, as an optional embodiment of the present invention, calculating the distance between the acoustic wave feature data to be measured and the acoustic wave feature data set based on the standard acoustic wave mean and the standard acoustic wave covariance includes:
[0167] Calculating a difference vector of the sound wave to be measured between the characteristic data of the sound wave to be measured and the mean vector of the standard sound wave, and transposing the difference vector of the sound wave to be measured to obtain a transposed difference vector of the sound wave to be measured;
[0168] The measured sound wave difference vector is multiplied by the inverse of the standard sound wave covariance vector, and the multiplication result is multiplied by the measured sound wave inverted difference vector to obtain the distance between the measured sound wave feature data and the sound wave feature data set.
[0169] Specifically, in the embodiment of the present invention, the distance S between the acoustic wave characteristic data to be measured and the acoustic wave characteristic data set can be calculated using the following formula: test :
[0170] S test =(z test -μ) T Σ -1 (z test -μ)
[0171] Among them, z test represents the characteristic data of the sound wave to be measured, μ represents the mean value of the standard sound wave, T represents transpose, and Σ represents the covariance of the standard sound wave.
[0172] In an embodiment of the present invention, when the distance between the sound wave characteristic data to be measured and the sound wave characteristic data set is larger, it means that the sound wave characteristic data to be measured is very different from the sound wave characteristic data in the sound wave characteristic data set. Therefore, the sound data to be measured is judged to be abnormal data. Conversely, when the distance between the sound wave characteristic data to be measured and the sound wave characteristic data set is smaller, it means that the sound wave characteristic data to be measured is close to the sound wave characteristic data in the sound wave characteristic data set. Therefore, the sound data to be measured is judged to be normal data.
[0173] like Figure 5 , which is a schematic diagram of the structure of an electronic device for implementing a sound anomaly detection method based on self-supervised learning according to the present invention.
[0174] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a sound anomaly detection program based on self-supervised learning.
[0175] Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example: SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 can also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the memory 11 can also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of a sound anomaly detection program based on self-supervised learning, but can also be used to temporarily store data that has been output or is to be output.
[0176] In some embodiments, the processor 10 may be composed of an integrated circuit, such as a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 10 is the control core (Control Unit) of the electronic device, connecting the various components of the entire electronic device using various interfaces and lines, and executing programs or modules stored in the memory 11 (such as a sound anomaly detection program based on self-supervised learning, etc.), as well as calling data stored in the memory 11, to perform various functions of the electronic device and process data.
[0177] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is configured to realize the connection and communication between the memory 11 and the at least one processor 10, etc. For the convenience of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0178] Figure 5 Only the electronic device with components is shown, and those skilled in the art can understand that, Figure 5 The structure shown does not constitute a limitation on the electronic device, and can include fewer or more components than shown, or combine certain components, or different component arrangements.
[0179] For example, although not shown, the electronic device can also include a power supply (such as a battery) for powering each component. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, so as to realize functions such as charge management, discharge management, and power consumption management through the power management device. The power supply can also include one or more direct current or alternating current power supplies, recharging devices, power supply fault detection circuits, power supply converters or inverters, power supply status indicators, etc. The electronic device can also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which are not described here.
[0180] Optionally, the communication interface 13 can include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to establish a communication connection between the electronic device and other electronic devices.
[0181] Optionally, the communication interface 13 can also include a user interface, which can be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface can also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch, etc. Among them, the display can also be appropriately called a display screen or a display unit, which is used to display information processed in the electronic device and to display a visualized user interface.
[0182] It should be understood that the embodiments are only for illustration, and the scope of the patent application is not limited by the structure.
[0183] The sound anomaly detection program stored in the memory 11 in the electronic device based on self-supervised learning is a combination of multiple computer programs, which can realize the following functions when running in the processor 10:
[0184] Obtain a positive sample sound data set and test sound data, and perform voice enhancement on the positive sample sound data set to obtain an enhanced sample sound data set;
[0185] Train a preset feature extraction model using the positive sample sound data set and the enhanced sample sound data set to obtain a trained feature extraction model;
[0186] Extract features of the positive sample sound data set and the test sound data using the trained feature extraction model to obtain a standard sound wave feature data set and test sound wave feature data;
[0187] Calculate the mean and covariance of the sound wave feature data set to obtain a standard sound wave mean and a standard sound wave covariance;
[0188] Calculate the distance between the test sound wave feature data and the sound wave feature data set according to the standard sound wave mean and the standard sound wave covariance, and determine that the test sound data is abnormal data when the distance is greater than a preset threshold.
[0189] Specifically, the processor 10 can refer to the description of the specific implementation method of the above computer program Figure 1 The description of the related steps in the corresponding embodiments is not repeated here.
[0190] Further, the modules / units integrated in the electronic device can be stored in a computer-readable storage medium if they are realized in the form of software function units and sold or used as independent products. The computer-readable medium can be non-volatile or volatile. The computer-readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
[0191] The embodiment of the present application can also provide a computer-readable storage medium, which stores a computer program, and the computer program can realize the following functions when executed by the processor of the electronic device:
[0192] Obtain a positive sample sound data set and test sound data, and perform voice enhancement on the positive sample sound data set to obtain an enhanced sample sound data set;
[0193] Using the positive sample sound data set and the enhanced sample sound data set to train a preset feature extraction model to obtain a trained feature extraction model;
[0194] Using the trained feature extraction model, the features of the positive sample sound data set and the sound data to be tested are respectively extracted to obtain a standard sound wave feature data set and sound wave feature data to be tested;
[0195] Calculating the mean and covariance of the acoustic wave feature data set respectively to obtain a standard acoustic wave mean and a standard acoustic wave covariance;
[0196] The distance between the sound wave feature data to be measured and the sound wave feature data set is calculated based on the standard sound wave mean and the standard sound wave covariance, and when the distance is greater than a preset threshold, the sound data to be measured is determined to be abnormal data.
[0197] Furthermore, the computer-usable 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.
[0198] In the several embodiments provided herein, it should be understood that the disclosed electronic devices, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the module division is merely a logical functional division, and actual implementation may employ other division methods.
[0199] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected to achieve the purpose of the solution of this embodiment according to actual needs.
[0200] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.
[0201] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0202] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.
[0203] Blockchain, as used in this article, refers to a novel application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each block contains information about a batch of online transactions, used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.
[0204] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. Second-order terms are used to indicate names and do not imply any particular order.
[0205] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A sound anomaly detection method based on self-supervised learning, characterized in that: The method comprises: Acquiring a positive sample sound data set and sound data to be tested, and performing speech enhancement on the positive sample sound data set to obtain an enhanced sample sound data set; Using the positive sample sound data set and the enhanced sample sound data set to train a preset feature extraction model to obtain a trained feature extraction model; Using the trained feature extraction model, the features of the positive sample sound data set and the sound data to be tested are respectively extracted to obtain a standard sound wave feature data set and sound wave feature data to be tested; Calculating the mean and covariance of the acoustic wave feature data set respectively to obtain a standard acoustic wave mean and a standard acoustic wave covariance; The distance between the sound wave feature data to be measured and the sound wave feature data set is calculated based on the standard sound wave mean and the standard sound wave covariance, and when the distance is greater than a preset threshold, the sound data to be measured is determined to be abnormal data.
2. The sound anomaly detection method based on self-supervised learning according to claim 1, characterized in that The method of using the positive sample sound data set and the enhanced sample sound data set to train a preset feature extraction model to obtain a trained feature extraction model includes: Encoding the positive sample sound data in the positive sample sound data set and the enhanced sample sound data in the enhanced sample sound data set using a coding layer in a preset feature extraction model to obtain a positive sample sound coding vector and an enhanced sample sound coding vector; Using the convolution layer in the preset feature extraction model to perform convolution operations on the positive sample sound coding vector and the enhanced sample sound coding vector, respectively, to obtain a positive sample sound feature vector and an enhanced sample sound feature vector; According to the positive sample sound feature vector and the enhanced sample sound feature vector, a preset loss function is used to calculate the loss value between the positive sample sound data in the positive sample sound data set and the enhanced sample sound data in the enhanced sample sound data set, and the parameters of the preset feature extraction model are iteratively adjusted according to the loss value until the loss value meets the preset conditions, thereby obtaining a trained feature extraction model.
3. The sound anomaly detection method based on self-supervised learning according to claim 2, characterized in that The step of calculating the loss value between the positive sample sound data in the positive sample sound dataset and the enhanced sample sound data in the enhanced sample sound dataset using a preset loss function according to the positive sample sound feature vector and the enhanced sample sound feature vector includes: The loss value Loss(·) between the positive sample sound data in the positive sample sound data set and the enhanced sample sound data in the enhanced sample sound data set is calculated using the following formula: Among them, sim represents the cosine similarity function, z i represents the positive sample sound feature vector corresponding to the i-th positive sample sound data in the positive sample sound data set, represents the enhanced sample sound feature vector of the enhanced sample sound data corresponding to the i-th positive sample sound data, z j represents the positive sample sound feature vector corresponding to the j-th positive sample sound data in the positive sample sound data set, where j≠i, and ρ represents a preset scaling parameter.
4. The method for detecting sound anomalies based on self-supervised learning according to claim 1, wherein: The performing speech enhancement on the positive sample sound data set to obtain an enhanced sample sound data set includes: performing tone conversion on the positive sample sound data in the positive sample sound data set to obtain a first enhanced sample sound data set; Performing audio adjustment on the positive sample sound data in the positive sample sound data set to obtain a second enhanced sample sound data set; injecting white noise data into the positive sample sound data in the positive sample sound data set to obtain a third enhanced sample sound data set; The first enhanced sample sound data set, the second enhanced sample sound data set, and the third enhanced sample sound data set are aggregated to obtain an enhanced sample sound data set.
5. The method for detecting sound anomalies based on self-supervised learning according to claim 1, wherein: The obtaining of the positive sample sound data set and the sound data to be tested comprises: Obtaining positive sample sound model data and test sound model data; Periodically scanning the positive sample sound model data and the sound model data to be tested respectively to obtain a positive sample sound discrete signal and a sound discrete signal to be tested; Classifying the instantaneous values of the positive sample sound discrete signal and the instantaneous values of the sound discrete signal to be tested into different levels according to the magnitudes of the instantaneous values of the positive sample sound discrete signal and the instantaneous values of the sound discrete signal to be tested; The levels of instantaneous values in the positive sample sound discrete signal and the test sound discrete signal are respectively converted into binary codes to obtain a positive sample sound data set and a test sound data set.
6. The method for detecting sound anomalies based on self-supervised learning according to claim 1, wherein: The step of respectively calculating the mean and covariance of the acoustic wave feature data set to obtain the standard acoustic wave mean and the standard acoustic wave covariance includes: Calculating the sum vector of each acoustic wave feature data in the acoustic wave feature data set, and calculating the mean of the acoustic wave feature data set according to the number of acoustic wave feature data in the acoustic wave feature data set and the sum vector of each acoustic wave feature data, to obtain a standard acoustic wave mean vector; Calculating a difference vector between each acoustic wave feature data in the acoustic wave feature data set and the standard acoustic wave mean, and transposing the difference to obtain a transposed difference vector; multiplying the difference vector by the transposed difference vector to obtain a difference product vector; The sum of the difference product vectors corresponding to each acoustic wave feature data in the acoustic wave feature data set is calculated to obtain a standard acoustic wave covariance.
7. The method for detecting sound anomalies based on self-supervised learning according to claim 1, wherein: The step of calculating the distance between the acoustic wave feature data to be measured and the acoustic wave feature data set according to the standard acoustic wave mean and the standard acoustic wave covariance includes: Calculating a difference vector of the sound wave to be measured between the characteristic data of the sound wave to be measured and the mean vector of the standard sound wave, and transposing the difference vector of the sound wave to be measured to obtain a transposed difference vector of the sound wave to be measured; The measured sound wave difference vector is multiplied by the inverse of the standard sound wave covariance vector, and the multiplication result is multiplied by the measured sound wave inverted difference vector to obtain the distance between the measured sound wave feature data and the sound wave feature data set.
8. A sound anomaly detection device based on self-supervised learning, characterized in that: The device comprises: A voice data enhancement module is used to obtain a positive sample voice data set and the voice data to be tested, and perform voice enhancement on the positive sample voice data set to obtain an enhanced sample voice data set; A feature extraction model training module is used to train a preset feature extraction model using the positive sample sound data set and the enhanced sample sound data set to obtain a trained feature extraction model; The sound data detection module to be tested is used to use the trained feature extraction model to respectively extract the features of the positive sample sound data set and the sound data to be tested, obtain the standard sound wave feature data set and the sound wave feature data to be tested, respectively calculate the mean and covariance of the sound wave feature data set to obtain the standard sound wave mean and the standard sound wave covariance, calculate the distance between the sound wave feature data to be tested and the sound wave feature data set based on the standard sound wave mean and the standard sound wave covariance, and when the distance is greater than a preset threshold, determine that the sound data to be tested is abnormal data.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to perform the sound anomaly detection method based on self-supervised learning according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for detecting sound anomalies based on self-supervised learning according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Abnormal sound detection model training method and device and computer storage medium
CN112466290A
Abnormality analysis method and device, terminal and storage medium
CN115389186A