Journal of Cognitive Human-Computer Interaction cover
Journal of Cognitive Human-Computer Interaction

Online ISSN 2771-1463

Full Length Article

Volume 7 • Issue 2 • PP: 05–09 • 2024

Extraction of Signal Features in Voice Signals to Train Machine Learning-Based Classifier Algorithms for Emotion Detection

Simran Somani 1* ,
Bhagyashree Shah 1 ,
Bhisaji C. Surve 2
1Student of MBA TECH (IT), MPSTME, NMIMS University, Mumbai, India
2Asst. Professor, Dept. of IT, MPSTME, NMIMS University, Mumbai, India
* Corresponding Author.
verified

Open Access & Copyright

© 2024 The Author(s). Published by ASPG. This article is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).

Abstract

This research aims to detect human emotions using speech signals through the development and implementation of methodologies, namely the frequency domain synthesis. To achieve improved results, various machine learning and deep learning models were applied for implementation and their resulting model performance was analyzed. The research findings revealed that each model exhibited different accuracy rates for different emotions but weighted accuracy is best for deep learning based model. This study provides valuable insights into the feasibility and effectiveness of utilizing different methodologies and models for emotion detection through voice signals synthesis. The audio signals are synthesized for Mel-Frequency Cestrum Coefficients (MFCC), Chroma, and MEL characteristics, which are then used as features to train the various machine learning-based classifiers. Python libraries like Librosa, Sklearn, Pyaudio, Numpy, and sound files are used to analyze voice modulations and identify emotions.

Full Text

This HTML version is generated from the article PDF. The PDF remains the version of record.

1. INTRODUCTION

are various applications of speech emotion detection in human interactions, such as customer service, teaching-learning, medical analysis, voice synthesis, personal interviews, and forensics.

Emotion is a natural element of every living being, including plants as some scientific experiments demonstrate it. In the case of human beings, it is vital because humans are social animals and have various means to express emotions. The various means by which humans can express emotions are voice in speech, facial expression, or text used in written communication. Emotion detection can be a very useful use case for technology-based tool development. In verbal talks, audio signals can be processed to detect emotions in speech; for facial detection, video signals can be processed; and in textual matter, natural language processing can be employed.

Another challenge is the presence of different languages, accents, phrases, speaking styles, and speakers because these factors directly affect most extracted attributes, such as pitch and energy. Additionally, because each emotion correlates with a different component of speech signals, it is possible to have many instances of a given emotion in a single speech signal. As a result, establishing the limits between different emotional components is difficult. Studies have considered classifying emotions across multiple languages, but audiobased speech synthesis can be language-independent.

It is a very challenging task to detect exact emotional states from audio signals due to various reasons. Hence, identification of the best representative features of the respective emotions to be used for machine learning is a vital task. There

2. LITERATURE SURVEY

A method for calculating MFCC coefficients, STE (Short-Term Energy), and audio pitch to identify irritation, pleasure, and depression using audio samples was performed by Girija Deshmukh et al. [1] using the entire RAVDESS dataset and a multi-class SVM classifier.

Peng Shi [2] developed and demonstrated that, compared with SVM and ANN algorithms, DBN (Deep Belief Networks) performed well and achieved about 5% accuracy improvement. J. Uma Maheswari and A. Akila [3] used GLCM (Gray Level Co-occurrence Matrix) and MFCC as audio features, and employed KNN and PRNN on the extracted features.

The audio properties such as sound, format, and phoneme, detected through MFCC, can be used as signal features for training and emotion prediction [4]. Varol et al. [5] suggest that various machine-learning procedures can be employed on numerous datasets with varied tests to yield better success rates.

3. RESEARCH METHODOLOGY

The research journey is executed through a structured process that begins with dataset selection and feature extraction, continues with model training, and ends with prediction and evaluation.

3.1 Research Framework

The proposed step-by-step process of machine-learning-based emotion detection is shown in Figure 1. The trained classifier can later be deployed in an online application for emotion detection from speech signals in various contextual applications.

Figure 1. Framework.
Figure 1. Framework.
Figure 2. Application of the trained model for new audio-signal emotion detection.
Figure 2. Application of the trained model for new audio-signal emotion detection.

3.2 Study of Dataset

The RAVDESS dataset was selected because it contains song and speech files classified into eight diverse emotions at two intensity levels, such as sad, angry, calm, happy, fearful, disgust, neutral, and surprised. The dataset provides speech recordings that are useful for studying emotional states under controlled conditions.

Figure 3. Sample waveform of an audio signal.
Figure 3. Sample waveform of an audio signal.

3.3 Audio Signal Processing

