WO2020006898A1 - 音频数据的乐器识别方法及装置、电子设备、存储介质 - Google Patents

音频数据的乐器识别方法及装置、电子设备、存储介质 Download PDF

Info

Publication number
WO2020006898A1
WO2020006898A1 PCT/CN2018/108239 CN2018108239W WO2020006898A1 WO 2020006898 A1 WO2020006898 A1 WO 2020006898A1 CN 2018108239 W CN2018108239 W CN 2018108239W WO 2020006898 A1 WO2020006898 A1 WO 2020006898A1
Authority
WO
WIPO (PCT)
Prior art keywords
musical instrument
audio data
identified
sample
neural network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2018/108239
Other languages
English (en)
French (fr)
Inventor
梅亚琦
刘奡智
王义文
王健宗
肖京
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2020006898A1 publication Critical patent/WO2020006898A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/48Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 specially adapted for particular use
    • G10L25/51Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 specially adapted for particular use for comparison or discrimination
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/03Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters
    • G10L25/18Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters the extracted parameters being spectral information of each sub-band
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/03Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters
    • G10L25/24Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters the extracted parameters being the cepstrum
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/27Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique
    • G10L25/30Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique using neural networks
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/45Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of analysis window

Definitions

  • the present application relates to the field of computer technology, and in particular, to a method and device for recognizing a musical instrument of audio data, an electronic device, and a computer-readable storage medium.
  • Existing musical instrument audio recognition methods are mainly configured to identify monotonic music (using only one instrument), by extracting the acoustic features of a monotone music (the extracted acoustic features are roughly time-frequency features, energy features, spectral features, harmony features, perception Characteristics, etc.), and match them with the acoustic characteristics of different instruments obtained during the training phase, and then realize the musical instrument recognition of monotone music.
  • the inventors realized that polyphonic music is different from monophonic music.
  • Polyphonic music is audio data generated by the mixed performance of multiple instruments.
  • the acoustic features extracted from polyphonic music are a mixture of the acoustic characteristics of multiple instruments. By means of feature matching, the types of musical instruments used in polyphonic music are identified.
  • the present application provides a method for identifying musical instruments of audio data.
  • This application provides a musical instrument identification method for audio data, including:
  • the Mel spectrum is input into a pre-built musical instrument recognition model to obtain the kind of musical instruments used in the audio data to be identified.
  • This application also provides a musical instrument identification device for audio data, the device includes:
  • a pre-processing module configured to pre-process the audio data to be identified
  • a signal conversion module configured to convert the audio data to be identified from a time-domain signal into a frequency-domain signal with a preset number of windows through a short-time Fourier transform
  • a Mel conversion module configured to convert a frequency domain signal of the preset window number from a frequency scale to a Mel scale to obtain a Mel spectrum
  • the musical instrument recognition module is configured to input the Mel spectrum into a pre-built musical instrument recognition model to obtain the kind of musical instrument used for the audio data to be identified.
  • this application also provides an electronic device, the electronic device:
  • Memory configured to store processor-executable instructions
  • the processor is configured to execute any one of the above-mentioned audio data musical instrument recognition methods.
  • the present application also provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to perform any one of the audio data recognition methods described above.
  • the technical solution provided in the present application can convert the audio data to be identified into a Mel spectrum and process the Mel spectrum using a pre-built musical instrument recognition model, so as to obtain the types of musical instruments used for the audio data to be identified.
  • polyphonic music is audio data generated by a mixture of multiple instruments
  • the acoustic features extracted from polyphonic music are a mixture of the acoustic characteristics of multiple instruments. Therefore, it is difficult to identify the polyphony by matching the acoustic characteristics of the instruments. Tune the type of instrument used in the music.
  • the solution provided by this application solves the defect that the prior art cannot identify the types of musical instruments used in polyphonic music.
  • the pre-built instrument recognition model is used to process the Mel spectrum of the audio data to be identified, and then polyphonic can be identified. The type of instrument used in the music.
  • FIG. 1 is a schematic diagram of an implementation environment involved in this application
  • Fig. 2 is a block diagram of a server according to an exemplary embodiment
  • Fig. 3 is a flow chart showing a method for identifying a musical instrument of audio data according to an exemplary embodiment
  • step 370 is a detailed flowchart of step 370 in the embodiment corresponding to FIG. 3;
  • FIG. 5 is a schematic diagram of a musical instrument recognition process of audio data
  • FIG. 6 is a flowchart of a musical instrument recognition method of audio data shown on the basis of the embodiment of FIG. 3; FIG.
  • step 362 is a detailed flowchart of step 362 in the embodiment corresponding to FIG. 6;
  • step 310 is a detailed flowchart of step 310 in the embodiment corresponding to FIG. 3;
  • Fig. 9 is a block diagram of a musical instrument identification device for audio data according to another exemplary embodiment.
  • Fig. 1 is a schematic diagram of an implementation environment involved in the present application according to an exemplary embodiment.
  • the implementation environment involved in this application includes a server 110.
  • the server 110 may use the method provided in this application to perform musical instrument identification on the audio data.
  • the implementation environment will also include data sources that provide data, ie audio data.
  • the data source may be the mobile terminal 130.
  • the server 110 may obtain the audio data to be identified uploaded by the mobile terminal 130, and then perform the musical instrument identification processing on the audio data to be identified using the method provided in this application.
  • the musical instrument identification method of audio data of the present application is not limited to deploying corresponding processing logic in the server 110, and it may also be processing logic deployed in other machines.
  • the processing logic for musical instrument recognition of audio data is deployed in a terminal device with computing capabilities.
  • FIG. 2 is a schematic structural diagram of a server according to an embodiment of the present application.
  • the server 200 may have a large difference due to different configurations or performance, and may include one or more central processing units (central processing units (CPU) 222 (for example, one or more processors) and memory 232, one or more storage media 230 (for example, one or more storage devices) storing application programs 242 or data 244.
  • the memory 232 and the storage medium 230 may be temporary storage or persistent storage.
  • the program stored in the storage medium 230 may include one or more modules (not shown), and each module may include a series of instruction operations on the server 200.
  • the central processing unit 222 may be configured to communicate with the storage medium 230 and execute a series of instruction operations in the storage medium 230 on the server 200.
  • the server 200 may also include one or more power sources 226, one or more wired or wireless network interfaces 250, one or more input / output interfaces 258, and / or, one or more operating systems 241, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM and more.
  • the steps performed by the server described in the embodiments shown in FIG. 3, FIG. 4, and FIG. 6 to FIG. 8 described below may be based on the server structure shown in FIG. 2.
  • the program may be stored in a computer-readable storage medium.
  • the aforementioned storage medium may be a read-only memory, a magnetic disk, or an optical disk.
  • Fig. 3 is a flow chart showing a method for identifying a musical instrument of audio data according to an exemplary embodiment.
  • the application range and execution subject of the audio data musical instrument identification method for example, the method is used for the server 110 of the implementation environment shown in FIG. 1. As shown in FIG. 3, the method may be executed by the server 110 and may include the following steps.
  • step 310 the audio data to be identified is pre-processed.
  • the to-be-identified audio data refers to an audio segment in which the type of the used musical instrument is unknown, and it is necessary to identify the type of the musical instrument mostly used in the audio segment.
  • Pre-processing may include, but is not limited to, changing the audio data to be identified from stereo to mono, down-sampling, and normalization.
  • step 330 the pre-processed audio data to be identified is converted from a time-domain signal to a frequency-domain signal of a preset number of windows by a short-time Fourier transform.
  • the short-time Fourier transform is a mathematical transformation related to the Fourier transform to determine the frequency and phase of a sine wave in a local region of a time-varying signal.
  • the short-time Fourier transform is to window the audio data (time-domain signal) to be identified, divide the signal into small segments, and then perform Fourier transform on each segment of the signal.
  • the short-time Fourier transform uses a fixed window function to divide the audio data to be identified according to time into n windows. The number of windows can be adjusted according to the length of the audio data. The longer the window, the more windows, and of course the shorter the window. The better, try to keep the signal frequency within the window as constant as possible.
  • the number of windows may be 43.
  • the audio data to be identified is divided into time-domain signals of 43 windows, and then the Fourier transform is used to perform Fourier transform on the time-domain signals of each window to obtain 43 segments of time-domain signal correspondences. 43-band frequency domain signal. It should be noted that the Fourier transform converts a time-domain signal into a frequency-domain signal, which belongs to the prior art and will not be repeated here.
  • step 350 the frequency-domain signals of the preset number of windows are converted from a frequency scale to a Mel scale to obtain a Mel spectrum.
  • the mel scale was named by Stevens, Volkmann, and Newman in 1937.
  • the unit of frequency is Hertz (Hz).
  • the frequency range that human ears can hear is 20-20000Hz, but the scale unit of human ears to Hz is not a linear perception relationship. For example, if we adapt to a tone of 1000Hz, if we increase the tone frequency to 2000Hz, our ears can only notice that the frequency has increased a little, and we cannot detect that the frequency has doubled. If you convert a common frequency scale (in HZI scale units) to a Mel scale, the mapping relationship is as follows:
  • f represents the frequency scale
  • the unit is HZ (Hertz)
  • fmel (f) represents the Mel scale.
  • the human ear's perception of frequency becomes a linear relationship. That is to say, under the Mel scale, if the Mel frequency of the two voices differs by twice, the tones that the human ear can perceive are also roughly twice as different. Convert the frequency domain signal of each window from the frequency scale to the Mel scale, that is, map the ordinary frequency value to the user's perception of the pitch (because the user cannot accurately perceive the frequency change, the frequency value is converted into mel Scale, the change in mel value can be accurately perceived by the user).
  • step 370 the Mel spectrum is input into a pre-built musical instrument recognition model to obtain a kind of musical instrument used in the audio data to be identified.
  • the musical instrument recognition model is trained through a large number of sample audio fragments of known types of musical instruments used.
  • the Mel spectrum is used as the input of the musical instrument recognition model.
  • the Mel spectrum is subjected to convolution processing through the musical instrument recognition model. According to the processing result, the types of musical instruments to be identified can be obtained.
  • the audio data to be identified can be obtained by converting the audio data to be identified into a Mel spectrum, and processing the Mel spectrum using a pre-built musical instrument recognition model.
  • a pre-built musical instrument recognition model Of musical instruments.
  • polyphonic music is audio data produced by a mixture of multiple instruments
  • the acoustic features extracted from polyphonic music are a mixture of the acoustic characteristics of multiple instruments, so it is difficult to identify the polyphony by matching the characteristics of the instrument.
  • the type of instrument used in the music solves the defect that the prior art cannot identify the types of musical instruments used in polyphonic music.
  • polyphonic music can be identified The type of instrument used in the.
  • the foregoing step 370 specifically includes:
  • step 371 a convolution calculation is performed on the Mel spectrum by a pre-built musical instrument recognition model, and a convolution calculation result is output.
  • the musical instrument recognition model can be a trained deep convolutional neural network model, and the Mel spectrum is convolved using the weight parameters of the convolutional layer, pooling layer, and fully connected layer trained by the deep convolutional neural network model.
  • FIG. 5 is a schematic diagram of a musical instrument recognition process of audio data. As shown in Figure 5, the audio data to be identified is converted into a Mel spectrum, and then the Mel spectrum is convolved through the trained multi-layer convolutional layer, pooling layer, and fully connected layer. The output result is Calculate results for convolution.
  • step 372 a normalization process is performed on the calculation result of the convolution to obtain a probability that the audio data to be identified includes each instrument.
  • the result of the convolution calculation is a one-dimensional vector containing multiple elements, each element representing a musical instrument. Assuming that there are 11 instruments in the training phase of the instrument recognition model, the convolution calculation results include 11 terms. By normalizing the convolution calculation results, each element after normalization represents the probability of using each instrument.
  • the normalization process can be a maximum normalization method, that is, the maximum value of all elements is converted to 1, and the values of other elements are linearly converted to 0 to
  • 11 output values are obtained.
  • the probability of the 11 output values is 0.4, 0.3, 0.7, 0.1, 0.1, 0.1, 8, 0, 0.1, 0.1. , 0.1.
  • the normalized 11 output values are used to obtain the identification
  • the probability of using the violin for audio data is 0.4, the probability of viola is 0.3, the probability of cello is 0.7, the probability of piano is 0.8, and other probabilities can be ignored.
  • step 373 the probability that the audio data to be identified contains each musical instrument is compared with a preset parameter to determine the type of musical instrument used by the audio data to be identified.
  • the preset parameter may be 0.5, and the probability that the audio data to be identified contains each instrument is compared with the preset parameter. If the probability that a certain instrument is included is greater than or equal to the preset parameter, the audio data to be identified may be used The instrument. Assume that the probability of using the violin for the audio data to be identified is 0.4, the viola probability is 0.3, the cello probability is 0.7, and the piano probability is 0.8. Less than 0.5, the probability of using the cello and piano is greater than 0.5, so it can be determined that the audio data to be identified is polyphonic music played by the cello and piano.
  • the musical instrument identification method provided by the present application further includes the following steps:
  • step 361 sample audio clips and instrument tag information known to the sample audio clips are obtained.
  • the sample audio clips can be 6000 pieces of audio data with a duration of 3 seconds extracted from 2000 clear recordings, and the types of musical instruments used in the sample audio clips are known. Marking the sample audio segment according to the type of instrument used for each sample audio segment can obtain sample label information. For example, suppose there are 11 instruments in total. A sample audio clip uses a violin, double bass, piano, saxophone. If the instrument is used, it will be marked as 1 and if it is not used, it will be marked as 0. The sample tag information is 100 100 100 01. The sample audio segment and its corresponding musical instrument tag information may be stored in the database of the server 110 in advance.
  • step 362 a neural network learning is performed through the sample audio segment and the corresponding musical instrument tag information to obtain the musical instrument recognition model.
  • performing neural network learning refers to learning musical instrument feature extraction based on a sample audio segment and corresponding musical instrument tag information, so as to minimize the difference between the learned musical instrument feature and its musical instrument tag information.
  • the network parameters of the neural network architecture can be used to obtain a musical instrument recognition model.
  • the neural network architecture usually includes an input layer, a convolutional layer and a pooling layer, and a fully connected layer.
  • step 362 specifically includes:
  • step 3621 a sample Mel spectrum of the sample audio segment is extracted
  • the sample audio segment can be pre-processed by referring to the processing process of the audio data to be identified, and then the pre-processed sample audio segment is converted from a time-domain signal to a frequency-domain signal of a preset window through a short-time Fourier transform. , And transform the frequency domain signals of all windows from the ordinary frequency scale to the Mel scale to obtain the Mel spectrum of the sample audio segment (for differentiation, it is referred to as the sample Mel spectrum).
  • step 3622 a deep convolutional neural network is used to perform convolution calculation on the sample Mel spectrum, and the musical instrument features corresponding to the sample Mel spectrum are extracted;
  • a deep convolutional neural network can include 4 stages, each stage includes a double convolutional layer and a pooling layer, and finally outputs through a fully connected layer.
  • the convolution layer can use 32 filters with a size of 3 ⁇ 3 receptive field and a step size of 1 to perform convolution calculations, and a pooling layer with a size of 3 ⁇ 3 and a step size of 1
  • the max-pooling method performs spatial abstraction. After the maximum value is pooled, some neural network units need to be temporarily discarded from the network according to a certain probability to prevent the neural network from overfitting. The probability of random discarding may be 0.25.
  • Table 1 is the input data size and parameter values (except the zero-padding process) of each layer in the convolution calculation process of the deep convolutional neural network.
  • a Mel spectrum with a size of 1 ⁇ 43 ⁇ 128 is subjected to convolution calculations through 32 3 ⁇ 3 filters to obtain an intermediate image with a data size of 32 ⁇ 45 ⁇ 130 (that is, 32 images with a size of 45 ⁇ 130 image), of which 43 becomes 45 and 128 becomes 130 because of the zero-filling process (not shown in the table).
  • the Mel spectrum is calculated by convolution, maximum pooling, and full connection.
  • the final output result can be 11 data to obtain the musical instrument characteristics of the sample Mel spectrum.
  • step 3623 according to the musical instrument label information corresponding to the sample audio segment, the weight parameters of the deep convolutional neural network are adjusted to minimize the difference between the musical instrument characteristics and the musical instrument label information.
  • the deep convolutional neural network is used as the musical instrument recognition model.
  • the characteristics of the musical instrument may be the last 11 data output by the above-mentioned deep convolutional neural network, and calculate the musical instrument label information of the sample audio fragment (for example, 100 100 100 01) Differences between instrument characteristics (11 data).
  • the weight parameters of the deep convolutional neural network such as the parameters of each filter in the table above
  • the instrument label information and the final output instrument characteristics are adjusted.
  • the difference is minimal.
  • the difference between the label information of the musical instrument and the characteristics of the musical instrument can be calculated by the similarity and distance between the label information of the musical instrument and the characteristics of the musical instrument. When the similarity is high, the difference is considered small, and when the distance is small, the difference is considered small.
  • the parameter-adjusted deep convolutional neural network is used as a musical instrument recognition model for subsequent musical instrument recognition.
  • the Euclidean distance between the extracted musical instrument features and the musical instrument label information may be minimized by adjusting weight parameters of the deep convolutional neural network.
  • the instrument characteristics and instrument label information can be regarded as two points x1 and x2 in an N-dimensional space (such as 11 dimensions).
  • the distance d between these two points can be calculated by the following formula, and the depth convolution is continuously adjusted.
  • the weight parameter of the neural network minimizes the distance d between the characteristics of the instrument and the label information of the instrument.
  • the foregoing step 310 specifically includes:
  • step 311 the audio data to be identified is converted from stereo to mono
  • stereo refers to the left and right channels
  • the audio data to be identified is converted from stereo to mono.
  • the left channel data and the right channel data of the audio data to be identified can be averaged to obtain the mono Audio data.
  • the sampling frequency can be reduced from the original 44100HZ to 22050HZ.
  • step 312 down-sampling the mono audio data to be identified
  • downsampling refers to the process of reducing the sampling rate of specific signals (audio data to be identified). Specifically, based on the Nyquist sampling theorem, the sampling frequency of 22050HZ mono audio data can be reduced to 11025HZ. . This sampling frequency contains most of the harmony sounds produced by the instrument, while removing noise above this frequency as much as possible.
  • step 313 normalize the down-sampled audio data to be identified.
  • the normalization method may adopt a maximum value normalization method, that is, the maximum value is converted to 1, the minimum value is converted to 0, and the amplitude of the audio data is linearly converted to a range of 0 to 1.
  • the following is a device embodiment of the present application, which can be configured to execute an embodiment of a musical instrument recognition method for audio data performed by the server 110 described above.
  • a musical instrument recognition method for audio data performed by the server 110 described above.
  • Fig. 9 is a block diagram of an audio data musical instrument identification device according to an exemplary embodiment.
  • the audio data musical instrument identification device may be used in the server 110 of the implementation environment shown in Fig. 1 to execute Figs. 3, 4, and All or part of the steps of the musical instrument recognition method of audio data shown in any of FIGS. 6-8.
  • the device includes, but is not limited to, a pre-processing module 910, a signal conversion module 930, a Mel conversion module 950, and a musical instrument recognition module 970.
  • a pre-processing module 910 configured to pre-process the audio data to be identified
  • the signal conversion module 930 is configured to convert the audio data to be identified from a time-domain signal into a frequency-domain signal of a preset number of windows through a short-time Fourier transform;
  • the Mel conversion module 950 is configured to convert a frequency domain signal of the preset window quantity from a frequency scale to a Mel scale to obtain a Mel spectrum;
  • the musical instrument recognition module 970 is configured to input the Mel spectrum into a pre-built musical instrument recognition model to obtain the kind of musical instrument used for the audio data to be identified.
  • the pre-processing module 910, the signal conversion module 930, the Mel conversion module 950, and the musical instrument recognition module 970 may be functional modules configured to perform corresponding steps in the above-mentioned musical instrument recognition method of audio data. It can be understood that these modules can be implemented by hardware, software, or a combination of both. When implemented in hardware, these modules may be implemented as one or more hardware modules, such as one or more application specific integrated circuits. When implemented in software, these modules may be implemented as one or more computer programs executing on one or more processors, such as programs stored in the memory 232 executed by the central processor 222 of FIG. 2.
  • the musical instrument identification module includes:
  • a result output unit configured to perform a convolution calculation on the Mel spectrum by a pre-built musical instrument recognition model, and output a convolution calculation result
  • a result normalization unit configured to perform normalization processing on the calculation result of the convolution to obtain a probability that the audio data to be identified includes each instrument;
  • the parameter comparison unit is configured to compare a probability that the audio data to be identified includes each instrument with a preset parameter, and determine a type of the instrument used in the audio data to be identified.
  • the apparatus further includes:
  • a data acquisition module configured to acquire a sample audio segment and musical instrument tag information known to the sample audio segment
  • a model building module is configured to perform neural network learning through the sample audio fragments and corresponding musical instrument tag information to obtain the musical instrument recognition model.
  • the model building module includes:
  • a Mel spectrum extraction unit configured to extract a sample Mel spectrum of the sample audio segment
  • a musical instrument feature extraction unit configured to perform a convolution calculation on the sample Mel spectrum by constructing a deep convolutional neural network to extract a musical instrument feature corresponding to the sample Mel spectrum;
  • a parameter adjusting unit is configured to adjust the weight parameters of the deep convolutional neural network according to the musical instrument label information corresponding to the sample audio segment, so as to minimize the difference between the musical instrument characteristics and the musical instrument label information.
  • the deep convolutional neural network is used as the musical instrument recognition model.
  • the parameter adjustment unit includes:
  • the distance adjustment subunit is configured to minimize the Euclidean distance between the extracted musical instrument features and the musical instrument label information by adjusting the weight parameters of the deep convolutional neural network.
  • the pre-processing module includes:
  • a channel conversion unit configured to convert the audio data to be identified from stereo to mono
  • a downsampling unit configured to downsample the mono audio data to be identified
  • An audio normalization unit configured to normalize the down-sampled audio data to be identified.
  • the channel conversion unit includes:
  • the data averaging subunit is configured to average the left channel data and the right channel data of the audio data to be identified to obtain mono audio data.
  • the present application also provides an electronic device, which can be configured as a server 110 in the implementation environment shown in FIG. 1 to execute the audio data shown in any of FIG. All or part of the steps of the musical instrument identification method.
  • the electronic device includes:
  • Memory configured to store processor-executable instructions
  • the processor is configured to execute a musical instrument recognition method of audio data according to the above exemplary embodiment.
  • a storage medium is also provided, and the storage medium is a computer-readable storage medium, and may be, for example, temporary and non-transitory computer-readable storage media including instructions.
  • the storage medium stores a computer program that can be executed by the central processing unit 222 of the server 200 to complete the above-mentioned musical instrument identification method of audio data.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Auxiliary Devices For Music (AREA)

Abstract

一种音频数据的乐器识别方法及装置、电子设备、计算机可读存储介质,包括:对待识别音频数据进行预处理(S310);通过短时傅里叶变换将待识别音频数据从时域信号转换成预设窗口数量的频域信号(S330);将预设窗口数量的频域信号从频率标度转换为梅尔标度,得到梅尔谱图(S350);将梅尔谱图输入预先构建的乐器识别模型,得到待识别音频数据所使用的乐器种类(S370)。解决了现有技术无法识别出复调音乐中所使用乐器种类的缺陷,通过预先构建的乐器识别模型对待识别音频数据的梅尔谱图进行处理,进而可以识别出复调音乐中所使用的乐器种类。

Description

     音频数据的乐器识别方法及装置、电子设备、存储介质 技术领域
本申请要求2018年7月5日递交、发明名称为“音频数据的乐器识别方法及装置、电子设备、存储介质”的中国专利申请201810729847.1的优先权,在此通过引用将其全部内容合并于此。
本申请涉及计算机技术领域,特别涉及一种音频数据的乐器识别方法及装置、电子设备、计算机可读存储介质。
背景技术
乐器识别是音乐内容分析的一个重要问题,它可以为其它声源识别技术提供有效参考,但由于应用领域狭窄,研究尚未成熟。目前已有的技术方案,主要研究对象是西方乐器和中国民族乐器。其中西方乐器包括:小提琴、中提琴、大提琴、低音大提琴、吉他、竖琴、钢琴、小号、短号、 法国号、萨克斯、低音号、长笛、双簧管、单簧管、排箫和低音管等。中国民族乐器主要研究了二胡、高胡、中胡、琵琶、古筝、阮、扬琴、鼓、 竹笛。
现有的乐器音频识别方法主要配置为识别单调音乐(仅使用一种乐器),通过提取某单调音乐的声学特征(抽取的声学特征大致有时频特征、能量特征、波谱特征、和声特征、感知特征等),将其与训练阶段获得的不同乐器的声学特征进行匹配,进而实现单调音乐的乐器识别。而发明人意识到复调音乐与单调音乐不同,复调音乐是由多种乐器混合演奏产生的音频数据,从复调音乐中所提取的声学特征是多种乐器声学特征的混合,由此难以通过特征匹配的方式,识别出复调音乐中所使用的乐器种类。
技术问题
为了解决相关技术中存在的难以识别出复调音乐中所使用的乐器种类的问题,本申请提供了一种音频数据的乐器识别方法。
技术解决方案
本申请提供了一种音频数据的乐器识别方法,包括:
对待识别音频数据进行预处理;
通过短时傅里叶变换将所述待识别音频数据从时域信号转换成预设窗口数量的频域信号;
将所述预设窗口数量的频域信号从频率标度转换为梅尔标度,得到梅尔谱图;
将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类。
本申请还提供了一种音频数据的乐器识别装置,所述装置包括:
预处理模块,配置为对待识别音频数据进行预处理;
信号转换模块,配置为通过短时傅里叶变换将所述待识别音频数据从时域信号转换成预设窗口数量的频域信号;
梅尔转换模块,配置为将所述预设窗口数量的频域信号从频率标度转换为梅尔标度,得到梅尔谱图;
乐器识别模块,配置为将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类。
进一步,本申请还提供了一种电子设备,所述电子设备:
处理器;
配置为存储处理器可执行指令的存储器;
其中,所述处理器被配置为执行上述任意一种音频数据的乐器识别方法。
进一步的,本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序可由处理器执行完成上述任意一种音频数据的乐器识别方法。
有益效果
本申请的实施例提供的技术方案可以包括以下有益效果:
本申请提供的技术方案,通过将待识别音频数据转换为梅尔谱图,并利用预先构建的乐器识别模型对梅尔谱图进行处理,进而可以得到待识别音频数据所使用的乐器种类。由于复调音乐是由多种乐器混合演奏产生的音频数据,从复调音乐中所提取的声学特征是多种乐器声学特征的混合,由此难以通过与乐器声学特征匹配的方式,识别出复调音乐中所使用的乐器种类。本申请提供的方案,解决了现有技术无法识别出复调音乐中所使用乐器种类的缺陷,通过预先构建的乐器识别模型对待识别音频数据的梅尔谱图进行处理,进而可以识别出复调音乐中所使用的乐器种类。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本申请。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并于说明书一起配置为解释本申请的原理。
图1是根据本申请所涉及的实施环境的示意图;
图2是根据一示例性实施例示出的一种服务器的框图;
图3是根据一示例性实施例示出的一种音频数据的乐器识别方法的流程图;
图4是图3对应实施例中步骤370的细节流程图;
图5为音频数据的乐器识别过程示意图;
图6是在图3对应实施例的基础上示出的一种音频数据的乐器识别方法的流程图;
图7是图6对应实施例中步骤362的细节流程图;
图8是图3对应实施例中步骤310的细节流程图;
图9是根据另一示例性实施例示出的一种音频数据的乐器识别装置的框图。
本发明的实施方式
里将详细地对示例性实施例执行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。
图1是根据一示例性实施例示出的本申请所涉及的实施环境示意图。本申请所涉及的实施环境包括服务器110。服务器110可以采用本申请提供的方法对音频数据进行乐器识别。
根据需要,该实施环境还将包括提供数据,即音频数据的数据来源。具体而言,在本实施环境中,数据来源可以为移动终端130。服务器110可以获取移动终端130上传的待识别音频数据,进而采用本申请提供的方法对该待识别音频数据进行乐器识别处理。
应当说明的是,本申请音频数据的乐器识别方法,不限于在服务器110中部署相应的处理逻辑,其也可以是部署于其它机器中的处理逻辑。例如,在具备计算能力的终端设备中部署对音频数据进行乐器识别的处理逻辑等。
参见图2,图2是本申请实施例提供的一种服务器结构示意图。该服务器200可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)222(例如,一个或一个以上处理器)和存储器232,一个或一个以上存储应用程序242或数据244的存储介质230(例如一个或一个以上海量存储设备)。其中,存储器232和存储介质230可以是短暂存储或持久存储。存储在存储介质230的程序可以包括一个或一个以上模块(图示未示出),每个模块可以包括对服务器200中的一系列指令操作。更进一步地,中央处理器222可以设置为与存储介质230通信,在服务器200上执行存储介质230中的一系列指令操作。服务器200还可以包括一个或一个以上电源226,一个或一个以上有线或无线网络接口250,一个或一个以上输入输出接口258,和/或,一个或一个以上操作系统241,例如Windows ServerTM,Mac OS XTM,UnixTM, LinuxTM,FreeBSDTM等等。下述图3、图4、图6-图8所示实施例中所述的由服务器所执行的步骤可以基于该图2所示的服务器结构。
本领域普通技术人员可以理解实现下述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
图3是根据一示例性实施例示出的一种音频数据的乐器识别方法的流程图。该音频数据的乐器识别方法的适用范围和执行主体,例如,该方法用于图1所示实施环境的服务器110。如图3所示,该方法可以由服务器110执行,可以包括以下步骤。
在步骤310中,对待识别音频数据进行预处理。
其中,待识别音频数据是指所使用乐器种类未知的音频片段,需要对该音频片段多采用的乐器种类进行识别。预处理可以包括但不限于对待识别音频数据从立体声变成单声道、进行降采样以及归一化。
在步骤330中,通过短时傅里叶变换将所述预处理后的待识别音频数据从时域信号转换成预设窗口数量的频域信号。
其中,短时傅里叶变换(STFT)是和傅里叶变换相关的一种数学变换,用以确定时变信号其局部区域正弦波的频率与相位。简单来说,短时傅里叶变换是给待识别音频数据(时域信号)在时域上加窗,把信号分成一小段一小段,然后对每一段信号分别做傅里叶变换。短时傅里叶变换使用一个固定的窗函数,将按照时间变化的待识别音频数据划分成n个窗口,按照音频数据的时间长短可以调整窗口数量,时间越长窗口越多,当然窗越短越好,尽可能使得窗内信号频率近似不变。在一种实施例中,对于3秒的音频数据,窗口数量可以是43个。具体的,通过进行窗口平移,将待识别音频数据划分成43个窗口的时域信号,然后采用傅里叶变换对每个窗口的时域信号进行傅里叶变换,得到43段时域信号对应的43段频域信号。需要说明的是,傅里叶变换将时域信号转换为频域信号属于现有技术在此不再赘述。
在步骤350中,将所述预设窗口数量的频域信号从频率标度转换为梅尔标度,得到梅尔谱图。
具体的,梅尔标度(the mel scale)由Stevens,Volkmann和Newman在1937年命名。频率的单位是赫兹(Hz),人耳能听到的频率范围是20-20000Hz,但人耳对Hz这种标度单位并不是线性感知关系。例如如果我们适应了1000Hz的音调,如果把音调频率提高到2000Hz,我们的耳朵只能觉察到频率提高了一点点,根本察觉不到频率提高了一倍。如果将普通的频率标度(以HZ我标度单位)转化为梅尔标度,映射关系如下式所示:
Figure 678183dest_path_image001
其中,f代表频率标度,单位为HZ(赫兹),fmel(f)代表梅尔标度。经过上述转化则人耳对频率的感知度就成了线性关系。也就是说,在梅尔标度下,如果两段语音的梅尔频率相差两倍,则人耳可以感知到的音调大概也相差两倍。 将每个窗口的频域信号从频率标度转换为梅尔标度,也就是将普通频率值映射为用户对音高的感知(因为频率的变化用户没法准确感知,将频率值转化为mel标度,mel值的变化用户可以准确感知)。
根据需要还可以通过自然对数压缩,使每个窗口内只使用128个梅尔频率点,从而既能够充分保留音乐的谐波特性,同时大大降低输入数据的维度。进而将每个窗口的128个梅尔频率点进行拼接,假设窗口数量是43个,可以得到1×43×128数据大小的梅尔谱图。
在步骤370中,将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类。
其中,乐器识别模型是通过大量已知所使用乐器种类的样本音频片段训练得到的。对于模型的训练将梅尔谱图作为乐器识别模型的输入,通过乐器识别模型对梅尔谱图进行卷积处理,根据处理结果可以得到待识别音频数据所使用的乐器种类。
本申请上述示例性实施例提供的技术方案,通过将待识别音频数据转换为梅尔谱图,并利用预先构建的乐器识别模型对梅尔谱图进行处理,进而可以得到待识别音频数据所使用的乐器种类。由于复调音乐是由多种乐器混合演奏产生的音频数据,从复调音乐中所提取的声学特征是多种乐器声学特征的混合,由此难以通过与乐器特征匹配的方式,识别出复调音乐中所使用的乐器种类。本申请提供的方案,解决了现有技术无法识别出复调音乐中所使用乐器种类的缺陷,通过预先构建的乐器识别模型对待识别音频数据的梅尔谱图进行处理,可以识别出复调音乐中所使用的乐器种类。
在一种示例性实施例中,如图4所示,上述步骤370具体包括:
在步骤371中,通过预先构建的乐器识别模型对所述梅尔谱图进行卷积计算,输出卷积计算结果。
其中,乐器识别模型可以是经过训练的深度卷积神经网络模型,利用深度卷积神经网络模型训练好的卷积层、池化层和全连接层的权重参数,对梅尔谱图进行卷积计算。图5为音频数据的乐器识别过程示意图。如图5所示,待识别音频数据被转化为梅尔谱图,然后通过训练好的多层卷积层、池化层和全连接层对梅尔谱图进行卷积计算,输出的结果即为卷积计算结果。
在步骤372中,对所述卷积计算结果进行归一化处理,得到所述待识别音频数据包含每种乐器的概率。
其中,卷积计算结果是一个一维向量,包含多个元素,每个元素代表一种乐器。假设在乐器识别模型训练阶段存在11种乐器,则卷积计算结果包括11项。通过对卷积计算结果进行归一化处理,归一化后的每个元素代表使用每种乐器的概率。归一化处理可以是最大值归一化方法,即将所有元素的最大值转化为1,将其他元素的值线性化地转换到0到
Figure 733864dest_path_image002
举例来说,对卷积计算结果的所有元素进行归一化后得到11个输出数值,11个输出数值的概率依次为0.4、0.3、0.7、0.1、0.1、0.1、8、0、0.1、0.1、0.1。假设在建模阶段11个数值依次代表小提琴、中提琴、大提琴、低音大提琴、吉他、竖琴、钢琴、小号、短号、 法国号、萨克斯,则根据归一化的11个输出数值,得到待识别音频数据使用小提琴概率是0.4,中提琴概率是0.3,大提琴概率是0.7、钢琴概率是0.8,其他概率较小可忽略。
在步骤373中,将所述待识别音频数据包含每种乐器的概率与预设参数进行比较,确定所述待识别音频数据所使用的乐器种类。
举例来说,预设参数可以是0.5,将待识别音频数据包含每种乐器的概率与预设参数进行比较,如果包含某种乐器的概率大于等于预设参数,可以认为待识别音频数据使用了该乐器。假设待识别音频数据使用小提琴概率是0.4,中提琴概率是0.3,大提琴概率是0.7、钢琴概率是0.8,其他概率较小可忽略,通过将上述概率值与0.5进行比较,使用小提琴和中提琴的概率均小于0.5,使用大提琴和钢琴的概率大于0.5,所以可以确定待识别音频数据是由大提琴和钢琴演奏的复调音乐。
在一种示例性实施例中,如图6所示,在上述步骤370之前本申请提供的乐器识别方法还包括以下步骤:
在步骤361中,获取样本音频片段以及所述样本音频片段已知的乐器标签信息。
其中,样本音频片段可以是从2000首清晰录音中提取的6000个时长为3秒的音频数据,并且已知样本音频片段所使用的乐器种类。根据每个样本音频片段所使用的乐器种类对样本音频片段进行标记,可以得到样本标签信息。举例来说,假设一共存在11种乐器,某个样本音频片段使用了小提琴、低音大提琴、钢琴、萨克斯,使用该乐器就标记为1,没有使用该乐器就标记为0,则该样本标签信息为100100100 01。样本音频片段及其对应的乐器标签信息可以提前存储在服务器110的数据库中。
在步骤362中,通过所述样本音频片段以及对应的乐器标签信息进行神经网络学习,得到所述乐器识别模型。
其中,进行神经网络学习是指根据样本音频片段及其对应的乐器标签信息,通过搭建神经网络架构学习乐器特征提取,使学习到的乐器特征与其乐器标签信息之间的差异最小,此时根据搭建的神经网络架构的网络参数即可得到乐器识别模型。该神经网络架构通常包括输入层、卷积层和池化层以及全连接层。
在一种示例性实施例中,如图7所示,上述步骤362具体包括:
在步骤3621中,提取所述样本音频片段的样本梅尔谱图;
具体的,可以参照对待识别音频数据的处理过程,对样本音频片段进行预处理,然后通过短时傅里叶变换对预处理后的样本音频片段从时域信号转换成预设窗口的频域信号,并对所有窗口的频域信号从普通的频率标度转换成梅尔标度,得到样本音频片段的梅尔谱图(为进行区分,此处称为样本梅尔谱图)。
在步骤3622中,通过搭建深度卷积神经网络对所述样本梅尔谱图进行卷积计算,提取所述样本梅尔谱图对应的乐器特征;
其中,深度卷积神经网络可以包含4阶段,每一阶段包含双卷积层和池化层,最后经过全连接层进行输出。在深度卷积神经网络中,卷积层可以使用尺寸为3×3感受野、步长为1的32个滤波器进行卷积计算,在池化层用尺寸为3×3,步长为1的最大值池化方法进行空间抽象。最大值池化之后需要按照一定概率暂时从网络中丢弃一些神经网络单元,用于防止神经网络过度拟合。其中,随机丢弃的概率可以是0.25。全连接层之后的随机丢弃概率可以增加到0.5,因为全连接层更容易发生过渡拟合。表1是深度卷积神经网络卷积计算过程中每层的输入数据大小、以及参数值(除了补零过程)。
表1 卷积过程中每层的输入数据大小、参数值
Figure 19352dest_path_image003
如上表1所示,尺寸为1×43×128的梅尔谱图,经过32个3×3的滤波器进行卷积计算,得到32×45×130数据大小的中间图像(即32张尺寸为45×130的图像),其中43变成45,由128变成130是因为经过了补零过程(表中未示出)。参照上述表中所列过程,对梅尔谱图经过卷积、最大池化和全连接的计算,最后输出结果可以是11个数据,得到样本梅尔谱图的乐器特征。
在步骤3623中,根据所述样本音频片段对应的乐器标签信息,调整所述深度卷积神经网络的权重参数,使所述乐器特征与所述乐器标签信息之间的差异最小,调整后的所述深度卷积神经网络作为所述乐器识别模型。
具体的,乐器特征可以是上述深度卷积神经网络最后输出的11个数据,计算样本音频片段的乐器标签信息(例如100100100 01)与乐器特征(11个数据)之间的差异,通过调整深度卷积神经网络的权重参数(如上述表中各滤波器的的参数),使乐器标签信息与最终输出的乐器特征之间的差异最小。其中乐器标签信息与乐器特征之间的差异可以通过计算乐器标签信息与乐器特征之间的相似度、距离等,相似度较高时认为差异较小,距离较小时认为差异较小。经过参数调整的深度卷积神经网络作为后续进行乐器识别的乐器识别模型。
在一种示例性实施例中,可以通过调整所述深度卷积神经网络的权重参数,使提取的所述乐器特征与所述乐器标签信息之间的欧式距离最小。
其中,乐器特征和乐器标签信息可以看成是N维空间(如11维)中的两个点x1、x2,通过以下公式可以计算出这两个点之间的距离d,不断调整深度卷积神经网络的权重参数,使其输出的乐器特征与乐器标签信息之间的距离d最小。
Figure 287522dest_path_image004
在一种示例性实施例中,如图8所示,上述步骤310具体包括:
在步骤311中,将所述待识别音频数据从立体声转化为单声道;
其中,立体声是指包含左右声道,将待识别音频数据从立体声转换成单声道,可以是将待识别音频数据的左声道数据和右声道数据取平均值,从而得到单声道的音频数据。通过将立体声转换成单声道,采样频率可以从原来的44100HZ降为22050HZ。
在步骤312中,对单声道的所述待识别音频数据进行降采样;
其中,降采样是指降低特定信号(待识别音频数据)的采样率的过程,具体的,可以基于Nyquist(奈奎斯特)采样定理,使22050HZ的单声道音频数据的采样频率降为11025HZ。该采样频率包含了乐器产生的绝大部分和声音响,同时尽可能去除了此频率之上的噪音。
在步骤313中,对降采样后的所述待识别音频数据进行归一化。
在经过降采样,将待识别音频数据的采样频率变成11025HZ后,对降采样的音频数据进行归一化。其中,归一化方法可以采用最大值归一化方法,即将最大值变换成1,最小值变换成0,将音频数据的幅值线性地转换到0到1的范围。
下述为本申请装置实施例,可以配置为执行本申请上述服务器110执行的音频数据的乐器识别方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请音频数据的乐器识别方法实施例。
图9是根据一示例性实施例示出的一种音频数据的乐器识别装置的框图,该音频数据的乐器识别装置可以用于图1所示实施环境的服务器110中,执行图3、图4、图6-图8任一所示的音频数据的乐器识别方法的全部或者部分步骤。如图9所示,该装置包括但不限于:预处理模块910、信号转换模块930、梅尔转换模块950以及乐器识别模块970。
预处理模块910,配置为对待识别音频数据进行预处理;
信号转换模块930,配置为通过短时傅里叶变换将所述待识别音频数据从时域信号转换成预设窗口数量的频域信号;
梅尔转换模块950,配置为将所述预设窗口数量的频域信号从频率标度转换为梅尔标度,得到梅尔谱图;
乐器识别模块970,配置为将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类。
上述装置中各个模块的功能和作用的实现过程具体详见上述音频数据的乐器识别方法中对应步骤的实现过程,在此不再赘述。
预处理模块910、信号转换模块930、梅尔转换模块950以及乐器识别模块970可以是功能模块,配置为执行上述音频数据的乐器识别方法中的对应步骤。可以理解,这些模块可以通过硬件、软件、或二者结合来实现。当以硬件方式实现时,这些模块可以实施为一个或多个硬件模块,例如一个或多个专用集成电路。当以软件方式实现时,这些模块可以实施为在一个或多个处理器上执行的一个或多个计算机程序,例如图2的中央处理器222所执行的存储在存储器232中的程序。
在一种示例性实施例中,所述乐器识别模块包括:
结果输出单元,配置为通过预先构建的乐器识别模型对所述梅尔谱图进行卷积计算,输出卷积计算结果;
结果归一化单元,配置为对所述卷积计算结果进行归一化处理,得到所述待识别音频数据包含每种乐器的概率;
参数比较单元,配置为将所述待识别音频数据包含每种乐器的概率与预设参数进行比较,确定所述待识别音频数据所使用的乐器种类。
在一种示例性实施例中,所述装置还包括:
数据获取模块,配置为获取样本音频片段以及所述样本音频片段已知的乐器标签信息;
模型构建模块,配置为通过所述样本音频片段以及对应的乐器标签信息进行神经网络学习,得到所述乐器识别模型。
在一种示例性实施例中,所述模型构建模块包括:
梅尔谱图提取单元,配置为提取所述样本音频片段的样本梅尔谱图;
乐器特征提取单元,配置为通过搭建深度卷积神经网络对所述样本梅尔谱图进行卷积计算,提取所述样本梅尔谱图对应的乐器特征;
参数调整单元,配置为根据所述样本音频片段对应的乐器标签信息,调整所述深度卷积神经网络的权重参数,使所述乐器特征与所述乐器标签信息之间的差异最小,调整后的所述深度卷积神经网络作为所述乐器识别模型。
在一种示例性实施例中,所述参数调整单元包括:
距离调整子单元,配置为通过调整所述深度卷积神经网络的权重参数,使提取的所述乐器特征与所述乐器标签信息之间的欧式距离最小。
在一种示例性实施例中,所述预处理模块包括:
声道转化单元,配置为将所述待识别音频数据从立体声转化为单声道;
降采样单元,配置为对单声道的所述待识别音频数据进行降采样;
音频归一化单元,配置为对降采样后的所述待识别音频数据进行归一化。
在一种示例性实施例中,所述声道转化单元包括:
数据平均子单元,配置为将所述待识别音频数据的左声道数据和右声道数据取平均值,得到单声道的音频数据。
可选的,本申请还提供一种电子设备,该电子设备可以配置为图1所示实施环境的服务器110中,执行图3、图4、图6-图8任一所示的音频数据的乐器识别方法的全部或者部分步骤。所述电子设备包括:
处理器;
配置为存储处理器可执行指令的存储器;
其中,所述处理器被配置为执行上述示例性实施例所述的音频数据的乐器识别方法。
该实施例中电子设备的处理器执行操作的具体方式已经在有关音频数据的乐器识别方法的实施例中执行了详细描述,此处将不做详细阐述说明。
在示例性实施例中,还提供了一种存储介质,该存储介质为计算机可读存储介质,例如可以为包括指令的临时性和非临时性计算机可读存储介质。该存储介质存储有计算机程序,所述计算机程序可由服务器200的中央处理器222执行以完成上述音频数据的乐器识别方法。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围执行各种修改和改变。本申请的范围仅由所附的权利要求来限制。

