A method for environmental noise monitoring based on self-attention mechanism

By using the self-attention mechanism to extract the voiceprint features in the spectrum map in environmental noise monitoring, the problem of inaccurate noise monitoring results in the prior art is solved, and high accuracy and real-time monitoring of environmental noise is achieved.

CN118866011BActive Publication Date: 2025-02-07HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411333837.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-02-07
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

The existing environmental noise monitoring methods are susceptible to factors such as background noise and time-frequency instability in complex environments, resulting in inaccurate monitoring results and are difficult to meet the high real-time and accuracy of noise monitoring in urbanization. Require.

Method used

The ambient noise monitoring method based on the self-attention mechanism is adopted to convert the audio signal into a spectrum graph through short-time Fourier transform, and the voiceprint features in the spectrum graph are extracted using the self-attention mechanism, and finally the voiceprint features are selected through the neural network. Make classification.

Benefits of technology

Achieves multi-dimensional monitoring and analysis of environmental sounds, captures rich information such as frequency, energy distribution and time changes of sound, significantly improves the accuracy and recognition ability of noise monitoring, and can accurately identify various sound sources in complex environments. category.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118866011B_ABST
    Figure CN118866011B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of environmental noise monitoring. The present invention discloses an environmental noise monitoring method based on a self-attention mechanism, including the following steps: converting an audio signal into a spectrogram by short-time Fourier transform; extracting voiceprint features of the spectrogram by a self-attention mechanism; corresponding to a specific environmental sound source category by a neural network voiceprint feature. The present invention converts an audio signal into a spectrogram by using a short-time Fourier transform, and extracts voiceprint features in the spectrogram by combining a self-attention mechanism, thereby realizing multi-dimensional monitoring and analysis of environmental sound. This method can capture rich information such as the frequency, energy distribution, and time variation of sound, providing more comprehensive and accurate indicators for environmental sound monitoring, and the self-attention mechanism can automatically learn key information in the spectrogram and give it a higher weight, thereby effectively extracting voiceprint features that are critical to classification tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of environmental noise monitoring, and in particular relates to an environmental noise monitoring method based on a self-attention mechanism. Background Art

[0002] Most of the existing environmental noise monitoring methods rely on traditional acoustic sensors and signal processing algorithms. These methods are easily affected by multiple factors such as background noise and unstable time-frequency changes in complex environments, resulting in inaccurate monitoring results. At the same time, with the acceleration of urbanization, environmental noise sources are becoming increasingly complex and diverse, which puts higher requirements on the real-time and accuracy of noise monitoring. Therefore, an environmental noise monitoring method based on self-attention mechanism is proposed to solve the above problems. Summary of the invention

[0003] The purpose of the present invention is to provide an environmental noise monitoring method based on a self-attention mechanism to solve the problems raised in the above background technology.

[0004] To achieve the above object, the present invention provides the following technical solution: an environmental noise monitoring method based on a self-attention mechanism, comprising the following steps:

[0005] S1: Convert the audio signal into a spectrogram through short-time Fourier transform;

[0006] S2: Extract voiceprint features of spectrogram through self-attention mechanism;

[0007] S3: The neural network voiceprint features are mapped to specific environmental sound source categories.

[0008] Preferably, the step of converting the audio signal into a spectrogram by short-time Fourier transform specifically comprises:

[0009] S11: converting the ambient sound signal into an electrical signal through a microphone;

[0010] S12: sampling the continuous electrical signal into a discrete time series signal through a collector;

[0011] S13: Slice the discrete time series signal into signal vectors with time domain overlap between adjacent signal vectors through a sliding time window.

[0012] S14: Perform discrete-time Fourier transform on each signal vector and retain only the amplitude result, and stack the transform results along the row direction in time order to obtain a spectrum matrix.

[0013] Preferably, the step of extracting voiceprint features from the spectrogram through the self-attention mechanism specifically includes:

[0014] S21: Slice the spectrum matrix described in S14 to obtain N overlapping sub-matrices with a size of ;

[0015] S22: Reshape the N overlapping sub-matrices into vectors through linear transformation, and add additional trainable category features, that is, ;