The audio signal is loaded and analysed through Python libraries. The signal may be represented in the time domain, where variations over time are shown, or transformed into the frequency domain to display the percentage of the signal included within each frequency band.

Figure 4. Audio-signal waveform representation.
Figure 4. Audio-signal waveform representation.

Some of the principal audio features are as follows:

  • Mel scale: examines how people perceive frequency as a scale of pitches perceived to be equally spaced.
  • Pitch: represents the highness or lowness of sound; a higher pitch indicates a higher frequency depending on context.
  • Frequency: measures wave cycles per second and is the rate at which sound vibrates.
  • Chroma: projects the spectrum onto 12 bins, each standing for one of the twelve semitones.
  • Fourier transform: moves signals between time and frequency domains.

3.4 Feature Extraction

Physical features and perceptual features are the two categories of audio features. Physical properties, such as energy, spectrum, cepstral coefficients, and fundamental frequency, are mathematical measurements calculated directly from the sound wave. Perceptual qualities describe how humans perceive sounds, including loudness, brightness, pitch, timbre, and rhythm. This work employs the Zero-Crossing Rate, Mel spectrogram, Chroma, delta and delta-delta MFCCs, and Mel Frequency Cepstral Coefficients. Using Librosa, a 525-length feature vector can be generated for each speech segment.

Figure 5. Feature-extraction implementation excerpt.
Figure 5. Feature-extraction implementation excerpt.

3.4.1 Spectrograms

Spectrograms show signal strength at various frequencies over time. The Mel-spectrogram is extracted from the power spectrum using Mel-spaced filter banks. By being more discriminative at lower frequencies and less discriminative at higher frequencies, the Mel scale seeks to emulate the nonlinear human-ear perception of sound.

Figure 6. Chromagram.
Figure 6. Chromagram.

The Mel-frequency cepstrum is useful for recognising audio and modelling the subjective pitch and frequency content of the audio stream. The triangular band-pass filter bank filters FFT power coefficients before computing MFCCs. Differential and acceleration coefficients are also called delta and delta-delta MFCCs; they help understand the dynamics of the power spectrum through time.

The mapping from actual frequency to the Mel scale is:

  , (1)

1+ f 700 mel(f) = 1127ln where ln is the logarithm with base e.

Figure 7. Formula for mapping frequency to the Mel scale.
Figure 7. Formula for mapping frequency to the Mel scale.

MFCC is a major technique used to extract audio-signal features mapped to emotions. In this technique, raw audio signals are converted into a compressed illustration that represents temporal and frequency-domain information. By applying inverse discrete Fourier transforms, MFCC extracts the first 12 coefficients of the signal and also captures the energy of the signal sample, resulting in 13 basic features. First-order and second-order derivatives add 26 more features that help describe transitions.

3.5 Data Preparation

The researcher first formulates data for training. Data must be statistical, the most common example being real values. Categorical data, such as sex traits with values “male” and “female”, and emotion elements such as “happy”, “sad”, “angry”, and “neutral”, are converted to a real-valued representation by one-hot encoding. The total dataset is split into an 80:20 ratio, where 80% is used for training and 20% for testing.

4. MACHINE LEARNING MODELS

The researchers used machine-learning classifiers that take numerical data extracted from the RAVDESS dataset as training features. Broadly, there are two categories of machinelearning algorithms: non-neural-network-based models and neural-network-based models.

In this research, three conventional classifiers were first tested: SVM, Decision Tree, and Random Forest. The researchers then worked with neural-network-based deep-learning algorithms, namely MLP (Multilayer Perceptron) and CNN (Convolution Neural Network). Training and testing are vital processes in machine learning. For training, 80% of the dataset is used, while 20% is assigned for testing to evaluate model performance.

4.1 Prediction and Model Evaluation

Once a model has been trained, it can be used to make predictions. Predictions are made on test data to estimate performance on unseen data. Accuracy and other merit ratios are checked using the testing dataset. Model performance for four emotions is evaluated using a confusion matrix and related ratios.

Figure 8. Confusion matrix.
Figure 8. Confusion matrix.

Precision measures how many positive predictions are correct:

Precision = TP TP+FP. (2)

Recall, or sensitivity, measures how many positive cases are correctly predicted:

Recall = TP TP+FN . (3)

The F1-score combines precision and recall using the harmonic mean:

F1 = 2× Precision×Recall

Precision+Recall. (4)

Figure 9. F1-score formula.
Figure 9. F1-score formula.

All merit ratios for model evaluation should be higher, and values close to 1 are better.

4.2 Non-Deep-Learning-Based Classifiers

Support Vector Machine, Decision Tree, and Random Forest models were implemented for the extracted features. Their performance was evaluated using classification reports including precision, recall, F1-score, and support.

