The first 5 pages, shown as text so search engines and readers can find this document.
Page 1
1
Regular Issue
Malaysian Journal of Science 45(2): 1-12 (June 2026) https://mjs.um.edu.my
DOI:https//doi.org/10.22452/mjs.vol45no2.1
Malaysian Journal of Science 45(2): 1-12 (June 2026)
Predicting DNA Sequence Similarity Across Species Using Machine Learning: a K-mer
Based Approach
Vinodkumar R. Patil1a*, Archana S. Vaidya2a and Manisha S. Patil3b
Abstract: This study examines the effectiveness of machine learning methods for categorizing DNA sequences across human, chimpanzee,
and dog samples. We employed k-mer encoding to renovate DNA structures into numerical representations suitable for machine learning
models. Four classifiers, such as naive bayes and weighted naive bayes, random forest, K-nearest neighbors, and decision tree, were
applied and evaluated using accuracy, precision, recall, and F1-score. The naive bayes classifier consistently outperformed the others
across all three datasets, achieving the highest accuracy in classifying human DNA (98.4%), followed by chimpanzee DNA (91.4%), and
exhibiting significantly lower accuracy for dog DNA (68.9%). This performance disparity is attributed to the increasing evolutionary
distance from human DNA. Additionally, a weighted naive bayes model that was trained on human data showed very high accuracy in
predicting chimpanzee (99.3%) and dog (92.6%) DNA sequences. The results presented here show the significance of taking into account
evolutionary relations and dataset features whenever developing and training classification models for genetic sequence analysis. The
research extends the present research by evaluating the performance of several different algorithms on separate DNA databases,
identifying strengths and weaknesses, and suggesting avenues for future research focusing on advanced feature engineering and
algorithm selection for improved cross-species classification.
Keywords: DNA classification, machine learning, K-mer, naive bayes.
1. Introduction
DNA is a hereditary molecule found in every living species that
determines the basic characteristics of bodies and acts as a
genomic scheme for a progressing organism. It is comprised of a
phosphate category, a sugar category, and nitrogenous
compounds (adenine, cytosine, guanine, and thymine) that make
up its double-stranded molecule. DNA analysis is decisive in the
recognition of diseases, tracing the extent of infections, solving
crimes, and paternity tests. Primers, human nucleotide
sequences, are used for DNA synthesis, which is an essential tool
in molecular biology (Momenzadeh et al., 2020). These primers
have been used for the recognition and detection of parasites,
bacteria, and viruses. The PCR technology amplifies the DNA
segment of a preexisting virus, making it possible to detect it. DNA
analysis is now one of the most popular topics in computational
biology. DNA sequencing is a way of ordering nucleotides in a DNA
fragment that sometimes exists in double strands (Nayak et al.,
2022).
Different techniques have been designed for the application of
DNA sequences for species identification purposes in different
areas, including the score of correspondence, population genetic
knowledge, and, particularly for species organizing features,
phylogeny. DNA sequencing research is done through shotgun
cloning and walking. Classification is one of the means of
character recognition of single or groups of characters, like
supermolecule sequences. There are several methods applied to
classify these sequences into their particular division, secondary
category, or family in order to eliminate alternatives, equalize
their value, and finally categorize the sequence. Bioinformatics is
the analysis of genetic material sequencing information, which
refers to the identification of a DNA sequence’s structural order.
Categorization breaks up a gene into different regions; selected-
effect function genes are categorized into functional DNA and
rubbish DNA (Benson et al., 2009).
While unusable DNA loses the unselected-effect activity, healthy
DNA possesses it. Efficient DNA sequences can be either precise,
with the literal DNA choosing the nucleotide order, or indifferent,
with the indifferent DNA choosing the existence or inactivity of an
arbitrary pattern of DNA. Junk DNA is part of the organism's
fitness and is below the variety neutrality, whereas waste DNA
decreases it. Functional categories assigned to DNA regions may
change over time. K-mers, substrings of length k, are applied in
bioinformatics for sequence analysis and computational
genomics. They are made up of nucleotides (A, T, C, and G) and
are used to assemble DNA sequences (Benson et al., 2020; Solis-
Reyes, 2009; Shadab et al., 2020). We apply several classifiers,
among them are the Naive Bayes, Random Forest, K-Nearest
Neighbour, and Decision Tree classifiers. The research considers
three datasets: human, dog, and chimpanzee, based on protein
coding sequences. The datasets are processed using k-mer
Authors information:
aDepartment of Computer Engineering, GES’s R. H. Sapat
College of Engineering, Management Studies and Research,
Nashik, INDIA. E-mail: borsevinodkumar@gmail.com1;
archana.vaidya@ges-coengg.org2
bDepartment of Computer Science and Engineering (Data
Science), R. C. Patel Institute of Technology, Shirpur, INDIA. E-
mail: manishavpatil2007@gmail.com3
*Corresponding Author: borsevinodkumar@gmail.com
Received: March, 2025
Accepted: July, 2025
Published: June, 2026
Page 2
2
Regular IssueMalaysian Journal of Science
DOI:https//doi.org/10.22452/mjs.vol45no2.1
Malaysian Journal of Science 45(2): 1-12 (June 2026)
encoding and machine learning classifiers, and classified using
scikit-learn to determine gene similarity and predict potential
relationships. The dataset has two columns: sequence and class,
where class is a pre-determined integer value depending on the
protein coding sequence (Solis-Reyes et al., 2009). The research
paper seeks to investigate the efficacy of machine learning
algorithms in DNA classification of protein sequence data and add
to the existing literature by comparing results with prior studies,
identifying strengths and weaknesses of various algorithms, and
proposing areas for improvement (Shadab et al., 2020).
2. Literature Review
Researchers identified new things to implement after evaluating
significance, seeking speedy and precise completion. Past
scholars contributed a lot to this research area. (Onesime et al.,
2021) introduces a new approach to predicting genomic islands
(GIs) in bacterial genomes based on seven sequence features
extracted with the scikit-learn toolkit. The approach employs a
chi-square test to identify significant features, which are
subsequently input into a random forest algorithm. The method
is appropriate to current approaches in standards of accuracy,
precision, recall, and other measures. The article (Alotaibi et al.,
2021) discusses the application of six machine learning algorithms
(K-nn, RF, SVM, LR, SGD, and GNB) to predict DNA mixture
contributors. The provided dataset includes DNA mixtures with a
maximum of five contributors. Accuracy, F1-score, recall, and
precision have been utilized to measure the metric of each
algorithm. Logistic regression (LR) has the best accuracy (95%) for
five-contributor mixtures. (Arowolo et al., 2021) Discusses a
method for RNA-Seq data classification using genetic algorithm
feature selection, decision tree, and K-nearest neighbors (KNN)
classifiers. The method is applied to a set of Anopheles gambiae
mosquitoes, a malaria vector. The feature selection using GA
greatly enhances the performance of the two classifiers, with the
decision tree having higher accuracy (98.3%) compared to KNN
(88.3%). The paper also discusses literature related to machine
learning approaches in the classification of gene expression.
(Mathur et al., 2023) Research suggests a DNA sequence
classification system for the identification of early diseases, based
on NCBI database samples and convolutional neural networks for
feature extraction and classification. (Arowolo et al., 2021)
Research assesses the application of a genetic algorithm (GA) for
feature selection in RNA sequencing data of the Anopheles
gambiae malaria vector dataset with 88.3% classification accuracy
for KNN and 98.3% for decision tree, showing its viability in
bioinformatics. The article (Hamed et al., 2023) explains the
application of machine learning models such as random forest,
KNN, naïve bayes, decision tree, and SVM in classifying DNA
sequences through pattern matching.
The approach (Alshayeji et al., 2023) applies natural language
processing and machine learning to automatically detect viruses
from human biospecimens at 98.6% classification accuracy,
precision, recall, and detection rate. The research employs
natural language processing and machine learning to
automatically detect viruses in human biospecimens with 98.6%
accuracy of classification, precision, recall, and detection rate. The
study (Li, F. et al., 2023) introduces an EpiTEAmDNA architecture,
a combination of transfer learning and ensemble learning
methods, for representing DNA methylation type features in 15
species, outperforming current methods. The study (Yadav, V. et
al., 2025) uses genome sequencing to study DNA structure and
species similarity between humans, chimpanzees, and dogs,
revealing 99.30% and 98.40% similarity, suggesting further
research could deepen understanding of life sciences.
3. Methods
The study has two phases of research: preprocessing and
postprocessing. The data preprocessing is dealt with in the
preprocessing phase, while model learning and framework testing
are covered under the article phase. Machine learning and NLP
are applied in this research work to process the texting DNA
sequence pattern into a series and to evaluate the various ML
algorithms.
Data Set
The data file “human_data.txt” was downloaded from the
Kaggle database and is used as a public dataset. The data includes
two features: DNA sequencing and class. The data size is (4380,
2), consisting of 4380 samples and two features. It contains six
gene family classes, including occurrences per class and numeric
values. The data is converted from string to numeric classes. In
order to demonstrate the occurrences for each class, a count plot
was created. Transcription factor (class 6) contained the most
data, with 1343 samples, and the Lon channel contained the least
class, with 240 samples (Bhushan Bawankar et al., 2024).
Feature Extraction
DNA sequences are written as a set of shorter sub-sequences of
length k, known as k-mers. These sub-sequences are similar to
words in human language processing (NLP) and help understand
DNA sequences and simplify analysis computation. In our model,
k-mer encoding generates hexamer “words” with word length
adjustable for various situations. In genomics, manipulations like
"k-mer counting" are used. Python's natural language processing
packages make this process easy. From each pattern string, a
function (get_K-mers) is provided to gather all potential overlaid
k-mers of a certain length. The data sequences are transformed
into repeating k-mers of length six, and repeated operations are
performed for every species DNA sequence in the dataset (Hamed
et al., 2023).
DNA Classification
This section provides a classification model applied to human,
chimpanzee, and dog DNA datasets. We utilize several classifiers;
among them are the naive bayes, decision tree classifier, w-naive
bayes classifier, random forest, and K-NN. Also, discuss various
performance parameters utilized for the evaluation of classifier
performance.
Page 3
3
Regular IssueMalaysian Journal of Science
DOI:https//doi.org/10.22452/mjs.vol45no2.1
Malaysian Journal of Science 45(2): 1-12 (June 2026)
Naive Bayes Classifier
The bayes principle is applied in the naïve bayes technique, a
machine learning statistical methodology, to solve classification
issues. It uses an independent variable to establish the range of
parameters and requires minimal training data (Peretz et al.,
2024). Eq. (1), which employs the Gauss distribution as the
decision function, is the most often used naïve bayes classifier
(Zuhanda et al., 2025). Eq. (1) utilizes the most probable principle
to provide the estimated mean and standard deviation.
𝑃𝑃(𝑣𝑣 𝑦𝑦⁄ ) = 1
√2𝜋𝜋𝜎𝜎2. 𝑒𝑒(𝑣𝑣−𝜇𝜇)2
2𝜎𝜎2� (1)
In order to classify data, naïve bayes considers a Gaussian
distribution and computes the mean, variance, and prior
probability for each class in training data (Wickramasinghe et al.,
2021).
Weighted Naive Bayes Classifier
The NB algorithm assumes condition attributes are
independent, which reduces the computational cost. However,
practical application varies, and hence, classification accuracy is
reduced when the default ownership weight is 1(Xia et al., 2021).
In this study, we employ the weighted naïve bayes (WNB)
algorithm to assign appropriate attributes based on their
classification contribution, preserving computation speed and
reducing the impact of attribute conditional independence on
classifier performance (Ye, 2021; Wickramasinghe et al., 2021).
The weighted NB is calculated using the following Eq. (2).
𝑝𝑝�𝐶𝐶𝑗𝑗/𝑋𝑋� = arg max 𝑝𝑝�𝐶𝐶𝑗𝑗� � 𝑝𝑝(𝐴𝐴𝑖𝑖 / 𝐶𝐶𝑗𝑗)𝑤𝑤𝑖𝑖
𝑛𝑛
𝑖𝑖=1
(2)
Random Forest Classifier
RF is a technique for classification, an ensemble technique
where a number of decision trees are parallel trained with
bootstrapping and aggregation of the base learners through
bagging. Thus, each decision tree is unequal because of the
property of high variance of the decision tree. Aggregation of
predictions of the final decision comes from individual base
classifiers. The goodness of generalization of the classifiers is also
much better and gives higher accuracy in comparison to the
random forest, which overcomes overfitting (Onesime et al.,
2021; Pazhanikumar et al., 2024). RF classifiers show more robust
results in noisy data and are simpler to tune hyperparameters
compared to DT classifiers. They give fast computation for the
internal measure of variable importance, VIMP, which comes in
handy with ranking variables, especially in large multi-
dimensional genomic imbalance data sets (Rrmoku et al., 2022).
Decision Tree Classifier
Machine learning models can be classified into parametric and
nonparametric algorithms. A decision tree model is a
nonparametric model based on supervised learning, where the
tree-like structure is used to represent the probability of an event
based on training data. The model is arranged in a top-down tree
structure, with nodes representing features and branches
representing possible values (Benson et al., 2009). This process of
building DTs from the training data is called DT induction, which
can be represented using a conditional control statement for easy
decision-making (Peretz et al., 2024)
K-Nearest Neighbour Classifier
The k-NN algorithm is a memory-based method that stores
objects during training, requiring less computational effort than
deep learning methods. It constructs an approximation of the
objective function, which is different for each new data to be
stored, which is advantageous when the objective function is
complex (Corso et al., 2021). As a progressive method that stores
new data only when it becomes accessible, K-NN may be
employed to address challenging issues. Still, it cannot express
itself precisely, a concise expression of the objects, and depends
on the determination of the distance of any object from all
training objects. The redundancy in attributes, along with
redundant data, weakens the proposed model. This weakness can
be compensated for by checking the reduction in the problem
space or testing the variation of distance calculations (Wang et al.,
2023).
4. Results and Discussion
In this stage, we provide an analysis of the classification model
performance by our results with human, chimpanzee, and dog
DNA datasets.
Table 1. Performance analysis of various classifiers based on
human DNA data.
Classifier Accuracy Precision Recall F1
Score
Naive Bayes 0.984 0.984 0.984 0.984
Random
Forest 0.918 0.926 0.918 0.919
K-Nearest
Neighbour 0.824 0.874 0.824 0.827
Decision
Tree 0.807 0.827 0.807 0.813
Page 4
4
Regular IssueMalaysian Journal of Science
DOI:https//doi.org/10.22452/mjs.vol45no2.1
Malaysian Journal of Science 45(2): 1-12 (June 2026)
Table 2. Confusion matrix of various classifier based on Human DNA data.
1. Naive bayes classifier 2. Random forest classifier
3. K-nearest neighbour classifier 4. Decision tree classifier
We utilize several classifiers, among them are the naive bayes,
decision tree classifiers, k-nearest neighbour, and random forest.
As a part of the standard parameters, the test performance for
classifiers was also executed in terms of accuracy, precision,
recall, and F1 score. We compute the receiver operating
characteristic and the Area under the curve values in each
classifier. Table 1 shows the actual performance of a classifier,
and Table 2 shows the confusion matrix of all classifiers based on
human DNA data.
Page 5
5
Regular IssueMalaysian Journal of Science
DOI:https//doi.org/10.22452/mjs.vol45no2.1
Malaysian Journal of Science 45(2): 1-12 (June 2026)
Figure 1. ROC and AUC of different classifier based on human DNA data.
Figure 2. Comparison of various classifier metrics of human DNA data.
The naive bayes classifier performed better with an accuracy,
precision, recall, and F1-score of 98.4 %. Random forest classifier
performed fairly well with an accuracy of 91.8%. K-nearest
neighbour and decision tree classifiers performed poorly, with an
accuracy of 82.4% and 80.7 % respectively, as shown in Table 1.
Table 3. Performance analysis of various classifiers based on chimpanzee DNA data.
Classifier Accuracy Precision Recall F1 Score
Naive Bayes 0.914 0.920 0.914 0.911
Random Forest 0.843 0.874 0.843 0.841
Decision Tree 0.769 0.767 0.769 0.766
K-Nearest Neighbour 0.682 0.852 0.682 0.705