[0016] S23: Incorporate the position information into the feature vector, add all the feature vectors and the position information vector with the trainable parameter to obtain the feature vector , ;

[0017] S24: The input is fed into a self-attention based encoder to extract voiceprint features.

[0018] Preferably, the The steps of extracting voiceprint features by inputting into the self-attention-based encoder include:

[0019] S241: Input the feature vector to the first residual block, the residual part of which includes a regularization layer and a multi-head attention mechanism layer;

[0020] S242: the output of the first residual block is input to the first residual block, the residual part of the residual block includes a regularization layer and a multi-layer perceptron layer;

[0021] S243: Repeat S241 to S242 L times, with the input of each repetition being the output result of the previous repetition.

[0022] Preferably, the step of inputting the feature vector into the first residual block, wherein the residual part of the residual block includes a regularization layer and a multi-head attention mechanism layer, specifically includes:

[0023] S2411: Use three different linear transformation matrices with trainable parameters to multiply the input matrix to obtain three different results: Query (Q), Keys (K), and Values ​​(V);

[0024] S2412: Perform matrix dot multiplication on Query and Keys, divide by the square root of the column size of the matrix, and finally perform normalization using a preset function;

[0025] S2413: Perform matrix dot multiplication on Values ​​and the output result of S2412;

[0026] S2414: Repeat S2411 to S2413 in parallel for h times, concatenate the h matrices output in parallel in the column direction, and finally perform linear transformation.

[0027] Preferably, the signal vector is a column vector.

[0028] Preferably, in S2412, the preset function is a normalized exponential function.

[0029] Compared with the prior art, the present invention has the following beneficial effects:

[0030] The present invention realizes multi-dimensional monitoring and analysis of environmental sound by converting audio signals into spectrograms using short-time Fourier transform and extracting voiceprint features from the spectrograms in combination with the self-attention mechanism. This method can capture rich information such as the frequency, energy distribution, and time variation of the sound, providing more comprehensive and accurate indicators for environmental sound monitoring, and the self-attention mechanism can automatically learn the key information in the spectrogram and give it a higher weight, thereby effectively extracting voiceprint features that are crucial to the classification task. This mechanism enables the model to accurately identify various sound source categories, such as traffic noise, industrial noise, and life noise, in a complex environmental sound background, significantly improving the classification accuracy and recognition ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a schematic diagram of the preprocessing process of the environmental audio according to the present invention;

[0032] Figure 2 This is a flow chart of environmental sound classification based on the self-attention mechanism of the present invention to extract the voiceprint features of the spectrum graph;

[0033] Figure 3 for Figure 2 Flowchart of the encoder based on the self-attention mechanism;

[0034] Figure 4 for Figure 3 Flowchart of multi-head attention computation. DETAILED DESCRIPTION

[0035] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.

[0036] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.

[0037] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.

[0038] See also Figure 1-Figure 4 As shown, the present invention provides the following technical solutions:

[0039] Example 1

[0040] A method for identifying environmental sound sources by using a self-attention mechanism to classify sound spectrograms. When implemented, a microphone and a collector are required to convert the sound signal in the environmental sound into a discrete time signal. The specific process of the method for identifying the environmental sound source in this signal is as follows:

[0041] Step 1) Convert the audio signal into a spectrogram by short-time Fourier transform;

[0042] Step 2) Extract the voiceprint features of the spectrogram through the self-attention mechanism;

[0043] Step 3) Use the neural network voiceprint features to map to specific environmental sound source categories.

[0044] In addition, in the present invention, regarding the above step 1):

[0045] like Figure 1 As shown, the specific process of step 1) is:

[0046] Step a1) For the ambient sound signal after discrete time sampling , perform window processing, the processing process is:

[0047] ;

[0048] in, is the time window number, is the frame number of the time window, The sliding step size is used, and each time window is processed by a window function to compensate for the spectrum leakage caused by not meeting the signal stationary assumption.

[0049] Step a2) Perform discrete Fourier transform on the windowed signal:

[0050] ;

[0051] in represents the frequency, It is the number of signal frames in a period of time.

[0052] Step a3) Based on, draw the spectrum diagram, that is , and divide the spectrum graph into N overlapping subgraphs. .

