14 min read
Classifying Kurdish Music Genres Using AI

Introduction

How many Kurdish music genres do you know about? While most people are familiar with Western music categories like pop, rock, classical, etc. Kurdish music also has its own unique and diverse genres. This led me to take the challenge of using Artificial Intelligence (AI) to automatically categorize Kurdish music. In my senior year of my bachelor’s degree, I conducted research to classify Kurdish music genres using AI. The result was surprisingly better than what I expected. I experimented with two different neural network models for this task, a Deep Neural Network (DNN) and a Convolutional Neural Network (CNN). Besides the experimentation, we have also collected and organized a dataset of Kurdish music genres to train and test the AI. You can find the research in this link, and if you want to test out the AI visit my website Kurdish Music Classifier (KMC) to test your favorite Kurdish music.

History of Genre Classifications

Music genre classification has been around since the late 19th century. Though the methods were different from today’s approaches, they laid the foundation for how we categorize music. Initially, music was classified primarily by lyrics. Later it evolved to include melody as well. This approach continued until music databases grew too large for manual classification. Additionally, as we were stepping into the age of technology, where using AI is possible to classify music into their corresponding genres. So, in the 1990s, researchers started using machine learning to classify genres. It was until the 2000s that neural networks started being used for that purpose.

Kurdish Music

Like Western music, Kurdish music features its own distinct genre classifications. In Kurdish culture, we recognize several genres such as Gorani (songs), Gorani Halparkê (Kurdish dance songs), Bend, etc. To conduct this research effectively, I needed to develop a deeper understanding of Kurdish musical traditions. That’s when I started sitting down with fine arts teachers and Kurdish artists and looking into the resources that they recommended.

Short History of Kurdish Music Genres

One book was repeatedly recommended, called “A Gateway for Melody of Kurdish Music” by Mahmood Zamdar. In one of the chapters, it talks about the history of Kurdish music genres. Initially, Kurdish music was organized by the events where it was performed, such as celebrations and entertainment. As foreign musical styles and instruments influenced Kurdish music, it evolved into broader categories: classic and modern.

Kurdish Music Genres

After conducting all the research on Kurdish music genres we found the following genres:

Gorani

Gorani is the common songs that we listen to and it has many sub genres, but due to the short span of time to do this research, we only did two:

Gorani Classic

A traditional form of Kurdish musical artistry characterized by its distinctive rhythm and lyrical composition. This genre maintains a minimalist approach to instrumentation, emphasizing the purity of vocal performance and fundamental musical elements to preserve its traditional essence.

Gorani Modern

A modern evolution of classical Gorani that incorporates diverse instrumental arrangements and modern musical elements. Influenced by various cultural traditions, this genre features dynamic compositional structures with mid-song rhythm transitions and flow variations. The style represents a fusion of traditional Kurdish music with modern musical innovations.

Halparkê

Halparkê is Kurdish cultural dance and it has its own type of music. It is not just one form of dance, we have a variety of form of Kurdish Halparkê dances and they all have their own style of music for it. There are sub-genres that are played for specific occasions with unique dance styles, like Harvesting or as a mourning ritual. For this research I did 3 sub-genres of Halparkê. Eventhough, there are more sub-genres than the ones I have labeled like “swêskeyî” or “şêxanî”. However, due to the limited time I had, I only labeled the following sub-genres:

Halparkê Çopî

An energetic genre intrinsically linked to Kurdish cultural dance traditions. Çopî, a specific form of Halparke dance, features fast-paced rhythms and distinctive lyrics. This widely celebrated dance form spans across Kurdistan and is often considered the foundational Kurdish dance style, making it an essential element of cultural celebrations.

Halparkê Sê Pê

A regional variation of Halparke is predominantly found in Eastern Kurdistan. The name ‘Sê Pê’ (Three Steps) derives from its characteristic three-step dance pattern. The music features distinctive rhythmic patterns specifically composed to complement this traditional dance form, creating a unique synchronization between movement and melody.

Halparkê Daxa

A sophisticated variation of Halparke is prevalent in Western and Northern Kurdistan. Distinguished by its unique instrumental composition and specific rhythm patterns, this genre accompanies an intricate dance form featuring coordinated hand movements and synchronized footwork performed in group formations. The style emphasizes collective harmony in both music and movement.