Claims (28)

  1. 一种音频数据的乐器识别方法,其中,包括:
    对待识别音频数据进行预处理;
    通过短时傅里叶变换将所述待识别音频数据从时域信号转换成预设窗口数量的频域信号;
    将所述预设窗口数量的频域信号从频率标度转换为梅尔标度,得到梅尔谱图;
    将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类。
  2. 根据权利要求1所述的方法,其中,所述将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类,包括:
    通过预先构建的乐器识别模型对所述梅尔谱图进行卷积计算,输出卷积计算结果;
    对所述卷积计算结果进行归一化处理,得到所述待识别音频数据包含每种乐器的概率;
    将所述待识别音频数据包含每种乐器的概率与预设参数进行比较,确定所述待识别音频数据所使用的乐器种类。
  3. 根据权利要求1-2任意一项所述的方法,其中,所述将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类之前,所述方法包括:
    获取样本音频片段以及所述样本音频片段已知的乐器标签信息;
    通过所述样本音频片段以及对应的乐器标签信息进行神经网络学习,得到所述乐器识别模型。
  4. 根据权利要求3所述的方法,其中,所述通过所述样本音频片段以及对应的乐器标签信息进行神经网络学习,得到所述乐器识别模型,包括:
    提取所述样本音频片段的样本梅尔谱图;
    通过搭建深度卷积神经网络对所述样本梅尔谱图进行卷积计算,提取所述样本梅尔谱图对应的乐器特征;
    根据所述样本音频片段对应的乐器标签信息,调整所述深度卷积神经网络的权重参数,使所述乐器特征与所述乐器标签信息之间的差异最小,调整后的所述深度卷积神经网络作为所述乐器识别模型。
  5. 根据权利要求4所述的方法,其中,根据所述样本音频片段对应的乐器标签信息,调整所述深度卷积神经网络的权重参数,使所述乐器特征与所述乐器标签信息之间的差异最小,包括:
    通过调整所述深度卷积神经网络的权重参数,使提取的所述乐器特征与所述乐器标签信息之间的欧式距离最小。
  6. 根据权利要求1-5任意一项所述的方法,其中,所述对待识别音频数据进行预处理,包括:
    将所述待识别音频数据从立体声转化为单声道;
    对单声道的所述待识别音频数据进行降采样;
    对降采样后的所述待识别音频数据进行归一化。
  7. 根据权利要求6所述的方法,其中,将所述待识别音频数据从立体声转化为单声道,包括:
    将所述待识别音频数据的左声道数据和右声道数据取平均值,得到单声道的音频数据。
  8. 一种音频数据的乐器识别装置,其中,包括:
    预处理模块,配置为对待识别音频数据进行预处理;
    信号转换模块,配置为通过短时傅里叶变换将所述待识别音频数据从时域信号转换成预设窗口数量的频域信号;
    梅尔转换模块,配置为将所述预设窗口数量的频域信号从频率标度转换为梅尔标度,得到梅尔谱图;
    乐器识别模块,配置为将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类。
  9. 根据权利要求8所述的装置,其中,所述乐器识别模块包括:
    结果输出单元,配置为通过预先构建的乐器识别模型对所述梅尔谱图进行卷积计算,输出卷积计算结果;
    结果归一化单元,配置为对所述卷积计算结果进行归一化处理,得到所述待识别音频数据包含每种乐器的概率;
    参数比较单元,配置为将所述待识别音频数据包含每种乐器的概率与预设参数进行比较,确定所述待识别音频数据所使用的乐器种类。
  10. 根据权利要求8-9任意一项所述的装置,其中,所述装置还包括:
    数据获取模块,配置为获取样本音频片段以及所述样本音频片段已知的乐器标签信息;
    模型构建模块,配置为通过所述样本音频片段以及对应的乐器标签信息进行神经网络学习,得到所述乐器识别模型。
  11. 根据权利要求10所述的装置,其中,所述模型构建模块包括:
    梅尔谱图提取单元,配置为提取所述样本音频片段的样本梅尔谱图;
    乐器特征提取单元,配置为通过搭建深度卷积神经网络对所述样本梅尔谱图进行卷积计算,提取所述样本梅尔谱图对应的乐器特征;
    参数调整单元,配置为根据所述样本音频片段对应的乐器标签信息,调整所述深度卷积神经网络的权重参数,使所述乐器特征与所述乐器标签信息之间的差异最小,调整后的所述深度卷积神经网络作为所述乐器识别模型。
  12. 根据权利要求11所述的装置,其中,所述参数调整单元包括:
    距离调整子单元,配置为通过调整所述深度卷积神经网络的权重参数,使提取的所述乐器特征与所述乐器标签信息之间的欧式距离最小。
  13. 根据权利要求8-12任意一项所述的装置,其中,所述预处理模块包括:
    声道转化单元,配置为将所述待识别音频数据从立体声转化为单声道;
    降采样单元,配置为对单声道的所述待识别音频数据进行降采样;
    音频归一化单元,配置为对降采样后的所述待识别音频数据进行归一化。
  14. 根据权利要求13所述的方法,其中,所述声道转化单元包括:
    数据平均子单元,配置为将所述待识别音频数据的左声道数据和右声道数据取平均值,得到单声道的音频数据。
  15. 一种电子设备,其中,所述电子设备:
    处理器;
    配置为存储处理器可执行指令的存储器;
    其中,所述处理器被配置为执行以下步骤:
    对待识别音频数据进行预处理;
    通过短时傅里叶变换将所述待识别音频数据从时域信号转换成预设窗口数量的频域信号;
    将所述预设窗口数量的频域信号从频率标度转换为梅尔标度,得到梅尔谱图;
    将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类。
  16. 根据权利要求15所述的电子设备,其中,所述将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类,包括:
    通过预先构建的乐器识别模型对所述梅尔谱图进行卷积计算,输出卷积计算结果;
    对所述卷积计算结果进行归一化处理,得到所述待识别音频数据包含每种乐器的概率;
    将所述待识别音频数据包含每种乐器的概率与预设参数进行比较,确定所述待识别音频数据所使用的乐器种类。
  17. 根据权利要求15-16任意一项所述的电子设备,其中,所述将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类之前,所述方法包括:
    获取样本音频片段以及所述样本音频片段已知的乐器标签信息;
    通过所述样本音频片段以及对应的乐器标签信息进行神经网络学习,得到所述乐器识别模型。
  18. 根据权利要求17所述的电子设备,其中,所述通过所述样本音频片段以及对应的乐器标签信息进行神经网络学习,得到所述乐器识别模型,包括:
    提取所述样本音频片段的样本梅尔谱图;
    通过搭建深度卷积神经网络对所述样本梅尔谱图进行卷积计算,提取所述样本梅尔谱图对应的乐器特征;
    根据所述样本音频片段对应的乐器标签信息,调整所述深度卷积神经网络的权重参数,使所述乐器特征与所述乐器标签信息之间的差异最小,调整后的所述深度卷积神经网络作为所述乐器识别模型。
  19. 根据权利要求18所述的电子设备,其中,根据所述样本音频片段对应的乐器标签信息,调整所述深度卷积神经网络的权重参数,使所述乐器特征与所述乐器标签信息之间的差异最小,包括:
    通过调整所述深度卷积神经网络的权重参数,使提取的所述乐器特征与所述乐器标签信息之间的欧式距离最小。
  20. 根据权利要求15-19任意一项所述的电子设备,其中,所述对待识别音频数据进行预处理,包括:
    将所述待识别音频数据从立体声转化为单声道;
    对单声道的所述待识别音频数据进行降采样;
    对降采样后的所述待识别音频数据进行归一化。
  21. 根据权利要求20所述的电子设备,其中,将所述待识别音频数据从立体声转化为单声道,包括:
    将所述待识别音频数据的左声道数据和右声道数据取平均值,得到单声道的音频数据。
  22. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序可由处理器执行以下步骤:
    对待识别音频数据进行预处理;
    通过短时傅里叶变换将所述待识别音频数据从时域信号转换成预设窗口数量的频域信号;
    将所述预设窗口数量的频域信号从频率标度转换为梅尔标度,得到梅尔谱图;
    将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类。
  23. 根据权利要求22所述的计算机可读存储介质,其中,所述将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类,包括:
    通过预先构建的乐器识别模型对所述梅尔谱图进行卷积计算,输出卷积计算结果;
    对所述卷积计算结果进行归一化处理,得到所述待识别音频数据包含每种乐器的概率;
    将所述待识别音频数据包含每种乐器的概率与预设参数进行比较,确定所述待识别音频数据所使用的乐器种类。
  24. 根据权利要求22-23任意一项所述的计算机可读存储介质,其中,所述将所述梅尔谱图输入预先构建的乐器识别模型,得到所述待识别音频数据所使用的乐器种类之前,所述方法包括:
    获取样本音频片段以及所述样本音频片段已知的乐器标签信息;
    通过所述样本音频片段以及对应的乐器标签信息进行神经网络学习,得到所述乐器识别模型。
  25. 根据权利要求24所述的计算机可读存储介质,其中,所述通过所述样本音频片段以及对应的乐器标签信息进行神经网络学习,得到所述乐器识别模型,包括:
    提取所述样本音频片段的样本梅尔谱图;
    通过搭建深度卷积神经网络对所述样本梅尔谱图进行卷积计算,提取所述样本梅尔谱图对应的乐器特征;
    根据所述样本音频片段对应的乐器标签信息,调整所述深度卷积神经网络的权重参数,使所述乐器特征与所述乐器标签信息之间的差异最小,调整后的所述深度卷积神经网络作为所述乐器识别模型。
  26. 根据权利要求25所述的计算机可读存储介质,其中,根据所述样本音频片段对应的乐器标签信息,调整所述深度卷积神经网络的权重参数,使所述乐器特征与所述乐器标签信息之间的差异最小,包括:
    通过调整所述深度卷积神经网络的权重参数,使提取的所述乐器特征与所述乐器标签信息之间的欧式距离最小。
  27. 根据权利要求22-26任意一项所述的计算机可读存储介质,其中,所述对待识别音频数据进行预处理,包括:
    将所述待识别音频数据从立体声转化为单声道;
    对单声道的所述待识别音频数据进行降采样;
    对降采样后的所述待识别音频数据进行归一化。
  28. 根据权利要求27所述的计算机可读存储介质,其中,将所述待识别音频数据从立体声转化为单声道,包括:
    将所述待识别音频数据的左声道数据和右声道数据取平均值,得到单声道的音频数据。
