Naïve Bayesian Anti-spam Filtering Technique for Malay Language



Similar documents
Bayesian Spam Filtering

A Two-Pass Statistical Approach for Automatic Personalized Spam Filtering

Detecting Spam Using Spam Word Associations

A Content based Spam Filtering Using Optical Back Propagation Technique

Impact of Feature Selection Technique on Classification

Data Pre-Processing in Spam Detection

CAS-ICT at TREC 2005 SPAM Track: Using Non-Textual Information to Improve Spam Filtering Performance

An Efficient Spam Filtering Techniques for Account

A MACHINE LEARNING APPROACH TO SERVER-SIDE ANTI-SPAM FILTERING 1 2

Simple Language Models for Spam Detection

A Proposed Algorithm for Spam Filtering s by Hash Table Approach

International Journal of Research in Advent Technology Available Online at:

Tweaking Naïve Bayes classifier for intelligent spam detection

Feature Subset Selection in Spam Detection

Developing Methods and Heuristics with Low Time Complexities for Filtering Spam Messages

Lan, Mingjun and Zhou, Wanlei 2005, Spam filtering based on preference ranking, in Fifth International Conference on Computer and Information

A Personalized Spam Filtering Approach Utilizing Two Separately Trained Filters

Abstract. Find out if your mortgage rate is too high, NOW. Free Search

Spam Filtering using Naïve Bayesian Classification

An Efficient Three-phase Spam Filtering Technique

Artificial Neural Network, Decision Tree and Statistical Techniques Applied for Designing and Developing Classifier

Unmasking Spam in Messages

An Approach to Detect Spam s by Using Majority Voting

Keywords - Algorithm, Artificial immune system, Classification, Non-Spam, Spam

Naive Bayes Spam Filtering Using Word-Position-Based Attributes

A Case-Based Approach to Spam Filtering that Can Track Concept Drift

Filtering Junk Mail with A Maximum Entropy Model

Spam detection with data mining method:

Three-Way Decisions Solution to Filter Spam An Empirical Study

Spam Filtering with Naive Bayesian Classification

Spam Detection System Combining Cellular Automata and Naive Bayes Classifier

Adaption of Statistical Filtering Techniques

PSSF: A Novel Statistical Approach for Personalized Service-side Spam Filtering

1 Introductory Comments. 2 Bayesian Probability

Spam Detection A Machine Learning Approach

6367(Print), ISSN (Online) & TECHNOLOGY Volume 4, Issue 1, (IJCET) January- February (2013), IAEME

How To Filter Spam Image From A Picture By Color Or Color

Non-Parametric Spam Filtering based on knn and LSA

T : Classification as Spam or Ham using Naive Bayes Classifier. Santosh Tirunagari :

Detecting Spam Bots in Online Social Networking Sites: A Machine Learning Approach

Increasing the Accuracy of a Spam-Detecting Artificial Immune System

Three types of messages: A, B, C. Assume A is the oldest type, and C is the most recent type.

Adaptive Filtering of SPAM

Intelligent Word-Based Spam Filter Detection Using Multi-Neural Networks

IMPROVING SPAM FILTERING EFFICIENCY USING BAYESIAN BACKWARD APPROACH PROJECT

Anti-Spam Filter Based on Naïve Bayes, SVM, and KNN model

Machine Learning for Naive Bayesian Spam Filter Tokenization

A Novel Technique of Classification for Spam Detection

Towards better accuracy for Spam predictions

PARAMETER MAPPING OF FEATURE SELECTION VIA TAGUCHI METHOD ON FILTERING

Bayesian Spam Detection

A Three-Way Decision Approach to Spam Filtering

SpamNet Spam Detection Using PCA and Neural Networks

Chapter 6. The stacking ensemble approach

Accelerating Techniques for Rapid Mitigation of Phishing and Spam s

Spam Filter Optimality Based on Signal Detection Theory

Robin Sharma M.Tech, Computer Sci. Engg, RIMT-IET, Mandi Gobindgarh, Punjab, India. Principal Dr. Sushil Garg RIMT-MAEC, Mandigobindgarh Punjab, India

Introduction to Bayesian Classification (A Practical Discussion) Todd Holloway Lecture for B551 Nov. 27, 2007

VCU-TSA at Semeval-2016 Task 4: Sentiment Analysis in Twitter

