Switch cabinet voiceprint anomaly detection method and device, and storage medium
By using an isolated forest algorithm to detect voiceprint abnormalities in switch cabinet fault diagnosis, the problems of inefficiency of traditional methods and inability to accurately identify faults are solved, and efficient and unsupervised abnormality detection and real-time monitoring capabilities are achieved.
Patent Information
- Application Number
- CN202411705097.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-04-11
AI Technical Summary
Traditional switch cabinet fault diagnosis methods are inefficient and cannot accurately identify potential faults. The threshold alarm system has limited sensitivity, which is prone to false alarms or missed reports.
The isolated forest algorithm is used to detect the sound pattern anomaly of the switch cabinet. By acquiring and preprocessing the sound signal, the feature signal is extracted, and the feature vector is input into the pretrained isolated forest model for abnormal detection.
It realizes efficient anomaly detection, has linear time complexity, can quickly process large-scale data sets, and has unsupervised learning ability, does not require labeling samples, is suitable for processing high-dimensional data, and can monitor and accurately identify outliers in real time.
Smart Images

Figure CN119811422A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power equipment monitoring, and in particular to a switch cabinet voiceprint anomaly detection method, equipment and storage medium. Background Art
[0002] In the power system, the switchgear is one of the key equipment for power transmission and distribution, and its operating status directly affects the safety and reliability of the entire power grid. As the requirements for safety and reliability of the power system continue to increase, effective fault diagnosis and preventive maintenance of the switchgear have become particularly important. In recent years, with the development of sensor technology and machine learning algorithms, it has become possible to use voiceprint data for fault diagnosis. Voiceprint data can reflect the information of the mechanical and electrical status inside the switchgear, and by analyzing it, fault signals can be identified in advance.
[0003] Traditional switchgear fault diagnosis methods mainly rely on regular manual inspections and simple threshold alarm systems. However, these methods have the following limitations:
[0004] 1. Low efficiency of manual inspection: The manual inspection cycle is long and it is difficult to detect early signs of faults in time.
[0005] 2. The sensitivity of the threshold alarm system is limited: fixed thresholds are difficult to adapt to changes under different working conditions and are prone to false alarms or missed alarms.
[0006] 3. Lack of data analysis capabilities: Traditional diagnostic methods cannot fully utilize the rich information in voiceprint data and it is difficult to accurately identify potential faults. Summary of the invention
[0007] The purpose of the present invention is to propose a switch cabinet voiceprint anomaly detection method, device and storage medium to solve the technical problems of low efficiency and inability to accurately identify the traditional switch cabinet voiceprint anomaly detection.
[0008] The present invention provides a switch cabinet voiceprint anomaly detection method, comprising the following steps:
[0009] S1. Obtain the sound signal inside the switch cabinet;
[0010] S2, preprocessing the sound signal to obtain a preprocessed signal;
[0011] S3, extracting features from the preprocessed signal to obtain a feature signal;
[0012] S4. Construct the feature signal into a feature vector and input it into the pre-trained isolation forest model to obtain the abnormal result.
[0013] A storage medium stores instructions and data for implementing a switch cabinet voiceprint anomaly detection method.
[0014] A switch cabinet voiceprint anomaly detection device comprises: a processor and the storage medium; the processor loads and executes instructions and data in the storage medium to implement a switch cabinet voiceprint anomaly detection method.
[0015] The beneficial effects provided by the present invention are:
[0016] 1. Efficient anomaly detection: Efficiency: The Isolation Forest algorithm has a linear time complexity (O(n)) and can quickly process large-scale data sets. In contrast, deep learning models usually require more computing resources and time to train, especially when dealing with high-dimensional data. Simplicity: The Isolation Forest algorithm forms an isolation forest (iForest) by constructing multiple isolated trees (iTree). Each isolated tree is constructed through a simple random process, without the need for complex mathematical models and a large number of parameter adjustments. This makes the Isolation Forest algorithm simpler in implementation.
[0017] 2. Unsupervised learning: Unsupervised learning: Isolation forest is an unsupervised anomaly detection method that does not require labeled samples for training. This is very important in practical applications because labeling data is often expensive and time-consuming. Adaptability: Due to the subsampling method, the isolation forest algorithm can effectively process high-dimensional data. This is very useful in many practical applications, such as switch cabinet voiceprint anomaly detection.
[0018] 3. Real-time monitoring and anomaly identification: Real-time monitoring: The system can continuously collect the voiceprint data of the switch cabinet and perform real-time analysis, which improves the timeliness and effectiveness of fault diagnosis. Anomaly identification: Anomalies are identified by calculating the anomaly score of each data point, which enables the system to accurately detect data points that are significantly different from the normal pattern, improving the accuracy of anomaly detection.
[0019] The switch cabinet voiceprint anomaly detection system based on the isolation forest algorithm proposed in this invention has significant advantages in terms of efficiency, unsupervised learning, and real-time monitoring and anomaly identification. These innovations make the system have important application value in the field of switch cabinet fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a schematic flow chart of the method of the present invention;
[0021] Figure 2 It is a working schematic diagram of the hardware device of the present invention. DETAILED DESCRIPTION
[0022] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0023] Please refer to Figure 1 , Figure 1 : is a flow chart of the method of the present invention; the present invention provides a switch cabinet voiceprint abnormality detection method, the method specifically comprises the following steps:
[0024] S1. Obtain the sound signal inside the switch cabinet;
[0025] As an embodiment, the present invention first collects the signal and then performs digital processing, and the process is as follows:
[0026] A high-sensitivity microphone array is used to collect sound signals inside the switch cabinet.
[0027] The analog sound signal is converted into a digital signal through an analog-to-digital converter (ADC), usually with a sampling frequency of 44.1kHz or higher to ensure a high enough resolution to capture the details in the voiceprint. Assume that the signal s(t) is a function of time t, and the sampling interval is where f s is the sampling frequency, then the discrete signal can be expressed as;
[0028] s[n]=s(nΔt) (1)
[0029] S2, preprocessing the sound signal to obtain a preprocessed signal;
[0030] The preprocessing in step S2 includes: noise reduction and frame division.
[0031] As an example, noise reduction: use a bandpass filter to remove irrelevant low-frequency and high-frequency noise, and retain the frequency band related to the switch cabinet soundprint. Assume that the frequency range of the signal is f min to f max , then the transfer function of the bandpass filter can be expressed as:
[0032]
[0033] Where f is the frequency.
[0034] Framing: Split the continuous digital signal into multiple frames of fixed length N to facilitate subsequent feature extraction. The kth frame can be expressed as:
[0035] s k [n]=s[n+kN] (3)
[0036] Where n=0,1,...,N-1.
[0037] S3, extracting features from the preprocessed signal to obtain a feature signal;
[0038] It should be noted that the characteristic signal in step S3 includes: Mel-frequency cepstral coefficients MFCCs, zero-crossing rate and energy.
[0039] As an embodiment, the present invention extracts voiceprint features from each frame, such as Mel-frequency cepstral coefficients MFCCs, zero-crossing rate, and energy.
[0040] The calculation steps of Mel frequency cepstral coefficients MFCCs are as follows:
[0041] Fourier transform: Perform discrete Fourier transform DFT on each frame to obtain the frequency domain representation s k (f).
[0042] Mel filter bank: Use a set of Mel filter banks M m (f) for s k (f) is filtered, where m is the filter index. Mel filter bank is a commonly used spectral feature extraction method, mainly used in speech recognition and audio signal processing. In the calculation process of Mel frequency cepstral coefficients MFCCs, Mel filter bank is used to convert the spectrum to Mel scale and extract the spectrum envelope features.
[0043] The specific calculation formula of the Mel filter bank is:
[0044] (1) To calculate the Mel frequency, we first need to convert the linear frequency into Mel frequency.
[0045] The relationship between the linear frequency f and the Mel frequency M(f) can be expressed by the following formula:
[0046]
[0047] (2) Design of Mel filter:
[0048] The Mel filter bank consists of a series of triangular filters, each of which corresponds to a specific Mel frequency range. m A filter with a center frequency of f m is on the Mel frequency scale. The center frequency of the filter is f m and the corresponding linear frequency f c The conversion relationship between them is:
[0049]
[0050] (3) Calculation of filter bank:
[0051] Assume there is a spectrum s after discrete Fourier transform DFT k(f), where f is the frequency point on the linear frequency axis, the transfer function of the Mel filter bank can be expressed as:
[0052]
[0053] where f l and f u are the left and right boundary frequencies of the filter, respectively, and f c is the center frequency of the filter. For each filter m, its boundary frequency can be determined based on the total number of filters and the frequency range. Assume that the frequency range covered by the filter bank is from f min to f max , then the boundary frequency of each filter can be calculated as follows:
[0054] Compute the total Mel frequency range:
[0055] M total =M(f max )-M(f min ) (7)
[0056] Compute the mel-frequency width covered by each filter:
[0057]
[0058] Calculate the center frequency f of each filter c :
[0059]
[0060] Calculate the edge frequency f of each filter l and f u :
[0061]
[0062] (4) Spectral energy of Mel filter bank:
[0063] Calculate the energy E of the filtered spectrum for each filter m m :
[0064]
[0065] where f l (m) and f u (m) are the left and right boundary frequencies of the mth filter, respectively, H m (f) is the transfer function of the mth filter.
[0066] (5) Logarithmic energy calculation:
[0067] Perform a logarithmic operation on the energy of each filter to obtain a logarithmic energy sequence:
[0068] L m =log(E m ) (13)
[0069] (6) Discrete Cosine Transform (DCT)
[0070] Logarithmic energy sequence L m Perform discrete cosine transform DCT to obtain MFCCs. DCT transform can be expressed as:
[0071]
[0072] Among them C k is the kth MFCC, N m is the number of filters, L m is the logarithmic energy of the mth filter.
[0073] The zero-crossing rate refers to the number of times a signal crosses the zero point per unit time. It is an important feature to measure the degree of signal oscillation. In switch cabinet voiceprint detection, the zero-crossing rate can help identify abnormal patterns in the signal. The calculation formula is for the kth frame s k Zero-crossing rate of [n]:
[0074]
[0075] where sgn(·) is the sign function, defined as:
[0076]
[0077] Finally, the present invention estimates the energy by calculating the sum of squares for each frame.
[0078]
[0079] where s k [n] is the nth sample in the kth frame.
[0080] S4. Construct the feature signal into a feature vector and input it into the pre-trained isolation forest model to obtain the abnormal result.
[0081] It should be noted that by combining the above features, a feature vector x can be constructed k , expressed as:
[0082] x k =[C1,C2,...,C Nceps ,ZCR k ,E k ] (18)
[0083] Among them, C1, C2,..., C Nceps are the first N ceps coefficients of MFCCs. N ceps represents the number of Mel Frequency Cepstral Coefficients (MFCCs) selected. Usually, we choose the first few MFCCs because the subsequent coefficients often contain less information. A common choice is the first 13 coefficients because these coefficients usually contain most of the information; ZCR k is the zero-crossing rate of the k-th frame; E k is the energy of the k-th frame.
[0084] After establishing the sound feature vector of the switchgear, this feature vector is used as an input parameter, and the Isolation Forest algorithm is used to detect abnormal sounds in the switchgear voiceprint.
[0085] The Isolation Forest algorithm is an effective anomaly detection algorithm that does not require labeled data and can automatically identify abnormal data points. The Isolation Forest algorithm process:
[0086] 1) Data preparation
[0087] Use the preprocessed feature vector dataset as input. The dataset is represented as
[0088] X = {x1, x2,..., x} n where x i is a vector containing multiple voiceprint features.
[0089] 2) Random sampling
[0090] Randomly draw a sample subset without replacement from the original dataset, and the size of each subset is ψ.
[0091] 3) Construct decision trees
[0092] For each sample subset, randomly select a feature q and its splitting value p, and use this to divide the samples into two parts, namely x i (q) < p and x i (q) > p. Repeat this process until all samples are isolated or the maximum height of the tree is reached.
[0093] 4) Construct a forest
[0094] Repeat the above steps multiple times to construct multiple decision trees to form a forest, and the number of trees in the forest is T number .
[0095] 5) Abnormal score calculation
[0096] For each test data point x, calculate its average path length h(x) in each tree. Calculate the anomaly score s(x,ψ) based on the average path length. The shorter the path length, the higher the score of the data point, indicating that it is more likely to be an anomaly.
[0097] The calculation formula for the anomaly score is:
[0098]
[0099] where E(h(x)) is the expected value of the path length of x in all trees, and c(ψ) is the average path length for a given sample size ψ, which can be given by:
[0100]
[0101] where H(·) represents the harmonic series, which can be approximated as the natural logarithm plus the Euler-Mascheroni constant γ≈0.5772156649;
[0102] 6) Anomaly Detection
[0103] A threshold τ is set and data points with scores higher than the threshold are marked as abnormal voiceprints.
[0104] Please refer to Figure 2 , Figure 2 4 is a schematic diagram of the working of the hardware device of an embodiment of the present invention, and the hardware device specifically includes: a switch cabinet voiceprint anomaly detection device 401, a processor 402 and a storage medium 403.
[0105] A switch cabinet voiceprint anomaly detection device 401: The switch cabinet voiceprint anomaly detection device 401 implements the switch cabinet voiceprint anomaly detection method.
[0106] Processor 402: The processor 402 loads and executes the instructions and data in the storage medium 403 to implement the switch cabinet voiceprint anomaly detection method.
[0107] Storage medium 403: the storage medium 403 stores instructions and data; the storage medium 403 is used to implement the switch cabinet voiceprint anomaly detection method.
[0108] In summary, the beneficial effects of the present invention are:
[0109] 4. Efficient anomaly detection: Efficiency: The Isolation Forest algorithm has a linear time complexity (O(n)) and can quickly process large-scale data sets. In contrast, deep learning models usually require more computing resources and time to train, especially when dealing with high-dimensional data. Simplicity: The Isolation Forest algorithm forms an isolation forest (iForest) by constructing multiple isolated trees (iTree). Each isolated tree is constructed through a simple random process, without the need for complex mathematical models and a large number of parameter adjustments. This makes the Isolation Forest algorithm simpler in implementation.
[0110] 5. Unsupervised learning: Unsupervised learning: Isolation forest is an unsupervised anomaly detection method that does not require labeled samples for training. This is very important in practical applications because labeling data is often expensive and time-consuming. Adaptability: Due to the subsampling method, the isolation forest algorithm can effectively process high-dimensional data. This is very useful in many practical applications, such as switch cabinet voiceprint anomaly detection.
[0111] 6. Real-time monitoring and anomaly identification: Real-time monitoring: The system can continuously collect the voiceprint data of the switch cabinet and perform real-time analysis, which improves the timeliness and effectiveness of fault diagnosis. Anomaly identification: Anomalies are identified by calculating the anomaly score of each data point, which enables the system to accurately detect data points that are significantly different from the normal pattern, improving the accuracy of anomaly detection.
[0112] The switch cabinet voiceprint anomaly detection system based on the isolation forest algorithm proposed in this invention has significant advantages in terms of efficiency, unsupervised learning, and real-time monitoring and anomaly identification. These innovations make the system have important application value in the field of switch cabinet fault diagnosis.
[0113] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A switch cabinet voiceprint anomaly detection method, characterized by: The following steps are involved: S1. Obtain the sound signal inside the switch cabinet; S2, preprocessing the sound signal to obtain a preprocessed signal; S3, extracting features from the preprocessed signal to obtain a feature signal; S4. Construct the feature signal into a feature vector and input it into the pre-trained isolation forest model to obtain the abnormal result.
2. A switch cabinet voiceprint anomaly detection method according to claim 1, characterized in that: The preprocessing in step S2 includes: noise reduction and frame division.
3. A switch cabinet voiceprint anomaly detection method according to claim 1, characterized in that: The characteristic signal in step S3 includes: Mel-frequency cepstral coefficients MFCCs, zero-crossing rate and energy.
4. A switch cabinet voiceprint anomaly detection method as claimed in claim 3, characterized in that: The calculation formula of Mel frequency cepstral coefficients MFCCs is as follows: Among them, C k is the kth MFCC, N m is the number of Mel filters, L m is the logarithmic energy of the m-th Mel filter.
5. A switch cabinet voiceprint anomaly detection method as claimed in claim 3, characterized in that: The zero-crossing rate calculation formula is as follows: Among them, sgn() is the sign function; s k [n] is the kth frame of the sound signal, and N is the total number of frames of the sound signal.
6. A switch cabinet voiceprint anomaly detection method according to claim 3, characterized in that: The energy calculation formula is as follows: where s k [n] is the nth sample in the kth frame.
7. A switch cabinet voiceprint anomaly detection method according to claim 1, characterized in that: The eigenvector is as follows: where C1, C2, ..., C Nceps are the first N Mel-frequency cepstral coefficients MFCCs ceps coefficients; N ceps Indicates the number of selected Mel-frequency cepstral coefficients (MFCCs); E k For energy, ZCR k is the zero crossing rate.
8. A storage medium, characterized in that: The storage medium stores instructions and data for implementing a switch cabinet voiceprint anomaly detection method as described in any one of claims 1 to 7.
9. A switch cabinet voiceprint anomaly detection device, characterized in that: include: A processor and a storage medium; the processor loads and executes instructions and data in the storage medium to implement a switch cabinet voiceprint anomaly detection method as described in any one of claims 1 to 7.