Next Article in Journal
Vehicle-Following Control Based on Deep Reinforcement Learning
Previous Article in Journal
Optimizing Transportation between Sea Ports and Regions by Road Transport and Rail and Inland Waterway Transport Means Including “Last Mile” Solutions
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Machine Learning Approach Regarding the Classification and Prediction of Dog Sounds: A Case Study of South Indian Breeds

by
Prabu Mohandas
1,*,
Jerline Sheebha Anni
2,
Khairunnisa Hasikin
3,4,*,
Dhayalan Velauthapillai
5,*,
Veena Raj
6,
Thanihaichelvan Murugathas
7,
Muhammad Mokhzaini Azizan
8 and
Rajkumar Thanasekaran
9
1
Intelligent Computing Lab, Department of Computer Science and Engineering, National Institute of Technology, Calicut 673601, India
2
KMCT College of Engineering for Women, Kozhikode 673601, India
3
Centre of Intelligent Systems for Emerging Technology (CISET), Faculty of Engineering, Universiti Malaya, Lembah Pantai, Kuala Lumpur 50603, Malaysia
4
Department of Biomedical Engineering, Faculty of Engineering, Universiti Malaya, Lembah Pantai, Kuala Lumpur 50603, Malaysia
5
Faculty of Engineering and Science, Western Norway University of Applied Sciences, 5063 Bergen, Norway
6
Faculty of Integrated Technologies, Universiti Brunei Darussalam, Jalan Tungku Link, Bandar Seri Begawan BE1410, Brunei
7
Department of Physics, University of Jaffna, Jaffna 40000, Sri Lanka
8
Department of Electrical and Electronic Engineering, Faculty of Engineering and Built Environment, Universiti Sains Islam Malaysia, Seremban 71800, Malaysia
9
Department of Computer Science and Engineering, National Institute of Technology, Puducherry 609609, India
*
Authors to whom correspondence should be addressed.
Appl. Sci. 2022, 12(20), 10653; https://doi.org/10.3390/app122010653
Submission received: 15 September 2022 / Revised: 3 October 2022 / Accepted: 6 October 2022 / Published: 21 October 2022
(This article belongs to the Section Acoustics and Vibrations)

Abstract

:
Barking is a form of vocal communication made by dogs. Each type of bark made by dogs has a distinct context. The classification of dog bark pattern will aid in the understanding of barking action. In this study, a machine learning algorithm is used to analyze the pattern of barking from two different dog species: Rajapalayam Hound and Kombai Hound. The objective is to find the context of the dog barking pattern based on various real-time scenarios, including whether the dogs are alone, looking at strangers, or showing an eagerness to fight. The barks of the dogs were recorded inside the house under different scenarios, such as while identifying the owner or strangers. Machine learning algorithms, such as the reinforcement learning method, were used in predicting and classifying the dog sounds. Q-learning is a reinforcement learning that will generate the next best action for the given state. It is a model-free learning used to find the best course of dog action for the given current state of the dog. The Q-learning algorithm had been used in improving the prediction of dog sounds by updating the values of learning, where the values with the highest reward were taken into consideration. In total, 6171 barks were collected from the dogs chosen for study, and the proposed approach achieved a correct prediction accuracy of 85.19% of the dog sounds.

1. Introduction

Dogs are a sophisticated species that make different sounds based on the given situation. Their features include sensory capabilities and physical activities such as barking, hunting, guarding, etc. Dog sounds are a way of communication, transferring information to other dogs and human beings [1,2,3]. These dog sounds are often indicative of their response and are associated with the behaviors of the dogs. Based on a dog’s behavior, there are variations in their barking pattern, which can easily be identified, usually by the owners. Dog bark sounds have different contexts and are a sign of behaviors such as play, alarm, excitement, fear, etc. [4,5,6].
The acoustic features of dog barks remain unexplored. There are acoustic patterns in the dog barking information found during analysis of the signal [7,8,9]. Based on the analysis, humans can classify dog barking pattern information in relation to the context in which the sounds are made. Humans are able to train dogs based on the sound making pattern [10,11]. Barking sound patterns need to be analyzed through the machine learning approach, because currently humans and dog owners can only classify dog barks relating to certain situations, such as stranger’s entry, fear, play, etc. In contrast, other dog sound features remain unexplored.
The acoustic properties of dog barks have to be analyzed and then trained in order to identify the sound making context [12,13]. Studies have been carried out in the past regarding such things as acoustic pattern analysis, sound-making context, and sound structure. Spectrogram analyses of dog bark acoustics have been made based on different contexts [14]. Dog sounds can be analyzed through feature extraction of the sounds produced in different contexts. These features include sound frequency, voice cycles, loudness, energy, etc. Machine learning approaches such as classification trees and k-nearest neighbors are used to classify the dog’s age, sex, and the context of the sound made [15,16]. Classification of dog sounds through machine learning is required because dogs exhibit sounds in different contexts, which humans can only identify up to certain limits [17,18]. Situations such as dog sounds in noisy environments, dog sounds in crowds, and intraspecific communication of dogs cannot currently be classified by humans.
Dogs produce acoustic communication in the frequency range of 1000–2000 Hz. There are varying levels of frequency in dog sounds based on aggression. A dog makes sound in various situations and sometimes without any intention, but only for communicating with other dogs. The identification of dog barks by humans has previously been based on the barking parameters, such as tone, pitch, and intervals between the barks [19]. Dog barking made at a specific pitch helps to identify dog behavior, e.g., barks made at low pitch as the result of aggressiveness and high-pitched barks due to the exhibition of fear [20]. Dog barks at a higher pitch and with long intervals have been identified as the expression of excitement and play. Analysis of the dog vocalizations through visual categorization helps in understanding dog behavior [21,22,23]. Variations in dog bark based on its visual detections have been analyzed, where a dog makes different barks for different colors detected. Dogs make responses to their owner based on their instructions. Playback experiments have been conducted to identify the response of the dogs to their owners, where dogs made subsequent responses to the owner’s instructions [24,25,26,27].
Dog barks have been analyzed using different techniques, such as machine learning algorithms for determining the specific contexts of dog barks. Analysis has been conducted based on dog acoustic features for the classification of different barks [28,29,30]. Dog barks from different breeds have been analyzed and differentiated on the basis of acoustic measures. Dog barks have acoustic measures such as the tone of the barks, the length of the barks, and the intervals between the barks [31].
Many research works have focused on the machine learning approach to explore the context of dog sounds. Machine learning models have the ability to learn and improve from experiences [32]. The classification and prediction of complex information has been achieved efficiently using machine learning techniques [33]. Deep learning has upgraded the learning architecture of machine learning [34]. Machine learning techniques have been used in designing an automated system [35]. Reinforcement learning is an area of machine learning used in various scenarios to identify possible behavior in a given situation.
Reinforcement learning creates a policy for the given action–value function based on the behavior observed. In the training process, regularization has an important role in adjusting the hyperparameters, such as environment, for analyzing different scenarios [36]. For improving the generalizability of the learning method, efficient regularization needs to be designed. Regularization is required in complex environments to overcome problems such as overfitting during the training phase [37,38,39]. In the proposed work, the environment is simple, comprising dog and owner; hence, there will be lower complexity.
The machine learning approach can be used in identifying dog characteristics based on analyzing dog acoustic features. This can be attained by analyzing the numerous sounds of the dog in different situations. Furthermore, machine learning approaches have been used to classify sounds from other animals, such as elephants, dolphins, birds, etc. [40].
Dogs make sounds for conveying information, and they are of a certain pattern. Dogs have a pattern of barking relating to a specific situation, such as stranger detection, walking, playing, etc. [41]. In this study, two dog types from the southern part Tamil Nadu have been selected for the analysis of dog barking pattern and sound analysis; prediction analysis and classification of dog barks on the Rajapalayam and Kombai Hound dog types have been carried out. Training on barking pattern was given to the dogs for detecting the presence of a known person or a stranger to the house. The results of machine learning approach analysis showed that the barking of the dog carried context information features relating to the identification of known and unknown persons in an effective way.
Acoustic analysis through machine learning is required to explore the data from the barking sounds, and the context can then be closely identified. This article focuses on the analysis of dog sound patterns to predict the context of the sound produced and train the dogs specifically to the contexts. The sounds of dog barking during different scenarios were analyzed. Analysis of dog barking pattern was performed in order to extract the features and context information of dog barks. On extracting these features, the dog barking was trained with the machine learning algorithm to propose an automated system for movement detection.
The overall structure of the paper is organized as follows: data collection and analysis are detailed in Section 2. In Section 3, the architecture and methodology of the dog sound classification with the learning algorithm is explained. The results of the proposed work are discussed in Section 4. Section 5 concludes the work.