[0053] In addition, in the present invention, if Figure 2 As shown, the specific process of step 2) is:

[0054] Step b1) Reshape the N sub-graph matrices described in step a3) into vectors through linear transformation, and add additional trainable category features to obtain feature vectors ,and ;

[0055] Step b2) Incorporate the position information of the sub-graph in the spectrum graph into the feature vector to obtain a new feature vector ,and ;

[0056] Step b3) Input into the self-attention based encoder to extract voiceprint features;

[0057] Step b4) mapping the voiceprint features to specific environmental sound categories through a fully connected neural network.

[0058] In addition, in the present invention, regarding the above step b3):

[0059] like Figure 3 As shown, the self-attention based encoder in step b3) is composed of The encoder blocks are connected in series. The specific process is as follows:

[0060] Step c1) convert the feature vector Input to the first encoder block, which contains two residual blocks. The residual part of the first residual block contains a regularization layer and a multi-head attention calculation layer, as shown below:

[0061] ;

[0062] in, , indicating the encoder blocks, represents the output or first feature vector of the previous encoder block, represents the calculation of multi-head attention mechanism, represents the regularization layer, and the calculation process is as follows:

[0063] ;

[0064] in, Feature vectors representing different subgraphs and categories Serial number, is the mathematical expectation of the eigenvector, is the variance of the eigenvector, To reduce the denominator to prevent it from being zero, we usually take For the value, and is a trainable parameter.

[0065] In addition, in the present invention, step c2) converts the output result of step c1) into Input to the second residual block, the residual part of which includes a regularization layer with the same structure as step c1) and a multi-layer perceptron layer, as shown below:

[0066] ;

[0067] in, The output of the current encoder block, Represents a multi-layer perceptron operation.

[0068] like Figure 4 As shown, the multi-head attention calculation described in step c1) is calculated as The parallel concatenation of attention calculations, generally , the specific calculation process is:

[0069] Step d1) Convert the feature matrix Through a linear transformation matrix with trainable parameters ,in Generally take The calculation results are expressed as ,in Represents different parallel paths of attention computation.

[0070] Step d2) is based on step d1) , calculate the attention matrix , as shown below:

[0071] ;

[0072] in, is the normalized exponential function.

[0073] Step d3) Step d2) h The concatenation is done and a linear transformation is performed using a matrix with trainable parameters as follows:

[0074] ;

[0075] in, is the multi-head attention output matrix, is a linear variation matrix with trainable parameters.

[0076] Example 2

[0077] Environmental noise monitoring is carried out in urban central areas to assess the impact of traffic, construction sites, commercial activities, etc. on residents' lives.

[0078] Implementation steps:

[0079] Deploy sensors: Deploy microphones and collectors at key locations in the city center (such as traffic intersections, parks, and near residential areas) to ensure full coverage of the monitoring area.

[0080] Data acquisition: The ambient sound signal is converted into an electrical signal through a microphone and sampled and digitized by a collector.

[0081] Spectrogram generation: According to steps S11-S14, the collected audio signal is converted into a spectrogram matrix, which specifically includes:

[0082] S11: converting the ambient sound signal into an electrical signal through a microphone;

[0083] S12: sampling the continuous electrical signal into a discrete time series signal through a collector;

[0084] S13: Slice the discrete time series signal into signal vectors with time domain overlap between adjacent signal vectors through a sliding time window.

[0085] S14: Perform discrete-time Fourier transform on each signal vector and retain only the amplitude result, and stack the transform results along the row direction in time order to obtain a spectrum matrix.

[0086] Voiceprint feature extraction: According to steps S21 to S23, the spectrum matrix is ​​sliced, reshaped and the position information is fused to obtain the feature vector , specifically including the steps:

[0087] S21: Slice the spectrum matrix described in S14 to obtain N overlapping sub-matrices with a size of ;

[0088] S22: Reshape the N overlapping sub-matrices into vectors through linear transformation, and add additional trainable category features, that is, ;

[0089] S23: Incorporate the position information into the feature vector, add all the feature vectors and the position information vector with the trainable parameter to obtain the feature vector ,and .