PCT/CN2018/108239 2018-07-05 2018-09-28 音频数据的乐器识别方法及装置、电子设备、存储介质 Ceased WO2020006898A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810729847.1A CN108962279A (zh) 2018-07-05 2018-07-05 音频数据的乐器识别方法及装置、电子设备、存储介质
CN201810729847.1 2018-07-05

Publications (1)

Publication Number Publication Date
WO2020006898A1 true WO2020006898A1 (zh) 2020-01-09

Family

ID=64484240

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/108239 Ceased WO2020006898A1 (zh) 2018-07-05 2018-09-28 音频数据的乐器识别方法及装置、电子设备、存储介质

Country Status (2)

Country Link
CN (1) CN108962279A (zh)
WO (1) WO2020006898A1 (zh)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109859770A (zh) * 2019-01-04 2019-06-07 平安科技(深圳)有限公司 音乐分离方法、装置及计算机可读存储介质
CN110008372A (zh) * 2019-02-22 2019-07-12 北京奇艺世纪科技有限公司 模型生成方法、音频处理方法、装置、终端及存储介质
CN109977255A (zh) * 2019-02-22 2019-07-05 北京奇艺世纪科技有限公司 模型生成方法、音频处理方法、装置、终端及存储介质
CN110111773B (zh) * 2019-04-01 2021-03-30 华南理工大学 基于卷积神经网络的音乐信号多乐器识别方法
CN110188235A (zh) * 2019-05-05 2019-08-30 平安科技(深圳)有限公司 音乐风格分类方法、装置、计算机设备及存储介质
CN110335622B (zh) * 2019-06-13 2024-03-01 平安科技(深圳)有限公司 音频单音色分离方法、装置、计算机设备及存储介质
CN110322896A (zh) * 2019-06-26 2019-10-11 上海交通大学 一种基于卷积神经网络的变压器故障声音识别方法
CN110796918A (zh) * 2019-10-29 2020-02-14 维沃移动通信有限公司 一种训练方法、装置及移动终端
CN111128236B (zh) * 2019-12-17 2022-05-03 电子科技大学 一种基于辅助分类深度神经网络的主乐器识别方法
CN111432282B (zh) * 2020-04-01 2022-01-04 腾讯科技(深圳)有限公司 一种视频推荐方法及装置
CN111681674B (zh) * 2020-06-01 2024-03-08 中国人民大学 一种基于朴素贝叶斯模型的乐器种类识别方法和系统
WO2022070771A1 (ja) * 2020-09-30 2022-04-07 ヤマハ株式会社 情報処理方法、情報処理システムおよびプログラム
CN113096620A (zh) * 2021-03-24 2021-07-09 妙音音乐科技(武汉)有限公司 一种乐器音色识别方法、系统、设备及存储介质
CN112967734B (zh) * 2021-03-26 2024-02-27 平安科技(深圳)有限公司 基于多声部的音乐数据识别方法、装置、设备及存储介质
CN113450828B (zh) * 2021-06-25 2024-07-09 平安科技(深圳)有限公司 音乐流派的识别方法、装置、设备及存储介质
CN113611292B (zh) * 2021-08-06 2023-11-10 思必驰科技股份有限公司 用于语音分离、识别的短时傅里叶变化的优化方法及系统
CN113921040A (zh) * 2021-09-30 2022-01-11 平安科技(深圳)有限公司 音频识别模型的训练方法和乐器对象识别方法
CN114305484B (zh) * 2021-12-15 2024-06-25 浙江大学医学院附属儿童医院 基于深度学习的心脏病心音智能分类方法、装置和介质
CN114627885A (zh) * 2022-02-25 2022-06-14 西安电子科技大学 一种基于asrt算法的小样本数据集乐器识别方法
CN115132183B (zh) * 2022-05-25 2024-04-12 腾讯科技(深圳)有限公司 音频识别模型的训练方法、装置、设备、介质及程序产品
CN115064184A (zh) * 2022-06-28 2022-09-16 镁佳(北京)科技有限公司 一种音频文件乐器含量识别向量表示方法及装置

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05188932A (ja) * 1992-01-14 1993-07-30 Sony Corp 楽音認識装置
CN103325382A (zh) * 2013-06-07 2013-09-25 大连民族学院 一种自动识别中国少数民族传统乐器音频数据的方法
CN103761965A (zh) * 2014-01-09 2014-04-30 太原科技大学 一种乐器信号的分类方法
CN106295717A (zh) * 2016-08-30 2017-01-04 南京理工大学 一种基于稀疏表示和机器学习的西洋乐器分类方法
CN106328121A (zh) * 2016-08-30 2017-01-11 南京理工大学 基于深度置信网络的中国传统乐器分类方法
CN106546892A (zh) * 2016-11-10 2017-03-29 华乘电气科技(上海)股份有限公司 基于深度学习的局部放电超声音频识别方法及系统
CN106682694A (zh) * 2016-12-27 2017-05-17 复旦大学 一种基于深度学习的敏感图像识别方法
CN106682649A (zh) * 2017-01-24 2017-05-17 成都容豪电子信息科技有限公司 一种基于深度学习的车型识别方法

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05188932A (ja) * 1992-01-14 1993-07-30 Sony Corp 楽音認識装置
CN103325382A (zh) * 2013-06-07 2013-09-25 大连民族学院 一种自动识别中国少数民族传统乐器音频数据的方法
CN103761965A (zh) * 2014-01-09 2014-04-30 太原科技大学 一种乐器信号的分类方法
CN106295717A (zh) * 2016-08-30 2017-01-04 南京理工大学 一种基于稀疏表示和机器学习的西洋乐器分类方法
CN106328121A (zh) * 2016-08-30 2017-01-11 南京理工大学 基于深度置信网络的中国传统乐器分类方法
CN106546892A (zh) * 2016-11-10 2017-03-29 华乘电气科技(上海)股份有限公司 基于深度学习的局部放电超声音频识别方法及系统
CN106682694A (zh) * 2016-12-27 2017-05-17 复旦大学 一种基于深度学习的敏感图像识别方法
CN106682649A (zh) * 2017-01-24 2017-05-17 成都容豪电子信息科技有限公司 一种基于深度学习的车型识别方法