2. Data Collection and Analysis

Two breeds of dog, Rajapalayam and Kombai, with distinctive differences, were chosen, and their bark sounds were recorded under various situations, as well as at separate houses, to form a dataset for machine learning use. Rajapalayam Hounds, also known as Poligar Hounds, are very intelligent and highly aggressive towards strangers. Kombai Hounds, often used as guard dogs, are intelligent, alert, and adaptive to different conditions. The two dog species were placed in separate environments and houses for analyzing their behavior in different situations. Eight dogs (4 male and 4 female) from each species were chosen for the study. Dogs from the age group of 1–10 years with different owners were taken for sound analysis.

2.1. Data Collection

In order to accurately determine the context of the dog sounds, behavioral analysis of the recorded data was performed. The two breeds of dog were situated at different houses, and sound recorders were placed on the house walls at a height of 2 m above the ground. The dogs were subjected to different scenarios, such as being subjected to friendly behavior, being alone, sensing strangers, etc., and their reactive barking sounds were recorded. These recorded data formed datasets to be used by the machine learning algorithm.

2.2. Sound Recorded Situations

The variations in dog barking sounds are due to the behavioral reactions of the dog when it is faced with diverse situations. These sounds are different in frequency, loudness, and pattern, and are directly linked to the behavior of the dog, such as whenever it sees its owner, senses a stranger, or gets into a fight with another animal, etc. The following are the situations that were simulated by the authors to provoke the behavioral reactions of the dog.

2.2.1. Behavior Reaction: Sensing a Stranger

In the absence of the owner, a stranger entered the house through an entry path. Dog sounds of 3–5 min was recorded.

2.2.2. Behavior Reaction: Getting into a Fight

This situation was recorded when the owner instructed the dog to fight and attack an unknown person. In this situation, the dog tried to bite, and it barked aggressively. It made sounds continuously for up to 3–4 min. These actions varied based on the age group of the dogs; older dogs were more aggressive compared to younger dogs, which made sounds unevenly and were less aggressive.

2.2.3. Behavior Reaction: Being Alone

The dog was left alone in the house for a duration of 1 h. Its movement and its sounds were recorded for 5–7 min.

2.2.4. Behavior Reaction: In Friendly Play

During the play situations, the owner played with the dog with a ball for 20 min. Its activities were observed, and barking sounds of nearly 5 min were recorded.

2.2.5. Behavior Reaction: During a Walk

The owner was made to walk around the house with the dog. The dog observed its surroundings during this situation and made sounds rarely, such that 7–8 min of sounds were recorded.

2.3. Recording Vocalization and Observation

The dog’s vocalization recordings were made by positioning the dog in the house and exposing it to the different scenarios. A H4N handy recorder was used for recording the sounds of the dogs. For the scenarios of dog sounds during play, walking, and stranger running, recordings were made in an open environment.
A total of 6171 bark sounds were recorded from 16 different, individual dogs, from the breeds of Rajapalayam and Kombai Hound. Each of the barks contained a continuous 3–4 barks, from which individual barks were manually separated and extracted. A total of 5200 barking sounds were taken for analysis, which includes 325 barking sounds from each dog based on age range and species using a systematic sampling procedure. Sounds were recorded from young dogs of age 1–3 years and older dogs of 6–10 years. The Dog’s behavior and its barking sounds in different situations, which included playing, walking, stranger’s presence, and owner presence, were recorded.
There were significant variations in the dog sounds when an unknown person approached the dogs. The dogs were aggressive when the unknown person approaching distance was less than 3 m, and they were comparatively less aggressive when the distance increased. The recordings were made manually and in real-time using a microphone connected to H4N handy recorder. The microphone was positioned at a distance of 3–5 m while recording the dog sounds. Recordings were collected by placing the dog inside the house, making the dog roam in the grounds, and placing it alone. Table 1 consists of dog sounds recorded in different contexts.

