Knock vibration detection method, device, and storage medium
Patent Information
- Application Number
- CN202611081774.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-08-18
AI Technical Summary
[0007]本申请的主要目的在于提供一种敲击振动检测方法、设备和存储介质,旨在解决敲击振动信号的检测准确度低的技术问题
本申请获取预设人车交互区域内的当前车辆振动信号;由于特征提取网络包含至少两个并行的特征提取分支,各特征提取分支分别用于提取不同维度的特征,将当前车辆振动信号输入至特征提取网络,特征提取网络能够通过至少两个并行的特征提取分支,同时从多个维度对车辆振动信号进行特征提取,得到多维度特征向量。从而避免单一的特征提取器的感受野和特征抽象层次固定,提升特征表达能力。
Smart Images

Figure CN122594890A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, device and storage medium for detecting impact vibration. Background Technology
[0002] Currently, a network model containing a feature extractor and a classifier is typically used to identify the knocking vibration signals generated during human-vehicle interaction. During training, the model parameters are optimized using the cross-entropy loss function, and during inference, the Softmax classifier is used to calculate the probability that the vehicle vibration signal belongs to a valid knocking vibration signal and the probability that it belongs to other interference signals, thereby achieving classification and decision.
[0003] However, single feature extractors have fixed receptive fields and feature abstraction levels, resulting in insufficient feature representation capabilities.
[0004] The cross-entropy loss function makes different categories linearly separable in the feature space only through supervision information. Samples of the same category are widely scattered and not tightly clustered in the feature space. When the tapping signal has intra-class differences due to factors such as tapping force, position, and gesture, the model has difficulty forming a stable decision boundary and is prone to missed detections.
[0005] Furthermore, the training paradigm based on cross-entropy loss and Softmax classifiers essentially relies on the closed set assumption, that is, it is assumed that the category of all test samples has already appeared in the training set. This closed set assumption performs well when the scene categories of the training set and the test set are consistent, but in real open environments, there are many other types of interference signals besides the knocking vibration signal, which are difficult to enumerate. When the model is deployed to a real open environment and faces unknown interference that is not included in the training set, it is easy to make misjudgments.
[0006] Therefore, the relevant technologies suffer from the technical problem of low accuracy in detecting impact vibration signals. Summary of the Invention
[0007] The main objective of this application is to provide a method, device, and storage medium for detecting impact vibrations, aiming to solve the technical problem of low detection accuracy of impact vibration signals.
[0008] To achieve the above objectives, this application proposes a method for detecting impact vibration, the method comprising: Obtain the current vehicle vibration signal within the preset human-vehicle interaction area; The current vehicle vibration signal is input into a feature extraction network to obtain a multi-dimensional feature vector. The feature extraction network contains at least two parallel feature extraction branches, each of which is used to extract features of different dimensions. Based on the multi-dimensional feature vector and the positive class sample prototype vector, it is determined whether the current vehicle vibration signal is a valid knocking signal, wherein the positive class sample prototype vector is used to characterize the standard features corresponding to a valid knocking operation.
[0009] In one embodiment, the feature extraction branch includes a main feature extraction branch and a sub-feature extraction branch. The main feature extraction branch includes a time-domain feature extraction branch, and the sub-feature extraction branch includes at least one of a time-domain feature extraction branch, a frequency-domain feature extraction branch, and a time-frequency-domain feature extraction branch. The step of inputting the current vehicle vibration signal into the feature extraction network to obtain a multi-dimensional feature vector includes: The current vehicle vibration signal is input into the feature extraction network, and the main feature extraction branch is used to extract features from the current vehicle vibration signal to obtain a first feature vector. The second feature vector is obtained by extracting features from the current vehicle vibration signal through the sub-feature extraction branch. The first feature vector and the second feature vector are fused to obtain a multi-dimensional feature vector.
[0010] In one embodiment, the main feature extraction branch and the sub-feature extraction branch are structurally symmetrical, and the size of the convolution kernel in the main feature extraction branch is larger than the size of the convolution kernel in the sub-feature extraction branch; The convolution kernel in the main feature extraction branch is used to extract the low-frequency features of the current vehicle vibration signal, and the convolution kernel in the secondary feature extraction branch is used to extract the high-frequency features of the current vehicle vibration signal.
[0011] In one embodiment, the step of determining whether the current vehicle vibration signal is a valid impact signal based on the multi-dimensional feature vector and the positive class sample prototype vector includes: Calculate the first similarity between the multi-dimensional feature vector and the prototype vector of the positive class sample; When the first similarity is less than a preset similarity threshold, the current vehicle vibration signal is determined to be a valid knocking signal; When the first similarity is greater than or equal to the preset similarity threshold, the current vehicle vibration signal is determined to be an interference signal.
[0012] In one embodiment, before the step of acquiring the current vehicle vibration signal within a preset human-vehicle interaction area, the method further includes: Obtain positive and negative class samples; The positive and negative samples are extracted using a feature extraction network to be trained, resulting in at least two historical feature vectors. Calculate the second similarity between at least two of the historical feature vectors; Based on the second similarity, the loss value of the metric loss function is calculated, the model parameters of the feature extraction network to be trained are updated according to the loss value, and the steps of obtaining positive and negative samples are returned until the preset optimization target is reached, and the trained feature extraction network is obtained.
[0013] In one embodiment, the feature extraction network to be trained includes a Siamese feature extraction network. The step of extracting features from the positive class samples and the negative class samples through the feature extraction network to be trained, thereby obtaining at least two historical feature vectors, includes: The positive and negative samples are input into the Siamese feature extraction network. The positive and negative samples are extracted through at least two feature extraction paths in the Siamese feature extraction network, respectively, to obtain at least two historical feature vectors. Each feature extraction path contains at least two parallel feature extraction branches, and the weights of each feature extraction path are shared.
[0014] In one embodiment, after the step of extracting features from the positive class samples and the negative class samples respectively through the feature extraction network to be trained, and obtaining at least two historical feature vectors, the method further includes: Obtain the historical feature vectors corresponding to all positive class samples in all previous training rounds; Calculate the mean vector of the historical feature vectors corresponding to all positive class samples, and use the mean vector as the prototype vector of the positive class samples in the current training round.
[0015] In one embodiment, after obtaining the trained feature extraction network, the method further includes: Obtain a verification sample set, which includes multiple verification samples and the real labels corresponding to each verification sample; Each of the verification samples is input into the trained feature extraction network to obtain the verification feature vector corresponding to each of the verification samples; Calculate the third similarity between each of the verification feature vectors and the prototype vector of the positive class sample to obtain a similarity set; Multiple candidate decision thresholds are selected from the similarity set; Based on the real labels, determine the recognition accuracy of the corresponding verification sample set when performing signal recognition according to the candidate judgment thresholds. The candidate judgment threshold with the highest recognition accuracy is used as the preset similarity threshold.
[0016] In one embodiment, the step of calculating the loss value of the metric loss function based on the second similarity includes: For the current training round, obtain the second similarity of all pairs of outlier samples; Select a subset of outlier sample pairs from all the outlier sample pairs whose second similarity is less than the third threshold, and use these subsets as difficult-to-distinguish outlier sample pairs. The loss value of the metric loss function is calculated based on the second similarity corresponding to the difficult-to-distinguish heterogeneous sample pairs and the second similarity corresponding to all homogeneous sample pairs.
[0017] In one embodiment, the step of calculating the loss value of the metric loss function based on the second similarity corresponding to the difficult-to-distinguish heterogeneous sample pairs and the second similarity corresponding to all homogeneous sample pairs includes: Based on the second similarity of all similar sample pairs in the current training round, the first component loss of similar sample pairs is calculated using the aforementioned loss function; Based on the second similarity corresponding to all hard-to-distinguish outlier sample pairs in the current training round, the second component loss brought by the hard-to-distinguish outlier sample pairs is calculated through the metric loss function. When the second similarity corresponding to the hard-to-distinguish outlier sample pairs is greater than the first distance threshold, the second component loss is zero. The loss value of the metric loss function is calculated based on the first component loss, the second component loss, and the total number of first sample pairs of all similar sample pairs and all difficult-to-distinguish heterogeneous sample pairs in the current training round.
[0018] In one embodiment, the metric loss function includes a contrastive loss function, and the step of calculating the loss value of the metric loss function based on the second similarity includes: Based on the second similarity, the third component loss brought by the positive class sample and the fourth component loss brought by the negative class sample are calculated through the contrast loss function. When the second similarity corresponding to the negative class sample is greater than the second distance threshold, the fourth component loss is zero. The loss value of the contrastive loss function is calculated based on the third component loss and the fourth component loss, as well as the total number of second samples of all positive class samples and all negative class samples in the current training round.
[0019] In addition, to achieve the above objectives, this application also proposes a knocking vibration detection device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the knocking vibration detection method as described above.
[0020] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the impact vibration detection method described above.
[0021] One or more technical solutions proposed in this application have at least the following technical effects: This application acquires the current vehicle vibration signal within a preset human-vehicle interaction area. Since the feature extraction network contains at least two parallel feature extraction branches, each branch extracts features from different dimensions. When the current vehicle vibration signal is input into the feature extraction network, the network can simultaneously extract features from the vehicle vibration signal from multiple dimensions through at least two parallel feature extraction branches, obtaining a multi-dimensional feature vector. This avoids the fixed receptive field and feature abstraction level of a single feature extractor, thus improving feature representation capabilities.
[0022] Since the prototype vector of positive class samples is used to characterize the standard features corresponding to a valid tapping operation, this application determines whether the current vehicle vibration signal is a valid tapping signal based on the multi-dimensional feature vector and the prototype vector of positive class samples. That is, the prototype vector of positive class samples is used as a reference standard, without relying on the assumption of linear separability of different categories of signals in the feature space. Therefore, when intra-class differences occur among samples of the same class, these intra-class differences will naturally be constrained to the vicinity of the prototype vector of positive class samples, rather than being forced to form an overfitted linear decision boundary, thereby reducing the risk of missed detection. Furthermore, this application determines whether the current vehicle vibration signal is a valid tapping signal based on the multi-dimensional feature vector and the prototype vector of positive class samples, without relying on a predefined closed category set. When unknown interference signals not included in the training set appear in a real open environment, the multi-dimensional feature vector of the unknown interference signal will deviate significantly from the prototype vector of positive class samples, thereby avoiding the problem of misjudging unknown interference caused by the closed set assumption.
[0023] Based on the above, this application can improve the accuracy of impact vibration detection. Attached Figure Description
[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart illustrating an embodiment of the impact vibration detection method of this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the impact vibration detection method of this application; Figure 3 This is a schematic diagram of the first scenario of the impact vibration detection method provided in Embodiment 2 of this application; Figure 4 This is a logical architecture diagram of the impact vibration detection method provided in Embodiment 3 of this application; Figure 5 This is a schematic diagram of a second scenario for the impact vibration detection method provided in Embodiment 3 of this application; Figure 6 This is a schematic diagram of a third scenario for the impact vibration detection method provided in Embodiment 3 of this application; Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the impact vibration detection method in this application embodiment.
[0027] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0028] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0029] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0030] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or a vibration detection device capable of performing the above functions. The following description uses a vibration detection device as an example to illustrate this embodiment and the subsequent embodiments.
[0031] Based on this, the embodiments of this application provide a method for detecting impact vibration, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the impact vibration detection method of this application.
[0032] It should be noted that the above-mentioned knocking vibration detection method can be applied to human-vehicle interaction scenarios. For example, knocking on the car door, window, or center console panel can trigger control commands such as unlocking the door, raising or lowering the window, or turning the air conditioner on or off.
[0033] In this embodiment, the impact vibration detection method includes steps S10 to S30: Step S10: Obtain the current vehicle vibration signal within the preset human-vehicle interaction area; In human-vehicle interaction scenarios, vibration sensors can be installed in designated human-vehicle interaction areas. These sensors are connected to the vehicle's microcontroller unit (MCU) via signal transmission lines. The MCU triggers the vibration sensors in real-time at a preset sampling frequency to collect the current vehicle vibration signal. Specifically, the vibration sensors collect vibration waveforms generated by external forces in the designated human-vehicle interaction area in real-time, and then convert these waveforms into the current vehicle vibration signal through analog-to-digital conversion. These external forces include active tapping by the user or unintentional collisions in the environment.
[0034] The preset human-vehicle interaction area is a specific area of the vehicle that is pre-defined to receive user tapping operations and can transmit vibration waves in response to those operations. Examples include specific areas on the surface of user-accessible body parts such as door trim panels, center console panels, windows, or the steering wheel.
[0035] Step S20: Input the current vehicle vibration signal into the feature extraction network to obtain a multi-dimensional feature vector. The feature extraction network contains at least two parallel feature extraction branches, each of which is used to extract features of different dimensions. It should be noted that the feature extraction network is pre-trained based on vehicle vibration signal samples. The feature extraction network is used to extract feature representations that can characterize the intrinsic properties of vehicle vibration signals.
[0036] The current vehicle vibration signal is input into a feature extraction network. The network performs independent feature extraction operations on the current vehicle vibration signal through at least two parallel feature extraction branches. Each feature extraction branch extracts the attribute representation of the current vehicle vibration signal in different dimensions, thereby obtaining a multi-dimensional feature vector. Parallel analysis of the same vehicle vibration signal from different dimensions can improve the richness and comprehensiveness of the feature representation.
[0037] Step S30: Based on the multi-dimensional feature vector and the positive class sample prototype vector, determine whether the current vehicle vibration signal is a valid knocking signal. The positive class sample prototype vector is used to characterize the standard features corresponding to a valid knocking operation.
[0038] It should be noted that the positive class sample prototype vector can be a pre-stored standard feature used to represent the effective tapping operation. That is, the positive class sample prototype vector is a representative feature vector located at the center position of the effective tapping signal category in the feature space. The positive class sample prototype vector can be obtained by aggregating multiple known effective tapping samples; the effective tapping signal is the vehicle vibration signal generated in the preset human-vehicle interaction area by the user's active tapping action that meets the preset tapping force range and preset tapping duration conditions.
[0039] In this embodiment, the prototype vector of the positive class sample is used as a reference benchmark to determine whether the current vehicle vibration signal is a valid impact signal. The multi-dimensional feature vector can be compared with the prototype vector of the positive class sample, the degree of matching between the multi-dimensional feature vector and the prototype vector of the positive class sample can be calculated, and the current vehicle vibration signal can be determined as a valid impact signal based on whether the degree of matching meets the preset conditions.
[0040] Since the prototype vector of the positive class sample can represent the center vector of the standard features corresponding to the effective tapping operation, the degree of matching between the multi-dimensional feature vector of the current vehicle vibration signal and the prototype vector of the positive class sample essentially reflects the proximity of the current vehicle vibration signal to the center of the effective tapping category in the feature space. When the tapping signal produces reasonable intra-class differences due to factors such as tapping force, tapping position, or tapping gesture, these intra-class differences will be constrained within an allowable range near the prototype vector of the positive class sample, rather than being forcibly pushed away from a fixed linear decision boundary, thereby reducing the risk of missed detection.
[0041] In one feasible implementation, determining whether the current vehicle vibration signal is a valid impact signal based on the multi-dimensional feature vector and the prototype vector of the positive class sample can be done as follows: Calculate the first similarity between the multi-dimensional feature vector and the prototype vector of the positive class sample; when the first similarity is less than the preset similarity threshold, determine the current vehicle vibration signal as a valid knocking signal; when the first similarity is greater than or equal to the preset similarity threshold, determine the current vehicle vibration signal as an interference signal.
[0042] Specifically, the Euclidean distance or cosine similarity between the multi-dimensional feature vector and the prototype vector of the positive class sample can be calculated. The negative value of the Euclidean distance or the cosine similarity can be used as the first similarity. The smaller the Euclidean distance, the closer the multi-dimensional feature vector and the prototype vector of the positive class sample are in the feature space, and the greater the first similarity. The greater the cosine similarity, the higher the consistency in direction between the multi-dimensional feature vector and the prototype vector of the positive class sample.
[0043] The first similarity is compared with a preset similarity threshold, which is a pre-set similarity threshold used to distinguish between valid impact signals and interference signals. When the first similarity is less than the preset similarity threshold, it is determined that the multi-dimensional feature vector is sufficiently close to the prototype vector of the positive class sample, that is, the current vehicle vibration signal meets the standard features corresponding to a valid impact, and the current vehicle vibration signal is determined to be a valid impact signal. When the first similarity is greater than or equal to the preset similarity threshold, it is determined that the distance between the multi-dimensional feature vector and the prototype vector of the positive class sample is too large, that is, the current vehicle vibration signal does not meet the standard features corresponding to a valid impact, and the current vehicle vibration signal is determined to be an interference signal.
[0044] Optionally, the current operating status information of the vehicle can be obtained, such as vehicle speed information, engine speed information, air conditioning operating status information, and window status information; based on the current operating status information and the preset mapping relationship between vehicle operating status and similarity threshold, the similarity threshold corresponding to the current operating status information can be determined.
[0045] For example, for each vehicle operating state, a verification sample set is collected for that operating state, the optimal similarity threshold corresponding to each verification sample set is determined, and a mapping relationship between the vehicle operating state and the similarity threshold is established.
[0046] Because the background noise is extremely low when the vehicle is stationary and the engine is off, large-amplitude low-frequency vibrations are generated by road bumps when driving at high speeds, and periodic mechanical vibrations occur when the air conditioner is on, the accuracy of knocking vibration detection can be improved by using a real-time similarity threshold.
[0047] Optionally, in automotive-human interaction scenarios, the tapping force of users varies significantly. Light taps result in small signal amplitudes and low signal-to-noise ratios, easily confused with noise; heavy taps, on the other hand, have large signal amplitudes and distinct characteristics, making misjudgment less likely. The system can also acquire the signal energy value of the current vehicle vibration signal; based on this value, it determines the corresponding tapping force level, including light and heavy tap levels; and adjusts a preset similarity threshold based on the tapping force level. For example, the similarity threshold corresponding to a light tap level is larger than the similarity threshold corresponding to a heavy tap level.
[0048] It should be noted that the interference signal is the vehicle vibration signal generated by an effective tapping operation performed by a user in a non-intended manner; the interference signal includes vehicle vibration signals generated by unintentional collisions in the environment, background vibration noise signals generated by vehicle movement or equipment operation, electrical signal noise generated by environmental electromagnetic interference or sensor noise itself, vehicle vibration signals generated by non-tapping contact with the preset human-vehicle interaction area, and remote vehicle vibration signals generated in other structural parts outside the preset human-vehicle interaction area and transmitted through the structure to the vibration sensor installation location, etc.
[0049] This embodiment uses the prototype vector of the positive class sample as a reference standard, without relying on the assumption of linear separability of different class signals in the feature space. Therefore, when intra-class differences arise among samples of the same class, these differences are naturally constrained to the vicinity of the prototype vector of the positive class sample, rather than being forced to form an overfitted linear decision boundary, thus reducing the risk of missed detections. Furthermore, based on the multi-dimensional feature vector and the prototype vector of the positive class sample, it determines whether the current vehicle vibration signal is a valid impact signal without relying on a predefined closed class set. When unknown interference signals not included in the training set appear in a real open environment, the multi-dimensional feature vector of the unknown interference signal will deviate significantly from the prototype vector of the positive class, thereby avoiding misjudgment of unknown interference caused by the closed set assumption.
[0050] Based on the first embodiment of this application, in the second embodiment of this application, the same or similar content as the above embodiment can be referred to the above description, and will not be repeated hereafter.
[0051] Based on this, the feature extraction branch includes a main feature extraction branch and a sub-feature extraction branch. The main feature extraction branch includes a time-domain feature extraction branch, and the sub-feature extraction branch includes at least one of the time-domain feature extraction branch, the frequency-domain feature extraction branch, and the time-frequency-domain feature extraction branch.
[0052] Reference Figure 2 The above step S20 includes steps S01 to S03: Step S01: Input the current vehicle vibration signal into the feature extraction network, and extract features from the current vehicle vibration signal through the main feature extraction branch to obtain the first feature vector; In this embodiment, the current vehicle vibration signal is input into the feature extraction network, and the time-domain features of the current vehicle vibration signal are extracted through the main feature extraction branch to retain the main waveform morphology features within the preset time window.
[0053] For example, the main feature extraction branch may include a convolutional layer and a temporal pooling layer connected in sequence. The convolutional layer is used to perform local temporal convolution operations on the current vehicle vibration signal to extract local waveform features, and the temporal pooling layer is used to perform max pooling operations on the local waveform features along the time dimension to output the first feature vector.
[0054] Step S02: Extract features from the current vehicle vibration signal through the secondary feature extraction branch to obtain the second feature vector; As an auxiliary feature extraction channel, the sub-feature extraction branch can supplement the extraction of more dimensional feature information in the current vehicle vibration signal. For example, when the sub-feature extraction branch is a time-domain feature extraction branch, the main feature extraction branch and the sub-feature extraction branch can be updated with differentiated parameters during the training process, so that the main feature extraction branch and the sub-feature extraction branch can achieve different feature extraction functions.
[0055] When the secondary feature extraction branch is the frequency domain feature extraction branch, the current vehicle vibration signal is first transformed by the frequency domain feature extraction branch to map the current vehicle vibration signal from the time domain to the frequency domain space, and then the detailed features in the transform domain are extracted in the frequency domain space.
[0056] When the secondary feature extraction branch is the time-frequency domain feature extraction branch, the current vehicle vibration signal can be first processed by time-frequency domain transformation through the time-frequency domain feature extraction branch to map the current vehicle vibration signal from the time domain to the time-frequency domain space, and then the time-frequency joint distribution features can be extracted in the time-frequency domain space.
[0057] The sub-feature extraction branch may also include at least one of the following: scale-time domain feature extraction branch, attention mechanism enhancement branch, and Mel (Mel-spectrum domain) spectral domain feature extraction branch. When the sub-feature extraction branch is a scale-time domain feature extraction branch, multi-scale feature extraction can be performed directly on the original time-domain waveform of the current vehicle vibration signal by using convolution kernel groups of different sizes through the scale-time domain feature extraction branch. Local pattern features of the current vehicle vibration signal at different time granularities can be captured through convolution kernels with different receptive fields.
[0058] When the sub-feature extraction branch is an attention mechanism enhancement branch, the attention mechanism enhancement branch can include a channel attention unit and a feature recalibration unit. The channel attention unit can perform global average pooling and global max pooling on the current vehicle vibration signal or the feature map after initial convolution processing, and input the pooling results into a gating network composed of two fully connected layers to generate attention weights for each feature channel. The feature recalibration unit is used to multiply the attention weights with the original feature map channel by channel to enhance important feature channels and suppress non-important feature channels, and output the second feature vector after attention enhancement.
[0059] In one feasible implementation, refer to Figure 3 The high-frequency branch shown can include parallel frequency domain feature extraction branches and time-frequency domain feature extraction branches, thereby enabling the extraction of features in different dimensions.
[0060] For example, the feature extraction network includes a main feature extraction branch and a sub-feature extraction branch. The sub-feature extraction branch includes parallel frequency domain feature extraction branches and time-frequency domain feature extraction branches. The main feature extraction branch is a time-domain feature extraction branch, which includes sequentially connected convolutional and pooling layers. The convolutional layers are used to perform local time-domain convolution operations on the current vehicle vibration signal to extract local waveform features, and the pooling layers are used to downsample the feature map output by the convolution to reduce data dimensionality.
[0061] Convolutional layers can be one-dimensional, and can use preset sizes and strides. Both preset sizes and strides can be determined based on task requirements and feature extraction objectives, respectively. For example, convolutional kernels with a size of 3×3 or 3×1 and a stride of 1 can capture finer local details while preserving the fine features of the original data, avoiding the loss of key details.
[0062] The sub-feature extraction branch includes a frequency domain feature extraction branch, which comprises a Fast Fourier Transform (FFT) unit and a spectrum analysis layer. The FFT unit performs a FFT on the current vehicle vibration signal to obtain spectral information, and the spectrum analysis layer extracts the frequency band energy distribution features within a preset frequency band from the spectral information. The sub-feature extraction branch also includes a time-frequency domain feature extraction branch, which comprises a wavelet transform unit and a time-frequency feature extraction unit. The wavelet transform unit performs a continuous wavelet transform or a discrete wavelet transform on the current vehicle vibration signal to obtain a wavelet coefficient matrix, and the time-frequency feature extraction unit extracts the energy distribution features of the wavelet coefficients at each scale along the scale axis and time axis on the wavelet coefficient matrix.
[0063] Step S03: Perform feature fusion on the first feature vector and the second feature vector to obtain a multi-dimensional feature vector.
[0064] Specifically, the first feature vector and the second feature vector can be concatenated along the feature dimension to obtain the concatenated fused feature. For example, according to a preset concatenation order, the elements of each dimension of the first feature vector and the elements of each dimension of the second feature vector are concatenated end to end along the feature dimension direction to form a multi-dimensional feature vector.
[0065] The spliced fused features are input into the feature transformation layer of the feature extraction network. The feature transformation layer performs linear or nonlinear transformations on the fused features to achieve full interaction and dimensional regularization between the multiple types of feature information carried by the first feature vector and the second feature vector, ensuring the effective integration of different feature information. Finally, the embedded features that can accurately represent the current vehicle vibration signal are output, and the embedded features are used as multi-dimensional feature vectors.
[0066] In one feasible implementation, the main feature extraction branch and the sub-feature extraction branch are structurally symmetrical, and the size of the convolution kernel in the main feature extraction branch is larger than the size of the convolution kernel in the sub-feature extraction branch; the convolution kernel in the main feature extraction branch is used to extract the low-frequency features of the current vehicle vibration signal, and the convolution kernel in the sub-feature extraction branch is used to extract the high-frequency features of the current vehicle vibration signal.
[0067] In this embodiment, the main feature extraction branch and the sub-feature extraction branch are symmetrically designed, with the convolution kernel size in the main feature extraction branch being larger than that in the sub-feature extraction branch. The difference in convolution kernel size determines the receptive field size and frequency response characteristics of each branch: larger convolution kernels have a larger receptive field, are more sensitive to low-frequency components in the signal, and can effectively capture the macroscopic change trend and overall contour information of the current vehicle vibration signal; therefore, the convolution kernel in the main feature extraction branch is used to extract the low-frequency features of the current vehicle vibration signal.
[0068] Smaller convolutional kernels have smaller receptive fields and are more sensitive to high-frequency components in the signal, effectively capturing local abrupt changes and transient details of the current vehicle vibration signal. Therefore, the convolutional kernels in the sub-feature extraction branch are used to extract the high-frequency features of the current vehicle vibration signal.
[0069] By fusing the low-frequency features output from the main feature extraction branch with the high-frequency features output from the sub-feature extraction branch, the resulting multi-dimensional feature vector simultaneously contains macroscopic information of the current vehicle vibration signal in the low-frequency dimension and detailed information in the high-frequency dimension. This enables a comprehensive characterization of the current vehicle vibration signal from global to local and from trend to detail, avoiding the problem of incomplete information coverage caused by single-scale or single-band feature extraction.
[0070] It should be noted that the low-frequency characteristics include at least the time-domain envelope characteristics, amplitude variation trend characteristics, energy attenuation profile characteristics, low-frequency energy distribution characteristics, and low-frequency spectral centroid characteristics of the vehicle vibration signal; the high-frequency characteristics include at least the time-domain impact peak characteristics, transient change moment characteristics, local waveform curvature characteristics, high-frequency energy distribution characteristics, high-frequency spectral centroid characteristics, and high-frequency energy attenuation rate characteristics of the vehicle vibration signal.
[0071] Specifically, refer to Figure 3 The low-frequency branch shown can include a main feature extraction branch that can be connected in sequence: a first convolutional module, a second convolutional module, and a third convolutional module, as well as a global compression convolutional layer connected after the third convolutional module. The first convolutional module includes a one-dimensional first convolutional layer, a first batch normalization layer, a first ReLU (Rectified Linear Unit) activation layer, and a first random dropout layer.
[0072] The first one-dimensional convolutional layer is used to perform convolution operations on the current vehicle vibration signal to extract low-frequency trend features at the global scale; the first batch normalization layer is connected after the first convolutional layer and is used to perform batch normalization processing on the convolution output to improve model stability; the first ReLU activation layer is connected after the first batch normalization layer and is used to perform nonlinear activation on the normalized feature map to introduce nonlinear expressive power; the first random deactivation layer is connected after the first ReLU activation layer and is used to randomly drop some neurons during training to prevent overfitting.
[0073] The step size can be determined based on the sampling rate of the vehicle vibration signal (e.g., several thousand to tens of thousands of hertz), the amount of data in the vehicle vibration signal, the number of output channels, the degree of overfitting prevention, and whether to add padding based on the preset kernel size and step size. For example, the kernel length of the first convolutional layer can be set to 51, the kernel size to 51×1, and the step size to 4, ensuring that the kernel can capture the complete vibration waveform features within the preset time period and efficiently downsample the signal in the time dimension; the number of output channels can be set to 8, so that the feature extraction network achieves the optimal balance between recognition accuracy and computational efficiency; and without adding padding (padding=0), the random deactivation probability of the first random deactivation layer can be set to 0.2.
[0074] The second convolutional module includes a one-dimensional second convolutional layer, a second batch normalization layer, a second ReLU activation layer, and a second random deactivation layer. The second convolutional layer is used to further extract mid-scale low-frequency features based on the feature map output by the first convolutional module. The settings of the second batch normalization layer, the second ReLU activation layer, and the second random deactivation layer are the same as those of the corresponding layers in the first convolutional module. For example, the kernel length of the second convolutional layer can be set to 31, the kernel size to 31×1, the stride to 4, and the number of output channels to 16, without adding padding.
[0075] The third convolutional module includes a one-dimensional third convolutional layer, a third batch normalization layer, a third ReLU activation layer, and a third random deactivation layer. The third convolutional layer is used to further extract fine-scale low-frequency detail features based on the feature map output by the second convolutional module. The settings of the third batch normalization layer, the third ReLU activation layer, and the third random deactivation layer are the same as those of the corresponding layers in the first convolutional module. For example, the kernel size of the third convolutional layer is 25×1, the stride is 4, the number of output channels is 32, and no padding is added.
[0076] The global compression convolutional layer is connected after the third random deactivation layer. The kernel size is equal to the temporal length of the feature map output by the third convolutional module after downsampling by the preceding layers. It has 32 output channels and a stride of 1, used to globally compress the low-frequency feature map after three layers of downsampling, compressing the temporal dimension to 1, and outputting a 32-dimensional first temporal feature vector. Each layer has a stride of 4. After three convolutional operations with a stride of 4, the feature map is downsampled by a total of 4 × 4 × 4 = 64 times in the temporal dimension. The kernel size of the global compression convolutional layer is equal to the temporal length of the downsampled feature map, thus compressing the entire temporal signal into a single 32-dimensional feature vector.
[0077] The secondary feature extraction branch can adopt a symmetrical network structure with the main feature extraction branch. The secondary feature extraction branch also includes a fourth convolutional module, a fifth convolutional module, and a sixth convolutional module connected in sequence, as well as a global compression convolutional layer connected after the sixth convolutional module.
[0078] The fourth convolutional module includes a one-dimensional fourth convolutional layer, a fourth batch normalization layer, a fourth ReLU activation layer, and a fourth random deactivation layer. The kernel size of the fourth convolutional layer is 11×1, the stride is 4, the number of output channels is 8, and no padding is added. It is used to perform convolution operations on the current vehicle vibration signal to extract coarse-grained high-frequency transient features.
[0079] The fifth convolutional module includes a one-dimensional fifth convolutional layer, a fifth batch normalization layer, a fifth ReLU activation layer, and a fifth random deactivation layer. The kernel size of the fifth convolutional layer is 7×1, the stride is 4, and the number of output channels is 16. No padding is added. It is used to further extract medium-granularity high-frequency detail features based on the feature map output by the fourth convolutional module.
[0080] The sixth convolutional module includes a one-dimensional sixth convolutional layer, a sixth batch normalization layer, a sixth ReLU activation layer, and a sixth random deactivation layer. The kernel size of the sixth convolutional layer is 5×1, the stride is 4, and the number of output channels is 32. No padding is added. It is used to further extract fine-grained high-frequency transient features based on the feature map output by the fifth convolutional module.
[0081] The global compression convolutional layer of the sub-feature extraction branch is connected after the sixth random deactivation layer. Its convolutional kernel size is equal to the length of the feature map output by the sixth convolutional module in the time dimension after being downsampled by the aforementioned layers. The number of output channels is 32 and the stride is 1. It is used to globally compress the high-frequency feature map after three layers of downsampling and outputs a second temporal feature vector with a dimension of 32.
[0082] The stride of each layer in the sub-feature extraction branch can be consistent with that of the main feature extraction branch (both are 4). The number of output channels in each layer of the sub-feature extraction branch is synchronized with that of the main feature extraction branch (8, 16, and 32 respectively). The internal structure of each convolutional module in the sub-feature extraction branch is consistent with that of the main feature extraction branch. Through the above multi-level downsampling, the sub-feature extraction branch can complete the extraction and screening of transient detail features in the current vehicle vibration signal.
[0083] Given that the main feature extraction branch and the sub-feature extraction branch each have the above structures, the specific way to fuse the first feature vector and the second feature vector to obtain a multi-dimensional feature vector can be as follows: The 32-dimensional first temporal feature vector output from the main feature extraction branch and the 32-dimensional second temporal feature vector output from the secondary feature extraction branch are concatenated and fused along their feature dimensions to form a 64-dimensional fused feature vector. This 64-dimensional fused feature vector is then input into a fully connected layer. The fully connected layer performs a linear mapping, transforming the fused features from 64 dimensions to a 32-dimensional target embedding dimension, outputting a 32-dimensional mapped feature vector. L2 normalization can be applied to this 32-dimensional mapped feature vector to obtain a multi-dimensional feature vector. L2 normalization involves taking the square root of the sum of the squares of each element in the mapped feature vector and using it as the denominator to normalize each element, ensuring that the L2 norm of the normalized feature vector is 1. This eliminates the influence of differences in feature vector magnitudes on subsequent similarity measurements.
[0084] Optionally, in automotive human-vehicle interaction scenarios, tapping events are sparse events (the user does not continuously tap), and most of the time the system processes pure noise signals without tapping, which may result in significant power consumption waste. A method can be used to continuously acquire low-power vehicle vibration signals within a preset human-vehicle interaction area at a first sampling frequency; extract time-domain features from the low-power vehicle vibration signals at a second sampling frequency (lower than the first sampling frequency) to obtain low-power time-domain features; based on the low-power time-domain features, a low-power classifier determines whether candidate tapping events exist within the preset human-vehicle interaction area; when the low-power classifier determines that a candidate tapping event exists, the vibration sensor is switched from low-power mode to normal operating mode, and the step of acquiring the current vehicle vibration signal within the preset human-vehicle interaction area is performed at the first sampling frequency; when the low-power classifier determines that no candidate tapping event exists, the vibration sensor remains in low-power mode.
[0085] Among them, the computational complexity of the low-power classifier is lower than that of the feature extraction network; the low-power time-domain features include at least the signal energy value, the number of peaks, the peak interval, and the zero-crossing rate.
[0086] Alternatively, the current vehicle vibration signal can be input into the feature extraction network to obtain a multi-dimensional feature vector in another way: The current vehicle vibration signal is input to the main feature extraction branch for feature extraction to obtain the first feature vector. The first feature vector is then compared with the prototype vector of the positive class sample to obtain the first similarity. It is then determined whether the first similarity meets the preset early termination condition. If the early termination condition is met, the operation of the remaining feature extraction branches is terminated, and the first feature vector is output as a multi-dimensional feature vector. If the early termination condition is not met, the operation of the remaining feature extraction branches continues, and the feature vectors output by each branch are fused to obtain a multi-dimensional feature vector.
[0087] For example, when the first similarity is highly certain with the determination of whether it is a valid knock or invalid interference (e.g., the distance to the prototype vector of the positive class sample is large), the operation of the remaining branches can be terminated and the determination result can be directly output, thereby saving power consumption.
[0088] Optionally, the method for determining whether the first similarity meets the preset early termination condition can also be as follows: obtain the historical feature vectors corresponding to the Q consecutive vehicle vibration signals preceding the current vehicle vibration signal, and the judgment results corresponding to the Q vehicle vibration signals; when the proportion of the number of samples with the judgment result of early termination in the Q vehicle vibration signals is greater than a preset proportion threshold, use the mean vector of the historical feature vectors of the Q vehicle vibration signals as the historical early termination judgment template vector; calculate the temporal correlation coefficient between the first feature vector and the historical early termination judgment template vector; when the temporal correlation coefficient is greater than the preset correlation threshold, it is determined that the early termination condition is met.
[0089] The temporal correlation coefficient is obtained by calculating the Pearson correlation coefficient between the first feature vector and the historical early termination decision template vector. The temporal correlation coefficient characterizes the similarity between the characteristic change trend of the current vehicle vibration signal and the characteristic change trend of signals that were successfully terminated early in the past. A higher temporal correlation coefficient indicates that the change pattern of the current signal and historical early termination samples in the feature space is more consistent, and the more likely the current signal is also suitable for early termination.
[0090] Through the symmetrical design of the main feature extraction branch and the sub-feature extraction branch and the configuration of the differential convolution kernel, the feature extraction network can simultaneously output multi-dimensional feature vectors containing macro trend information and local transient details, forming a highly recognizable feature expression that combines global macro trends and local transient details, thereby improving the feature extraction accuracy and generalization ability of the feature extraction network.
[0091] Based on the first and second embodiments of this application, in the third embodiment of this application, the content that is the same as or similar to the above embodiments can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 4Before obtaining the current vehicle vibration signal within the preset human-vehicle interaction area, you can also: Obtain positive and negative samples; extract features from the positive and negative samples respectively using the feature extraction network to be trained, and obtain at least two historical feature vectors; calculate the second similarity between the at least two historical feature vectors; calculate the loss value of the loss function based on the second similarity, update the model parameters of the feature extraction network to be trained according to the loss value, and return to the steps of obtaining positive and negative samples, until the preset optimization target is reached, and obtain the trained feature extraction network.
[0092] Positive samples include historical vehicle vibration signals corresponding to valid tapping operations, while negative samples include historical interference signals.
[0093] Specifically, volunteers can be recruited based on age and gender. Each volunteer, following the program prompts, performs a specific tapping action in a designated human-vehicle interaction area and collects historical vehicle vibration signals at a certain sampling frequency.
[0094] For example, recruit multiple volunteers (e.g., 20-30) of different ages and genders to participate in data collection. Each volunteer, following the program prompts, completes a double-click operation at regular intervals (e.g., 1-2 seconds) (with a certain interval between two double-clicks (e.g., 150-400ms)). Within a preset human-vehicle interaction area, they randomly select the tapping location, tapping force, and tapping gesture to fully cover the diversity of positive class samples in terms of tapping location, tapping force, and tapping gesture. Each volunteer collects historical vehicle vibration signals corresponding to multiple (e.g., 300-500) double-click operations to obtain positive class samples.
[0095] Typical scenarios that generate knocking signals during vehicle use can be selected, and negative samples can be collected in these scenarios. These scenarios include at least rain, car washing, and equipment vibration. In each scenario, continuous historical vehicle vibration signals for a specific duration (10-20 minutes) are collected to obtain negative samples.
[0096] Specifically, refer to Figure 5The collected historical interference signals include at least one of the following: weather factor interference signals (such as vibrations caused by liquid or solid particles directly contacting the vehicle body in scenarios like rain, snow, dripping from eaves, or dripping from under trees); direct contact vibration interference signals (such as vibrations caused by external objects contacting the vehicle body structure in scenarios like wiping the car, washing the car, or opening and closing the car door); human factor interference signals (such as vibrations caused by ping-pong balls, tree branches, empty water bottles, or ballpoint pens accidentally hitting the vehicle body, as well as vibrations caused by non-standard knocking that differ significantly from the effective knocking waveform); and vehicle vibration interference signals (such as vibrations caused by the vehicle itself or external sound waves in scenarios like compressors, blowers, engines, vehicle movement, in-car music, car horns, fireworks, etc.).
[0097] During the sample collection process, the ratio of positive to negative samples can be controlled, for example, by keeping the ratio between 1:2 and 1:3 to ensure the balance of each type of negative sample during training.
[0098] Specifically, the feature extraction network to be trained can be a temporal convolutional network or a recurrent neural network. The method for extracting features from positive and negative samples using this network, resulting in at least two historical feature vectors, can be as follows: The feature extraction network to be trained extracts features from positive and negative samples respectively, resulting in at least two historical feature vectors.
[0099] Specifically, the feature extraction network to be trained may include multiple feature extraction branches. Each feature extraction branch in the feature extraction network to be trained can be used to extract features from positive and negative samples respectively, resulting in at least two historical feature vectors.
[0100] Assuming there are 500 positive samples and 5000 negative samples, the feature extraction branches in the feature extraction network to be trained are used to extract features from the positive and negative samples respectively, resulting in at least two historical feature vectors.
[0101] Furthermore, calculating the second similarity between at least two historical feature vectors includes: calculating the similarity between the historical feature vectors corresponding to positive class samples and the historical feature vectors corresponding to negative class samples, calculating the similarity between historical feature vectors corresponding to each pair of positive class samples, and calculating the similarity between historical feature vectors corresponding to each pair of negative class samples.
[0102] Specifically, the first calculation formula can be used to calculate the Euclidean distance between at least two historical feature vectors. The Euclidean distance is used as the second similarity metric. A smaller Euclidean distance indicates that the two historical feature vectors are closer in the feature space, and the two samples in the training sample pair are more similar; a larger Euclidean distance indicates that the two historical feature vectors are farther apart in the feature space, and the two samples in the training sample pair are less similar. Specifically, the first calculation formula can be:
[0103] in, This represents the Euclidean distance between at least two historical feature vectors. This represents the historical feature vector corresponding to one of the samples in a sample pair. This represents the historical feature vector corresponding to another sample in a sample pair.
[0104] In one feasible implementation, the loss function can be a center loss function or a triplet loss function. Specifically, the loss value of the loss function calculated based on the second similarity can be: based on the second similarity between the historical feature vectors of positive and negative samples, a distance-pushing penalty term is calculated to widen the distance between dissimilar samples; based on the second similarity between the historical feature vectors of similar samples, a close-grouping penalty term is calculated to cluster similar samples; and the distance-pushing penalty term and the close-grouping penalty term are used as the loss value of the loss function.
[0105] In one feasible implementation, the triplet loss function is constructed by extracting anchor samples from positive and negative samples, forming triplet pairs of positive and negative samples, constraining the distance between the anchor sample and the positive sample to be less than the distance between the anchor sample and the negative sample, and the difference is a preset boundary value.
[0106] It is understandable that when the second similarity is the similarity between the historical feature vectors corresponding to positive class samples and the historical feature vectors corresponding to negative class samples, if the second similarity is greater than a certain threshold, it means that the negative class sample and the positive class sample are too close in the feature space. Therefore, the loss value of the loss function calculated based on the second similarity is larger. When the second similarity is the similarity between the historical feature vectors corresponding to each pair of positive class samples or the historical feature vectors corresponding to each pair of negative class samples, if the second similarity is less than or equal to a certain threshold, it means that the samples of the same class are too scattered in the feature space. The model has failed to fully extract the common features of the samples of the same class, resulting in insufficient intra-class compactness. Therefore, the loss value of the loss function calculated based on the second similarity is larger.
[0107] Furthermore, based on the calculated loss value, the gradient of the weights of each layer can be calculated using the backpropagation algorithm and optimizer, and the model parameters of the feature extraction network to be trained can be updated along the gradient descent direction. For example, when the loss value is greater than the preset loss threshold, the model parameters of the feature extraction network to be trained can be updated, and the steps of obtaining positive and negative samples can be returned to continue the next round of iterative training.
[0108] Repeat the above process until the preset optimization goal is achieved, resulting in a trained feature extraction network. The preset optimization goal is that the second similarity between samples of the same class is less than or equal to a preset similarity threshold (e.g., Euclidean distance less than or equal to 0.5), and the second similarity between samples of different classes is greater than a preset similarity threshold (e.g., Euclidean distance greater than 0.5). This achieves the mapping of samples of the same class to a distribution region in the feature space that is tightly aggregated around the prototype vector of the positive class sample, while pushing samples of different classes away from this distribution region to outside the preset similarity threshold, thereby forming a clear class distinction boundary in the feature space.
[0109] In one feasible implementation, after obtaining positive and negative samples, positive sample pools and negative sample pools can be constructed respectively.
[0110] Specifically, the positive class sample pool can be constructed as follows: using a predetermined window duration (700ms) as the window length and a predetermined sliding duration (10ms) as the step size, sample segments are slid across the positive class samples to generate multiple positive class samples, and all positive class samples are stored in the positive class sample pool. Alternatively, based on the energy of the vehicle vibration signal, a peak detection algorithm is used to extract all peak points in the positive class samples. Valid double-click start time points are selected through dual filtering using preset energy and time thresholds. Starting from a predetermined first duration (200ms) before each double-click start time point, using a predetermined window duration (700ms) as the window length and a predetermined sliding duration (10ms) as the step size, the process slides forward to a predetermined second duration (10ms) before the double-click start time point, and adds a predetermined third duration random bias (±3ms) during each slide, thereby generating multiple positive class samples, and all positive class samples are stored in the positive class sample pool.
[0111] The negative sample pool can be constructed as follows: using a window length of 700ms (predetermined window duration), non-overlapping sliding window slices are applied to the negative samples to generate basic negative samples, which are then stored in the negative sample pool. Furthermore, peak detection and threshold filtering are also performed on the negative samples. If a window contains two valid peaks (simulating the peak structure of a double-click), the window is truncated as a difficult negative sample and stored in the negative sample pool as well. By retaining difficult negative samples with peak structures similar to those of positive samples, the robustness of the model in distinguishing boundary samples can be improved.
[0112] Adaptive data augmentation operations can be applied to the extracted samples with a preset probability (e.g., 50%). These operations include random amplitude perturbation and Gaussian noise superposition to break the inherent distribution limitations of the samples and improve sample diversity. For example, the amplitude of the sample at each time point is multiplied by a random coefficient within a preset range ([0.8, 1.2]) to achieve random amplitude perturbation; Gaussian white noise with a mean of 0 and a standard deviation equal to the standard deviation of the sample amplitude (3%-5%) is added to achieve Gaussian noise superposition.
[0113] In one feasible implementation, the feature extraction network to be trained includes a Siamese feature extraction network. Positive and negative samples can be input into the Siamese feature extraction network, and features can be extracted from the positive and negative samples through at least two feature extraction paths in the Siamese feature extraction network, respectively, to obtain at least two historical feature vectors. Each feature extraction path contains at least two parallel feature extraction branches, and the weights of each feature extraction path are shared.
[0114] Specifically, features can be extracted from similar samples and / or dissimilar samples in the training sample pair using a Siamese feature extraction network, resulting in two historical feature vectors. The Siamese feature extraction network includes multiple feature extraction paths, each containing at least two parallel feature extraction branches. By using the multiple feature extraction branches in the Siamese feature extraction network to extract features from similar samples and / or dissimilar samples in the training sample pair, multiple historical feature vectors can be obtained.
[0115] Reference Figure 6 The twin feature extraction network contains at least two feature extraction pathways with identical structures and shared weights, such as a first feature extraction pathway and a second feature extraction pathway. The first feature extraction pathway and the second feature extraction pathway have completely identical network structures, and the weights of the first feature extraction pathway and the second feature extraction pathway are updated synchronously during training. Each feature extraction pathway contains at least two parallel feature extraction branches.
[0116] Since the first feature extraction path and the second feature extraction path share weights, the first historical feature vector and the second historical feature vector are in the same feature space. The training sample pair is input into the Siamese feature extraction network, and the features of the samples in the training sample pair are extracted by at least two feature extraction paths in the Siamese feature extraction network, resulting in two historical feature vectors. The difference between the two historical feature vectors comes only from the difference of the input samples themselves.
[0117] Therefore, by adopting a weight-sharing Siamese feature extraction network architecture, each feature extraction path can extract features from the input training sample pairs in a completely consistent manner, ensuring the fairness and consistency of feature extraction and avoiding similarity measurement bias caused by different feature extraction methods.
[0118] Furthermore, during training, the gradient of the weights of each layer can be calculated using the backpropagation algorithm and optimizer based on the calculated loss value. The shared weights of each feature extraction path in the Siamese feature extraction network are then updated along the gradient descent direction. For example, when the loss value is greater than a preset loss threshold, the shared weights of each feature extraction path in the Siamese feature extraction network are updated. Since the weights of each feature extraction path are completely shared, updating the weights once applies to all paths simultaneously. The process then returns to the step of extracting training sample pairs from the training sample set and continues to the next round of iterative training.
[0119] In one feasible implementation, the metric loss function includes a contrastive loss function, and the loss value of the metric loss function can be calculated based on the second similarity as follows: Based on the second similarity, the third component loss brought by positive samples and the fourth component loss brought by negative samples are calculated by the contrastive loss function. When the second similarity corresponding to the negative sample is greater than the second distance threshold, the fourth component loss is zero. Based on the third component loss and the fourth component loss, as well as the total number of second samples of all positive samples and all negative samples in the current training round, the loss value of the contrastive loss function is calculated.
[0120] Specifically, when acquiring positive and negative samples, the sample labels of positive and negative samples can be determined; the sample label of positive samples can be set to 1 (indicating that it belongs to the historical vehicle vibration signal corresponding to a valid tapping operation); the sample label of negative samples can be set to 0 (indicating that it belongs to the historical interference signal).
[0121] Based on the second similarity, the specific method for calculating the third component loss brought by positive samples and the fourth component loss brought by negative samples through the comparison loss function can be as follows: based on the second similarity corresponding to the positive samples in the current training batch and the sample label of the positive samples, calculate the third component loss brought by the positive samples; based on the second similarity corresponding to the negative samples in the current training batch and the sample label of the negative samples, calculate the fourth component loss brought by the negative samples.
[0122] Furthermore, the third and fourth component losses are summed, and the sum is divided by the total number of second sample pairs of all positive and negative samples in the current training round to obtain the average value. This average value is used as the loss value of the contrastive loss function; specifically, it can be expressed as:
[0123] in, This represents the loss value of the contrastive loss function. Indicates the sample label, when When =1, This represents the third component loss caused by positive class samples, when When =0, This represents the fourth component loss caused by outlier samples; margin represents a preset distance threshold (which can be set to 1), used to limit the minimum feature distance between negative and positive samples. This indicates that the fourth component loss is zero when the second similarity between negative and positive samples is greater than the second distance threshold; N represents the total number of second sample pairs between all positive and negative samples in the current training round.
[0124] The training objective of this contrastive loss function is to bring the historical feature vectors corresponding to similar samples closer together, achieving tight aggregation of similar samples in the feature space, while pushing the historical feature vectors corresponding to dissimilar samples further apart in the embedding space to a distance greater than a preset interval threshold, thereby achieving sufficient separation of dissimilar samples and improving the ability to reject unknown interference in open set scenarios.
[0125] The aforementioned training mechanism enables the trained feature extraction network to map similar samples to a distribution region in the feature space that is tightly clustered around the prototype vector of the positive sample, while pushing out-of-class samples away from this distribution region to a preset similarity threshold, thus forming a clear class distinction boundary in the feature space. This training strategy does not require pre-defining all possible interference categories; it only needs to learn through comparison between positive samples and any interference samples to enable the model to effectively distinguish between unknown interference signals and valid impact signals in the feature space, thereby improving the ability to reject unknown interference in open-set scenarios. Furthermore, this training strategy does not require an absolute balance between the number of original positive and negative samples; maintaining a basic balance between the number of similar and out-of-class samples during training effectively overcomes the class imbalance problem and ensures the stability and effectiveness of model training.
[0126] Furthermore, the model parameters of the trained feature extraction network can be quantized from floating-point format to INT8 integer format; the quantized feature extraction network can be deployed to the MCU of the target device, for example, to the microcontroller unit inside the front or rear hood of a vehicle; the prototype vector of the positive class samples can be kept in floating-point format and stored in the memory of the microcontroller unit.
[0127] During the inference phase, the MCU collects vehicle vibration signals in real time and performs preprocessing operations on the signals that are consistent with those on the training set samples (e.g., extracting a 700ms signal segment). The preprocessed signals are then input into the trained feature extraction network, which outputs the corresponding real-time feature vector. The Euclidean distance between the real-time feature vector and the prototype vector of the positive class sample is calculated. If the Euclidean distance is less than or equal to a preset distance threshold, it is determined to be a valid impact signal; otherwise, it is determined to be an interference signal.
[0128] In one feasible implementation, after extracting features from positive and negative samples using at least two feature extraction paths of the Siamese feature extraction network to obtain at least two historical feature vectors, the following can also be done: Obtain the historical feature vectors corresponding to all positive class samples in all previous training rounds; calculate the mean vector of the historical feature vectors corresponding to all positive class samples, and use the mean vector as the prototype vector of the positive class samples in the current training round.
[0129] Specifically, during the training of the Siamese feature extraction network, after each training epoch, the historical feature vectors corresponding to all positive class samples participating in training in all epochs prior to the current training epoch t are obtained; the mean vector of all historical feature vectors is calculated, that is, the average value of all positive class samples in each dimension is calculated, and the calculated mean vector is used as the prototype vector of the positive class samples in the current training epoch. Specifically, the calculation formula can be:
[0130] in, Indicates up to the tth The total number of all positive class samples that have participated in training up to one training epoch. This represents the historical feature vector output by the feature extraction network after the k-th positive class sample is input.
[0131] For example, before training the feature extraction network, the prototype vector of positive class samples is an uninitialized zero-value vector. When the first positive class sample is input into the feature extraction network and outputs the corresponding first historical feature vector, the first historical feature vector is used as the initial prototype vector of positive class samples. After completing the second training round, the historical feature vectors corresponding to the first and second positive class samples are obtained respectively, and their mean vector is calculated as the prototype vector of positive class samples in the current round. In this way, after each training round, the mean vector is recalculated based on the historical feature vectors of all positive class samples before the current round to update the prototype vector of positive class samples.
[0132] Since each training round introduces new positive class samples, the prototype vector of the positive class samples is continuously recalculated and updated as the training rounds progress, gradually approaching the center position of the true distribution of positive class samples in the feature space. Through the update mechanism based on the mean calculation of the global positive class sample feature vector, the prototype vector of the positive class samples can stably represent the standard features corresponding to a valid tapping operation. As the training process converges, the prototype vector of the positive class samples gradually stabilizes. When the training reaches the preset optimization goal, the prototype vector of the positive class samples obtained in the last round is used as the final prototype vector of the positive class samples and stored in local memory. This serves as a fixed reference benchmark for determining whether the current vehicle vibration signal is a valid tapping signal during the inference phase.
[0133] In one feasible implementation, after obtaining the trained feature extraction network, the following can also be done: Obtain a validation sample set, which contains multiple validation samples and their corresponding ground truth labels. Input each validation sample into a trained feature extraction network to obtain a validation feature vector for each sample. Calculate the third similarity between each validation feature vector and the prototype vector of the positive class sample to obtain a similarity set. Select multiple candidate decision thresholds from the similarity set. Based on each ground truth label, determine the recognition accuracy of the corresponding validation sample set when performing signal recognition based on each candidate decision threshold. Use the candidate decision threshold with the highest recognition accuracy as the preset similarity threshold.
[0134] Specifically, the verification sample set can be obtained by: independently collecting verification samples outside the training sample set, the verification samples including positive and negative verification samples, and labeling each verification sample with a corresponding real label (e.g., a valid knock signal is labeled as 1 and an interference signal is labeled as 0); and combining all the verification samples into a verification sample set.
[0135] Perform the same preprocessing operations on the validation samples as on the training samples (e.g., extract a 700ms signal segment, perform the same normalization process, etc.) to ensure the consistency of the input data format.
[0136] Calculate the Euclidean distance between the validation feature vector corresponding to each validation sample and the prototype vector of the positive class sample. Use the Euclidean distance value corresponding to each validation sample as the third similarity and summarize them to obtain the similarity set.
[0137] Multiple candidate decision thresholds are selected from the similarity set. For example, the minimum distance value and the maximum distance value in the similarity set are determined. Within the interval from the minimum distance value to the maximum distance value, multiple candidate decision thresholds are selected by uniform sampling according to the preset number of candidate thresholds (e.g., 100) to ensure that the candidate decision thresholds fully cover the complete value range of the similarity distribution of the verification samples.
[0138] For each candidate decision threshold, perform the following operations: Iterate through each verification sample in the verification sample set. If the third similarity of the verification sample is less than the current candidate decision threshold, the verification sample is determined as a valid knock signal; otherwise, it is determined as an interference signal. Compare the decision result of each verification sample with the real label of the verification sample one by one, count the number of verification samples whose decision results match the real label, and calculate the percentage of this number to the total number of verification samples as the recognition accuracy under the current candidate decision threshold.
[0139] Iterate through all candidate decision thresholds and their corresponding recognition accuracies, selecting the candidate decision threshold with the highest recognition accuracy as the preset similarity threshold. If multiple candidate decision thresholds correspond to the same highest recognition accuracy, select the candidate decision threshold that achieves the optimal balance between the recall rate of the valid knock signal and the precision rate of the interference signal in the validation sample set (e.g., selecting the candidate decision threshold that maximizes the sum of the recall rate of the valid knock signal and the precision rate of the interference signal) as the preset similarity threshold to balance the detection rate and anti-interference ability.
[0140] The determined preset similarity threshold is stored in local memory for use as a judgment condition during the inference phase.
[0141] In one feasible implementation, training sample pairs can be extracted from the positive class sample pool and the negative class sample pool, that is, sample pairs of the same class and sample pairs of different classes can be extracted, and the sample pair labels of the training sample pairs can be determined, including the same class and different classes; the same class sample pairs and sample pairs of different classes can be used as training samples, and the similarity measure in the feature space can be used as the optimization objective to achieve iterative training of the feature extraction network to be trained.
[0142] Among them, a pair of similar samples is a combination of training samples consisting of two samples belonging to the same class. A pair of similar samples includes at least two identical positive class samples or at least two identical negative class samples; a pair of dissimilar samples is a combination of training samples consisting of at least two samples belonging to different classes. A pair of dissimilar samples includes at least one positive class sample and at least one negative class sample.
[0143] The label for a pair of samples from the same class can be set to 1 (indicating similarity, i.e., belonging to the same class). The specific way to construct pairs of samples from different classes can be: randomly select a positive class sample from the positive class sample pool and randomly select a negative class sample from the negative class sample pool to form a pair. The label for pairs of samples from different classes can be set to 0 (indicating dissimilarity, i.e., belonging to different classes).
[0144] During the extraction process, the ratio of similar sample pairs to dissimilar sample pairs can be controlled, for example, the ratio can be controlled between 1:2 and 1:3, and the number of samples extracted from each negative sample pool can be kept balanced to ensure the balance of various negative sample types during training.
[0145] By flexibly sampling positive and negative samples, we can construct pairs of samples of the same class and pairs of samples of different classes for metric learning training. During training, we only need to keep the number of pairs of samples of the same class and pairs of samples of different classes basically balanced, without forcing the original number of positive and negative samples to reach a balance, thus overcoming the negative impact of class imbalance on model training.
[0146] In one feasible implementation, the loss value of the metric loss function can be calculated based on the second similarity and the sample pair labels in the following way: For the current training round, obtain the second similarity corresponding to all out-of-class sample pairs; select some out-of-class sample pairs whose second similarity is less than the third threshold from all out-of-class sample pairs, and regard these out-of-class sample pairs whose second similarity is less than the third threshold as difficult-to-distinguish out-of-class sample pairs; calculate the loss value of the loss function based on the second similarity corresponding to the difficult-to-distinguish out-of-class sample pairs and the second similarity corresponding to all similar sample pairs.
[0147] Specifically, in the current training round, the second similarity of each of all outlier sample pairs (positive-negative sample combinations) constructed in that round can be obtained. All outlier sample pairs are sorted in ascending order of their corresponding second similarity. Based on a preset hard example selection ratio (e.g., 30%), the top-ranked outlier sample pairs are selected from the sorted pairs. A few pairs of outlier samples are considered as difficult-to-distinguish outlier pairs; at this point, the third threshold is the selected threshold. The maximum value of the second similarity among the difficult-to-distinguish outlier sample pairs, that is, only outlier sample pairs with a second similarity less than this threshold are selected as difficult-to-distinguish outlier sample pairs to participate in the loss calculation, while other outlier sample pairs with a second similarity greater than or equal to this threshold (i.e. simple outlier sample pairs that are easily distinguished by the model) do not participate in the loss calculation of the current round.
[0148] Alternatively, the third threshold can be set as a fixed threshold. For example, the third threshold can be preset to a fixed similarity value (e.g., Euclidean distance 1.2), and all out-of-class sample pairs with a second similarity less than this fixed value will be screened as difficult-to-distinguish out-of-class sample pairs.
[0149] Based on the second similarity of the selected difficult-to-distinguish outlier sample pairs and the second similarity of all similar sample pairs in the current round, the loss value of the metric loss function is calculated. This makes the calculation of the metric loss function no longer treat all outlier sample pairs equally, but instead focuses the model's learning attention on the most difficult outlier sample combinations to be correctly distinguished in the current training round, that is, focusing on the interference samples that are close to the positive class samples in the feature space and are near the classification boundary.
[0150] In one feasible implementation, the first component loss of the contrastive loss function can be calculated based on the second similarity corresponding to all similar sample pairs in the current training round and the sample pair labels of the similar sample pairs; the second component loss of the contrastive loss function can be calculated based on the second similarity corresponding to all hard-to-distinguish heterogeneous sample pairs in the current training round and the sample pair labels of the heterogeneous sample pairs.
[0151] Further, based on the first component loss, the second component loss, and the total number of first sample pairs for all similar sample pairs and all difficult-to-distinguish heterogeneous sample pairs in the current training round, the loss value of the metric loss function is calculated. Specifically, the first component loss and the second component loss corresponding to all sample pairs can be summed, and the summation result can be divided by the total number of first sample pairs for all similar sample pairs and all difficult-to-distinguish heterogeneous sample pairs in the current training round to obtain the average value. This average value is used as the loss value of the metric loss function. Specifically, it can be expressed as:
[0152] in, To measure the loss value of the loss function, This represents the total number of positive class sample pairs in the current training round. This represents the total number of all hard-to-distinguish outlier pairs in the current training round. () represents the total number of first sample pairs among all similar sample pairs and all difficult-to-distinguish different sample pairs in the current training round. This represents the second similarity between pairs of positive samples. This represents the second similarity between pairs of difficult-to-distinguish different samples. Indicates the sample pair label, when When =1, This represents the first component loss caused by similar sample pairs, when When =0, This represents the second component loss caused by out-of-class samples; margin This represents a preset distance threshold (which can be set to 1); when the second similarity of a pair of hard-to-distinguish outlier samples is greater than the first distance threshold, the loss of the second component is zero.
[0153] This allows the feature extraction network to automatically filter out easily distinguishable simple negative class samples during training, focusing optimization on the most easily confused combinations of difficult-to-distinguish outlier samples near the decision boundary. This increases the feature distance between difficult-to-distinguish negative class samples and positive class samples, thereby improving the model's ability to recognize complex interference signals.
[0154] In this embodiment, by using a weight-sharing-based twin feature extraction network architecture, combined with a multi-branch parallel feature extraction architecture, an online hard case mining mechanism, and an adaptive threshold optimization based on the validation set, the trained feature extraction network and the preset similarity threshold can comprehensively improve the accuracy of vehicle vibration signal detection from multiple levels, such as fine-grained feature representation, generalization ability in open scenarios, discrimination accuracy of hard cases, and robustness against class imbalance.
[0155] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the impact vibration detection method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0156] This application provides a knocking vibration detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the knocking vibration detection method in the first embodiment described above.
[0157] The following is for reference. Figure 7 The diagram illustrates a structural schematic suitable for implementing the impact vibration detection device in the embodiments of this application. The impact vibration detection device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, tablets, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital televisions and desktop computers. Figure 7 The impact vibration detection device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this application.
[0158] like Figure 7As shown, the impact vibration detection device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the impact vibration detection device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the impact vibration detection device to communicate wirelessly or wiredly with other devices to exchange data. Although the figures show impact vibration detection devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0159] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0160] The impact vibration detection device provided in this application, employing the impact vibration detection method in the above embodiments, can solve the technical problem of low detection accuracy of vibration signals from impacted vehicles. Compared with the prior art, the beneficial effects of the impact vibration detection device provided in this application are the same as those of the impact vibration detection method provided in the above embodiments, and other technical features of this impact vibration detection device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0161] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0162] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0163] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the impact vibration detection method in the above embodiments.
[0164] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0165] The aforementioned computer-readable storage medium may be included in the impact vibration detection device; or it may exist independently and not assembled into the impact vibration detection device.
[0166] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the impact vibration detection device, cause the impact vibration detection device to perform the aforementioned impact vibration detection method.
[0167] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0168] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0169] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0170] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described impact vibration detection method, thereby solving the technical problem of low detection accuracy of vibration signals from impacted vehicles. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the impact vibration detection method provided in the above embodiments, and will not be repeated here.
[0171] The above are merely some embodiments of this application and do not limit the scope of protection of this application. All equivalent structural transformations made based on the technical concept of this application and the content of this specification and drawings, or direct / indirect applications in other related technical fields, are included within the scope of protection of this application. All actions involving the acquisition of signals, information, or data in this application are performed in accordance with the relevant data protection laws and policies of the country where the application is located and with authorization from the owner of the corresponding device.
Claims
1. A method for detecting impact vibration, characterized in that, The impact vibration detection method includes: Obtain the current vehicle vibration signal within the preset human-vehicle interaction area; The current vehicle vibration signal is input into a feature extraction network to obtain a multi-dimensional feature vector. The feature extraction network contains at least two parallel feature extraction branches, each of which is used to extract features of different dimensions. Based on the multi-dimensional feature vector and the positive class sample prototype vector, it is determined whether the current vehicle vibration signal is a valid knocking signal, wherein the positive class sample prototype vector is used to characterize the standard features corresponding to a valid knocking operation.
2. The impact vibration detection method as described in claim 1, characterized in that, The feature extraction branch includes a main feature extraction branch and a sub-feature extraction branch. The main feature extraction branch includes a time-domain feature extraction branch, and the sub-feature extraction branch includes at least one of a time-domain feature extraction branch, a frequency-domain feature extraction branch, and a time-frequency-domain feature extraction branch. The step of inputting the current vehicle vibration signal into the feature extraction network to obtain a multi-dimensional feature vector includes: The current vehicle vibration signal is input into the feature extraction network, and the main feature extraction branch is used to extract features from the current vehicle vibration signal to obtain a first feature vector. The second feature vector is obtained by extracting features from the current vehicle vibration signal through the sub-feature extraction branch. The first feature vector and the second feature vector are fused to obtain a multi-dimensional feature vector.
3. The impact vibration detection method as described in claim 2, characterized in that, The main feature extraction branch and the sub-feature extraction branch are structurally symmetrical, and the size of the convolution kernel in the main feature extraction branch is larger than the size of the convolution kernel in the sub-feature extraction branch; The convolution kernel in the main feature extraction branch is used to extract the low-frequency features of the current vehicle vibration signal, and the convolution kernel in the secondary feature extraction branch is used to extract the high-frequency features of the current vehicle vibration signal.
4. The impact vibration detection method as described in claim 1, characterized in that, The step of determining whether the current vehicle vibration signal is a valid impact signal based on the multi-dimensional feature vector and the positive class sample prototype vector includes: Calculate the first similarity between the multi-dimensional feature vector and the prototype vector of the positive class sample; When the first similarity is less than a preset similarity threshold, the current vehicle vibration signal is determined to be a valid knocking signal; When the first similarity is greater than or equal to the preset similarity threshold, the current vehicle vibration signal is determined to be an interference signal.
5. The impact vibration detection method as described in claim 1, characterized in that, Before the step of acquiring the current vehicle vibration signal within the preset human-vehicle interaction area, the method further includes: Obtain positive and negative class samples; The positive and negative samples are extracted using a feature extraction network to be trained, resulting in at least two historical feature vectors. Calculate the second similarity between at least two of the historical feature vectors; Based on the second similarity, the loss value of the metric loss function is calculated, the model parameters of the feature extraction network to be trained are updated according to the loss value, and the steps of obtaining positive and negative samples are returned until the preset optimization target is reached, and the trained feature extraction network is obtained.
6. The impact vibration detection method as described in claim 5, characterized in that, The feature extraction network to be trained includes a Siamese feature extraction network. The step of extracting features from the positive class samples and the negative class samples through the feature extraction network to be trained, thereby obtaining at least two historical feature vectors, includes: The positive and negative samples are input into the Siamese feature extraction network. The positive and negative samples are extracted through at least two feature extraction paths in the Siamese feature extraction network, respectively, to obtain at least two historical feature vectors. Each feature extraction path contains at least two parallel feature extraction branches, and the weights of each feature extraction path are shared.
7. The impact vibration detection method as described in claim 5, characterized in that, After the step of extracting features from the positive and negative samples using the feature extraction network to be trained, and obtaining at least two historical feature vectors, the method further includes: Obtain the historical feature vectors corresponding to all positive class samples in all previous training rounds; Calculate the mean vector of the historical feature vectors corresponding to all positive class samples, and use the mean vector as the prototype vector of the positive class samples in the current training round.
8. The impact vibration detection method as described in claim 7, characterized in that, After obtaining the trained feature extraction network, the following is also included: Obtain a verification sample set, which includes multiple verification samples and the real labels corresponding to each verification sample; Each of the verification samples is input into the trained feature extraction network to obtain the verification feature vector corresponding to each of the verification samples; Calculate the third similarity between each of the verification feature vectors and the prototype vector of the positive class sample to obtain a similarity set; Multiple candidate decision thresholds are selected from the similarity set; Based on the real labels, determine the recognition accuracy of the corresponding verification sample set when performing signal recognition according to the candidate judgment thresholds. The candidate judgment threshold with the highest recognition accuracy is used as the preset similarity threshold.
9. The impact vibration detection method as described in claim 5, characterized in that, The step of calculating the loss value of the metric loss function based on the second similarity includes: For the current training round, obtain the second similarity of all pairs of outlier samples; Select a subset of outlier sample pairs from all the outlier sample pairs whose second similarity is less than the third threshold, and use these subsets as difficult-to-distinguish outlier sample pairs. The loss value of the metric loss function is calculated based on the second similarity corresponding to the difficult-to-distinguish heterogeneous sample pairs and the second similarity corresponding to all homogeneous sample pairs.
10. The impact vibration detection method as described in claim 9, characterized in that, The step of calculating the loss value of the loss function based on the second similarity corresponding to the difficult-to-distinguish heterogeneous sample pairs and the second similarity corresponding to all homogeneous sample pairs includes: Based on the second similarity of all similar sample pairs in the current training round, the first component loss of similar sample pairs is calculated using the aforementioned loss function; Based on the second similarity corresponding to all hard-to-distinguish outlier sample pairs in the current training round, the second component loss brought by the hard-to-distinguish outlier sample pairs is calculated through the metric loss function. When the second similarity corresponding to the hard-to-distinguish outlier sample pairs is greater than the first distance threshold, the second component loss is zero. The loss value of the metric loss function is calculated based on the first component loss, the second component loss, and the total number of first sample pairs of all similar sample pairs and all difficult-to-distinguish heterogeneous sample pairs in the current training round.
11. The impact vibration detection method as described in claim 5, characterized in that, The loss function includes a contrastive loss function, and the step of calculating the loss value of the loss function based on the second similarity includes: Based on the second similarity, the third component loss brought by the positive class sample and the fourth component loss brought by the negative class sample are calculated through the contrast loss function. When the second similarity corresponding to the negative class sample is greater than the second distance threshold, the fourth component loss is zero. The loss value of the contrastive loss function is calculated based on the third component loss and the fourth component loss, as well as the total number of second samples of all positive class samples and all negative class samples in the current training round.
12. A device for detecting impact vibration, characterized in that, The impact vibration detection device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the impact vibration detection method as described in any one of claims 1 to 11.
13. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the impact vibration detection method as described in any one of claims 1 to 11.