Meqam

A sophisticated vocal art form that exemplifies the pure essence of Kurdish musical tradition. This genre can be performed with or without instrumental accompaniment, placing primary emphasis on vocal prowess, poetic lyrical structure, and the artistic delivery of verses. The style demonstrates the profound connection between poetry and musical expression in Kurdish culture.

Bend

A structured musical form characterized by its distinctive use of rhyming syllabic patterns in lyrics, accompanied by instrumental arrangements typically featuring drums and keyboard elements. The genre creates a harmonious balance between vocal delivery and musical accompaniment.

Heyran

A deeply emotive genre characterized by its melancholic melodic structure and narrative lyrical content. This style features expressive vocal performances that convey profound emotional depth, often telling poignant stories through its sorrowful musical arrangements and heartfelt delivery.

Note: We could not classify all the genres during the short span of time of the research, but don’t hesitate to contact us of any missing genres that should be added. Additionally, This is one of the approaches to classify Kurdish music genres, other music experts might have different view of how Kurdish music is classified.

Approach & Implementation

There are many approaches to classifying music genres. Many machine learning and deep learning models can have really good results. However, deep learning stands out among the other approaches for classifying music genres. So, I experimented with two different neural networks:

Deep Neural Network (DNN)

DNN is a common neural network model that is used in a lot of applications, one of them being audio recognition. We designed an architecture that is optimized for Kurdish music, and after iteration of experiments, the following is the final design of the DNN:

DNN Architecture Figure 1: The architecture of the Deep Neural Network (DNN) used for classifying Kurdish music genres.

Convolutional Neural Network (CNN)

CNN is a type of neural network that is widely used in image recognition. You might wonder why I chose an image recognition model for audio classification. According to research, CNNs have demonstrated exceptional performance in audio recognition tasks, often outperforming traditional audio processing models. You may also wonder how audio data can be processed by an image recognition model—a question I will address in the Data section. After extensive experimentation, we developed this CNN architecture optimized for Kurdish music genre classification:

CNN Architecture Figure 2: The architecture of the Convolutional Neural Network (CNN) used for classifying Kurdish music genres.

How Does a Neural Network Learn

I will try to explain the technical parts as easily as I can, but it will be a lot. So:

Bear Image

In 1943, Warren McCulloch and Walter Pitts conducted a research on how human brain neurons might work. They designed some simple models of nervous activities using electrical circuits, the following image is an example of one of them:

Neural Network Example Figure 3: An early model of neural network designed by Warren McCulloch and Walter Pitts.

Their design paved the way of how neural network is architected. While biological neurons are highly complex, neural network neurons function through comparatively simpler mathematical operations.

Consider this example: we’re designing a DNN to recognize the difference between cats and dogs. The neural network is made of layers, which is the list of circles presented in the image below. Each circle is called a neuron. All of them are connected to each other and work together to learn. When we give a dog image to the model, it passes through multiple layers (called hidden layers). Each layer processes the image, gradually breaking it down to identify distinguishing features. While the neurons are breaking down the image, they assign certain values to each neuron, which is called weight. The image goes through all the layers until the end it starts deciding whether it is a dog or a cat. This one iteration is called an epoch, which is a phase/cycle of learning in a neural network model. After each epoch, it starts validating whether the decision was right or wrong, whether it was a dog or a cat. If the prediction was wrong, the neurons start adjusting the weight values and learn from their mistakes. Then, it starts another epoch, one after the other, until the neural network learns the difference between a dog and a cat.

Figure 4: An example image used to explain neural network learning.

Data

As the saying goes, “Your AI is only as good as your data.” For optimal AI learning, we have to have good data in terms of quality and quantity. The most difficult challenge in my research was assembling a large, high-quality dataset since no Kurdish music database was available at the time. This required purchasing music from various sources—both CDs and online platforms—and organizing them into their respective genres with assistance from music experts.

After organizing them and preprocessing the data, preparing it for teaching the AI. I collected 880 samples of Kurdish music (each sample being 30 seconds long), spanning 8 genres. Each genre was evenly distributed, with 110 samples of music per genre. However, 110 samples per genre proved insufficient for model training. To address this, we segmented each 30-second sample into one-second intervals before beginning the AI training process.

