A dual-microphone sound source localization method based on time-delay neural network
Through the dual microphone sound source positioning method based on delay neural network, the problems of low positioning accuracy and insufficient computing resources in the existing technology are solved, real-time high-accuracy sound source positioning on embedded devices is realized, and the system is enhanced robustness and multi-scale feature fusion capability.
Patent Information
- Application Number
- CN202411155386.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-08-22
AI Technical Summary
The existing dual-microphone sound source positioning method is susceptible to noise and reverb in complex environments, resulting in reduced positioning accuracy. The neural network-based method has limited computing resources on embedded devices, making it difficult to achieve real-time positioning.
The dual microphone sound source positioning method based on delay neural network is adopted, including learnable feature extraction module, time window setting module, delay neural network module, extrusion excitation module and self-attention module, and the model is trained through the cross entropy loss function. , using time-delay neural networks to replace recurrent neural networks to realize parallel time frame computing, enhancing robustness and multi-scale feature fusion.
Real-time sound source positioning on embedded devices is realized, the system's robustness and positioning accuracy are improved, the noise interference can be effectively resisted, and the accuracy and efficiency of sound source positioning are significantly improved.
Smart Images

Figure CN118688717B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of sound source localization, and in particular relates to a dual-microphone sound source localization method based on a time-delay neural network. Background Art
[0002] With the continuous development of artificial intelligence technology, sound source localization technology has broad application prospects in the fields of smart speakers, robots, smart homes, conference systems, etc. The existing dual-microphone sound source localization methods mainly use traditional algorithms, such as cross-correlation method, generalized cross-correlation method, etc., but these methods are easily affected by noise and reverberation in complex environments, resulting in reduced positioning accuracy. Therefore, it is of great practical significance to study a dual-microphone sound source localization method with high accuracy and robustness.
[0003] At present, the multi-channel sound source localization methods based on neural networks mostly use the convolutional recurrent neural network (CRN) structure to take advantage of the dual advantages of using convolutional neural network modeling for local feature extraction and using recurrent neural network modeling for temporal feature extraction. However, since recurrent neural networks cannot be calculated in parallel, they are limited by computing resources when used on edge devices such as embedded systems. Summary of the invention
[0004] In view of the defects of the above-mentioned prior art, considering that dual-microphone sound source positioning requires fast calculation speed, less computing resources and high positioning accuracy when used in smart homes such as fans and air conditioners, the present invention proposes a dual-microphone sound source positioning method based on a time-delay neural network.
[0005] The dual-microphone sound source localization method based on a time-delay neural network of the present invention comprises the following steps:
[0006] S1. Dual-microphone audio data acquisition and processing;
[0007] S2. Calculate the input features of the dual-microphone sound source localization model for the dual-microphone audio data processed in step S1;
[0008] S3. Construct a dual-microphone sound source localization model based on time-delay neural network;
[0009] The dual-microphone sound source localization model includes a learnable feature extraction module, a time window setting module, a time-delay neural network module, a squeeze excitation module, a self-attention module and a classification module;
[0010] The learnable feature extraction module is composed of a one-dimensional convolutional neural network;
[0011] The time window setting module is used to set the time window of the time-delay neural network;
[0012] The time-delay neural network module consists of a dilated convolutional neural network, a ReLU activation function and a batch normalization layer;
[0013] The squeeze excitation module includes a squeeze phase and an excitation phase; the squeeze phase is a global average pooling layer, and the excitation phase includes two fully connected layers, namely a first fully connected layer and a second fully connected layer;
[0014] The self-attention module is used to provide different weights for different time frames;
[0015] The classification module is used to calculate the direction of the target sound source;
[0016] S4. Input the input features obtained in step S2 into the dual-microphone sound source localization model constructed in step S3; use cross entropy as the training loss function for training until the loss function converges to obtain the final sound source localization model;
[0017] The audio data emitted by the dual microphones to be located are used to calculate the input features of the dual-microphone sound source localization model in the same way as step S2, and the input features are input into the final sound source localization model obtained in step S4 to perform sound source localization.
[0018] Preferably, step S2 uses the generalized cross-correlation method feature based on phase transformation as the input feature of the dual-microphone sound source localization model, and the specific calculation process is:
[0019] S21. Calculate the cross power spectral density of the two microphones:
[0020] , X1(k,l) and X2(k,l) represent the frequency domain signals of two microphones, where k and l represent the frequency and frame number of the signal respectively, and the superscript * represents conjugation;
[0021] S22. Perform phase transformation on the cross power spectrum density PSD(k,l) to obtain the cross power spectrum conversion density: ;
[0022] S23. Calculate the cross-correlation function R(l) by inverse Fourier transform IFFT: ;
[0023] R(l)=IFFT(PSD'(k,l))
[0024] The cross-correlation function R(l) represents the GCC-PHAT feature of the lth frame signal, and its dimension is K. The obtained cross-correlation function R(l) is the input feature of the dual-microphone sound source localization model.
[0025] Preferably, the dual-microphone sound source localization model includes multiple time-delay neural network modules cascaded in sequence and forming a residual connection, that is, the output of each time-delay neural network module is directly connected to the input end of all subsequent time-delay neural network modules; and the output ends of all time-delay neural network modules are also directly connected to the extrusion stage of the extrusion excitation module.
[0026] Preferably, the self-attention module adopts the channel- and context-dependent statistical information pooling module in the ECAPA-TDNN model.
[0027] Preferably, the classification module includes a third fully connected layer and a softmax layer.
[0028] Preferably, the output end of the first fully connected layer is connected to a ReLU activation function layer; the output end of the second fully connected layer is connected to a Sigmoid activation function layer.
[0029] Preferably, in step S1, dual-microphone audio data is obtained by using simulation and real acquisition methods as a training set and a verification set for model training;
[0030] The simulation method obtains data sources as follows: using the open source Python library to generate dual-microphone simulation data, using the AISHELL open source Chinese speech database as the target speech input; placing dual-microphone sound sources at different positions in the simulation room, setting the target speech angle to 0~180°, with an interval of 10°, generating dual-microphone speech at different target angles, and saving the target angle as the training classification label of the corresponding speech data;
[0031] The real way to obtain the data source is as follows: set the target angle interval to 10°, namely 0°, 10°...180°, set a high-fidelity speaker to play the voice and use a dual-microphone array to collect dual-microphone voice, and at the same time retain the target angle corresponding to each voice data as a data label.
[0032] The dual-microphone sound source localization method based on time-delay neural network described in the present invention has the following advantages:
[0033] First, the time-delay neural network is used to replace the recurrent neural network. While effectively processing time series signals, the parallel calculation of time frame signals can be realized, so that model reasoning can be used in real-time systems and embedded devices.
[0034] Second, by setting a reasonable time window length, the time-delay neural network can resist noise and random interference to a certain extent and improve the robustness of the system;
[0035] Third, the squeezing excitation module is used to explicitly model the dependencies between channels to improve the network’s representation ability and spatial information fusion capability;
[0036] Fourth, the network's multi-scale feature fusion capability is enhanced through the residual connection module. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 FIG. 1 is a schematic diagram of a specific implementation process of the dual-microphone sound source localization method of the present invention;
[0038] Figure 2 Shown is a schematic diagram of a specific implementation of the dual-microphone sound source localization model of the present invention;
[0039] Figure 3 Shown is a schematic diagram of a specific implementation of the time-delay neural network module of the present invention;
[0040] Figure 4 Shown is a schematic diagram of a specific implementation of the extrusion excitation module of the present invention. DETAILED DESCRIPTION
[0041] In order to more intuitively and clearly describe the specific details of the technical solution of the present invention, a detailed description will be given below in conjunction with specific embodiments and example drawings.
[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in combination with the specific implementation methods of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] The dual-microphone sound source localization method based on time-delay neural network of the present invention is as follows: Figure 1 As shown, the following steps are included:
[0044] S1. Dual-microphone audio data acquisition and processing:
[0045] Two microphones with a spacing of 4 cm are used to simultaneously send out audio data and collect it. The sampling rate is set to 16KHz. The time domain signals collected by the two microphones are x1 and x2 respectively. The sampling point length K of each frame signal is set to 512 sampling points, and the frame shift is K / 2. The time domain signals x1 and x2 are framed, windowed, and discrete Fourier transformed to obtain the frequency domain signals X1(k,l) and X2(k,l) of the two microphones respectively, where k and l represent the frequency and frame number of the signal respectively;
[0046] S2. Calculation of input features of dual-microphone sound source localization model:
[0047] This embodiment uses the generalized cross-correlation method feature GCC-PHAT based on phase transformation
[0048] (Generalized Cross-Correlation with Phase Transform) is used as the input feature of the dual-microphone sound source localization model. The calculation process is:
[0049] S21. Calculate the cross power spectral density of the two microphones:
[0050] , the superscript * indicates conjugation,
[0051] S22. Perform phase transformation on the cross power spectrum density PSD(k,l) to obtain the cross power spectrum conversion density: ;
[0052] S23. Calculate the cross-correlation function R(l) by inverse Fourier transform IFFT: ;
[0053] The cross-correlation function R(l) represents the GCC-PHAT feature of the l-th frame signal, and its dimension is K;
[0054] The obtained cross-correlation function R(l) is the input feature of the dual-microphone sound source localization model;
[0055] S3. Construct a dual-microphone sound source localization model based on time-delay neural network;
[0056] The dual-microphone sound source localization model is as follows: Figure 2 As shown, it includes a learnable feature extraction module, a time window setting module, a time delay neural network module, a squeeze excitation module, a self-attention module and a classification module;
[0057] The learnable feature extraction module is composed of a one-dimensional convolutional neural network with a convolution kernel size of 1, an input channel of 512, and an output channel of 60;
[0058] The time window setting module sets the time window length of the time delay neural network to L=60;
[0059] The input features of the dual-microphone sound source localization model obtained in step S2 are continuously input into the learnable feature extraction module frame by frame, and accumulated until the time frame length is L=60, and the 60*60 dimensional features are input into the time-delay neural network module;
[0060] The time-delay neural network module, such as Figure 3 As shown, it can be composed of a hole convolutional neural network, a ReLU activation function and a batch normalization layer.
[0061] Preferably, in the dual-microphone sound source localization model, four time-delay neural network modules are cascaded sequentially to form a residual connection, which from beginning to end are respectively the first time-delay neural network module, the second time-delay neural network module, the third time-delay neural network module and the fourth time-delay neural network module.
[0062] The four time-delay neural network modules also form a residual connection, that is, the output of each time-delay neural network module is directly connected to the input end of all subsequent time-delay neural network modules, that is, the output end of the first time-delay neural network module. Figure 2 The input end of the second time-delay neural network module is connected, and the input ends of the third and fourth time-delay neural network modules are connected; similarly, the output end of the second time-delay neural network module is connected to the input ends of the third and fourth time-delay neural network modules. The residual connection makes the input features of each module contain the output features of all previous modules to fuse features at different scales.
[0063] Set the first time-delay neural network module input channel to 60, output channel C to 60, convolution kernel size to 5, and the dilated convolution ratio of the dilated convolution neural network to 1. Set the second time-delay neural network module input channel to 60, output channel to 60, convolution kernel size to 3, and dilated convolution ratio to 2. Set the third time-delay neural network module input channel to 60, output channel to 60, convolution kernel size to 3, and dilated convolution ratio to 3. Set the fourth time-delay neural network module input channel to 60, output channel to 60, convolution kernel size to 3, and dilated convolution ratio to 4.
[0064] The atrous convolutional neural network inserts holes between standard convolution kernels, thereby increasing the receptive field of the convolution kernel without increasing the number of parameters;
[0065] The ReLU activation function can introduce nonlinear characteristics to the neural network, allowing the network to learn and simulate more complex functions; the batch normalization layer is used to accelerate the training process and improve model performance in deep learning, which can accelerate convergence and reduce dependence on initialization;
[0066] By setting different convolution kernel sizes and void ratios, the depth of the network model can be increased and the receptive field of the convolutional neural network can be expanded.
[0067] The extrusion excitation module includes an extrusion phase and an excitation phase.
[0068] The squeezing stage is a global average pooling layer that performs a global average pooling operation to compress the information in the spatial dimension and obtain a global response for each channel.
[0069] In the excitation stage, two fully connected layers are used to learn the dependencies between channels. The first fully connected layer reduces the 1*1*C dimensional feature vector obtained by the squeezing operation to a lower dimensional representation, for example, it can be reduced to 1*1*C / 4, where C is the channel dimension; dimensionality reduction helps to reduce the number of parameters and the amount of computation, while enabling the neural network to learn a more compact representation of channel importance.
[0070] The first fully connected layer can be followed by a ReLU activation function layer to provide nonlinear capabilities, enabling the network to capture more complex channel dependencies.
[0071] The function of the second fully connected layer is to restore the low-dimensional feature vector output by the first fully connected layer to the original channel dimension C. In this way, each output corresponds to the importance weight of an input channel. The output of the second fully connected layer will be connected to a Sigmoid activation function to compress the weight value into the range of (0, 1) to characterize the importance of each channel. A specific implementation of the squeeze excitation module is as follows: Figure 4 shown.
[0072] When the dual-microphone sound source localization model includes four time-delay neural network modules, the output ends of the four time-delay neural network modules are directly connected to the extrusion stage of the extrusion excitation module to form a residual connection. The residual connection between the squeezing excitation module and the four time-delay neural network modules constitutes a residual module. The input features of each module in the residual module include the output features of all previous modules to fuse features at different scales.
[0073] The self-attention module adopts the channel- and context-dependent statistical information pooling module of the ECAPA-TDNN model (Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification) to provide different weights for different time frames, thereby aggregating the spatial features of the sound source orientation.
[0074] The classification module includes a third fully connected layer and a softmax layer. The output dimension of the fully connected layer is set to 19 and the category with a large probability value in the classification number calculated by the softmax layer is the target sound source direction.
[0075] The dual-microphone sound source localization model of the present invention adopts a time-delay neural network module to replace a recurrent neural network, which can realize parallel calculation of time frame signals while effectively processing time series signals, so that model reasoning can be used in real-time systems and embedded devices; the time-delay neural network can resist noise and random interference to a certain extent by setting a reasonable time window length, thereby improving the robustness of the system.
[0076] The squeezing excitation module explicitly models the dependencies between channels to improve the network's representation ability and spatial information fusion ability, and the residual connection module enhances the network's multi-scale feature fusion ability, thereby improving the accuracy and robustness of the model's positioning.
[0077] S4. Use the simulated and real collected dual-microphone audio data to train the sound source localization model. After the training is completed, use the trained sound source localization model to obtain input features for the dual-microphone sound source that needs to be located using steps S1 and S2, and input the input features into the model to perform dual-microphone sound source localization.
[0078] The specific training method can obtain dual-microphone audio data in step S1 by using simulation and real collection methods, including audio information and corresponding labels;
[0079] The simulation data comes from: using the open source python library to generate dual-microphone simulation data, using the AISHELL open source Chinese speech database as the target speech input. The simulation sets the room size from 3M*3M*3M to 6M*6M*3M, places the dual-microphone sound source at different positions in the room, sets the target speech angle from 0 to 180°, with an interval of 10°, generates dual-microphone speech at different target angles, and saves the target angle as the training classification label of the corresponding speech data.
[0080] The actual data collected comes from: setting the target angle interval to 10°, namely 0°, 10°…180°, setting a high-fidelity speaker to play voice and using a dual-microphone array to collect dual-microphone voice, while retaining the target angle corresponding to each voice data as a data label.
[0081] The simulated dual-microphone speech data and the real collected speech data are calculated through step S2 to obtain the input features of the model, namely the cross-correlation function R(l), and the input features are sent to the model for training. All the initial parameters of the model can be set based on experience or randomly generated. The cross entropy is used as the training loss function to evaluate the difference between the angle value calculated by the model and the true label angle value during the training process. Through continuous training iterations until the loss function converges, the final sound source localization model is obtained.
[0082] After the training is completed, the azimuth angle accuracy is used to evaluate the model performance. The sound source localization model obtained by the present invention is used to estimate the azimuth angle (DOA) of the dual microphones. Compared with the traditional signal processing method, when the sound source is 2 meters away from the center of the dual microphone array, the accuracy of the time-delay neural network dual microphone sound source localization method is significantly higher than the traditional method;
[0083] Sound source direction [°] The positioning accuracy of the present invention Traditional positioning method accuracy Accuracy improvement (%) 0 100% 93.75% 6.25 20 97.5% 73.75% 23.75 40 98.75% 68.75% 30 60 100% 98.75% 1.25 80 100% 100% 0 100 100% 100% 0 120 97.5% 97.5% 0 140 96.25% 90% 6.25 160 97.5% 81.25% 16.25 180 93.75% 81.25% 12.5
[0084] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0085] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0086] The foregoing describes various preferred embodiments of the present invention. Unless the preferred implementation modes in various preferred embodiments are obviously self-contradictory or based on a certain preferred implementation mode, various preferred implementation modes can be arbitrarily superimposed and used in combination. The embodiments and specific parameters in the embodiments are only for clearly describing the invention verification process of the inventor, and are not used to limit the patent protection scope of the present invention. The patent protection scope of the present invention shall still be based on its claims. All equivalent structural changes made using the contents of the description and drawings of the present invention should be included in the protection scope of the present invention.
Claims
1. A dual-microphone sound source localization method based on time-delay neural network, characterized in that , including the following steps: S1. Dual-microphone audio data acquisition and processing; S2. Calculate the input features of the dual-microphone sound source localization model for the dual-microphone audio data processed in step S1; S3. Construct a dual-microphone sound source localization model based on time-delay neural network; The dual-microphone sound source localization model includes a learnable feature extraction module, a time window setting module, a time-delay neural network module, a squeeze excitation module, a self-attention module and a classification module; The learnable feature extraction module is composed of a one-dimensional convolutional neural network; The time window setting module is used to set the time window of the time-delay neural network; The time-delay neural network module consists of a dilated convolutional neural network, a RELU activation function and a batch normalization layer; The squeeze excitation module includes a squeeze phase and an excitation phase; the squeeze phase is a global average pooling layer, and the excitation phase includes two fully connected layers, namely a first fully connected layer and a second fully connected layer; The self-attention module is used to provide different weights for different time frames; The classification module is used to calculate the direction of the target sound source; S4. Input the input features obtained in step S2 into the dual-microphone sound source localization model constructed in step S3; use cross entropy as the training loss function for training until the loss function converges to obtain the final sound source localization model; The audio data emitted by the dual microphones to be located are used to calculate the input features of the dual-microphone sound source localization model in the same way as step S2, and the input features are used as the input into the final sound source localization model obtained in step S4 to perform sound source localization; Step S2 uses the generalized cross-correlation method feature based on phase transformation as the input feature of the dual-microphone sound source localization model. The specific calculation process is: S21. Calculate the cross power spectral density of the two microphones: X1(k,l) and X2(k,l) represent the frequency domain signals of the two microphones, where k and l represent the frequency and frame number of the signal respectively, and the superscript * represents conjugation; S22. Perform phase transformation on the cross power spectrum density PSD(k,l) to obtain the cross power spectrum conversion density: S23. Calculate the cross-correlation function R(l) by inverse Fourier transform IFFT: R(l)=IFFT(PSD'(k,l)) The cross-correlation function R(l) represents the GCC-PHAT feature of the l-th frame signal, and its dimension is K. The obtained cross-correlation function R(l) is the input feature of the dual-microphone sound source localization model, and PSD'(k,l) is the cross-power spectrum conversion density.
2. The dual-microphone sound source localization method based on time-delay neural network as claimed in claim 1, characterized in that: The dual-microphone sound source localization model includes multiple time-delay neural network modules cascaded in sequence and forming a residual connection, that is, the output of each time-delay neural network module is directly connected to the input end of all subsequent time-delay neural network modules; and the output ends of all time-delay neural network modules are also directly connected to the extrusion stage of the extrusion excitation module.
3. The dual-microphone sound source localization method based on time-delay neural network as claimed in claim 1, characterized in that: The self-attention module adopts the channel- and context-dependent statistical information pooling module in the ECAPA-TDNN model.
4. The dual-microphone sound source localization method based on time-delay neural network as claimed in claim 1, characterized in that: The classification module includes a third fully connected layer and a softmax layer.
5. The dual-microphone sound source localization method based on time-delay neural network as claimed in claim 1, characterized in that: The output end of the first fully connected layer is connected to a RELU activation function layer; the output end of the second fully connected layer is connected to a Sigmoid activation function layer.
6. The dual-microphone sound source localization method based on time-delay neural network as claimed in claim 1, characterized in that: In step S1, dual-microphone audio data is obtained by simulation and real acquisition as a training set and a validation set for model training; The simulation method obtains data sources as follows: using the open source Python library to generate dual-microphone simulation data, using the AISHELL open source Chinese speech database as the target speech input; placing dual-microphone sound sources at different positions in the simulation room, setting the target speech angle to 0-180°, with an interval of 10°, generating dual-microphone speech at different target angles, and saving the target angle as the training classification label of the corresponding speech data; The real way to obtain the data source is as follows: set the target angle interval to 10°, namely 0°, 10°...180°, set a high-fidelity speaker to play the voice and use a dual-microphone array to collect dual-microphone voice, and at the same time retain the target angle corresponding to each voice data as a data label.