2.4. Sound Parameters

There were 29 sound parameters extracted from one particular dog bark sound, including energy, loudness, energy difference, density difference, pitch maximum and minimum, number of voice cycles, and measurements of tonality. These considered parameters described the quality of sound obtained, which changed considerably over time. For example, voice cycles are the unit movements of the vocal folds, which detail the air being exhaled during the production of the sound. Tonality and harmonics-to-noise ratio give the tonal frequency components over the noise caused by the irregular movements of the vocal folds [42,43,44]. There were variations in the dog sounds based on different contexts. Figure 1 shows the variations in the sounds produced by the dogs through spectrogram analysis. In a similar manner, other dog sounds were considered for analysis. From the sounds recorded, 5200 files of individual sounds were analyzed, and the sounds were classified into different scenarios.

3. Approach and Analysis: Architecture and Methodology

The proposed approach was defined through the architecture of sound analysis by placing the dog in the house environment and in different scenarios. The pattern of the dog barking sound, along with its sound features, were then analyzed in order to determine the context of bark sound.

3.1. Architecture of Sound Analysis

The proposed architecture consists of the processes involved in the recording of the dog barks inside the house and in the open environment under different scenarios. The recorded sound was classified, and predictions were made using learning algorithm capability (Appendix A). The classification and prediction processes of the dog barking sound are presented in Figure 2.

3.2. Multivariate Analysis

To further break down the composition and categorization of dog barking sounds, this paper used multivariate analysis methods as well as ANOVA. Deterministic function variables were used to determine the difference in the context of dog sounds in different scenarios. There were several variables used in categorizing the sounds, such as energy, loudness, energy difference, density difference, pitch maximum and minimum, number of voice cycles, and measurements of tonality. These were used to determine the combination of different dog sounds based on the variables, and different bark sounds were separated.

3.3. Methodology: Machine Learning-Based Approach

The methodology for analyzing the sound contexts was composed through the feature extraction of the sound elements. After the feature extraction, sound classification was carried out based on the context of the dog sound. In the proposed methodology, classification of the dog sounds was based on the feature extraction and contextual information. Both the dog species were placed in similar situations; for most of the situations encountered, Rajapalayam Hound and Kombai Hound made sounds with an identical pattern.
Huge differences in the barking sound were noticed in two extreme conditions—when an owner or stranger enters the testing compound, and also when the dog is sitting alone all by itself at the house, or is in an open environment, away from the house. The acoustic features of the dog sounds were analyzed and annotated in order to identify the behavior of the dog. Through the proposed method, the pattern of the dog sounds due to environmental changes could be determined by the humans in the houses. Figure 3 depicts the proposed methodology for recording and analyzing the different barks of the dog. The recorded dog barking sound was framed to identify the barking, because a single recorded sound contains a series of barking sounds.
Sound acquisition involves acquiring the dog sounds by positioning the microphone. The acquired sounds in different scenarios were analyzed in order to identify patterns in the dog barking. Framing is important and allows the algorithm to extract the unique features from the frames of the sounds. Therefore, framing segments the signals into several frames, and this is very important considering that the signals are not static and change rapidly. Fast Fourier transform was used to separate the barks based on their sequence. The sequence of dog barks recorded was used in order to understand the complete meaning or the reason for the bark made by the dogs. Mel-Frequency Cepstral Coefficients (MFCCs) were used for the determination of the spectrum of sounds exhibited, which were similar to the human auditory responses [45,46].
MFCCs were used for distinguishing between dog barks based on the frequency levels at which they had been made. Based on the MFCC coefficients obtained, sound classification of the dog was made to identify the barking pattern. Sound patterns observed during different scenarios were taken into considerations. By using spectrogram analysis, variation in the dog sounds identified and sound patterns were identified.

3.3.1. Classification

Classification of the dog sounds was carried out using the barking pattern. The barking pattern information observed for the different scenarios was used to classify the different types of dog sound. Figure 4 represents the reinforcement learning method for the prediction of the dog sounds. It comprises Environment and Agent.

3.3.2. Environment

Regarding environment, dog sounds were acquired, and their features were analyzed in order to learn the features of different types of dog sounds. Environment comprises input sound, learning layers, label, and rewards.

3.3.3. Input Sound

The input sound is the dog sound acquired for analyzing the features associated with it.

3.3.4. Feature Learning Layers

From the input sound acquired, sound features were extracted, and its features were analyzed for classification and predictions. Learning algorithms from reinforcement machine learning techniques were used for learning the features of the sound acquired.

3.3.5. Label

Predicted sounds were labelled for training and future predictions. Every sound was labelled to determine the reward for the prediction of the sound and to train the system.

3.3.6. Reward

The reward for every sound acquired and predicted was based on correct and incorrect predictions. The sounds with the highest reward were considered as accurate predictions with the use of learning layers.

3.3.7. Agents

Agents were trained on different dog sounds with their corresponding sound actions. Using the sound features extracted, prediction policy was used for determining the sound patterns of the dogs. The prediction policy process is to determine the sounds scenario acquired to make predictions. It also includes past predictions and information from the learning layer of the sounds trained. With this technique, predictions were achieved in an efficient manner, and further changes in the sounds of the dog learning were updated for the improved performance.

3.4. Learning Algorithm for Sound Classification