Returning to the CNN model: while it’s designed for image recognition, our data is in audio format. This presents an interesting challenge. How do we train an image recognition model with audio data? To solve this, we convert our audio into a visual representation called a mel-spectrogram, shown below:

Mel-Spectrogram Figure 5: A mel-spectrogram representing the frequency of an audio sample.

The mel-spectrogram represents the frequency of the audio, and it is unique for each song. Despite the differences between each song, if you put them in a genre, they have similar patterns. The waves inside the image are called Mel Frequency Cepstral Coefficients (MFCCs), and they represent the audio. This transformation from audio to mel-spectrograms provides the visual data needed to train our AI.

Experiments

We did six different experiments for each model until we reached the best result. The following tables show all six experiments’ details. These are the explanations of the column tables:

  1. No.: Experiment number.

  2. Output Shape: The shape of the data that is being given to the neural network to learn.

  3. Total Samples: The amount of data that was given to the neural network to learn from.

  4. Randomization Algorithm: The algorithm we used to mix the data and randomize it before training the model.

  5. Epoch: Number of epochs (phases of learning).

  6. Accuracy: Percentage of correct predictions on the test dataset.

  7. Loss: Measure of prediction error on the test dataset.

DNN Experiments

No.Input ShapeTotal SamplesRandomization AlgorithmEpochsAccuracyLoss
1(2, 13)1,056,000Random Split3074%72%
2(2, 13)200,000Random Split3067%90%
3(2, 13)1,056,000K-Fold Cross-Validation3074%71%
4(2, 13)1,056,000K-Fold Cross-Validation10075%69%
5(44, 13)26,400K-Fold Cross-Validation3090%39%
6(44, 13)26,400K-Fold Cross-Validation3090%32%

Table 1: Summary of experiments conducted using the Deep Neural Network (DNN) model for Kurdish music genre classification.

CNN Experiments

No.Input ShapeTotal SamplesRandomization AlgorithmEpochsAccuracyLoss
1(2, 13, 1)1,056,000Random Split3067%88%
2(2, 13, 1)200,000Random Split3064%98%
3(2, 13, 1)1,056,000K-Fold Cross-Validation3067%88%
4(2, 13, 1)1,056,000K-Fold Cross-Validation10069%85%
5(44, 13, 1)26,400K-Fold Cross-Validation3092%23%
6(44, 13, 1)26,400K-Fold Cross-Validation3092%25%

Table 2: Summary of experiments conducted using the Convolutional Neural Network (CNN) model for Kurdish music genre classification.

Result

We see from the last experiment of the tables that the CNN performed better at classifying Kurdish music genres. The CNN has a 92% accuracy with only 25% loss, while the DNN has 90% accuracy with 32% loss.

Here is a cool graph shows how the learning process was throughout the 30 epochs:

Note: In the top graph, the X-axis shows the number of epochs, while the Y-axis displays the accuracy percentage. In the bottom graph, the X-axis also represents epochs, while the Y-axis shows the loss percentage. The blue line represents the training process, while the yellow line shows the validation results.

DNN:

DNN Accuracy Figure 6: DNN accuracy and loss over 30 epochs.

CNN:

CNN Accuracy Figure 7: CNN accuracy and loss over 30 epochs.

Conclusion

Now that you’ve learned about the project, we invite you to experience it first-hand at our Kurdish Music Classifier (KMC) website. If you want to read it in more detail than this, then check out my research paper on MDPI. While that year-long journey has produced promising results, we acknowledge that AI development is an ongoing process, and our system may not always be perfect. We welcome your feedback on the classifier’s accuracy and would appreciate reports of any misclassifications. Additionally, as our initial research couldn’t cover all Kurdish music genres, we encourage you to suggest any genres we may have missed.

References

  1. Kamala, A.; Hassani, H. (2022). Kurdish Music Genre Recognition Using a CNN and DNN. Engineering Proceedings, 31(1), 64. Link

  2. Zamdar, M. (1980). A Gateway for Melody of Kurdish Music. pp.53 - 55. [In Kurdish].

  3. McCulloch, W. S., & Pitts, W. (1943). A logical calculus of the ideas immanent in nervous activity. The Bulletin of Mathematical Biophysics, 5(4), 115-133. Link

  4. Grigorian, A. (2019). Rolling in the Deep: CNN. Link