Figure 10. Classification report for one of the evaluated models.
Figure 10. Classification report for one of the evaluated models.
Figure 11. Classification report for another evaluated model.
Figure 11. Classification report for another evaluated model.
Figure 12. Classification report for the neural-network-based model.
Figure 12. Classification report for the neural-network-based model.

4.3 Deep-Learning-Based Classifiers

Deep-learning models were also implemented using extracted audio features. In particular, ANN/MLP and CNN-based approaches were explored. These models learn non-linear relations between features and emotional labels and are suitable for complex speech-emotion patterns.

Figure 13. Implementation excerpt for machine-learning model training and evaluation.
Figure 13. Implementation excerpt for machine-learning model training and evaluation.

5. RESULTS AND DISCUSSION

The comparative performance of all models is summarized in Table 1. The ANN model achieved the highest accuracy among the tested models, followed by Random Forest, SVM, and Decision Tree.

Table 1. Comparison of accuracy for all models.
Table 1. Comparison of accuracy for all models.

Classifier Model Type Accuracy ANN 80.21% SVM 62.50% Random Forest 69.64% Decision Tree 57.01%

Figure 14. Accuracy comparison of machine-learning algorithms.
Figure 14. Accuracy comparison of machine-learning algorithms.

The results indicate that neural-network-based models can capture complex relationships in speech-emotion features more effectively than conventional models. The ANN model with appropriate hyperparameter settings provides the best performance and is recommended for real-life deployment.

6. SUMMARY AND CONCLUSIONS

Automatic emotion detection in any conversation at run time can be a very useful application in contexts such as recruitment interviews and customer support. Hence, the development of such a system with practically reasonable accuracy is the objective of this research. Any machine-learning model development begins with an appropriate dataset. The RAVDESS dataset used in this research work is comprehensive and well composed for the development of machinelearning-based models.

The next task is to convert the dataset into vital features that characterize important aspects of emotions, which act as class identifiers for the classifiers. In this research, major efforts were made to extract maximum features that appropriately capture emotion types. Once suitable features are extracted, the next objective is to develop the most accurate model. The researchers implemented different algorithms using Python library functions. Every model was evaluated using various merit parameters and compared to identify the most suitable model.

The results show that ANN with appropriate hyperparameter settings gives the best results and is recommended for reallife applications. Future improvement can be achieved with more varied datasets and by experimenting with additional signal features and model parameters.

References

[1] Girija Deshmukh, Apurva Gaonkar, Gauri Golwalkar, Sukanya Kulkarni, “Speech based Emotion Recognition using Machine Learning”, Institute Of Electrical And Electronics Engineers, Mar. 2019.

[2] Peng Shi, "Speech Emotion Recognition Based on Deep Belief Network", Institute Of Electrical And Electronics Engineers, March 2018.

[3] Ajith Krishna R,Ankit Kumar,Vijay K. "An Automated Optimize Utilization of Water and Crop Monitoring in Agriculture Using IoT." Journal of Cognitive Human-Computer Interaction, Vol. 1, No. 1, 2021 ,PP. 37-45.

[4]  J. Uma Maheswari, A. Akila, "An Enhanced Human Speech Emotion Recognition Using Hybrid of PRNN and KNN", Institute of Electrical and Electronics Engineers, Feb 2019.

[5] Sri Raksha R. Gupta, M.S. Likitha, A. Upendra Raju and K. Hasitha “Speech Based Human Emotion Recognition Using MFCC”, Institute Of Electrical And Electronics Engineers, March 2017.

[6] Parvesh K,Tharun C,Prakash M. "Apparel Recommendation Engine Using Inverse Document Frequency and Weighted Average Word2vec." Journal of Cognitive Human-Computer Interaction, Vol. 1, No. 2, 2021 ,PP. 46-56.

[7] Tian Kexin, Huang Yongming, Zhang Guobao, Zhang Lin, "Research on Emergency Parking Instruction Recognition Based on Speech Recognition and Speech Emotion Recognition", Institute Of Electrical And Electronics Engineers, Nov. 2019.

[8] Ye Sim Ülgen Sonmez, Asaf Varol, "New Trends in Speech Emotion Recognition", Institute of Electrical and Electronics Engineers, June 2019.

[9] T. Giannakopoulos, A. Pikrakis and S. Theodoridis, "A dimensional approach to emotion recognition of speech from movies", IEEE Int'l Conf. Acoustics Speech and Signal Processing (ICASSP), 2009.

[10] Vijay K. "Collaborating The Textual Reviews Of The Merchandise and Foretelling The Rating Supported Social Sentiment." Journal of Cognitive Human-Computer Interaction, Vol. 1, No. 2, 2021 ,PP. 63 - 72.