In the sound classification process, the pattern of dog barking sound identification was made based on the labelling information from the sound recorded. Acoustic features were taken into consideration for classifying context-based dog sounds. A model was designed to identify the context of the dog barking sound by utilizing the extracted features. A classification method was applied for learning the models from the data. These models were used for the prediction of dog behavior based on the acoustic features from the individual contexts.
In the sound classification problem, feature vector x ϵ Rn and its components, x1…xn, are called predictor variables, and there is a class variable C taking values on (0,1). The objective is to construct classifier models from the training data consisting of a set of ‘n’ observations, Dn = ((x1, C1), (x2, C2)..… (xn, Cn)), from the probability distribution p(x, C). The sound classification model used to assign labels to different instances, x(n + 1), is characterized by the predictor variables.
The integrity of the model for sound prediction and classification depends on the data values of True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN). The error rate can be defined as (FN + FP)/N, and the accuracy as (TP + TN)/N. N is the total number of instances of TP, FP, TN, and FN.
Table 2 represents the dog sounds recorded and their prediction accuracy. The total number of instances taken for the accuracy prediction is 800. The differences in the predictions and error rate will be improved using the proposed approach.
The Q-learning algorithm is the descriptive form of reinforcement learning algorithms. Q-learning can learn an efficient technique, even without an operating prototype, by adjusting the reward and action of a state called the Q function. It will find the next best action for the given current state and aims to choose the action at random and maximizes the reward. Q-learning was used in the sound predictions because of its computational efficiency in learning. It is a learning algorithm that will return the highest Q value for each state, resulting in a search for optimal actions. The action value of the function [43] can be written as:
Qt+1 (st, yt) = Qt (st,yt )+ ∝t [r t + 1 + β × max a A Qt (s t + 1,y) − Qt (st,yt)]
The above equation represents the Temporal Difference (TD) update, which was applied every time a sound was detected in the environment. This updating was used in the best possible prediction of the sounds acquired.
The algorithm A1- learning algorithm describes the learning method of the proposed approach, with the different states and their actions. Q (s, a) is the expected value of doing a in state s, following the optimal policy. The Q-table is initialized, and an action is chosen for analysis. For each action, a reward is returned to determine the action. The Q-table is updated with the learning function for different actions.
The k-nearest neighbor classifier was used in the prediction of the sounds of the dog based on the given instance. It determines the sounds labelled ‘x’ for the most frequent sounds found in the ‘k’ instances. The Euclidean distance algorithm was used in the estimation of the nearest neighbors for the continuous variable ‘x’. The prediction process was conducted by using the labels of the k-nearest neighbor in the sounds. For the model design, the wrapper selection method was used in the feature selection process in classifying the sounds. It is useful for making the automatic selection of data that are most relevant to the model design predicted. The Euclidean distance algorithm between two points was calculated using Equation (2):
d ( x , y ) = i = 1 n ( x i 2   y i 2 )
In the training process, the environment for the dog behavior was set up, such as the dog being placed inside the house with the owner. The observation of the agent (dog) was then recorded to analyze its behavior. Based on the instructions from the owner and environment, dogs perform an action, exhibiting their behavior. On observing the action of the dogs, rewards were mapped to define a policy.

3.4.1. Training

During the training process, the dog sound was used as input, sound features were extracted, and labels of the sound were loaded. Feature extraction and behavior prediction were achieved using the K-NN algorithm. The training dataset was used in training the machine for prediction with the use of the learning algorithm. The training was then carried out by presenting different scenarios of dog sounds. Changes in the patterns of barking information of the dogs were validated for improved performance predictions. Predictions were made based on the dog sound features, and the machine learning process was trained. The training process is described in Figure 5.
For the performance verification of the model formed, a test input was given to predict the dog sounds. During the training process, it was observed that increasing the training iterations affected the overall prediction and classification accuracy. However, the validation accuracy remained unchanged, even after the 100th epoch, hence it was concluded that the network was overtraining.

3.4.2. Testing

The testing process comprises input test sound, feature extraction, learning model, and the end result of sound classification, as described in Figure 6. The dog sound was given as the input, and the input sound underwent feature extraction. Based on the features of the sounds, predictions were determined with the model formed using the learning algorithm, which determined the type of sound received as the input. Hence, dog sounds were classified based on the type of input sound given.
In the testing process, the proposed model was expected to classify the given sound file. A confusion matrix was used to evaluate the classification model’s performance. The confusion matrix describes the classification errors based on the sound predictions. In the matrix representation, diagonal entries correspond to correct classifications, while other entries are incorrect classifications.
Out of a total of 43 dogs taken for testing, the proposed model was able to correctly identify 39 dog sounds. Based on the increased amount of training and its sound features, the sound classification accuracy was high. The process was repeated with the same datasets for training and testing to compare different hyperparameters. The hyperparameters included actor learning rate, exploration, and environment.
Sound samples trained for more than 100 epochs did not process valid results of prediction. Table 3 consists of training dog sounds during different scenarios, and training values were updated based on the new states encountered. Updating the values was performed through training in order to achieve the prediction of dog sounds.
The values in Table 3 were updated based on the training samples presented. Based on the dog sound patterns, the values in the tables were updated for the predictions. This is a learning process, and for each state its corresponding values are updated for classification.

4. Different Scenario and Observation: A Real Time Case Study

A case study was carried out relating to the barking of Rajapalayam and Kombai dog types. These dogs are used both as pet animals and as hunters. Kombai dogs have high hunting skills compared to Rajapalayam dogs, and both were found in the Theni District, Tamil Nadu. The sounds of these two dog species were considered for the case study to understand the pattern classification and to predict barking patterns based on context. The dogs were trained by their owners to exactly make a sound during different scenarios. Recorded barking sounds under a variety of scenarios were analyzed to determine the prediction level.

4.1. Different Scenario and Observation

The dogs were placed in separated houses, together with their owners. Recordings of the sounds were collected for a period of 5 days continuously and were subsequently analyzed. Different scenarios were considered for this case study, and they were as follows:
(1)
Dog barking while a stranger walked in;
(2)
Dog barking while a stranger was running;
(3)
Dog playing with a ball;
(4)
Dog playing with the owner;
(5)
When the dog was alone.

4.1.1. Dog Barking While Stranger Walked in

During this situation, the dogs made repeated barks when they detected strangers walking in the darkness of the night. Both the dogs stayed alert and detected most of the people during this scenario. Sounds made by the dogs were loud and repetitive.
Table A1 represents the sounds recorded during the Stranger Walking into the House scenario. The dogs detected the stranger’s presence in most cases. Adult dogs were able to identify the strangers efficiently. Irrespective of the stranger’s appearance, dogs detected the strangers accurately. Hence, these dogs were efficient in detecting the strangers.
The prediction accuracy of the dog sounds during the Strangers Walking scenario is relatively high, with less error rate and false detections. Both dogs were presented with a similar scenario, and their results are presented in Figure 7a.

4.1.2. Dog Barking While Stranger Is Running