Filters that use Spammy Words Only

AN EFFECTIVE SPAM FILTERING FOR DYNAMIC MAIL MANAGEMENT SYSTEM

Machine Learning in Spam Filtering

Classification Using Data Reduction Method

Spam Filters: Bayes vs. Chi-squared; Letters vs. Words

Efficient Spam Filtering using Adaptive Ontology

WE DEFINE spam as an message that is unwanted basically

An incremental cluster-based approach to spam filtering

Dr. D. Y. Patil College of Engineering, Ambi,. University of Pune, M.S, India University of Pune, M.S, India

Using Biased Discriminant Analysis for Filtering

Active Learning SVM for Blogs recommendation

Data Mining Algorithms Part 1. Dejan Sarka

Anti Spamming Techniques

Spam Filtering and Removing Spam Content from Massage by Using Naive Bayesian

Spam Detection by Random Forests Algorithm

Mining a Corpus of Job Ads

Projektgruppe. Categorization of text documents via classification

A Hybrid ACO Based Feature Selection Method for Spam Classification

Question 2 Naïve Bayes (16 points)

SMS Spam Filtering Technique Based on Artificial Immune System

Differential Voting in Case Based Spam Filtering

1. Classification problems

A Collaborative Approach to Anti-Spam

Spam Filtering Based On The Analysis Of Text Information Embedded Into Images

Effectiveness and Limitations of Statistical Spam Filters

Representation of Electronic Mail Filtering Profiles: A User Study

On Attacking Statistical Spam Filters

Machine Learning Final Project Spam Filtering

Single-Class Learning for Spam Filtering: An Ensemble Approach

Spam Filtering based on Naive Bayes Classification. Tianhao Sun

Immunity from spam: an analysis of an artificial immune system for junk detection

Not So Naïve Online Bayesian Spam Filter

Detecting Spam. MGS 8040, Data Mining. Audrey Gies Matt Labbe Tatiana Restrepo

On Attacking Statistical Spam Filters

4.5 Symbol Table Applications

Journal of Information Technology Impact

Statistical Feature Selection Techniques for Arabic Text Categorization

Image Spam Filtering by Content Obscuring Detection

Some fitting of naive Bayesian spam filtering for Japanese environment

Social Media Mining. Data Mining Essentials

Spam? Not Any More! Detecting Spam s using neural networks

Transcription:

Naïve Bayesian Anti-spam Filtering Technique for Malay Language Thamarai Subramaniam 1, Hamid A. Jalab 2, Alaa Y. Taqa 3 1,2 Computer System and Technology Department, Faulty of Computer Science and Information Technology, University Malaya 3 Mosul University-Computer Science Dep. Iraq thamx@hotmail.com, hamidjalab@um.edu.my, alaa.taqa@gmail.com Abstract: Internet technologies have accelerated the distribution of spam. Various anti-spam techniques have been development to minimize if not eliminate the spam problem. This paper introduces a Naïve Bayesian technique to combat spam problem for Malay language. An experiment is conducted using Naïve Bayesian techniques coupled with stemming process and document frequency to filter Malay language spam. The result of the experiment shows that Naïve Bayesian classifier is able to classify spam and non spam emails successfully. Keywords: Anti-spam filters, Naïve Bayesian, text categorization, email, Machine Learning 1. Introduction Email refers to an electronic messaging system that transmits message electronically across network which allows users to communicate with each other at a low cost while providing an efficient mail delivery system. The reliability, userfriendliness and availability of wide range of free email make it most popular and preferred communication tool. Spam, unsolicited emails are now widely viewed as a serious threat to the Internet, whereby it floods the users inboxes and costing businesses billions of dollars in wasted bandwidth. In 20 the total global productivity cost of spam increased by $2 billion to $132 billion[1]. Automated anti-spam techniques are highly recommended in combating spam. As such, many researchers are devising anti-spam classifiers using various machine learning approaches. Naïve Bayesian classification technique is one of such approach that has been widely used for natural language processing. Sahami, Dumais [2] proposed the Naïve Bayesian (NB) approach to automatically classifier emails using decision theoretic framework. It is a straight forward application of the Naïve Bayes classifier to filter spam [3]. In recent years, Naïve Bayesian technique is been widely applied to filter spam [4-8]. An experiment was carried out using Naïve Bayesian classification technique to classify Malay language spam. Malay language is a branch of Austronesian family that mainly used in Malaysia, Indonesian, Brunei, and Singapore. In Malaysia it is national and official language. Many sectors and individuals, especially government officials communicate using Malay language. Currently many studies on anti-spam using machine learning techniques are focused on English-based spam. However there is a lack of studies conducted on Malay-based spam. The objective of this paper is to develop a technique based on Naïve Bayesian algorithm in filtering Malay language spam. The features computed using modified stemming process and document frequency are used to measure the effectiveness of Naïve Bayesian classifier in determining the Malay spam and non-spam emails, which is the main contribution of this work. The outline of the paper is as follows: Naïve Bayesian classification technique presented in Section 2. Experimental results and discussion are shown in Sections 3 and 4, respectively. Finally the conclusion is presented in Section 5. 2. Naïve Bayesian Classification Technique Naïve Bayes is a fundamental statistical approach based on probability proposed by Sahami, Dumais [2]. New emails are classified based on the training set features that already been classified into spam or legitimate email. Bayesian algorithm predicts the new email as a spam if words that appear in it have a high probability. Naïve Bayesian algorithm as described by Lai [9], given a feature vector of an email, where denotes the attributes in the corpus. These attributes are a particular word that present or absent in an email belong to a category that to be predicted and by Bayesian law the probability that belongs to c is as given in denotes the a-priori probability of a randomly picked e-mail has vector as its representation, P(c) is also the a prior probability of class c (that is, the probability that a randomly picked e-mail is from that class), and denotes the probability of a randomly picked e-mail with class c has as its representation. Androutsopoulos, Koutsias [] notes that the probability is almost impossible to calculate because the fact that the number of possible vectors is too high. In order to alleviate this problem, it is common to make the assumption (1) 35