[11]  A. Hanjalic, "Extracting moods from pictures and sounds: Towards truly personalized TV", IEEE Signal Proc. Magazine, vol. 23, no. 2, pp. 90-100, 2006.

[12]   L. Lu, D. Liu and H.J. Zhang, "Automatic mood detection and tracking of music audio signals", IEEE Trans. on audio speech and language processing, vol. 14, no. 1, pp. 5-18, 2006.

[13] A. Nogueiras, A. Moreno, A. Bonafonte and J.B. Marino, "Speech emotion recognition using hidden Markov models", INTERSPEECH, 2001.

[14]  R. Venkatesan ,Althaaf Shaik ,Suraj Kumar,Vipul Guria ,Abhishek Raj. "Intelligent Smart Dustbin System using Internet of Things (IoT) for Health Care." Journal of Cognitive Human-Computer Interaction, Vol. 1, No. 2, 2021 ,PP. 73 - 80.

[15] R. Plutchik and H. Kellerman, "Emotion: theory research and experience" in Theories of emotion, Academic Press, vol. 1, 1980.

[16] Y. Wang and L. Guan, "Recognizing human emotional state from audiovisual signals", IEEE Trans. on Multimedia, vol. 10, no. 5, pp. 936-946, 2008.

[17] P. Kavitha,R. Subha Shini,R. Priya. "An Implementation Of Statistical Feature Algorithms For The Detection Of Brain Tumor." Journal of Cognitive Human-Computer Interaction, Vol. 1, No. 2, 2021 ,PP. 57 - 62.

[18] Ling Cen, Fei Wu, Zhu Liang Yu, Fengye Hu, “A Real-Time Speech Emotion Recognition System and its Application in Online Learning”, Emotions, Technology, Design and Learning, ScienceDirect, 2016.

[19] Mehmet Cen Sezgin,Bilg Gunsel & Gunes Kurt, Perceptual audio features for emotion detection, EURASIP Journal on Audio,Speech and Music Processing, 2012,Article number 16,Springer.

[20] Renu Taneja;Aman Bhatia;Javesh Monga;Purva Marwaha, Emotion detection of audio files,2016 3rd International Conference on Computing for Sustainable Global Development (INDIACom), IEEE Publication.

Continue Reading

View the full issue arrow_forward

Cite This Article

Choose your preferred format

format_quote
Somani, Simran, et al. “Extraction of Signal Features in Voice Signals to Train Machine Learning-Based Classifier Algorithms for Emotion Detection.” Journal of Cognitive Human-Computer Interaction, vol. 7, no. 2, 2024, pp. 05–09. https://doi.org/10.54216/JCHCI.070202.
Somani, S., Shah, B., & Surve, B. C. (2024). Extraction of Signal Features in Voice Signals to Train Machine Learning-Based Classifier Algorithms for Emotion Detection. Journal of Cognitive Human-Computer Interaction, 7(2), 05–09. https://doi.org/10.54216/JCHCI.070202
Somani, Simran, Bhagyashree Shah, and Bhisaji C. Surve. “Extraction of Signal Features in Voice Signals to Train Machine Learning-Based Classifier Algorithms for Emotion Detection.” Journal of Cognitive Human-Computer Interaction 7, no. 2 (2024): 05–09. https://doi.org/10.54216/JCHCI.070202.
Somani, S., Shah, B. and Surve, B.C. (2024) ‘Extraction of Signal Features in Voice Signals to Train Machine Learning-Based Classifier Algorithms for Emotion Detection’, Journal of Cognitive Human-Computer Interaction, 7(2), pp. 05–09. Available at: https://doi.org/10.54216/JCHCI.070202.
Somani S, Shah B, Surve BC. Extraction of Signal Features in Voice Signals to Train Machine Learning-Based Classifier Algorithms for Emotion Detection. Journal of Cognitive Human-Computer Interaction. 2024;7(2):05-09. doi:10.54216/JCHCI.070202
S. Somani, B. Shah, and B. C. Surve, “Extraction of Signal Features in Voice Signals to Train Machine Learning-Based Classifier Algorithms for Emotion Detection,” Journal of Cognitive Human-Computer Interaction, vol. 7, no. 2, pp. 05–09, 2024, doi: 10.54216/JCHCI.070202.
policy

Publisher's Note

The statements, opinions, and data presented in this article are solely those of the author(s) and do not necessarily represent those of ASPG, the journal, or its editors. ASPG and the editors disclaim responsibility for any harm arising from the use of any ideas, methods, instructions, or products described in this article, to the fullest extent permitted by applicable law.

Digital Archive Ready