Also Published As

Publication number Publication date
CN108962279A (zh) 2018-12-07

Similar Documents

Publication Publication Date Title
WO2020006898A1 (zh) 音频数据的乐器识别方法及装置、电子设备、存储介质
De Poli et al. Sonological models for timbre characterization
CN107610715B (zh) 一种基于多种声音特征的相似度计算方法
WO2020248393A1 (zh) 语音合成方法、系统、终端设备和可读存储介质
CN106295717B (zh) 一种基于稀疏表示和机器学习的西洋乐器分类方法
CN113658583B (zh) 一种基于生成对抗网络的耳语音转换方法、系统及其装置
CN110472097A (zh) 乐曲自动分类方法、装置、计算机设备和存储介质
CN110310621A (zh) 歌唱合成方法、装置、设备以及计算机可读存储介质
CN111063327A (zh) 音频处理方法、装置、电子设备及存储介质
CN113113033A (zh) 一种音频处理方法、设备及可读存储介质
Yu et al. Sparse cepstral codes and power scale for instrument identification
CN118708703B (zh) 一种基于知识库的多轮对话模型生成方法、设备及介质
CN118298845B (zh) 复调音频的音高识别模型的训练方法、装置、介质及设备
CN116438599A (zh) 通过标准arm嵌入式平台上的卷积神经网络嵌入式语音指纹进行人声轨道去除
WO2023102932A1 (zh) 音频转换方法、电子设备、程序产品及存储介质
Sturm et al. Musical instrument identification using multiscale mel-frequency cepstral coefficients
Grumiaux et al. Efficient bandwidth extension of musical signals using a differentiable harmonic plus noise model
CN115565507A (zh) 一种基于ai技术的乐器识别以及自动记谱系统
CN113571084A (zh) 音频处理方法、装置、设备及存储介质
CN117636839A (zh) 语音合成方法和装置
CN119864047A (zh) 音频分离方法、系统和相关装置
US12482482B2 (en) Studio quality audio enhancement
CN112420070A (zh) 自动标注方法、装置、电子设备及计算机可读存储介质
CN115691468A (zh) 歌声合成方法、计算机设备及存储介质
CN116911251A (zh) 一种信息处理方法、装置及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18925503

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18925503

Country of ref document: EP

Kind code of ref document: A1