that the components of the vector are independent in the class. Thus, can be decomposed to So, using the Naïve Bayesian classifier for spam filtering can be computed as The simplicity and faster performance of Naïve Bayesian [4] approach has made it a very popular approach to be used in various classification fields, especially in spam filtering. The performance of Naïve Bayesian approach is reasonably dependable and excellent in different experimental setting [9]. It is simple to employ and independence allows parameters to be estimated on different data sets. Furthermore Naïve Bayesian takes short learning time [11]. However Naïve Bayesian classifier can only learn linear discriminant functions thus suboptimal for non-linearly separable concepts [12]. (2) to lack of free benchmark dataset for Malay language, a Google s Gmail account was setup for the purpose of collecting spam emails. Collected spam emails mainly contain information about health products, promotions, pornography, marketing and education. Non spam emails are collected from author s personal email account that mainly contains official information from University or government sector and personal corresponding. Only text based emails are used for this experiment, emails containing images and videos are ignored. Features from the email s subjects and body are used for this experiment. 3.2 Tokenization Collected emails need to be tokenized first before it can be used. The process of reducing a message to its colloquial component refers to tokenization [13]. Messages are broken up into series of tokens which then are added into a vector space to construct features vector for classification. Tokenization process will extract all the words from the message without the regards of its importance, thus producing a very large feature vector that may overwhelm the classifier. Collected emails go through a tokenization process whereby features from the subject and body of the emails are extracted into a features vector. This is accomplished by creating a tokenization program using Java programming language. 3. Experimental Results An experiment was carried out to filter or classify spam and non spam emails based on probability values that are derived from training process. Classification process begins with preprocessing stage which includes tokenizing, stemming and feature selection steps. Upon finishing initial pre-processing steps, a training process is conducted to create spam features library that consist of word probability based on Naïve Bayesian probability algorithm. Spam and non-spam emails are fed to the training process separately to produce the relevant training library. Once this process in completed the result is combined for word probability. This work is carried out in stages as follows; 1. Collection of emails 2. Tokenization process 3. Features reduction process 4. Features selection process 5. Training process 6. Testing process 3.1 Data Collections A total of 550 emails are used 350 emails (230 spam emails and 120 non spam emails) used for training and 200 emails (0 spam emails and 0 non spam emails) for testing. Due 36 3.3 Features Reduction Features reduction process is performed after tokenization process to reduce content obfuscations. Dimensionality reduction technique is applied to reduce features vector from unwanted words. In order to improve the efficiency of classification, document frequency is used. Document frequency refers to the number of documents in which a feature occurs. The weight of the features is measured in term of frequency and the lower frequency i.e. less than the predetermined threshold is removed. Insignificant features that do not contribute to classification are ignored thus improving the efficiency of classifier. Mathematical form of DF as follows; Regular expression technique also applied to get rid unwanted characters such as symbols, spaces, numbers and misspelled words are identified and removed. Upper case words are converted to equivalent lowest cases words. Further reduction is applied using stop word removal process which removes non-formative words which have high frequency that can cause complication in classification process. A stop word text file is created and checked against the features vector, if a stop word is recognized or identified than it is removed or deleted from the features vector. (4)