[0090] Self-attention encoding: Follow steps S241 to S243 to convert the feature vector Input into the self-attention based encoder for voiceprint feature extraction, which includes the following steps:

[0091] S241: Input the feature vector to the first residual block, the residual part of which includes a regularization layer and a multi-head attention mechanism layer;

[0092] S242: the output of the first residual block is input to the first residual block, the residual part of the residual block includes a regularization layer and a multi-layer perceptron layer;

[0093] S243: Repeat S241 to S242 L times, with the input of each repetition being the output result of the previous repetition.

[0094] Sound source classification: The extracted voiceprint features are input into the neural network model and corresponded to specific environmental sound source categories, such as traffic noise, industrial noise, and living noise.

[0095] Data analysis and reporting: Analyze and process the monitoring results to generate noise pollution reports, providing a basis for urban planning and noise management.

[0096] Example 3

[0097] Noise monitoring is carried out within industrial plants to assess the contribution of production equipment, workshop operations, etc. to plant boundary noise.

[0098] Implementation steps:

[0099] Monitoring point layout: Determine the noise monitoring points based on the characteristics of the noise source and the factory boundary layout to ensure that the noise pollution situation in the factory area can be fully reflected.

[0100] Equipment installation: Install microphones and collectors at monitoring points to ensure that the equipment is stable and reliable.

[0101] Real-time data collection: The environmental sound signals are collected in real time through the collector and digitally processed.

[0102] Spectrogram generation and feature extraction: According to steps S1 to S2, the audio signal is converted into a spectrogram and the voiceprint features are extracted, which specifically includes the following steps:

[0103] S1: Convert the audio signal into a spectrogram through short-time Fourier transform;

[0104] S2: Extract voiceprint features of spectrogram through self-attention mechanism;

[0105] Sound source identification and classification: Use neural network models to identify voiceprint features and classify them into different industrial noise sources, such as machinery equipment noise, workshop operation noise, etc.

[0106] Data recording and reporting: The monitoring data will be recorded in real time and uploaded to the data center, and noise monitoring reports will be generated regularly to provide decision-making support for enterprise management departments.

[0107] Example 4

[0108] Develop a noise monitoring application for smartphones to facilitate individual users to monitor noise anytime and anywhere.

[0109] Implementation steps:

[0110] Application development: Develop a noise monitoring application based on the smartphone platform, using the microphone function of the phone to collect ambient sound signals.

[0111] Data preprocessing: The collected audio signal is preprocessed according to steps S11 to S14 to generate a spectrum matrix, which specifically includes the following steps:

[0112] S11: converting the ambient sound signal into an electrical signal through a microphone;

[0113] S12: sampling the continuous electrical signal into a discrete time series signal through a collector;

[0114] S13: Slice the discrete time series signal into signal vectors with time domain overlaps between adjacent ones through a sliding time window;

[0115] S14: Perform discrete-time Fourier transform on each signal vector and retain only the amplitude result, and stack the transform results along the row direction in time order to obtain a spectrum matrix.

[0116] Feature extraction and classification: The spectrogram matrix is ​​input into the pre-trained neural network model based on the self-attention mechanism to extract the voiceprint features and classify them.

[0117] Result display and feedback: The classification results are displayed to users in an intuitive way, such as noise level, noise source type, etc., and corresponding suggestions and measures are provided.

[0118] Data sharing and community participation: Users are encouraged to upload monitoring data to the cloud database to form a community network for noise monitoring and provide data support for environmental protection and noise management.

[0119] Example 5

[0120] In smart cities, real-time monitoring and early warning of urban noise can be achieved by deploying multiple intelligent noise monitoring stations and combining cloud computing and big data processing technologies.

[0121] Implementation steps:

[0122] Intelligent monitoring station deployment: Intelligent noise monitoring stations are installed in key areas of the city (such as traffic intersections, parks, residential areas, etc.). Each monitoring station contains a microphone, a data collector and a data transmission module.

[0123] Audio signal acquisition and preprocessing:

[0124] The microphone converts the ambient sound signal into an electrical signal.

[0125] The data logger samples the electrical signal to generate a discrete time series signal.

[0126] The time series signal is converted into a spectrum matrix by short-time Fourier transform (STFT), and the steps from S11 to S14 are performed. The specific steps include:

