CNN based Minimal model for recognizing word
manashmandal / deadsimplespeechrecognizer Goto Github PK
View Code? Open in Web Editor NEWCNN based Minimal model for recognizing word
License: MIT License
CNN based Minimal model for recognizing word
License: MIT License
I am a new practitioner of speech processing.
i am confused as why you did from keras.datasets import mnist
in the .ipynb
when the data we are concerned with is an audio file.
Also if you notice here :
https://blog.manash.me/building-a-dead-simple-word-recognition-engine-using-convnet-in-keras-25e72c19c12b the first three code blocks , i,e
are not present in the ipynb here : https://github.com/manashmndl/DeadSimpleSpeechRecognizer/blob/master/SpeechRecognition.ipynb
So, i'm confused how it is still working.
Request you to kindly update the IPYNB to include an end to end tutorial.
Thank you.
def wav2mfcc(file_path, max_pad_len=11):
wave, sr = librosa.load(file_path, mono=True, sr=None)
wave = wave[::3]
mfcc = librosa.feature.mfcc(wave, sr=16000)
pad_width = max_pad_len - mfcc.shape[1]
mfcc = np.pad(mfcc, pad_width=((0, 0), (0, pad_width)), mode='constant')
return mfcc
What is significance of
wave, sr = librosa.load(file_path, mono=True, sr=None) wave = wave[::3]
Q1. how does removing mono = true affect the code.
Q2. what is happeniing here : wave = wave[::3
Hi,
I try to reproduce and train the NN. However I get the error below. Could you please help?
ParameterError Traceback (most recent call last)
in
3
4 # Save data to array file first
----> 5 save_data_to_array(max_len=feature_dim_2)
6
7 # # Loading train set and test set
/tf/notebooks/voice-assistant/DeadSimpleSpeechRecognizer/preprocess.py in save_data_to_array(path, max_len)
45 wavfiles = [path + label + '/' + wavfile for wavfile in os.listdir(path + '/' + label)]
46 for wavfile in tqdm(wavfiles, "Saving vectors of label - '{}'".format(label)):
---> 47 mfcc = wav2mfcc(wavfile, max_len=max_len)
48 mfcc_vectors.append(mfcc)
49 np.save(label + '.npy', mfcc_vectors)
/tf/notebooks/voice-assistant/DeadSimpleSpeechRecognizer/preprocess.py in wav2mfcc(file_path, max_len)
22 wave, sr = librosa.load(file_path, mono=True, sr=None)
23 wave = wave[::3]
---> 24 mfcc = librosa.feature.mfcc(wave, sr=16000)
25
26 # If maximum length exceeds mfcc lengths then pad the remaining ones
/usr/local/lib/python3.6/dist-packages/librosa/feature/spectral.py in mfcc(y, sr, S, n_mfcc, dct_type, norm, lifter, **kwargs)
1704
1705 if S is None:
-> 1706 S = power_to_db(melspectrogram(y=y, sr=sr, **kwargs))
1707
1708 M = scipy.fftpack.dct(S, axis=0, type=dct_type, norm=norm)[:n_mfcc]
/usr/local/lib/python3.6/dist-packages/librosa/feature/spectral.py in melspectrogram(y, sr, S, n_fft, hop_length, win_length, window, center, pad_mode, power, **kwargs)
1829 S, n_fft = _spectrogram(y=y, S=S, n_fft=n_fft, hop_length=hop_length, power=power,
1830 win_length=win_length, window=window, center=center,
-> 1831 pad_mode=pad_mode)
1832
1833 # Build a Mel filter
/usr/local/lib/python3.6/dist-packages/librosa/core/spectrum.py in _spectrogram(y, S, n_fft, hop_length, power, win_length, window, center, pad_mode)
2528 S = np.abs(stft(y, n_fft=n_fft, hop_length=hop_length,
2529 win_length=win_length, center=center,
-> 2530 window=window, pad_mode=pad_mode))**power
2531
2532 return S, n_fft
/usr/local/lib/python3.6/dist-packages/librosa/core/spectrum.py in stft(y, n_fft, hop_length, win_length, window, center, dtype, pad_mode)
213
214 # Check audio is valid
--> 215 util.valid_audio(y)
216
217 # Pad the time series so that frames are centered
/usr/local/lib/python3.6/dist-packages/librosa/util/utils.py in valid_audio(y, mono)
276
277 if not y.flags["F_CONTIGUOUS"]:
--> 278 raise ParameterError('Audio buffer is not Fortran-contiguous. '
279 'Use numpy.asfortranarray to ensure Fortran contiguity.')
280
ParameterError: Audio buffer is not Fortran-contiguous. Use numpy.asfortranarray to ensure Fortran contiguity.
Sir, I'm new to speech and audio processing.
I am confused, whether https://blog.manash.me/building-a-dead-simple-word-recognition-engine-using-convnet-in-keras-25e72c19c12b is more accurate (end -end) or the ipynb here https://github.com/manashmndl/DeadSimpleSpeechRecognizer/blob/master/SpeechRecognition.ipynb?
Request to make clean ipynb for new bies like me.
Thanks for share your knowledge.
After performing padding operation, we get the shape of MFCC as (20, 11). But if the dataset has audio files longer suppose of 24sec and MFCC yields a shape (20, 2300), here most of the audio files(frames) will be cut off. So is there any way I can get the MFCC feature of an audio file of multiple frames.
Thanks for the create code. I am just wondering why you use binary cross entropy loss function in your github code and categorical cross-entropy in your blog post. I have more than 2 categories I wish to classify, and it seems strange to me that you are using binary cross entropy for a classification problem with 3 classes. Can you explain to me why you are using this loss function?
Sir there many missing code in ipynb and there is not complete code on your blog.
Very nice tutorial for read , but hard for me to execute on my end.
Please Please include all steps in ipynb , as many steps missing.
Sincerely thanks
1- What is the max_len and why it is assigned to 11?
2- What is feature_dim_1 and feature_dim_2?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.