Stemming, originally proposed by Porter in 1980, is a process for removing the commoner morphological and inflexional ending from words in English. A set of rules is applied iteratively to transform words to their roots or stems. Simply put, stemming is a process of reducing words to its basic form or its root word. Malay language has its own morphology and unique structure. The prefix (eg. meng.., ber.., peng.. ) and suffix (eg...an,..kan,..nya ) of the words need to be removed in order to increase the learning speed of the classifier. However porter algorithm does produce incorrect root word for Malay word. Thus some changes were applied to the porter stemming algorithm. Figure 1 shows a segment of pseudo code for Malay word stemming process. Removing penge and peng prefix If wordstartwith penge then Remove penge Else if wordstartwith peng then If wordcharat(5) = vowel then Remove peng Replace the vowel with k Else Remove peng Endif Endif Figure 1. Pseudo-code segment of Stemming process 3.4 Features Selection Feature or word frequency is established by term frequency (tf); number of time the words appear in the message yield the significant of the word to the document. Each unique word in the features vector is applied with term frequency to calculate the values of total occurrences that then will be used for Naïve Bayesian probability. Table 1 shows the sample of total number of term occurrences in the feature vector. 3.5 Training Process Once the total feature occurrences are generated, features probability is calculated for spam and non spam features. Data files containing total features occurrences for spam and non spam are then run through a probability program to tabulate the probability frequency or value. This is achieved for each of the unique words that appears in the features vector until a final value is obtained. Total number of occurrences of selected feature is divided with total of feature vector (corpus size) to obtain the probability value. Table 1. Sample of features Probability 37 Probability Words frequency 0.0306122448 0.0816326530 0.0918367346 0.0224489795 0.0816326530 0.02857285 0.05520408 0.0224489795 0.02857285 0.02857285 0.0489795918 0.0326530612 0.1122448979 account ahli akaun akhir alamat american amerika anak antarabangsa arah aset asli automatik awal baca baik 15 40 45 11 40 27 11 24 16 55 3.6 Testing Process A new set of selected spam (0 emails) and non spam (0 emails) emails for testing undergo a similar process as of training process that is tokenization process to extract features from emails, features reduction process (stop-words, document frequency, regular expression and stemming) to remove features obfuscation, non-informative words and reduce features to root words, finally features selection process to establish term frequency. Thereafter, the derived term frequency for each unique features are compared against the spam library for a match, if or once a match is found than that particular email is classified as a spam and otherwise if a match is absent than it is classified as non spam email. 4. Discussion According to Guzella and Caminhas [3] classifier performances need to be evaluated on its information retrieval and decision theory. Accuracy, Precision, Recall parameters will used to calculate the effectiveness of the classifier s performances. Accuracy ratio is calculated using number of correctly classified spam and non spam against the total number of emails used. Precision ratio is based on the number of correctly classified spam to the number of total spam email. Recall rate refers to the rate of correctly marked spam against spam that misclassified as non spam and the number of spam identified a spam (table 2 and table 3). Performance s of information retrieval and decision theory are applied to check the whether the classifier has been successful. Experiment s result shows (Table 4) that this experiment has been successful. Naïve Bayesian classifier able to classify spam and non spam emails with an accuracy of 96.0%. Table 2. Performance measurement