[0127] S11: converting the ambient sound signal into an electrical signal through a microphone;

[0128] S12: sampling the continuous electrical signal into a discrete time series signal through a collector;

[0129] S13: Slice the discrete time series signal into signal vectors with time domain overlaps between adjacent ones through a sliding time window;

[0130] S14: Perform discrete-time Fourier transform on each signal vector and retain only the amplitude result, and stack the transform results along the row direction in time order to obtain a spectrum matrix.

[0131] Voiceprint feature extraction:

[0132] Slice the spectrogram matrix into multiple sub-matrices and extract voiceprint features through the self-attention mechanism, following steps S21 to S23. The specific steps include:

[0133] S21: Slice the spectrum matrix described in S14 to obtain N overlapping sub-matrices with a size of ;

[0134] S22: Reshape the N overlapping sub-matrices into vectors through linear transformation, and add additional trainable category features, that is, ;

[0135] S23: Incorporate the position information into the feature vector, add all the feature vectors and the position information vector with the trainable parameter to obtain the feature vector ,and ;

[0136] Incorporate position information into the feature vector and use a self-attention-based encoder (such as the Transformer model) to further extract deep features. The specific steps include:

[0137] S24: The input is fed into a self-attention based encoder to extract voiceprint features.

[0138] Noise classification and identification:

[0139] The extracted voiceprint features are input into the pre-trained neural network model to classify noise sources (such as traffic noise, industrial noise, living noise, etc.).

[0140] Evaluate noise levels in real time and compare them with preset noise standards to determine whether they exceed the standards.

[0141] Data upload and cloud processing:

[0142] Upload monitoring data and classification results to the cloud server in real time.

[0143] Cloud servers perform big data analysis to generate noise pollution maps and trend reports.

[0144] Early warning and feedback:

[0145] When the noise level exceeds the standard, the system automatically triggers the early warning mechanism and sends early warning information to relevant departments and the public.

[0146] Provide noise management advice and guide relevant departments to take noise reduction measures.

[0147] Example 6

[0148] In industrial plants, high-precision noise monitoring equipment combined with a self-attention mechanism can be used to accurately locate noise sources and conduct detailed assessments of noise levels.

[0149] Implementation steps:

[0150] High-precision monitoring equipment deployment:

[0151] High-precision noise monitoring equipment, including microphone arrays and high-speed data acquisition systems, is deployed at key locations within industrial plants.

[0152] Audio signal acquisition and spectrum generation:

[0153] Use microphone arrays to capture multi-channel audio signals.

[0154] The multi-channel audio signal is converted into a spectrogram matrix through STFT, and the spatial spectrum is estimated to improve the accuracy of noise source positioning.

[0155] Voiceprint feature extraction and noise source location:

[0156] The self-attention mechanism is used to extract deep features from the spectrum matrix, which includes the following steps:

[0157] S21: Slice the spectrum matrix described in S14 to obtain N overlapping sub-matrices with a size of ;

[0158] S22: Reshape the N overlapping sub-matrices into vectors through linear transformation, and add additional trainable category features, that is, ;

[0159] S23: Incorporate the position information into the feature vector, add all the feature vectors and the position information vector with the trainable parameter to obtain the feature vector ,and ;

[0160] S24: The input is fed into a self-attention based encoder to extract voiceprint features.

[0161] Combining beamforming technology and sound source localization algorithm, accurate positioning of noise sources can be achieved.

[0162] Noise Level Assessment and Classification:

[0163] Evaluate the noise level of the located noise source and calculate parameters such as equivalent sound level.

[0164] Classify noise sources into different types of industrial noise (such as mechanical equipment noise, fluid dynamic noise, etc.).

[0165] Report generation and feedback:

[0166] Generate detailed noise source assessment reports including location, noise level, noise type, and more.

[0167] Provide noise reduction suggestions and guide enterprises to take corresponding measures to reduce noise pollution.

[0168] Example 7

[0169] In complex environments (such as airports, ports, etc.), acoustic imaging technology is used to visualize noise sources to improve the intuitiveness and accuracy of noise monitoring.