The second scenario was about the barking of the dog when it detected strangers running. The dogs barked repeatedly and at higher frequency levels when detecting a stranger running. Both dog species, while detecting the strangers running, made barking sounds of high frequency continuously. The sounds of the dogs are presented in Table A2 and had an identical pattern, with not much variation in barking.
The dog sounds were repetitive and loud during this scenario. The dog’s physical behavior was to try and run in the direction of the stranger running. Both dog species made the barking sound continuously. The prediction of dog sounds during the stranger running was analyzed, and predictions were made correctly in a higher number of situations. Figure 7b represents the prediction results of the dog sounds, and it shows that there were very few false detections.

4.1.3. Dog Playing with a Ball

Dogs playing with balls in the absence of the owner were recorded for pattern classification. During this situation, dogs played calmly with the balls by running around without any variation in the frequency of the barking; these are shown below in Table A3. Barks made by the dogs in the above scenario were smaller.
Dog sounds were repetitive and loud during this scenario. Both dog species made the barking sound continuously. Dog sound prediction during the play scenario with the ball was comparatively low compared to the other scenarios, because the dog did not make much sound during this scenario. Sounds made by the dogs were at rare instances and of low frequency. Figure 7c represents the prediction results of the dog sounds during the Play with Ball scenario.

4.1.4. Dog Playing with the Owner

Dog barks were recorded while they were playing with their owners and are described in Table A4. The dogs played with their owners, producing barks of the same frequency level for the entire barking sound. During the play scenario, dogs got excited, and there was not much barking made by the dog as they revolved around their owner.
Dogs were playing with excitement in reaction to their owner, and most of the time they were roaming with their owners. They did not make any sound, their behavior was soft, and they followed the owner’s instructions.
Figure 7d comprises the results of the dog sound predictions while the dog was playing with the owner. Both dog species sounds were predicted with a high accuracy during this scenario. False predictions were found due to the varied excitement levels of dogs when playing with the owner.

4.1.5. Dog When Alone

During the scenario of dogs being alone, they remained calm and did not bark unless they found any changes in the room. In this scenario, both dog species remained idle for most of the time.
Dogs made barks on rare situations when they found any change in the surroundings. They remained idle and roamed about, or slept. Table A5 shows the different barks made by the dogs identified by the owners of their house when the dog was alone. Variations in the bark classification were due to the dogs training in barking being inadequate.
Figure 7e represents the prediction results of dog sounds when the dog was alone in the house. Dogs only made sounds in rare cases, which were predicted, and there were moderate false rates due to sudden and uneven barking pattern information

5. Result and Discussion

Predictions of dog sounds were made on the basis of context for the Rajapalayam and Kombai dogs. The classification and prediction of the dog sounds using the Q-learning algorithm and k-nearest neighbor produced improved results compared to the existing methods. This method consists of predictor variables such as energy, loudness, band density, energy diff, density diff, pitch min, pitch max, and pitch slope for the determination of dog contexts and sex factors. The prediction levels of the dogs during different scenarios were analyzed. The prediction accuracies for the dogs using the k-nearest neighbor model were 92% in female dogs and 85.7% in male dogs. Table 4 shows the prediction results of dog sounds based on the proposed approach.
The confusion matrix describes the performance of the predicted sound when it is given as an input. Correct and incorrect values are presented in the confusion matrix, which summarizes the prediction results of the dog sounds. Two different dog species were taken for the study of sounds in five different scenarios. These predictions have improved results, because the machine learning features were updated based on changes in the environment. The confusion matrix of dog sound prediction is shown in Table 5.
The prediction analysis made of the sounds of the two dog species chosen for study and the results are presented in Table 4. The proposed approach classifies the dog sounds in relation to the sound produced by individuals based on the context in which it was made. The prediction level varies because the clarity of the dog sounds depends on the surrounding environment. The proposed approach also helps us to explore the characteristics of the dog sounds.
A comparison was made to analyze the predictions of the dog sounds based on the training given to the dogs in the different contexts. Results are described in Figure 8, which clearly shows the improved performance in the dog sounds through training based on different contexts. The machine learning approach has helped to classify different types of sound, and with further training improved performance was achieved.

6. Conclusions

The approach used has shown improved performance in predicting dog sounds in various contexts. The reinforcement learning method was used for predicting and classifying the characteristics of dog sounds during various scenarios. An 85.19% prediction accuracy was achieved based on the training sounds of the two dog species, Rajapalayam and Kombai Hounds. The classification and predictions were made on the basis of the sounds recorded in different surroundings. The proposed prediction approach was efficient, and it could be implemented in other types of dogs to investigate its performance in the overall prediction of dog sounds. The Q-learning algorithm with k-nearest neighbor learns each state of action the dogs perform during particular scenarios. The proposed algorithm outputs an accurate prediction by estimating the optimal Q-function with high probability using the number of observations. Hence, dog sounds have contextual information that can be trained and predicted through machine learning approaches. The limitations of the work include the lack of analysis of the behavior of the dogs during different scenarios, such as different environments, climate factors, etc., which still need to be analyzed. Different breeds of dog could be chosen for study to identify the nature of their behavior.

Author Contributions

Conceptualization, methodology, software, validation, formal analysis, investigation, resources, writing—original draft preparation—P.M., J.S.A., K.H., D.V., T.M., V.R., M.M.A. and R.T. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Ethical review and approval were waived for this study as no animal was harmed during the study.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest. The authors declare that they have no known competing financial interests or personal relationships that could have influenced the work reported in this paper.

Appendix A

Algorithm A1: Learning Algorithm
Input: Initial state s , Action set a , update sound k , learning rate , discount factor β
Notations:   t —time interval between sounds,   y t —action in time for the specific sounds, s t —state of time for the dog sound,   r t —reward for the state, A —Sample set for Q updating,   λ —to determine update functioning of Q
initiate   i = 0, t = 0, Q 0 ( s 0 , a 0 ) = 0
for time interval t between sounds do
y t ← action selection   ( y, Q t ( s t , y t ) )
r t ← get reward ( s t , y t ) Q t + 1 ( s t , y t )     Q t ( s t , y t ) + t [ r t + 1 + β × m a x a A Q t ( s t + 1 ,   y ) Q t ( s t ,   y t ) ]
// Updating function
A A   ( s t , y t ,     r t )    // Adding a new sample
if   i = k
then
for   n K
do ( s , y , r ) = getsample ( A )
end for
i ← 0
end if
t t   + 1
end for