Measurements Accuracy(A) Precision (p) Recall(r) Formulae False positive and false negative are vital in determining the effectiveness of classification. False positives produced by the NB classifier are still considered high. This may result in the need to frequently examine deleted emails which also diminish productivity. False positive may be contributed by over-stemming, under-stemming or elimination of significant features from the feature vector during features reduction and selection process. Furthermore, more corpus for training may avoid or reduce over-fitting. Keys TP (True Positive) TN (True Negative) FP (False Positive) FN (False Negative) Table 3. Meaning of keys used Descriptions Spam emails that correctly predicted as Spam email Non Spam emails that correctly predicted as Legitimate email (Non Spam) Non Spam emails that misclassified as Spam email Spam emails that misclassified as Legitimate email (Non Spam) Out of 200 emails used (0 spam and 200 non spam emails) 97 emails and 95 emails are respectively classified correctly as spam (True positive) and non spam (True Negative). However, false positive of 2.5% and false negative 1.5% have caused the accuracy ratio achieved to be below 0% with an error rate at 4%. Precision is at 95.1% while the recall rate is 97.0%. Figure 2 shows the performance measurement result. Table 4. Classification result using Confusion Matrix Predicted Actual Spam Non Spam Spam 97 3 Non Spam 97.5% 97.0% 96.5% 96.0% 95.5% 95.0% 94.5% 94.0% 95.1% 5 95 97.0% 96.0% Precision Recall Accuracy Figure 2. Performances measurement results Values 5. Conclusion Spam is increasingly becoming a major headache for Internet users. Various anti-spam programs have been deployed and machine learning approaches are the most popular techniques to filter spam. This paper explores the use of Naïve Bayesian technique to combat spam problem for Malay language. An experiment was conducted using Naïve Bayesian technique in filtering Malay language spam shows promising results and successful in which sees 96% accuracy (Figure 2). Further refinement on the stemming and feature selection process needed to improve accuracy rate. In order to avoid over-fitting and biasness training corpus need to be increased. Future improvement will concentrate on further reducing false positive by increasing training corpus and analyze the effects of stemming in classifying Malay language spam. Reference [1] Clearbridge. What is the global cost of spam? Mailshine. 2011 [cited 2012 th Feb]; Available from: http://www.mailshine.com/2011/06/whats-the-globalcost-of-spam/. [2] Sahami, M., Dumais, S., Heckermen, D. & Horvitz, E. A., Bayesian Approach to Filtering Junk E-Mail. in Learning for Text Categorization: Papers from the 1998 Workshop. AAAI Technical Report WS-98-05. 1998. [3] Guzella, T. and W. Caminhas, A review of machine learning approaches to spam filtering. Expert Systems with Applications, 36(7): p. 206-222. 2009. [4] Almeida, T.A. and A. Yamakami. Content-based spam filtering. in The 20 International Joint Conference on Neural Networks (IJCNN). 20. [5] Qin, L., Bing, L., Junhua, Y. & Zhongyue, H. Research of a Spam Filtering Algorithm Based on Naive Bayes and AIS. in Computational and Information Sciences (ICCIS), 20 International Conference on. 20. [6] Khalid, A. and I.M. Osman, A multi-phase feature selection approach for the detection of spam. World of Computer Science and Information Technology Journal (WCSIT), 1(3): p. 96-99. 2011. [7] Zaidan, A.A., Ahmed, N.N., Karim, A.H., Alm, G.M & Zaidan, B.B., Spam influence on business and economy: theoretical and experimental studies for textual anti-spam filtering using mature document processing and naïve bayesian classifier. African Journal of Business Management, 5(2): p. 596-607. 2011. 38

[8] Srikanth, K., S. Ramakrishna, and V.S. Sarma, An improved statistical filtering for spam detection combining Bayesian method and regression analysis. International Journal of Information Technology and Knowledge Management, 2(1): p. 169-175. 2012. [9] Lai, C.-C., An empirical study of three machine learning methods for spam filtering. Knowledge-Based Systems, 20(3): p. 249-254. 2007. [] Androutsopoulos, I., Koutsias, J., Chandrinos, K., Paliouras, G. & Spyropoulos, C., An evaluation of Naive Bayesian anti-spam filtering, in Proc. of the workshop on Machine Learning in the New Information Age: 11th Europe conference on Machine Learning. 2000. [11] Ko, M., A. Tiwari, and J. Mehnen, A review of soft computing applications in supply chain management. Applied Soft Computing, 20. (3): p. 661-674. [12] Rish, I. An empirical study of the naive Bayes classifier. in International Joint Conference on Artificial Intelligence. 2001. [13] Zdziarski, J.A., Ending spam : Bayesian content filtering and the art of statistical language classification. San Francisco: No Starch Press. 2005. 39