[0170] Implementation steps:

[0171] Acoustic imaging equipment deployment:

[0172] Deploy acoustic imaging cameras or array microphone systems in the monitoring area to collect ambient sound signals.

[0173] A camera or array microphone system can generate a map of the noise intensity in real time.

[0174] Sound intensity distribution map generation:

[0175] The collected sound signals are processed by the acoustic imaging algorithm to generate a sound intensity distribution map of the noise.

[0176] The sound intensity distribution diagram shows the location and intensity of noise sources in a graphical form.

[0177] Noise source identification and location:

[0178] Combining image recognition technology and self-attention mechanism, the sound intensity distribution map is further analyzed.

[0179] Identify specific noise sources and pinpoint their location.

[0180] Results display and application:

[0181] The sound intensity distribution diagram and positioning results of the noise source are displayed to relevant personnel in a visual manner.

[0182] Based on the monitoring results, formulate targeted noise control measures to optimize the noise environment.

[0183] These implementation methods combine different technical means and application scenarios, aiming to improve the efficiency and accuracy of noise monitoring and provide stronger support for noise management and environmental protection.

[0184] In addition, to achieve the above-mentioned purpose, an embodiment of the present invention further proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements an environmental noise monitoring method based on a self-attention mechanism of an embodiment of the present invention.

[0185] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable vehicles (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0186] The embodiments of the present invention are described with reference to flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or boxes.

[0187] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0189] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. "" and / or "" indicate that either one of the two can be selected, or both can be selected. Moreover, the terms "" include "" "" contain "" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "" include a..."" does not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.

[0191] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for environmental noise monitoring based on a self-attention mechanism, characterized in that: The steps include: S1: Convert the audio signal into a spectrogram through short-time Fourier transform; S2: Extract voiceprint features of spectrogram through self-attention mechanism; S3: The neural network voiceprint features are mapped to specific environmental sound source categories; The step of converting the audio signal into a spectrogram by short-time Fourier transform specifically includes: S11: converting the ambient sound signal into an electrical signal through a microphone; S12: sampling the continuous electrical signal into a discrete time series signal through a collector; S13: Slice the discrete time series signal into signal vectors with time domain overlaps between adjacent ones through a sliding time window; S14: Perform discrete-time Fourier transform on each signal vector and retain only the amplitude result, stack the transform results along the row direction in chronological order to obtain a spectrum matrix; the step of extracting the voiceprint features of the spectrum through the self-attention mechanism specifically includes: S21: Slice the spectrum matrix described in S14 to obtain N overlapping sub-matrices with a size of ; S22: Reshape the N overlapping sub-matrices into vectors through linear transformation, and add additional trainable category features, that is, ; S23: Incorporate the position information into the feature vector, add all the feature vectors and the position information vector with the trainable parameters to obtain the feature vector ,and ; S24: Input into the self-attention based encoder to extract voiceprint features; The S24 specifically includes: S241: Input the feature vector to the first residual block, the residual part of which includes a regularization layer and a multi-head attention mechanism layer; S242: the output of the first residual block is input to the first residual block, the residual part of the residual block includes a regularization layer and a multi-layer perceptron layer; S243: Repeat S241 to S242 L times, with the input of each repetition being the output result of the previous repetition; The S241 specifically includes: S2411: Use three different linear transformation matrices with trainable parameters to multiply the input matrix to obtain three different results: Query (Q), Keys (K), and Values ​​(V); S2412: Perform matrix dot multiplication on Query and Keys, divide by the square root of the column size of the matrix, and finally perform normalization using a preset function; S2413: Perform matrix dot multiplication on Values ​​and the output result of S2412; S2414: Repeat S2411 to S2413 in parallel for h times, concatenate the h matrices output in parallel in the column direction, and finally perform linear transformation.

2. The environmental noise monitoring method based on the self-attention mechanism according to claim 1 is characterized in that: The signal vector is a column vector.

3. The environmental noise monitoring method based on the self-attention mechanism according to claim 2 is characterized in that: In S2412, the preset function is a normalized exponential function.

Citation Information

Patent Citations

  • Environmental noise identification method and system fusing self-attention and convolution operation

    CN115954019A