Appendix B

Table A1. Dog Sounds Recorded While the Stranger is Walking.
Table A1. Dog Sounds Recorded While the Stranger is Walking.
Dog TypeGenderAge
(in Years)
Day 1Day 2Day 3Day 4Day 5
Rajapalayam HoundFemale132012
Female61810221326
Male225761
Male82217141821
Kombai HoundFemale241002
Female982113510
Male200121
Male10151916118
Table A2. Dog Sounds Recorded When the is Stranger Running.
Table A2. Dog Sounds Recorded When the is Stranger Running.
Dog TypeGenderAge
(in Years)
Day 1Day 2Day 3Day 4Day 5
Rajapalayam HoundFemale122132
Female6191417811
Male240021
Male82522121923
Kombai HoundFemale231243
Female91721131910
Male213143
Male102317142118
Table A3. Dog Sounds Recorded While Playing with a Ball.
Table A3. Dog Sounds Recorded While Playing with a Ball.
Dog TypeGenderAge
(in Years)
Day 1Day 2Day 3Day 4Day 5
Rajapalayam HoundFemale144132
Female68710119
Male220311
Male8124161310
Kombai HoundFemale265522
Female98101759
Male257433
Male101081397
Table A4. Dog Sounds Recorded When Playing with Owner.
Table A4. Dog Sounds Recorded When Playing with Owner.
Dog TypeGenderAge
(in Years)
Day 1Day 2Day 3Day 4Day 5
Rajapalayam HoundFemale11148149
Female68130811
Male2711986
Male859608
Kombai HoundFemale241357
Female91301168
Male2681197
Male109137711
Table A5. Dog Sounds Recorded When Dog is Alone.
Table A5. Dog Sounds Recorded When Dog is Alone.
Dog TypeGenderAge
(in Years)
Day 1Day 2Day 3Day 4Day 5
Rajapalayam HoundFemale122131
Female6151317109
Male220010
Male81319171012
Kombai HoundFemale230101
Female91518131411
Male212021
Male10111916912

