Air whistle anomaly detection method and device, computer equipment and readable storage medium
By obtaining the sound signals of the motorcycle bagpipes, extracting the sound fragments of the bagpipes and using the Meer cepspectral characteristics and lightweight model for bagpipe abnormality detection, the problems of low accuracy and high maintenance costs of bagpipes are solved, and efficient and accurate bagpipe fault diagnosis and a healthy maintenance environment are achieved.
Patent Information
- Application Number
- CN202510500045.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-15
AI Technical Summary
The bagpipes of the railway heavy-load trains have low detection accuracy and low maintenance efficiency in extreme operating environments, strong subjectiveness of manual judgments, high maintenance costs and great harm to the human body.
By obtaining the sound signal of the motorcycle bagpipe, extracting the bagpipe sound fragments in the full cycle, using the Meer cepspectral feature vector and lightweight anomaly detection model to perform anomaly detection of bagpipe sounds, realizing automatic identification and fault diagnosis of bagpipe sounds.
It improves the accuracy and efficiency of bagpipe abnormality detection, reduces the subjectivity of manual judgment, reduces the maintenance cost and protects the health of maintenance personnel.
Smart Images

Figure CN120496569A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of acoustic signal processing, and in particular to a bagpipe anomaly detection method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] The harsh operating environment of heavy-haul trains can negatively impact the performance of onboard mechanical equipment, with cumulative structural fatigue damage caused by vibration being common. Bagpipes, for example, utilize compressed air to generate sound, serving as communication and warning devices between locomotives and trains. The vibrations generated by heavy-haul trains can loosen, shift, or even damage internal bagpipe components, severely impacting their sound quality.
[0003] In traditional methods, bagpipe maintenance is often done by judging the sound of the bagpipe with human ears, which is highly subjective and has low maintenance efficiency. Summary of the Invention
[0004] Based on this, it is necessary to provide a bagpipe abnormality detection method, device, computer equipment, computer-readable storage medium and computer program product to address the technical problem of low bagpipe maintenance efficiency in the above method.
[0005] In a first aspect, the present application provides a bagpipe anomaly detection method. The method comprises:
[0006] Acquiring a bagpipe sound signal emitted by a bagpipe of a locomotive to be detected;
[0007] Extracting a complete cycle of bagpipe sound segment from the bagpipe sound signal;
[0008] Extracting sound features of the bagpipe sound clip;
[0009] The sound features are detected by the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal.
[0010] In one embodiment, extracting a complete cycle of bagpipe sound segments from the bagpipe sound signal includes:
[0011] framing the bagpipe sound signal to obtain a sound frame sequence;
[0012] Determining a start frame and an end frame from the sound frame sequence;
[0013] The sound segment consisting of the sound frames between the start frame and the end frame is regarded as a complete cycle of the bagpipe sound segment.
[0014] In one embodiment, determining a start frame and an end frame from the sound frame sequence includes:
[0015] Obtaining the average energy of each frame of the sound signal in the sound frame sequence;
[0016] Determine, from the sound frame sequence, a first sound frame whose average energy is greater than a first threshold as a starting frame;
[0017] Obtaining an energy difference between each sound frame after the start frame and an adjacent previous sound frame;
[0018] The sound frame whose energy difference with respect to the adjacent previous sound frame is greater than the second threshold is used as the end frame.
[0019] In one embodiment, extracting the sound features of the bagpipe sound clip includes:
[0020] Processing the bagpipe sound segment through a high-pass filter to obtain a filtered bagpipe sound segment;
[0021] performing frame processing and time-frequency conversion processing on the filtered bagpipe sound segment to obtain a frequency spectrum of the bagpipe sound signal;
[0022] A Mel-frequency cepstrum feature vector is extracted according to the frequency spectrum of the bagpipe sound signal, and the Mel-frequency cepstrum feature vector is used as a sound feature of the bagpipe sound segment.
[0023] In one embodiment, the anomaly detection model includes a first compression module, a first branch, a second branch, a second compression module, and a global average pooling module; the first branch and the second branch each include a depthwise separable module and an inverse residual and feature attention module;
[0024] The trained anomaly detection model is used to process the sound features to obtain an anomaly detection result of the bagpipe sound signal, including:
[0025] Inputting the sound feature into the compression module of the trained anomaly detection model for processing, and outputting a first scale feature and a second scale feature;
[0026] Input the first scale feature into the first branch for processing, and output a first convolution feature; input the second scale feature into the second branch for processing, and output a second convolution feature;
[0027] Inputting the first convolution feature and the second convolution feature into the second compression module for processing, and outputting a fusion feature;
[0028] The fusion features are processed by the global average pooling module to obtain an abnormality detection result of the bagpipe sound signal.
[0029] In one embodiment, the depth-wise separable module includes channel-by-channel convolution and point-by-point convolution; wherein the channel-by-channel convolution is used to cause each kernel to convolve on a channel; and the point-by-point convolution is used to combine the result of the previous stage in the channel direction with the weight to generate a new convolution feature.
[0030] In a second aspect, the present application further provides a bagpipe anomaly detection device. The device comprises:
[0031] A signal acquisition module, used to acquire a bagpipe sound signal emitted by a bagpipe of a locomotive to be detected;
[0032] A sound extraction module, configured to extract a complete cycle of bagpipe sound segments from the bagpipe sound signal;
[0033] A feature extraction module, configured to extract sound features of the bagpipe sound segment;
[0034] The anomaly monitoring module is used to detect the sound features through the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal.
[0035] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0036] Acquiring a bagpipe sound signal emitted by a bagpipe of a locomotive to be detected;
[0037] Extracting a complete cycle of bagpipe sound segment from the bagpipe sound signal;
[0038] Extracting sound features of the bagpipe sound clip;
[0039] The sound features are detected by the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0041] Acquiring a bagpipe sound signal emitted by a bagpipe of a locomotive to be detected;
[0042] Extracting a complete cycle of bagpipe sound segment from the bagpipe sound signal;
[0043] Extracting sound features of the bagpipe sound clip;
[0044] The sound features are detected by the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal.
[0045] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0046] Acquiring a bagpipe sound signal emitted by a bagpipe of a locomotive to be detected;
[0047] Extracting a complete cycle of bagpipe sound segment from the bagpipe sound signal;
[0048] Extracting sound features of the bagpipe sound clip;
[0049] The sound features are detected by the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal.
[0050] The above-mentioned bagpipe anomaly detection method, device, computer equipment, storage medium and computer program product obtain the bagpipe sound signal emitted by the locomotive bagpipe to be detected, extract a complete cycle of bagpipe sound segments from the bagpipe sound signal, and extract the sound features of the bagpipe sound segments; detect the sound features through the trained anomaly detection model to obtain the anomaly detection result of the bagpipe sound signal. When performing bagpipe anomaly detection, this method extracts a complete cycle of bagpipe sound segments from the bagpipe sound signal and performs anomaly detection on the bagpipe sound segments, which can avoid interference from other signals and improve the accuracy and efficiency of detection; anomaly detection is achieved through the trained anomaly detection model, which can accurately and efficiently detect faults in various major working conditions at the bagpipe maintenance site, including normal high pitch, normal low pitch, abnormal high pitch and abnormal low pitch, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 1. A schematic flow chart of a bagpipe anomaly detection method according to an embodiment;
[0052] Figure 2 1. It is a flowchart of the bagpipe sound segment extraction step in one embodiment;
[0053] Figure 3 is a schematic diagram of a frequency spectrum of a portion of a bagpipe sound signal according to an embodiment;
[0054] Figure 4 is a Mel-frequency cepstral coefficient diagram of a portion of a bagpipe signal in one embodiment;
[0055] Figure 5Schematic diagram of the structure of an anomaly detection model in one embodiment;
[0056] Figure 6 is a schematic diagram of a confusion matrix of detection results of an anomaly detection model in one embodiment;
[0057] Figure 7 A schematic flow chart of a bagpipe anomaly detection method according to another embodiment;
[0058] Figure 8 is a structural block diagram of a bagpipe abnormality detection device in one embodiment;
[0059] Figure 9 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0061] It should be noted that the terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0062] At present, the maintenance of abnormal bagpipe sounds on heavy-load railway trains mainly faces the following two problems:
[0063] (1) The detection accuracy and maintenance efficiency of abnormal bagpipes on heavy-load trains are low.
[0064] Heavy-load trains experience significant uncertainty in track excitation under extreme operating conditions. With increasing on-track operating time, various mechanical components experience varying degrees of performance degradation. On sections with a high proportion of bridges and tunnels, frequent entry and exit of tunnels can be subject to sudden crosswind shocks, severely impacting the stability of train components. On sections with long, continuous downhill slopes, complex and variable line conditions and operating instructions result in constantly changing train operating conditions, all of which wear out the mechanical components of heavy-load trains. As an external mechanical component, the windpipe is subject to interference from external factors and body vibration during operation. Different operating conditions also have varying impacts on the accuracy and stability of its sound. This results in varying types and degrees of wear on the windpipe each time it is used, resulting in sounds of varying frequencies and amplitudes. Furthermore, variations in the whistle's frequency cause variations in its pitch, and since faults primarily manifest in pitch changes, the human ear struggles to accurately capture and analyze this information. Relying solely on manual experience, this lacks objectivity and a lack of fixed criteria for judgment, resulting in inaccurate detection and difficult repairs.
[0065] (2) The maintenance cost of heavy-load train bagpipes is high, and the testing process is very harmful to human health.
[0066] The complexity and diversity of abnormal bagpipe sounds pose considerable challenges to maintenance. The performance of bagpipes requires repeated manual confirmation and judgment during the process of entering the warehouse for repair, replacement, and outbound inspection. Current methods rely on experienced maintenance and quality inspectors to listen closely to the bagpipe sounds and make subjective measurements and judgments. However, the decibel level of a whistle is generally around 100dB, and the frequency range is below 12,000Hz, which exceeds the normal sound index range acceptable to humans. Long-term exposure to an environment with 85dB noise has a high probability of causing deafness and may also induce certain cardiovascular and mental illnesses. Moreover, when entering the warehouse for maintenance, the closed environment may form a resonance effect, increasing the decibel level of the bagpipe sound and increasing hearing damage to maintenance personnel.
[0067] Therefore, in order to address the above problems, in order to achieve accurate identification of abnormal whistle sounds of heavy-loaded railway trains and further provide algorithm support for the development of intelligent portable devices for abnormal bagpipe sound detection, this application provides an efficient and lightweight bagpipe anomaly detection algorithm.
[0068] refer to Figure 1, which is a flow chart of the bagpipe anomaly detection method provided in an embodiment of the present application. This embodiment takes the application of this method to a terminal as an example. It can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps:
[0069] Step S110: obtaining a bagpipe sound signal emitted by the bagpipe of the locomotive to be detected.
[0070] In a specific implementation, in a heavy-load train maintenance workshop, bagpipe sound data is collected on-site through a one-way sound collection device to obtain the original bagpipe sound signal.
[0071] Step S120: extracting a complete cycle of bagpipe sound segments from the bagpipe sound signal.
[0072] In a specific implementation, endpoint detection can be performed on the bagpipe sound signal to determine the starting position and the ending position, and the sound signal between the starting position and the ending position can be intercepted as a complete cycle of the bagpipe sound segment.
[0073] In some embodiments, the collected bagpipe sound signal may be first framed to obtain a sound frame sequence, and the average energy of each sound frame in the sound frame sequence may be calculated. Endpoint detection is then performed based on the average energy of each sound frame to determine the start and end frames. The first time point of the start frame is used as the start position of a complete bagpipe sound segment, and the last time point of the end frame is used as the end position of a complete bagpipe sound segment.
[0074] Step S130: extracting sound features of the bagpipe sound segment.
[0075] In a specific implementation, the sound features of the bagpipe sound segment can be extracted by using the Mel-frequency cepstrum method, or by training a feature extraction model and extracting the sound features of the bagpipe sound segment using the trained feature extraction model.
[0076] Step S140 , detecting the sound features using the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal.
[0077] In a specific implementation, an initial anomaly detection model can be pre-built and trained using training data. The trained anomaly detection model is then fed with the sound features of a complete bagpipe sound segment emitted by a locomotive bagpipe to be tested. This results in anomaly detection results for the bagpipe sound signal, such as normal high pitch, normal low pitch, abnormal high pitch, and abnormal low pitch. If the anomaly detection result is normal high pitch or normal low pitch, the bagpipe is operating normally. If the anomaly detection result is abnormal high pitch or abnormal low pitch, the bagpipe is faulty, and it can be determined whether the abnormality is in the high pitch or the low pitch.
[0078] In some embodiments, training the anomaly detection model may include collecting several sample bagpipe sound signals and determining a label for each sample bagpipe sound signal, such as normal high pitch, normal low pitch, abnormal high pitch, or abnormal low pitch. A complete bagpipe sound segment is extracted from each sample bagpipe sound signal in the same manner as described in steps S120 and S130 above, and the sound features of the bagpipe sound segment are extracted. The initial anomaly detection model is then trained using the sound features of each sample bagpipe sound signal as input variables and the corresponding labels as supervisory information until a training termination condition is met, thereby terminating the training and obtaining a trained anomaly detection model.
[0079] In the above-mentioned bagpipe anomaly detection method, a bagpipe sound signal emitted by the bagpipe of the locomotive to be detected is obtained, and a complete cycle of bagpipe sound segments is extracted from the bagpipe sound signal, and the sound features of the bagpipe sound segments are extracted; the sound features are detected by the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal. When performing bagpipe anomaly detection, this method extracts a complete cycle of bagpipe sound segments from the bagpipe sound signal and performs anomaly detection on the bagpipe sound segments, which can avoid interference from other signals and improve the accuracy and efficiency of detection; anomaly detection is achieved by using the trained anomaly detection model, which can accurately and efficiently detect faults in various major working conditions at the bagpipe maintenance site, including normal high pitch, normal low pitch, abnormal high pitch, and abnormal low pitch.
[0080] In an exemplary embodiment, Figure 2 As shown, the above step S120 extracts a complete cycle of bagpipe sound segments from the bagpipe sound signal, including:
[0081] Step S210: Frame the bagpipe sound signal to obtain a sound frame sequence.
[0082] Step S220: Determine the start frame and the end frame from the sound frame sequence.
[0083] Step S230 , taking the sound segment composed of the sound frames between the start frame and the end frame as a complete cycle of the bagpipe sound segment.
[0084] In a specific implementation, the bagpipe sound signal can be framed according to a preset frame length to obtain a time sequence consisting of multiple sound frames, which is recorded as a sound frame sequence. For example, if the bagpipe sound signal is 5000ms and the frame length is set to 20ms, the bagpipe sound signal can be divided into 250 sound frames. Then, the average energy of each frame of the sound signal in the sound frame sequence can be calculated. Based on the average energy of each frame of the sound signal, the start frame and the end frame can be determined from each sound frame in the sound frame sequence. The sound segment composed of the sound frames between the start frame and the end frame is regarded as a complete cycle of the bagpipe sound segment. It should be noted that the bagpipe sound segment also includes the start frame and the end frame.
[0085] In this embodiment, the bagpipe sound signal is framed, the start frame and the end frame are determined from the sound frame sequence, and the sound segment composed of the sound frames between the start frame and the end frame is used as a complete cycle of the bagpipe sound segment. In this way, the bagpipe sound segment can be intercepted, which can avoid interference from other sound signals during abnormality detection and improve the confidence of the detection results of subsequent bagpipe sound abnormality detection.
[0086] Furthermore, in an exemplary embodiment, a start frame and an end frame are determined from a sound frame sequence, including: obtaining the average energy of each frame of sound signal in the sound frame sequence; determining the first sound frame whose average energy is greater than a first threshold from the sound frame sequence as the start frame; obtaining the energy difference between each sound frame after the start frame and the adjacent previous sound frame; and determining the sound frame whose energy difference with the adjacent previous sound frame is greater than a second threshold as the end frame.
[0087] Specifically, taking the frame length of each sound frame as 20ms as an example, the average energy of each frame of sound signal is The calculation process can be expressed as:
[0088] (1)
[0089] in, is the energy per millisecond.
[0090] According to the high energy characteristic of bagpipe sound, the first threshold is set , average energy of each sound frame in the sound frame sequence frame by frame With the first threshold For comparison, if the average energy of a sound frame is detected , then the sound frame is used as the starting frame of the bagpipe sound segment.
[0091] The end frame is further identified from the sound frames after the start frame. Considering that the bagpipe sound signal will continue to be in a high energy state, the average energy set of each sound frame after the start frame is obtained: , calculate the energy difference between each sound frame relative to the adjacent previous sound frame, that is, the energy difference between two adjacent sound frames :
[0092] (2)
[0093] According to each energy difference, the end frame is identified from the sound frames after the start frame. Specifically, when the bagpipe sound signal ends, the energy of the sound signal gradually decreases. Therefore, the sound frame whose energy difference with the adjacent previous sound frame is greater than the second threshold can be used as the end frame. Let the second threshold be , if The energy difference between a frame and its adjacent previous sound frame , determine the Frame is the end frame.
[0094] The start frame and the end frame are converted into time measurements, the start endpoint and the end endpoint of the bagpipe sound signal are obtained, and the corresponding sound signal is intercepted.
[0095] In this embodiment, the starting frame is first determined based on the average energy of each frame of the sound signal, and then the energy difference between two adjacent sound frames after the starting frame is determined. The ending frame is filtered based on the energy difference. This method completes the positioning and screening of the bagpipe sound signal based on the continuous high-intensity characteristic of the bagpipe sound signal, which can ensure the accuracy of the intercepted bagpipe sound segment.
[0096] In an exemplary embodiment, the above-mentioned step S130 extracts the sound features of the bagpipe sound clip, including: processing the bagpipe sound clip through a high-pass filter to obtain a filtered bagpipe sound clip; performing frame processing and time-frequency conversion processing on the filtered bagpipe sound clip to obtain a spectrum of the bagpipe sound signal; extracting a Mel-frequency cepstrum feature vector based on the spectrum of the bagpipe sound signal, and using the Mel-frequency cepstrum feature vector as the sound feature of the bagpipe sound clip.
[0097] In the specific implementation, a high-pass filter is first applied to the bagpipe sound signal to increase the amplitude of the high-frequency signal components, and the processed signal is divided into frames with a set frame length, such as 20ms. The time-frequency conversion is then performed using the Fast Fourier Transform (FFT) formula:
[0098] (3)
[0099] Convert the time domain signal to the frequency domain to explore the more obvious signal features of the bagpipe sound signal. Figure 3 , which is a schematic diagram of the frequency spectrum of part of the bagpipe sound signal.
[0100] A Mel filter bank is designed based on the bagpipe sound signal. The power spectrum is filtered through a set of triangular filters with a Mel scale (for example, 25 filters) to extract the frequency band. The spectrum obtained by Fourier transform is multiplied and accumulated with the frequency of each filter, and then the logarithm is taken. The obtained value is the logarithmic energy value of the frequency band corresponding to the filter. . The logarithmic energy Substitute into the discrete cosine transform formula to obtain the Mel-Frequency Cepstral Coefficients (MFCC) feature vector :
[0101] (4)
[0102] Where L represents the Mel cepstral coefficient, which is 13, and M is the number of Mel filter pairs. Figure 4 , which is the Mel-frequency cepstral coefficient diagram of part of the bagpipe signal.
[0103] In this embodiment, the bagpipe sound segment is processed by a high-pass filter, so that the amplitude of the high-frequency signal component can be increased, and then the filtered bagpipe sound segment is framed and time-frequency converted, so that more obvious signal features of the bagpipe sound signal can be mined, thereby improving the accuracy of the subsequently extracted Mel-frequency cepstrum feature vector, thereby more effectively characterizing the features of the bagpipe sound signal, and being more conducive to the accurate establishment of the subsequent anomaly detection model.
[0104] In an exemplary embodiment, Figure 5 As shown, the anomaly detection model includes a first compression module, a first branch, a second branch, a second compression module and a global average pooling module; the first branch and the second branch each include a depthwise separable module and a reverse residual and feature attention module;
[0105] Step S140 processes the sound features through the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal, including: inputting the sound features into the compression module of the trained anomaly detection model for processing, outputting a first scale feature and a second scale feature; inputting the first scale feature into the first branch for processing, outputting a first convolution feature; inputting the second scale feature into the second branch for processing, outputting a second convolution feature; inputting the first convolution feature and the second convolution feature into the second compression module for processing, outputting a fusion feature; processing the fusion feature through the global average pooling module to obtain an anomaly detection result of the bagpipe sound signal.
[0106] In some embodiments, the depth-wise separable module includes channel-by-channel convolution and point-by-point convolution; wherein, the channel-by-channel convolution is used to make each kernel convolve on a channel; the point-by-point convolution is used to combine the results of the previous stage in the channel direction with the weights to generate new convolution features.
[0107] Specifically, if Figure 5 As shown, the present application builds a lightweight classification model for bagpipe sound signals as an anomaly detection model. First, the sound features of the input bagpipe sound signal are analyzed through the first compression module of small-scale convolution, and the analysis results are sent to two independent branches. First, compared with the standard convolution layer, the number of convolution kernels in the first compression module is smaller. At the same time, the compression module operates with a convolution kernel of size 1, which can greatly reduce the number of parameters and reduce the dimension of the output feature map. Furthermore, multi-scale convolution can be used to use convolution kernels of different sizes to generate features of different dimensions, which is conducive to the multimodal extraction of features. For example, in Figure 5 In the example, the two outputs of the first compression module are the convolution result of size 1 and the convolution result of size 3, and the convolution results of the two dimensions are input into the two branches respectively.
[0108] To further reduce computational costs, each branch contains a depthwise separable module and an inverse residual and feature attention module. The depthwise separable module consists of channel-by-channel convolution and point-by-point convolution. Since each kernel in the channel-by-channel convolution only convolves one channel, the number of channels in the convolution result remains unchanged. To extract spatial correlation information between channels, the point-by-point convolution combines the channel-wise results of the previous stage with the weights to generate new convolution features. The inverse residual connection strategy can reduce the risk of overfitting in model training caused by the above modules and avoid vanishing or exploding network parameter gradients.
[0109] The output results of the two branches are merged again and input into the second compression module for processing. Then, after convolution processing, the global information is integrated through the global average pooling (GAP) operation to minimize the parameters and avoid model overfitting. Finally, the anomaly detection result and confidence of the bagpipe sound signal are output.
[0110] In some embodiments, before step S140 , the sound features of the bagpipe sound clip, namely the Mel-frequency Cepstrum Feature Vectors (MFCC feature vectors), may be normalized to reduce data variance. The normalized sound features are then input into an anomaly detection model for detection to obtain an anomaly detection result.
[0111] In this embodiment, a lightweight abnormal bagpipe anomaly detection model is designed. On the basis of ensuring detection accuracy and efficiency, the computational complexity and model calculation cost are reduced through small-size convolution calculation.
[0112] In an exemplary embodiment, the anomaly detection model is trained in the following manner: obtaining a set of sample bagpipe sound signals; extracting a complete cycle of a sample bagpipe sound segment for each sample bagpipe sound signal in the set of sample bagpipe sound signals; extracting the sound features of the sample bagpipe sound segment; and training an initial anomaly detection model using the sound features of the sample bagpipe sound signals as input and the true labels as supervision information to obtain a trained anomaly detection model.
[0113] Each sample bagpipe sound signal is provided with a corresponding label, such as normal high pitch, normal low pitch, abnormal high pitch, and abnormal low pitch.
[0114] In the specific implementation, during training, the sound features of the sample bagpipe sound signal are input into the initial anomaly detection model for processing, the predicted detection result is output, the loss value between the predicted detection result and the corresponding true label is calculated, and the model parameters of the initial anomaly detection model are adjusted with the goal of reducing the loss value to obtain a new anomaly detection model. The new anomaly detection model is trained using the next sample bagpipe sound signal until the loss value converges or reaches the preset number of training times, and the training is ended to obtain the trained anomaly detection model.
[0115] In some embodiments, to reduce the difference between data and improve the convergence speed of the anomaly detection model, the sound features in the sample data, namely the Mel-frequency Cepstrum feature vector (MFCC feature vector), are normalized and the normalized sound features are used as input variables to train the initial anomaly detection model. The normalization formula is:
[0116] (5)
[0117] in, For the Rank The input samples of the columns, and They are The mean and standard deviation of the data in each signal channel.
[0118] The model parameters were selected and fine-tuned through experiments. Based on the training effect comparison, the number of iterations was set to 350, the Adam (Adaptive Moment Estimation) optimizer was used, the learning rate was set to 0.00001, the learning rate decay coefficient was set to 0.000001, the batch size was set to 8, and the cross entropy loss was used to verify the loss. After the loss function converged, the final anomaly detection model was obtained. The detection result confusion matrix of this model is as follows: Figure 6 shown.
[0119] In this embodiment, an anomaly detection model is trained using a sample bagpipe sound signal set, so that anomaly detection of bagpipes can be performed using the anomaly detection model, thereby improving detection efficiency and accuracy.
[0120] In one embodiment, in order to more clearly illustrate the embodiment of the present application, the following Figure 7 For further explanation. Figure 7 , is a flow chart of a bagpipe abnormality detection method according to another embodiment. In this embodiment, the method includes the following steps:
[0121] Step S710, obtaining a bagpipe sound signal emitted by a bagpipe of a locomotive to be detected;
[0122] Step S720, framing the bagpipe sound signal to obtain a sound frame sequence;
[0123] Step S730, obtaining the average energy of each frame of the sound signal in the sound frame sequence, and determining the first sound frame in the sound frame sequence whose average energy is greater than a first threshold as the starting frame;
[0124] Step S740, obtaining the energy difference between each sound frame after the start frame and the adjacent previous sound frame, and taking the sound frame whose energy difference with the adjacent previous sound frame is greater than a second threshold as the end frame;
[0125] Step S750, taking the sound segment consisting of the sound frames between the start frame and the end frame as a complete cycle of the bagpipe sound segment;
[0126] Step S760, processing the bagpipe sound segment through a high-pass filter to obtain a filtered bagpipe sound segment;
[0127] Step S770, performing frame processing and time-frequency conversion processing on the filtered bagpipe sound segment to obtain a frequency spectrum of the bagpipe sound signal;
[0128] Step S780, extracting a Mel-frequency cepstrum feature vector based on the frequency spectrum of the bagpipe sound signal;
[0129] Step S790 : Detect the Mel-frequency cepstrum feature vector using the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal.
[0130] The anomaly detection model includes a first compression module, a first branch, a second branch, a second compression module, and a global average pooling module. Both the first and second branches contain a depthwise separable module and an inverse residual and feature attention module. The depthwise separable module includes channel-wise convolution and point-wise convolution. The channel-wise convolution allows each kernel to perform convolution on a channel, while the point-wise convolution combines the channel-wise results of the previous stage with the weights to generate new convolution features.
[0131] This method addresses the persistent, high-intensity nature of bagpipe sounds at maintenance sites by designing an endpoint detection method for these sounds. Furthermore, leveraging the low signal-to-noise ratio of bagpipe sound signals, the method uses Mel-frequency cepstrum analysis to mine the signal's implicit frequency-domain characteristic coefficients. Furthermore, a lightweight abnormal bagpipe detection network is designed, using small-scale convolutions to reduce computational complexity and model cost. This method accurately detects faults in various key bagpipe sound conditions encountered at maintenance sites, including normal high pitch, normal low pitch, abnormal high pitch, and abnormal low pitch. This method provides a practical solution for bagpipe maintenance issues on heavy-duty trains.
[0132] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0133] Based on the same inventive concept, embodiments of the present application also provide a bagpipe anomaly detection device for implementing the aforementioned bagpipe anomaly detection method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more bagpipe anomaly detection device embodiments provided below can be found in the aforementioned bagpipe anomaly detection method, and will not be further elaborated here.
[0134] In one embodiment, Figure 8 As shown, a bagpipe abnormality detection device is provided, comprising:
[0135] The signal acquisition module 810 is used to acquire the bagpipe sound signal emitted by the bagpipe of the locomotive to be detected;
[0136] The sound extraction module 820 is used to extract a complete cycle of bagpipe sound segments from the bagpipe sound signal;
[0137] A feature extraction module 830 is used to extract sound features of the bagpipe sound segment;
[0138] The anomaly monitoring module 840 is used to detect the sound features using the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal.
[0139] In one embodiment, the sound extraction module 820 is further used to frame the bagpipe sound signal to obtain a sound frame sequence; determine the start frame and the end frame from the sound frame sequence; and regard the sound segment composed of the sound frames between the start frame and the end frame as a complete cycle of the bagpipe sound segment.
[0140] In one embodiment, the sound extraction module 820 is further used to obtain the average energy of each frame of sound signal in the sound frame sequence; determine the first sound frame whose average energy is greater than a first threshold from the sound frame sequence as the starting frame; obtain the energy difference between each sound frame after the starting frame and the adjacent previous sound frame; and use the sound frame whose energy difference with the adjacent previous sound frame is greater than a second threshold as the ending frame.
[0141] In one embodiment, the feature extraction module 830 is further used to process the bagpipe sound segment through a high-pass filter to obtain a filtered bagpipe sound segment; perform frame processing and time-frequency conversion on the filtered bagpipe sound segment to obtain a spectrum of the bagpipe sound signal; extract the Mel-frequency cepstrum feature vector based on the spectrum of the bagpipe sound signal, and use the Mel-frequency cepstrum feature vector as the sound feature of the bagpipe sound segment.
[0142] In one embodiment, the anomaly detection model includes a first compression module, a first branch, a second branch, a second compression module and a global average pooling module; the first branch and the second branch each include a depthwise separable module and an inverse residual and feature attention module; the anomaly monitoring module 840 is further used to input the sound features into the compression module of the trained anomaly detection model for processing, and output a first scale feature and a second scale feature; input the first scale feature into the first branch for processing, and output a first convolution feature; input the second scale feature into the second branch for processing, and output a second convolution feature; input the first convolution feature and the second convolution feature into the second compression module for processing, and output a fusion feature; and process the fusion feature through the global average pooling module to obtain an anomaly detection result of the bagpipe sound signal.
[0143] In one embodiment, the depth-wise separable module includes channel-by-channel convolution and point-by-point convolution; wherein the channel-by-channel convolution is used to make each kernel convolve on a channel; and the point-by-point convolution is used to combine the result in the channel direction of the previous stage with the weight to generate a new convolution feature.
[0144] Each module in the bagpipe anomaly detection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0145] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown. The computer device includes a processor, memory, a communication interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal via wired or wireless communication. The wireless communication can be achieved via Wi-Fi, a mobile cellular network, NFC (near-field communication), or other technologies. When executed by the processor, the computer program implements a bagpipe anomaly detection method. The display screen of the computer device can be a liquid crystal display or an electronic ink display. The input device of the computer device can be a touch layer covering the display screen, or keys, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse.
[0146] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0147] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0148] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0149] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0150] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0151] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0152] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0153] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A bagpipe anomaly detection method, characterized in that: The method comprises: Acquiring a bagpipe sound signal emitted by a bagpipe of a locomotive to be detected; Extracting a complete cycle of bagpipe sound segment from the bagpipe sound signal; Extracting sound features of the bagpipe sound clip; The sound features are detected by the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal.
2. The method according to claim 1, characterized in that Extracting a complete cycle of a bagpipe sound segment from the bagpipe sound signal comprises: framing the bagpipe sound signal to obtain a sound frame sequence; Determining a start frame and an end frame from the sound frame sequence; The sound segment consisting of the sound frames between the start frame and the end frame is regarded as a complete cycle of the bagpipe sound segment.
3. The method according to claim 2, characterized in that Determining a start frame and an end frame from the sound frame sequence includes: Obtaining the average energy of each frame of the sound signal in the sound frame sequence; Determine, from the sound frame sequence, a first sound frame whose average energy is greater than a first threshold as a starting frame; Obtaining an energy difference between each sound frame after the start frame and an adjacent previous sound frame; The sound frame whose energy difference with respect to the adjacent previous sound frame is greater than the second threshold is used as the end frame.
4. The method according to claim 1, wherein The step of extracting the sound features of the bagpipe sound segment comprises: Processing the bagpipe sound segment through a high-pass filter to obtain a filtered bagpipe sound segment; performing frame processing and time-frequency conversion processing on the filtered bagpipe sound segment to obtain a frequency spectrum of the bagpipe sound signal; A Mel-frequency cepstrum feature vector is extracted according to the frequency spectrum of the bagpipe sound signal, and the Mel-frequency cepstrum feature vector is used as a sound feature of the bagpipe sound segment.
5. The method according to claim 1, wherein The anomaly detection model includes a first compression module, a first branch, a second branch, a second compression module and a global average pooling module; the first branch and the second branch each include a depthwise separable module and a reverse residual and feature attention module; The trained anomaly detection model is used to process the sound features to obtain an anomaly detection result of the bagpipe sound signal, including: Inputting the sound feature into the compression module of the trained anomaly detection model for processing, and outputting a first scale feature and a second scale feature; Input the first scale feature into the first branch for processing, and output a first convolution feature; input the second scale feature into the second branch for processing, and output a second convolution feature; Inputting the first convolution feature and the second convolution feature into the second compression module for processing, and outputting a fusion feature; The fusion features are processed by the global average pooling module to obtain an abnormality detection result of the bagpipe sound signal.
6. The method according to claim 5, characterized in that The depth-wise separable module includes channel-by-channel convolution and point-by-point convolution; wherein the channel-by-channel convolution is used to make each kernel convolve on a channel; the point-by-point convolution is used to combine the result in the channel direction of the previous stage with the weight to generate a new convolution feature.
7. A bagpipe abnormality detection device, characterized in that: The device comprises: A signal acquisition module, used to acquire a bagpipe sound signal emitted by a bagpipe of a locomotive to be detected; A sound extraction module, configured to extract a complete cycle of bagpipe sound segments from the bagpipe sound signal; A feature extraction module, configured to extract sound features of the bagpipe sound segment; The anomaly monitoring module is used to detect the sound features through the trained anomaly detection model to obtain an anomaly detection result of the bagpipe sound signal.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the bagpipe abnormality detection method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the bagpipe abnormality detection method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the bagpipe abnormality detection method according to any one of claims 1 to 6 are implemented.