Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Bayesian Network


Published on

Bayesian Network

  1. 1. BAYESIAN NETWORK <ul><li>Submitted By </li></ul><ul><li>Faisal Islam </li></ul><ul><li>Srinivasan Gopalan </li></ul><ul><li>Vaibhav Mittal </li></ul><ul><li>Vipin Makhija </li></ul><ul><li>Prof. Anita Wasilewska </li></ul><ul><li>State University of New York at Stony Brook </li></ul>
  2. 2. References <ul><li>[1]Jiawei Han:”Data Mining Concepts and Techniques”,ISBN 1-53860-489-8 </li></ul><ul><li>Morgan Kaufman Publisher. </li></ul><ul><li>[2] Stuart Russell,Peter Norvig “Artificial Intelligence – A modern Approach ,Pearson education. </li></ul><ul><li>[3] Kandasamy,Thilagavati,Gunavati , Probability, Statistics and Queueing Theory , Sultan Chand Publishers. </li></ul><ul><li>[4] D. Heckerman: “A Tutorial on Learning with Bayesian Networks”, In “Learning in Graphical Models”, ed. M.I. Jordan, The MIT Press, 1998. </li></ul><ul><li>[5] http:// </li></ul><ul><li>[6] </li></ul><ul><li>[7] http:// </li></ul><ul><li>[8] http:// </li></ul><ul><li>[9] http:// </li></ul>
  3. 3. CONTENTS <ul><li>HISTORY </li></ul><ul><li>CONDITIONAL PROBABILITY </li></ul><ul><li>BAYES THEOREM </li></ul><ul><li>NAÏVE BAYES CLASSIFIER </li></ul><ul><li>BELIEF NETWORK </li></ul><ul><li>APPLICATION OF BAYESIAN NETWORK </li></ul><ul><li>PAPER ON CYBER CRIME DETECTION </li></ul>
  4. 4. HISTORY <ul><li>Bayesian Probability was named after Reverend Thomas Bayes (1702-1761). </li></ul><ul><li>He proved a special case of what is currently known as the Bayes Theorem. </li></ul><ul><li>The term “Bayesian” came into use around the 1950’s. </li></ul><ul><li>Pierre-Simon, Marquis de Laplace (1749-1827) independently proved a generalized version of Bayes Theorem. </li></ul><ul><li> </li></ul>
  5. 5. HISTORY (Cont.) <ul><li>1950’s – New knowledge in Artificial Intelligence </li></ul><ul><li>1958 Genetic Algorithms by Friedberg (Holland and Goldberg ~1985) </li></ul><ul><li>1965 Fuzzy Logic by Zadeh at UC Berkeley </li></ul><ul><li>1970 Bayesian Belief Network at Stanford University (Judea Pearl 1988) </li></ul><ul><li>The idea’s proposed above was not fully developed until later. BBN became popular in the 1990s. </li></ul><ul><li> </li></ul>
  6. 6. HISTORY (Cont.) <ul><li>Current uses of Bayesian Networks: </li></ul><ul><li>Microsoft’s printer troubleshooter. </li></ul><ul><li>Diagnose diseases (Mycin). </li></ul><ul><li>Used to predict oil and stock prices </li></ul><ul><li>Control the space shuttle </li></ul><ul><li>Risk Analysis – Schedule and Cost Overruns. </li></ul>
  7. 7. CONDITIONAL PROBABILITY <ul><li>Probability : How likely is it that an event will happen? </li></ul><ul><li>Sample Space S </li></ul><ul><ul><li>Element of S : elementary event </li></ul></ul><ul><ul><li>An event A is a subset of S </li></ul></ul><ul><li>P( A ) </li></ul><ul><li>P( S ) = 1 </li></ul><ul><li>Events A and B </li></ul><ul><li>P(A|B)- Probability that event A occurs given that event B has already occurred. </li></ul><ul><li>Example: </li></ul><ul><li>There are 2 baskets. B1 has 2 red ball and 5 blue ball. B2 has 4 red ball and 3 blue ball. Find probability of picking a red ball from basket 1? </li></ul>
  8. 8. CONDITIONAL PROBABILITY <ul><li>The question above wants P(red ball | basket 1). </li></ul><ul><li>The answer intuitively wants the probability of red ball from only the sample space of basket 1. </li></ul><ul><li>So the answer is 2/7 </li></ul><ul><li>The equation to solve it is: </li></ul><ul><li>P(A|B) = P(A∩B)/P(B) [Product Rule] </li></ul><ul><li>P(A,B) = P(A)*P(B) [ If A and B are independent ] </li></ul><ul><li>How do you solve P(basket2 | red ball) ??? </li></ul>
  9. 9. BAYESIAN THEOREM <ul><li>A special case of Bayesian Theorem: </li></ul><ul><li>P(A∩B) = P(B) x P(A|B) </li></ul><ul><li>P(B∩A) = P(A) x P(B|A) </li></ul><ul><li>Since P(A∩B) = P(B∩A), </li></ul><ul><li>P(B) x P(A|B) = P(A) x P(B|A) </li></ul><ul><li>=> P(A|B) = [P(A) x P(B|A)] / P(B) </li></ul>A B
  10. 10. BAYESIAN THEOREM <ul><li>Solution to P(basket2 | red ball) ? </li></ul><ul><li>P(basket 2| red ball) = [P(b2) x P(r | b2)] / P(r) </li></ul><ul><li>= (1/2) x (4/7)] / (6/14) </li></ul><ul><li>= 0.66 </li></ul>
  11. 11. BAYESIAN THEOREM <ul><li>Example 2: A medical cancer diagnosis problem </li></ul><ul><li>There are 2 possible outcomes of a diagnosis: +ve, -ve. We know .8% of world population has cancer. Test gives correct +ve result 98% of the time and gives correct –ve result 97% of the time. </li></ul><ul><li>If a patient’s test returns +ve, should we diagnose the patient as having cancer? </li></ul>
  12. 12. BAYESIAN THEOREM <ul><li>P(cancer) = .008 P(-cancer) = .992 </li></ul><ul><li>P(+ve|cancer) = .98 P(-ve|cancer) = .02 </li></ul><ul><li>P(+ve|-cancer) = .03 P(-ve|-cancer) = .97 </li></ul><ul><li>Using Bayes Formula: </li></ul><ul><li>P(cancer|+ve) = P(+ve|cancer)xP(cancer) / P(+ve) </li></ul><ul><li>= 0.98 x 0.008 = .0078 / P(+ve) </li></ul><ul><li>P(-cancer|+ve) = P(+ve|-cancer)xP(-cancer) / P(+ve) </li></ul><ul><li>= 0.03 x 0.992 = 0.0298 / P(+ve) </li></ul><ul><li>So, the patient most likely does not have cancer. </li></ul>
  13. 13. BAYESIAN THEOREM <ul><li>General Bayesian Theorem: </li></ul><ul><li>Given E1, E2,…,En are mutually disjoint events and P(Ei) ≠ 0, (i = 1, 2,…, n) </li></ul><ul><li>P(Ei/A) = [P(Ei) x P(A|Ei)] / Σ P(Ei) x P(A|Ei) </li></ul><ul><li>i = 1, 2,…, n </li></ul>
  14. 14. BAYESIAN THEOREM <ul><li>Example: </li></ul><ul><li>There are 3 boxes. B1 has 2 white, 3 black and 4 red balls. B2 has 3 white, 2 black and 2 red balls. B3 has 4 white, 1 black and 3 red balls. A box is chosen at random and 2 balls are drawn. 1 is white and other is red. What is the probability that they came from the first box?? </li></ul>
  15. 15. BAYESIAN THEOREM <ul><li>Let E1, E2, E3 denote events of choosing B1, B2, B3 respectively. Let A be the event that 2 balls selected are white and red. </li></ul><ul><li>P(E1) = P(E2) = P(E3) = 1/3 </li></ul><ul><li>P(A|E1) = [2c1 x 4c1] / 9c2 = 2/9 </li></ul><ul><li>P(A|E2) = [3c1 x 2c1] / 7c2 = 2/7 </li></ul><ul><li>P(A|E3) = [4c1 x 3c1] / 8c2 = 3/7 </li></ul>
  16. 16. BAYESIAN THEOREM <ul><li>P(E1|A) = [P(E1) x P(A|E1)] / Σ P(Ei) x P(A|Ei) </li></ul><ul><li>= 0.23727 </li></ul><ul><li>P(E2|A) = 0.30509 </li></ul><ul><li>P(E3|A) = 1 – (0.23727 + 0.30509) = 0.45764 </li></ul>
  17. 17. BAYESIAN CLASSIFICATION <ul><li>Why use Bayesian Classification: </li></ul><ul><li>Probabilistic learning: Calculate explicit probabilities for hypothesis, among the most practical approaches to certain types of learning problems </li></ul><ul><li>Incremental: Each training example can incrmentally increase/decrease the probability that a hypothesis is correct. Prior knowledge can be combined with observed data. </li></ul>
  18. 18. BAYESIAN CLASSIFICATION <ul><li>Probabilistic prediction : Predict multiple hypotheses, weighted by their probabilities </li></ul><ul><li>Standard: Even when Bayesian methods are computationally intractable, they can provide a standard of optimal decision making against which other methods can be measured </li></ul>
  19. 19. NAÏVE BAYES CLASSIFIER <ul><li>A simplified assumption: attributes are conditionally independent: </li></ul><ul><li>Greatly reduces the computation cost, only count the class distribution. </li></ul>
  20. 20. NAÏVE BAYES CLASSIFIER <ul><li>The probabilistic model of NBC is to find the probability of a certain class given multiple dijoint (assumed) events. </li></ul><ul><li>The naïve Bayes classifier applies to learning tasks where each instance x is described by a conjunction of attribute values and where the target function f(x) can take on any value from some finite set V. A set of training examples of the target function is provided, and a new instance is presented, described by the tuple of attribute values <a1,a2,…,an>. The learner is asked to predict the target value, or classification, for this new instance. </li></ul>
  21. 21. NAÏVE BAYES CLASSIFIER <ul><li>Abstractly, probability model for a classifier is a conditional model </li></ul><ul><li>P(C|F1,F2,…,Fn) </li></ul><ul><li>Over a dependent class variable C with a small nuumber of outcome or classes conditional over several feature variables F1,…,Fn. </li></ul><ul><li>Naïve Bayes Formula: </li></ul><ul><li>P(C|F1,F2,…,Fn) = argmax c [P(C) x P(F1|C) x P(F2|C) x…x P(Fn|C)] / P(F1,F2,…,Fn) </li></ul><ul><li>Since P(F1,F2,…,Fn) is common to all probabilities, we donot need to evaluate the denomitator for comparisons. </li></ul>
  22. 22. NAÏVE BAYES CLASSIFIER <ul><li> Tennis-Example </li></ul>
  23. 23. NAÏVE BAYES CLASSIFIER <ul><li>Problem: </li></ul><ul><li>Use training data from above to classify the following instances: </li></ul><ul><li><Outlook=sunny, Temperature=cool, Humidity=high, Wind=strong> </li></ul><ul><li><Outlook=overcast, Temperature=cool, Humidity=high, Wind=strong> </li></ul>
  24. 24. NAÏVE BAYES CLASSIFIER <ul><li>Answer to (a): </li></ul><ul><li>P(PlayTennis=yes) = 9/14 = 0.64 </li></ul><ul><li>P(PlayTennis=n) = 5/14 = 0.36 </li></ul><ul><li>P(Outlook=sunny|PlayTennis=yes) = 2/9 = 0.22 </li></ul><ul><li>P(Outlook=sunny|PlayTennis=no) = 3/5 = 0.60 </li></ul><ul><li>P(Temperature=cool|PlayTennis=yes) = 3/9 = 0.33 </li></ul><ul><li>P(Temperature=cool|PlayTennis=no) = 1/5 = .20 </li></ul><ul><li>P(Humidity=high|PlayTennis=yes) = 3/9 = 0.33 </li></ul><ul><li>P(Humidity=high|PlayTennis=no) = 4/5 = 0.80 </li></ul><ul><li>P(Wind=strong|PlayTennis=yes) = 3/9 = 0.33 </li></ul><ul><li>P(Wind=strong|PlayTennis=no) = 3/5 = 0.60 </li></ul>
  25. 25. NAÏVE BAYES CLASSIFIER <ul><li>P(yes)xP(sunny|yes)xP(cool|yes)xP(high|yes)xP(strong|yes) = 0.0053 </li></ul><ul><li>P(no)xP(sunny|no)xP(cool|no)xP(high|no)x P(strong|no) = 0.0206 </li></ul><ul><li>So the class for this instance is ‘no’. We can normalize the probility by: </li></ul><ul><li>[0.0206]/[0.0206+0.0053] = 0.795 </li></ul>
  26. 26. NAÏVE BAYES CLASSIFIER <ul><li>Answer to (b): </li></ul><ul><li>P(PlayTennis=yes) = 9/14 = 0.64 </li></ul><ul><li>P(PlayTennis=no) = 5/14 = 0.36 </li></ul><ul><li>P(Outlook=overcast|PlayTennis=yes) = 4/9 = 0.44 </li></ul><ul><li>P(Outlook=overcast|PlayTennis=no) = 0/5 = 0 </li></ul><ul><li>P(Temperature=cool|PlayTennis=yes) = 3/9 = 0.33 </li></ul><ul><li>P(Temperature=cool|PlayTennis=no) = 1/5 = .20 </li></ul><ul><li>P(Humidity=high|PlayTennis=yes) = 3/9 = 0.33 </li></ul><ul><li>P(Humidity=high|PlayTennis=no) = 4/5 = 0.80 </li></ul><ul><li>P(Wind=strong|PlayTennis=yes) = 3/9 = 0.33 </li></ul><ul><li>P(Wind=strong|PlayTennis=no) = 3/5 = 0.60 </li></ul>
  27. 27. NAÏVE BAYES CLASSIFIER <ul><li>Estimating Probabilities: </li></ul><ul><li>In the previous example, P(overcast|no) = 0 which causes the formula- </li></ul><ul><li>P(no)xP(overcast|no)xP(cool|no)xP(high|no)xP(strong|nno) = 0.0 </li></ul><ul><li>This causes problems in comparing because the other probabilities are not considered. We can avoid this difficulty by using m- estimate. </li></ul>
  28. 28. NAÏVE BAYES CLASSIFIER <ul><li>M-Estimate Formula: </li></ul><ul><li>[c + k] / [n + m] where c/n is the original probability used before, k=1 and m= equivalent sample size. </li></ul><ul><li>Using this method our new values of probility is given below- </li></ul>
  29. 29. NAÏVE BAYES CLASSIFIER <ul><li>New answer to (b): </li></ul><ul><li>P(PlayTennis=yes) = 10/16 = 0.63 </li></ul><ul><li>P(PlayTennis=no) = 6/16 = 0.37 </li></ul><ul><li>P(Outlook=overcast|PlayTennis=yes) = 5/12 = 0.42 </li></ul><ul><li>P(Outlook=overcast|PlayTennis=no) = 1/8 = .13 </li></ul><ul><li>P(Temperature=cool|PlayTennis=yes) = 4/12 = 0.33 </li></ul><ul><li>P(Temperature=cool|PlayTennis=no) = 2/8 = .25 </li></ul><ul><li>P(Humidity=high|PlayTennis=yes) = 4/11 = 0.36 </li></ul><ul><li>P(Humidity=high|PlayTennis=no) = 5/7 = 0.71 </li></ul><ul><li>P(Wind=strong|PlayTennis=yes) = 4/11 = 0.36 </li></ul><ul><li>P(Wind=strong|PlayTennis=no) = 4/7 = 0.57 </li></ul>
  30. 30. NAÏVE BAYES CLASSIFIER <ul><li>P(yes)xP(overcast|yes)xP(cool|yes)xP(high|yes)xP(strong|yes) = 0.011 </li></ul><ul><li>P(no)xP(overcast|no)xP(cool|no)xP(high|no)xP(strong|nno) = 0.00486 </li></ul><ul><li>So the class of this instance is ‘yes’ </li></ul>
  31. 31. NAÏVE BAYES CLASSIFIER <ul><li>The conditional probability values of all the </li></ul><ul><li>attributes with respect to the class are </li></ul><ul><li>pre-computed and stored on disk. </li></ul><ul><li>This prevents the classifier from computing the conditional probabilities every time it runs. </li></ul><ul><li>This stored data can be reused to reduce the </li></ul><ul><li>latency of the classifier. </li></ul>
  32. 32. BAYESIAN BELIEF NETWORK <ul><li>In Naïve Bayes Classifier we make the assumption of class conditional independence, that is given the class label of a sample, the value of the attributes are conditionally independent of one another. </li></ul><ul><li>However, there can be dependences between value of attributes. To avoid this we use Bayesian Belief Network which provide joint conditional probability distribution. </li></ul><ul><li>A Bayesian network is a form of probabilistic graphical model. Specifically, a Bayesian network is a directed acyclic graph of nodes representing variables and arcs representing dependence relations among the variables. </li></ul>
  33. 34. BAYESIAN BELIEF NETWORK <ul><li>A Bayesian network is a representation of the joint distribution over all the variables represented by nodes in the graph. Let the variables be X(1), ..., X(n). </li></ul><ul><li>Let parents(A) be the parents of the node A. Then the joint distribution for X(1) through X(n) is represented as the product of the probability distributions P(Xi|Parents(Xi)) for i = 1 to n. If X has no parents, its probability distribution is said to be unconditional, otherwise it is conditional. </li></ul>
  35. 36. BAYESIAN BELIEF NETWORK <ul><li>By the chaining rule of probability, the joint probability of all the nodes in the graph above is: </li></ul><ul><li>P(C, S, R, W) = P(C) * P(S|C) * P(R|C) * P(W|S,R) </li></ul><ul><li>W=Wet Grass, C=Cloudy, R=Rain, S=Sprinkler </li></ul><ul><li>Example: P(W∩-R∩S∩C) </li></ul><ul><li>= P(W|S,-R)*P(-R|C)*P(S|C)*P(C) </li></ul><ul><li>= 0.9*0.2*0.1*0.5 = 0.009 </li></ul>
  36. 37. BAYESIAN BELIEF NETWORK <ul><li>What is the probability of wet grass on a given day - P(W)? </li></ul><ul><li>P(W) = P(W|SR) * P(S) * P(R) + </li></ul><ul><li> P(W|S-R) * P(S) * P(-R) + </li></ul><ul><li> P(W|-SR) * P(-S) * P(R) + </li></ul><ul><li> P(W|-S-R) * P(-S) * P(-R) </li></ul><ul><li>Here P(S) = P(S|C) * P(C) + P(S|-C) * P(-C) </li></ul><ul><li>P(R) = P(R|C) * P(C) + P(R|-C) * P(-C) </li></ul><ul><li>P(W)= 0.5985 </li></ul>
  37. 38. Advantages of Bayesian Approach <ul><li>Bayesian networks can readily handle </li></ul><ul><li>incomplete data sets. </li></ul><ul><li>Bayesian networks allow one to learn </li></ul><ul><li>about causal relationships </li></ul><ul><li>Bayesian networks readily facilitate use of prior knowledge. </li></ul>
  38. 39. APPLICATIONS OF Bayesian-Network
  39. 40. Sources/References <ul><li>Naive Bayes Spam Filtering Using Word-Position-Based Attributes - </li></ul><ul><li>by-: Johan Hovold, Department of Computer Science,Lund University Box 118, 221 00 Lund, Sweden.[E-mail] </li></ul><ul><li>[Presented at CEAS 2005 Second Conference on Email and Anti-Spam July 21 & 22, at Stanford University] </li></ul><ul><li>Tom Mitchell , “ Machine Learning” , Tata Mcgraw Hill </li></ul><ul><li>A Bayesian Approach to Filtering Junk EMail, </li></ul><ul><li>Mehran Sahami Susan Dumaisy David Heckermany Eric Horvitzy Gates Building </li></ul><ul><li>Computer Science Department Microsoft Research, Stanford University Redmond W </li></ul><ul><li>Stanford CA fsdumais heckerma horvitzgmicrosoftcom </li></ul><ul><li>[Presented at AAAI Workshop on Learning for Text Categorization , July 1998, Madison, Wisconsin] </li></ul>
  40. 41. Problem??? <ul><li>real world Bayesian network application – </li></ul><ul><li>“ Learning to classify text. “ </li></ul><ul><li>Instances are text documents </li></ul><ul><li>we might wish to learn the target concept “electronic news articles that I find interesting,” or “pages on the World Wide Web that discuss data mining topics.” </li></ul><ul><li>In both cases, if a computer could learn the target concept accurately, it could automatically filter the large volume of </li></ul><ul><li>online text documents to present only the most relevant </li></ul><ul><li>documents to the user. </li></ul>
  41. 42. TECHNIQUE <ul><li>learning how to classify text, based on the </li></ul><ul><li>naive Bayes classifier </li></ul><ul><li>it’s a probabilistic approach and is among the most effective algorithms currently known for learning to classify text documents, </li></ul><ul><li>Instance space X consists of all possible text documents </li></ul><ul><li>given training examples of some unknown target function f(x), which can take on any value from some finite set V </li></ul><ul><li>we will consider the target function classifying documents as interesting or uninteresting to a particular person, using the target values like and dislike to indicate these two classes. </li></ul>
  42. 43. Design issues <ul><li>how to represent an arbitrary text document in terms of attribute values </li></ul><ul><li>decide how to estimate the probabilities required by the naive Bayes classifier </li></ul>
  43. 44. Approach <ul><li>Our approach to representing arbitrary text documents is disturbingly simple: Given a text document, such as this paragraph, we define an attribute for each word position in the document and define the value of that attribute to be the English word found in that position . Thus, the current paragraph would be described by 111 attribute values, corresponding to the 111 word positions. The value of the first attribute is the word “our,” the value of the second attribute is the word “approach,” and so on. Notice that long text documents will require a larger number of attributes than short documents. As we shall see, this will not cause us any trouble. </li></ul>
  44. 45. ASSUMPTIONS <ul><li>assume we are given a set of 700 training documents that a friend has classified as dislike and another 300 she has classified as like </li></ul><ul><li>We are now given a new document and asked to classify it </li></ul><ul><li>let us assume the new text document is the preceding paragraph </li></ul>
  45. 46. <ul><li>We know (P(like) = .3 and P (dislike) = .7 in the current example </li></ul><ul><li>P(a i , = w k |v j ) (here we introduce w k to indicate the k th word in the English vocabulary) </li></ul><ul><li>estimating the class conditional probabilities (e.g., P(a i = “our”Idislike)) is more problematic because we must estimate one such probability term for each combination of text position, English word, and target value. </li></ul><ul><li>there are approximately 50,000 distinct words in the English vocabulary, 2 possible target values, and 111 text positions in the current example, so we must estimate 2*111* 50, 000 =~10 million such terms from the training data. </li></ul><ul><li>we make assumption that reduces the number of probabilities that must be estimated </li></ul>
  46. 47. <ul><li>we shall assume the probability of encountering a specific word w k (e.g., “chocolate”) is independent of the specific word position being considered (e.g., a23 versus a95) . </li></ul><ul><li>we estimate the entire set of probabilities P(a 1 = w k |v j ), P(a 2 = w k |v j )... by the single position-independent probability P(w k lv j ) </li></ul><ul><li>net effect is that we now require only 2* 50, 000 distinct terms of the form P(w k lv j ) </li></ul><ul><li>We adopt the rn-estimate, with uniform priors and with m equal to the size of the word vocabulary </li></ul><ul><li>n  total number of word positions in all training examples whose target value is v, n k is the number of times word W k is found among these n word positions, and Vocabulary is the total number of distinct words (and other tokens) found within the training data. </li></ul>
  47. 48. Final Algorithm <ul><li>Examples is a set of text documents along with their target values. V is the set of all possible target values. This function learns the probability terms P( w k | v j ), describing the probability that a randomly drawn word from a document in class v j will be the English word W k . It also learns the class prior probabilities P(v i ). 1. collect all words, punctuation, and other tokens that occur in Examples • Vocabulary  set of all distinct words & tokens occurring in any text document from Examples 2. calculate the required P(v i ) and P( w k | v j ) probability terms • For each target value v j in V do • docs j  the subset of documents from Examples for which the target value is v j • P(v1)  Idocs j I / Examplesl • Text j a single document created by concatenating all members of docs j • n  total number of distinct word positions in Text j • for each word W k in Vocabulary n k  number of times word w k occurs in Text j • P(w k Iv j )  n k +1/n+|Vocabulary| </li></ul><ul><li>CLASSIFY_NAIVE_BAYES_TEXT( Doc) Return the estimated target value for the document Doc. a i denotes the word found in the i th position within Doc. • positions  all word positions in Doc that contain tokens found in Vocabulary • Return V NB , where </li></ul>
  48. 49. <ul><li>During learning, the procedure LEARN_NAIVE_BAYES_TEXT examines all training documents to extract the vocabulary of all words and tokens that appear in the text, then counts their frequencies among the different target classes to obtain the necessary probability estimates. Later, given a new document to be classified, the procedure CLASSIFY_NAIVE_BAYESTEXT uses these probability estimates to calculate VNB according to Equation Note that any words appearing in the new document that were not observed in the training set are simply ignored by CLASSIFY_NAIVE_BAYESTEXT </li></ul>
  49. 50. Effectiveness of the Algorithm <ul><li>Problem  classifying usenet news articles </li></ul><ul><li>target classification for an article  name of the usenet newsgroup in which the article appeared </li></ul><ul><li>In the experiment described by Joachims (1996), 20 electronic newsgroups were considered </li></ul><ul><li>1,000 articles were collected from each newsgroup, forming a data set of 20,000 documents. The naive Bayes algorithm was then applied using two-thirds of these 20,000 documents as training examples, and performance was measured over the remaining third. </li></ul><ul><li>100 most frequent words were removed (these include words such as “the” and “of’), and any word occurring fewer than three times was also removed. The resulting vocabulary contained approximately 38,500 words. </li></ul><ul><li>The accuracy achieved by the program was 89%. </li></ul>sci .med talk.creligion.misc comp.sys.mac.hardware sci.electronics talk.politics.misc sci.crypt talk.politics.mideast talk.politics.guns alt.atheism soc.religion.christian
  50. 51. APPLICATIONS <ul><li>A newsgroup posting service that learns to assign documents to the appropriate newsgroup. </li></ul><ul><li>NEWSWEEDER system—a program for reading netnews that allows the user to rate articles as he or she reads them. NEWSWEEDER then uses these rated articles (i.e its learned profile of user interests to suggest the most highly rated new articles each day </li></ul><ul><li>Naive Bayes Spam Filtering Using Word- Position-Based Attributes </li></ul>
  51. 52. Thank you !
  52. 53. <ul><li>Bayesian Learning Networks </li></ul><ul><li>Approach to </li></ul><ul><li>Cybercrime Detection </li></ul>
  53. 54. Bayesian Learning Networks Approach to Cybercrime Detection N S ABOUZAKHAR, A GANI and G MANSON The Centre for Mobile Communications Research (C4MCR), University of Sheffield, Sheffield Regent Court, 211 Portobello Street, Sheffield S1 4DP, UK [email_address] [email_address] [email_address] M ABUITBEL and D KING The Manchester School of Engineering, University of Manchester IT Building, Room IT 109, Oxford Road, Manchester M13 9PL, UK [email_address] [email_address]
  54. 55. <ul><li>REFERENCES </li></ul><ul><li>David J. Marchette, Computer Intrusion Detection and Network Monitoring, </li></ul><ul><li>A statistical Viewpoint, 2001,Springer-Verlag, New York, Inc, USA. </li></ul><ul><li>2. Heckerman, D. (1995), A Tutorial on Learning with Bayesian Networks, Technical </li></ul><ul><li>Report MSR-TR-95-06, Microsoft Corporation. </li></ul><ul><li>3. Michael Berthold and David J. Hand, Intelligent Data Analysis, An Introduction, 1999, Springer, Italy. </li></ul><ul><li>4. , accessed on 01/12/2002 </li></ul><ul><li>5. , accessed on 01/12/2002. </li></ul><ul><li>6. Ian H. Witten and Eibe Frank, Data Mining, Practical Machine Learning Tools and </li></ul><ul><li>Techniques with Java Implementations, 2000, Morgan Kaufmann, USA. </li></ul><ul><li>7. , accessed on 20/12/2002 </li></ul>
  55. 56. <ul><li>Growing dependence of modern society </li></ul><ul><li>on telecommunication and information </li></ul><ul><li>networks. </li></ul><ul><li>Increase in the number of interconnected </li></ul><ul><li>networks to the Internet has led to an </li></ul><ul><li>increase in security threats and cyber crimes. </li></ul>Motivation behind the paper..
  56. 57. <ul><li>In order to detect distributed network </li></ul><ul><li>attacks as early as possible, an under </li></ul><ul><li>research and development probabilistic </li></ul><ul><li>approach, based on Bayesian networks </li></ul><ul><li>has been proposed. </li></ul>Structure of the paper
  57. 58. <ul><li>Learning Agents which deploy Bayesian network approach are considered to be a promising and useful tool in determining suspicious early events of Internet </li></ul><ul><li>threats. </li></ul>Where can this model be utilized
  58. 59. Before we look at the details given in the paper lets understand what Bayesian Networks are and how they are constructed………….
  59. 60. Bayesian Networks <ul><li>A simple, graphical notation for conditional independence assertions and hence for compact specification of full </li></ul><ul><li>joint distributions. </li></ul><ul><li>Syntax: </li></ul><ul><ul><li>a set of nodes, one per variable </li></ul></ul><ul><ul><li>a directed, acyclic graph (link ≈ &quot;directly influences&quot;) </li></ul></ul><ul><ul><li>a conditional distribution for each node given its </li></ul></ul><ul><ul><li>parents: </li></ul></ul><ul><ul><ul><li>P (X i | Parents (X i )) </li></ul></ul></ul><ul><li>In the simplest case, conditional distribution represented as a conditional probability table (CPT) giving the </li></ul><ul><li>distribution over X i for each combination of parent values </li></ul>
  60. 61. Some conventions………. <ul><li>Variables depicted as nodes </li></ul><ul><li>Arcs represent probabilistic dependence between </li></ul><ul><li>variables. </li></ul><ul><li>Conditional probabilities </li></ul><ul><li>encode the strength of </li></ul><ul><li>dependencies. </li></ul><ul><li>Missing arcs implies </li></ul><ul><li>conditional independence. </li></ul>
  61. 62. Semantics <ul><li>The full joint distribution is defined as the product of the </li></ul><ul><li>local conditional distributions: </li></ul><ul><li>P (X 1 , … ,X n ) = π i = 1 P (X i | Parents(X i )) </li></ul><ul><li>e.g., P (j  m  a   b   e) </li></ul><ul><li>= P (j | a) P (m | a) P (a |  b,  e) P (  b) P (  e) </li></ul>
  62. 63. Example of Construction of a BN
  63. 64. Back to the discussion of the paper……….
  64. 65. Description <ul><li>This paper shows how probabilistically Bayesian network detects communication network attacks, allowing for generalization of Network Intrusion Detection Systems </li></ul><ul><li>(NIDSs). </li></ul>
  65. 66. Goal <ul><li>How well does our model detect or classify </li></ul><ul><li>attacks and respond to them later on. </li></ul><ul><li>The system requires the estimation of two </li></ul><ul><li>quantities: </li></ul><ul><li>The probability of detection (PD) </li></ul><ul><li>Probability of false alarm (PFA). </li></ul><ul><li>It is not possible to simultaneously achieve a PD of 1 and PFA of 0. </li></ul>
  66. 67. Input DataSet <ul><li>The 2000 DARPA Intrusion Detection Evaluation Program which was prepared and managed by MIT Lincoln Labs has provided the necessary dataset. </li></ul><ul><li>Sample dataset </li></ul>
  67. 68. Construction of the network <ul><li>The following figure shows the Bayesian </li></ul><ul><li>network that has been automatically </li></ul><ul><li>constructed by the learning algorithms of </li></ul><ul><li>BayesiaLab. </li></ul><ul><li>The target variable, activity_type , is directly </li></ul><ul><li>connected to the variables that heavily </li></ul><ul><li>contribute to its knowledge such as service </li></ul><ul><li>and protocol_type . </li></ul>
  68. 70. Data Gathering <ul><li>MIT Lincoln Labs set up an environment to </li></ul><ul><li>acquire several weeks of raw TCP dump </li></ul><ul><li>data for a local-area network (LAN) </li></ul><ul><li>simulating a typical U.S. Air Force LAN. The </li></ul><ul><li>generated raw dataset contains about few </li></ul><ul><li>million connection records. </li></ul>
  69. 71. Mapping the simple Bayesian Network that we saw to the one used in the paper
  70. 72. Observation 1 : <ul><li>As shown in the next figure, the most probable activity corresponds to a smurf attack (52.90%), an ecr_i (ECHO_REPLY) service (52.96%) and an icmp protocol (53.21%). </li></ul>
  71. 74. Observation 2 : <ul><li>What would happen if the probability of receiving ICMP protocol packets is increased? Would the probability of having a smurf attack increase? </li></ul><ul><li>Setting the protocol to its ICMP value increases the probability of having a smurf attack from 52.90% to 99.37%. </li></ul>
  72. 76. Observation 3 : <ul><li>Let’s look at the problem from the opposite direction. If we set the probability of portsweep attack to 100%,then the value of some associated variables would inevitably vary. </li></ul><ul><li>We note from Figure 4 that the probabilities of the TCP protocol and private service have been increased from 38.10% to 97.49% and from 24.71% to 71.45% respectively. Also, we can notice an increase in the REJ and RSTR flags. </li></ul>
  73. 78. How do the previous examples work?? PROPOGATION Data Data
  74. 79. Benefits of the Bayesian Model <ul><li>The benefit of using Bayesian IDSs is the ability to adjust our IDS’s sensitivity. </li></ul><ul><li>This would allow us to trade off between </li></ul><ul><li>accuracy and sensitivity. </li></ul><ul><li>Furthermore, the automatic detection network anomalies by learning allows distinguishing the normal activities from the abnormal ones. </li></ul><ul><li>Allow network security analysts to see the </li></ul><ul><li>amount of information being contributed by each variable in the detection model to the knowledge of the target node </li></ul>
  75. 80. Performance evaluation
  76. 81. Thank you ! QUESTIONS OR QUERIES