References

  1. Yin, S. A New Perspective on Barking Dogs. J. Comp. Psychol. 2002, 116, 189–193. [Google Scholar] [CrossRef]
  2. Feddersen-Petersen, D.U. Vocalization of European Wolves (Canis lupus lupus L.) and Various Dog Breeds (Canius lupus f. fam.). Arch. Anim. Breed. 2000, 43, 387–398. [Google Scholar] [CrossRef]
  3. Maros, K.; Pongrácz, P.; Bárdos, G.; Molnár, C.; Faragó, T.; Miklósi, Á. Dogs can discriminate barks from different situations. Appl. Anim. Behav. Sci. 2008, 114, 159–167. [Google Scholar] [CrossRef]
  4. Slobodchikoff, C.N.; Andrea, P.; Jennifer, L.V. Prairie Dog Alarm Calls Encode Labels about Predator Colors. Anim. Cogn. 2009, 12, 435–439. [Google Scholar] [CrossRef]
  5. Taylor, A.M.; David, R.; Karen, M. Context-Related Variation in the Vocal Growling Behaviour of the Domestic Dog (Canis familiaris). Int. J. Behav. Biol. Ethol. 2009, 115, 905–915. [Google Scholar] [CrossRef]
  6. Scheider, L.; Grassmann, S.; Kaminski, J.; Tomasello, M. Domestic Dogs Use Contextual Information and Tone of Voice when following a Human Pointing Gesture. PLoS ONE 2011, 6, e21676. [Google Scholar] [CrossRef] [Green Version]
  7. Pongrácz, P.; Miklósi, A.; Timár-Geng, K.; Csányi, V. Preference of Copying Unambiguous Demonstrations in Dogs. J. Comp. Psychol. 2003, 117, 337–343. [Google Scholar] [CrossRef] [Green Version]
  8. Pérez-Espinosa, H.; Pérez-Martınez, J.M.; Durán-Reynoso, J.Á.; Reyes-Meza, V. Automatic Classification of Context in Induced Barking. Res. Comput. Sci. 2015, 100, 63–74. [Google Scholar] [CrossRef]
  9. Quervel-Chaumette, M.; Faerber, V.; Faragó, T.; Marshall-Pescini, S.; Range, F. Investigating Empathy-Like Responding to Conspecifics Distress in Pet Dogs. PLoS ONE 2016, 11, e0152920. [Google Scholar] [CrossRef] [Green Version]
  10. Peter, A. I saw where you have been—The topography of human demonstration affects dogs’ search patterns and perseverative errors. Behav. Process. 2016, 125, 51–62. [Google Scholar] [CrossRef]
  11. Albuquerque, N. Dogs recognize dog and human emotions. R. Soc. Biol. Lett. 2016, 12, 1–5. [Google Scholar] [CrossRef] [Green Version]
  12. Hall, J. Persistence and resistance to extinction in the domestic dog: Basic research and applications to canine training. Behav. Process. 2017, 141, 67–74. [Google Scholar] [CrossRef]
  13. Sarah, M.P.; Chiara, F.; Paola, V. The effect of training and breed group on problem-solving behaviours in dogs. Anim. Cogn. 2016, 19, 571–579. [Google Scholar]
  14. Yin, S.; McCowan, B. Barking in Domestic Dogs: Context Specificity and Individual Identification. Anim. Behav. 2004, 68, 343–355. [Google Scholar] [CrossRef]
  15. Larranaga, A.; Bielza, C.; Pongrácz, P.; Faragó, T.; Bálint, A.; Larranaga, P. Comparing supervised learning methods for classifying sex, age, context and individual Mudi dogs from barking. Anim. Cogn. 2015, 18, 405–421. [Google Scholar] [CrossRef] [Green Version]
  16. Anisha, R.P.; Anita, H.P. Detection of Strangers Based on Dog’s Sound. Int. J. Innov. Technol. Explor. Eng. 2019, 8, 111–114. [Google Scholar]
  17. Demir, F.; Abdullah, D.A.; Sengur, A. A New Deep CNN Model for Environmental Sound Classification. IEEE Access 2020, 8, 66529–66537. [Google Scholar] [CrossRef]
  18. Piczak, K.J. Environmental sound classification with convolutional neural networks. In Proceedings of the 2015 IEEE 25th International Workshop on Machine Learning for Signal Processing (MLSP), Boston, MA, USA, 17–20 September 2015; pp. 1–6. [Google Scholar]
  19. Peter, P.; Csaba, M.; Adam, M. Acoustic Parameters of Dog Barks Carry Emotional Information for Humans. Appl. Anim. Behav. Sci. 2006, 100, 228–240. [Google Scholar]
  20. Peter, P.; Csaba, M.; Miklosi, A. Barking in family dogs: An ethological approach. Vet. J. 2010, 183, 141–147. [Google Scholar]
  21. Range, F.; Aust, U.; Steurer, M.; Huber, L. Visual Categorization of Natural Stimuli by Domestic Dogs. Anim. Cogn. 2008, 11, 339–347. [Google Scholar] [CrossRef]
  22. Siniscalchi, M.; Lusito, R.; Sasso, R.; Quaranta, A. Are temporal features crucial acoustic cues in dog vocal recognition? Anim. Cogn. 2012, 15, 815–821. [Google Scholar] [CrossRef]
  23. Colbert-White, E.N.; Tullis, A.; Andresen, D.R.; Parker, K.M.; Patterson, K.E. Can dogs use vocal intonation as a social referencing cue in an object choice task? Anim. Cogn. 2018, 21, 253–265. [Google Scholar] [CrossRef]
  24. Wallis, L.J.; Range, F.; Müller, C.A.; Serisier, S.; Huber, L.; Virányi, Z. Training for eye contact modulates gaze following in dogs. Anim. Behav. 2015, 106, 25–37. [Google Scholar] [CrossRef] [Green Version]
  25. Chijiiwa, H.; Kuroshima, H.; Hori, Y.; Anderson, J.R.; Fujita, K. Dogs avoid people who behave negatively to their owner: Third-party affective evaluation. Anim. Behav. 2015, 106, 123–127. [Google Scholar] [CrossRef]
  26. Huber, A.; Barber, A.L.; Faragó, T.; Müller, C.A.; Huber, L. Investigating emotional contagion in dogs (Canis familiaris) to emotional sounds of humans and conspecifics. Anim. Cogn. 2017, 20, 703–715. [Google Scholar] [CrossRef] [Green Version]
  27. Molnár, C.; Pongrácz, P.; Faragó, T.; Dóka, A.; Miklósi, Á. Dogs discriminate between barks: The effect of context and identity of the caller. Behav. Process. 2009, 82, 198–201. [Google Scholar] [CrossRef]
  28. Faragó, T.; Takács, N.; Miklósi, Á.; Pongracz, P. Dog growls express various contextual and affective content for human listeners. R. Soc. Open Sci. 2017, 4, 170134. [Google Scholar] [CrossRef] [Green Version]
  29. Khamparia, A.; Gupta, D.; Nguyen, N.G.; Khanna, A.; Pandey, B.; Tiwari, P. Sound Classification Using Convolutional Neural Network and Tensor Deep Stacking Network. IEEE Access 2019, 7, 7717–7727. [Google Scholar] [CrossRef]
  30. Ullo, S.L.; Khare, S.K.; Bajaj, V.; Sinha, G.R. Hybrid Computerized Method for Environmental Sound Classification. IEEE Access 2020, 8, 124055–124065. [Google Scholar] [CrossRef]
  31. Pongrácz, P.; Molnár, C.; Miklósi, A.; Csányi, V. Human Listeners are Able to Classify Dog Barks Recorded in Different Situations. J. Comp. Psychol. 2005, 119, 136–144. [Google Scholar] [CrossRef] [Green Version]
  32. Munir, H.; Vogel, B.; Jacobsson, A. Artificial Intelligence and Machine Learning Approaches in Digital Education: A Systematic Revision. Information 2022, 13, 203. [Google Scholar] [CrossRef]
  33. Zhang, Z. Speech feature selection and emotion recognition based on weighted binary cuckoo search. Alex. Eng. J. 2021, 60, 1499–1507. [Google Scholar] [CrossRef]
  34. Heidari, A.; Navimipour, N.J.; Unal, M.; Toumaj, S. Machine learning applications for COVID-19 outbreak management. Neural Comput. Appl. 2022, 34, 15313–15348. [Google Scholar] [CrossRef] [PubMed]
  35. Heidari, A.; Navimipour, N.J.; Unal, M. Applications of ML/DL in the management of smart cities and societies based on new trends in information technologies: A systematic literature review. Sustain. Cities Soc. 2022, 85, 104089. [Google Scholar] [CrossRef]
  36. Slobodchikoff, C.N.; Placer, J. Acoustic Structures in the Alarm Calls of Gunnison’s Prairie Dogs. Anim. Behav. 2006, 42, 712–719. [Google Scholar] [CrossRef] [Green Version]
  37. Riede, T.; Mitchell, B.R.; Tokuda, I.; Owren, M.J. Characterization Noise in Non-Human Vocalizations: Acoustic Analysis and Human Perception of Barks by Coyotes and Dog. J. Acoust. Soc. Am. 2005, 118, 514–522. [Google Scholar] [CrossRef] [Green Version]
  38. Pongrácz, P.; Molnár, C.; Dóka, A.; Miklósi, Á. Do Children Understand Man’s Best Friend? Classification of Dog Barks by Pre-Adolescents and Adults. Appl. Anim. Behav. Sci. 2011, 135, 95–102. [Google Scholar] [CrossRef]
  39. Bjorck, J.; Rappazzo, B.H.; Chen, D.; Bernstein, R.; Wrege, P.H.; Gomes, C.P. Automatic Detection and Compression for Passive Acoustic Monitoring of the African Forest Elephant. Assoc. Adv. Artif. Intell. 2019, 33, 476–484. [Google Scholar] [CrossRef] [Green Version]
  40. Nossier, S.A.; Rizk, M.; Moussa, N.D.; el Shehaby, S. Enhanced smart hearing aid using deep neural networks. Alex. Eng. J. 2019, 58, 539–550. [Google Scholar] [CrossRef]
  41. Wang, H.; Xu, Y.; Li, M. Study on the MFCC similarity-based voice activity detection algorithm. In Proceedings of the 2nd International Conference on AIMSEC, Dengleng, China, 8–10 August 2011; pp. 4391–4394. [Google Scholar]
  42. Kotenko, I.; Izrailov, K.; Buinevich, M. Static Analysis of Information Systems for IoT Cyber Security: A Survey of Machine Learning Approaches. Sensors 2022, 22, 1335. [Google Scholar] [CrossRef]
  43. Sun, F.; Wang, X.; Zhang, R. Improved Q-Learning Algorithm Based on Approximate State Matching in Agricultural Plant Protection Environment. Entropy 2021, 23, 737. [Google Scholar] [CrossRef] [PubMed]
  44. Zheng, Q.; Yang, M.; Yang, J.; Zhang, Q.; Zhang, X. Improvement of Generalization Ability of Deep CNN via Implicit Regularization in Two-Stage Training Process. IEEE Access 2018, 6, 15844–15869. [Google Scholar] [CrossRef]
  45. Jin, B.; Cruz, L.; Goncalves, N. Deep Facial Diagnosis: Deep Transfer Learning from Face Recognition to Facial Diagnosis. IEEE Access 2020, 8, 123649–123661. [Google Scholar] [CrossRef]
  46. You, L.; Jiang, H.; Hu, J.; Chang, C.H.; Chen, L.; Cui, X.; Zhao, M. GPU-accelerated Faster Mean Shift with euclidean distance metrics. In Proceedings of the 2022 IEEE 46th Annual Computers, Software, and Applications Conference (COMPSAC), Los Alamitos, CA, USA, 27 June–1 July 2022; pp. 211–216. [Google Scholar] [CrossRef]
Figure 1. Spectrogram of dog sounds: (a) While Playing with Owner, (b) During Stranger Running.
Figure 1. Spectrogram of dog sounds: (a) While Playing with Owner, (b) During Stranger Running.
Applsci 12 10653 g001
Figure 2. Proposed architecture for the bark pattern classification.
Figure 2. Proposed architecture for the bark pattern classification.
Applsci 12 10653 g002
Figure 3. Proposed methodology for bark pattern classification.
Figure 3. Proposed methodology for bark pattern classification.
Applsci 12 10653 g003
Figure 4. Reinforcement learning method for dog sound predictions.
Figure 4. Reinforcement learning method for dog sound predictions.
Applsci 12 10653 g004
Figure 5. Training process of dog sounds.
Figure 5. Training process of dog sounds.
Applsci 12 10653 g005
Figure 6. Testing process of dog sounds.
Figure 6. Testing process of dog sounds.
Applsci 12 10653 g006
Figure 7. Prediction accuracy of dog sounds during (a) stranger walking, (b) stranger running, (c) playing with a ball, (d) playing with owner, (e) the dog was alone.
Figure 7. Prediction accuracy of dog sounds during (a) stranger walking, (b) stranger running, (c) playing with a ball, (d) playing with owner, (e) the dog was alone.
Applsci 12 10653 g007
Figure 8. Comparison of prediction results between trained and untrained dog sounds.
Figure 8. Comparison of prediction results between trained and untrained dog sounds.
Applsci 12 10653 g008
Table 1. Dataset of dog sounds with different contexts.
Table 1. Dataset of dog sounds with different contexts.
Dog TypeGenderAge
(in Years)
AloneFightPlayStranger
Walking
Stranger RunningTotal
Rajapalayam HoundFemale14890588059325
Female64088558755325
Male23590708050325
Male84291579540325
Kombai HoundFemale24787529049325
Female94585488760325
Male24187558557325
Male104090589443325
Table 2. Prediction accuracy of dog sounds.
Table 2. Prediction accuracy of dog sounds.
PredictionsRajapalyam Dog%Kombai Dog%
True Positive34586.2533684
False Positive153.75215.2
True Negative307.5276.8
False Negative102.5164
Table 3. Q–learning during different states of training.
Table 3. Q–learning during different states of training.
StatesActions
Stranger WalkingStranger RunningBallOwnerAlone
000000
2500000
5000000
7500000
10000000
Training
0131281410
251718131812
502118172413
752719182515
1003421192816
Table 4. Overall prediction level.
Table 4. Overall prediction level.
ScenarioPrediction (%)
Rajapalayam DogKombai Dog
Stranger Walk87.0088.42
Stranger Run87.8585.98
Play with Ball81.5382.08
Play with Owner83.9585.52
Alone83.6385.96
Table 5. Confusion matrix of the dog sounds predicted.
Table 5. Confusion matrix of the dog sounds predicted.
PredictedActual SoundsStranger WalkStranger RunPlay with BallPlay with OwnerAlonePrediction (%)
Actual
Stranger Walk2001712130097.50
Stranger Run2202018680097.27
Play with Ball1400910815094.28
Play with Owner1600423130098.12
Alone120001079593.33
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Mohandas, P.; Anni, J.S.; Hasikin, K.; Velauthapillai, D.; Raj, V.; Murugathas, T.; Azizan, M.M.; Thanasekaran, R. Machine Learning Approach Regarding the Classification and Prediction of Dog Sounds: A Case Study of South Indian Breeds. Appl. Sci. 2022, 12, 10653. https://doi.org/10.3390/app122010653

AMA Style

Mohandas P, Anni JS, Hasikin K, Velauthapillai D, Raj V, Murugathas T, Azizan MM, Thanasekaran R. Machine Learning Approach Regarding the Classification and Prediction of Dog Sounds: A Case Study of South Indian Breeds. Applied Sciences. 2022; 12(20):10653. https://doi.org/10.3390/app122010653

Chicago/Turabian Style

Mohandas, Prabu, Jerline Sheebha Anni, Khairunnisa Hasikin, Dhayalan Velauthapillai, Veena Raj, Thanihaichelvan Murugathas, Muhammad Mokhzaini Azizan, and Rajkumar Thanasekaran. 2022. "Machine Learning Approach Regarding the Classification and Prediction of Dog Sounds: A Case Study of South Indian Breeds" Applied Sciences 12, no. 20: 10653. https://doi.org/10.3390/app122010653

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop