← All talks

BSidesMCR 2019: Profiling The Attacker:Natural Language Processing To Predict Crime -James Stevenson

BSides Manchester16:0578 viewsPublished 2019-09Watch on YouTube ↗
Show transcript [en]

so the question is what does Minority Report Black Mirror and 1984 all have income really cool it's not fat at the raw forms of media nor is it the fact that there are parts of dystopian features instead it's the fact that they each talked about predicting crime in one form or another whether it's the precogs the minority reports the Ricola in black mirror or the fort's police in 1984 each of these forms of media look at how we could predict crime but more specifically to have repercussions of doing so and that's what we're gonna be talking about today we're gonna be talking about how we can use natural language processing if one with machine learning to help us

predict crime so for those of you that know me will know another mathematician and I'm also not a police officer so why are we talking about natural language processing which is quite lefty and predictive policing which has namely suggest is all about the law and crime and well it comes down to this quote the idea that intrusion analysis security analysis it's about far more than the tools we use it's about the victims and it's about looking at new ways that we can protect ourselves against attacks but also predict those attacks in the first place so are we actually gonna be talking about today well i'ma break it down into three areas I want to talk

about what predictive policing actually is I want to talk about what natural language processing is and then finally goes about how we can engage these two ideas together how we can use natural language processing to predict crime Who am I well my name is James Stevenson and this time two years ago now as a student at University of South Wales studying commuter security before that I was an intern I thought logic a cloud security company and these days I'm a software engineer in security researcher but you're being strained to it what is predictive policing I keep talking about it but what actually is it because if we're going to use natural language processing to a pretty crime then we

kind of need to know what predictive policing is in the first place and predictive policing comes down to two main areas location-based predictive policing and individual based predictive policing nothing we suggest location-based predictive policing is all about looking at an area it's about saying in this area in the future is a crime likely to occur now this is a map of London between a specific time period where the colors show where and when coins occurred and if they fell like this that's really useful for location-based predictive policing because we can use this data what we need okay if a crime is occurred under these specific circumstances in the past that it means that Chrome's likely to

occur under these same circumstances again in the future now today we're going to be focusing on individual based predictive policing that you're looking at individual and saying how likely is this specific individual to commit a crime and when it comes to individual based predictive policing there's a whole array of approaches Furies and methodologies that we can use to help us for the crime and today we're gonna be focusing on three of these the first fury that we're looking at is called strain theory now strain theory is the idea that society puts pressure on individuals to achieve specific goals like the American dream but when individuals lack the means to achieve those goals they're more likely to

commit crime so that they can achieve them the next ferry that we're going to be looking at is called social control theory now with this theory States is it six individuals who work close relationships commitments values or norms again are more likely to commit crime because they don't have those relationships or values as an anchor in society and then finally we're going to be looking at social disorganization theories now in this theory states as if that location is key if an individual lives or works in an area known for a specific type of crime this view States live intrinsically by just being that we're more likely to commit crime Susilo look at what predictive policing

is different types of predictive policing and how we can use predictive policing approaches to predict crime for this talk here's all about natural language processing it's all about how we can use natural language processing to do just that before we dive into natural language processing however we need to understand what language is in the first place and thus as human beings language comes down to three main Aires speaking reading and writing things that we all do every day so because we do these things every day most of us or maybe some of us will be able to answer this next question and that's the question of Paris - products plus England equals what now the answer

is London because Paris is - France as London is - England now if we knew that was the answer great but why did we know that was the answer well we would have known that that was the answer because the experiences we've had to a bread books gone an Internet spoken to people and this is all built but our knowledge base and our understanding of the world and so if we were to feed that question into our natural language processing machine would it be able to answer it well yes but only if we gave it the right context so this is the Wikipedia article for London and if we fed this into our natural language processing

machine it would learn from the surrounding context noodlin that London is a city that London is in the UK of which England is as well again building on that understanding and building on that context and so if that's how natural language processing works had a sentiment analysis working because sentiment analysis is a form of natural language processing that allows us to look at a specific piece of text and say what's the emotion what is this sentiment behind that text and again when it comes to us as human beings we have 18 pillars to our emotions but for sentiment analysis who they really care about - that's positive emotions and negative emotions so how do we translate those eight down to two

well what we're talking about positive emotions we're talking about this top broom just drawing anger and surprise with anger being the red herring and when we're talking about negative emotions we're talking about this bottle break and so if these are the emotions that we're talking about when we referred to sentiment analysis how to actually get that emotion from text well as the things and most machine learning approaches we take a massive dataset so for us that's going to be you brush one of these we're going to break each of those reviews down into two main elements the actual review and the sentiment of that review for example I love my local pizza restaurants positive sentiment or this place has really gone

downhill negative sentiment we then break that dataset down to you we have our training set and our testing set but when it comes to training our natural language processing machine we look at the key words you say what key words are more prominent with a positive sentiment and what key words more pronounced a negative sentiment then when it comes to testing we look at the remaining entities and we have got an actual image processing machine to tell us what it thinks the sentiment is then if that matches the sentiment we know them to have great if it doesn't means that something has gone wrong and so if that's how the actual language processing works if that's have

sentiment analysis works then what already exists what are some examples of natural language processing in the rivers well this is a double expression or specifically comprehend medical which is Amazon's approach to natural language processing when it comes to healthcare and medicine a doctor or healthcare professional will type in a patient's details symptoms information the natural language processing talk will go off do its thing and it will come back with key bits information it thinks that that health care professional needs to know yes we have Tado I know TOI was Microsoft's approach to natural language processing when it came to a Twitter chat BOTS say which Taylor which were supposed to people to how people smoked it now what's quite

controversial they lasted just under 24 hours nonetheless is a great example and then Pilate we have predictive text sir well Android or an iPhone the way that predictive text as probably works on your device is by using natural language processing so there we have three great natural language processing examples with healthcare communications and mobile phones but none of those examples look at how we could use natural language processing to predict crime which is what this talk is all about so this is Alice and it's Alice's job to do just that it's Alice's job to predict crime the way that Alex Carly does this is she individually and manually just different websites different chat forums different social media accounts and she

profiles specific individuals on their likelihood of committing crime the problem with this is that it's slow and laborious so how can we take this for the next level well we could automate it we could describe these websites for information relating to specific individuals apply our natural image processing and predictive policing techniques and then return to Alice a risk a score a likelihood or how likely these specific individuals are of committing a crime and then of course Allison ot in connection as individuals accordingly so if we were to build a framework like this what would it look like well first of all Allison atif we need to sit down and decide on an impact for each of these individuals if this

individual was to commit this crime or wants to perform this attack what would the impact be and this comes down to those three main areas of a loss of intentionality integrity and variability once we have an impact we can work out our likelihood what is the likelihood of this individual committing this crime or performing this attorney and this is what we look back to those predictive policing approaches that we mentioned earlier on we script these websites for text relating to a specific individual we apply our natural language processing techniques and then first of all we say does this tax cut in reference 20 goals or aspirations and if so what is the sentiment next we

take that same bit of text but now we say does this text contain reference to any close relationships and individuals in groups any organizations and if so what is the sentiment finally we take that same bit of text but now we say does this text contain reference to the individuals location if so is that the location known for this type of crime and finally what is the sentiment we think of for each of these layers aggregating a score as weekend and this score defines the overall likelihood of this specific individual committing a crime now that we have our impact in our likelihoods we can work out our risk what is the overall risk of this

specific individual committing a crime penultimately we can use natural language processing to pull additional information from this text information like common topics or trends age gender or race salary occupation religion any dates and times now the reason why we haven't focused on this information study was because this information has the scope are becoming significantly more bias and that's where you talk for another day but we will touch on it later on and then finally we just want a diamond convention and then we convention that we can use to instantly identify these individuals without including any of that personally identifiable information so here we could use a hash we could use an IP address we could use a random word this

is just one example this is broken down into four areas the source of the data the detailed time records the risk level which is what we worked out earlier on and then a pseudo-random word to give the name some uniqueness and then we have it we've looked at what predictive policing is what natural language processing is and how we can merge these two ideas together what I do next is I'm going to go through some questions that I normally get I spoke this talk I'm going to wrap the talk up and if we have any additional questions we can go from them so the first question we have is is pretty clear placing better than are

placing an answer is nil where predictive policing is a tool it's a supplement it's a fee that should be used in addiction to know what placing and isn't here to replace police nor is it here to replace police intuition second question we have is is predictive policing bias and insecurity yes prolific policing is quite biased the problem we have who predicted least is that it's garbage in garbage out if our data is bias then these are frameworks of bias also and the problem we have of crime data is that it's intrinsically bias because we have so many undocumented or less documented crimes like assault and is that the data we have isn't representative of the real

world the second problem we have when it comes to machine learning and bias is that these tools these techniques these frameworks are created by human beings who again or intrinsic advice less question you have is this predictive policing used in the real world yes so there's an example of being used in a States there's a scheme run by the LAPD it's called laser but with their laser works is that sense of score to ex-offenders on their likelihood of repeat crime and if those individuals fall into a top bracket they receive a 4-1 visit from police finally we have how good is natural language processing applicable nuances or differences in touched now there's an example like

giving here which is a natural language processing tool that can simultaneously for the sent to different languages and I find this really interesting because it goes to show that in some cases natural language processing can be better than the same text and some of us as human beings so are they stage of the talk you might be thinking I think this is really interesting or you might be thinking oh James you're a terrible human being who's evil you might also be thinking why are we talking about predictive policing adekanbi describe competence and again it comes back to this quote the idea that intrusion analysis security analysis it's about far more than the tools we use it's about innovating but it's also

about thinking outside the box and looking at new ways that we can protect ourselves against attacks but also protect ourselves from those attacks in the first place now for me I care less about natural image processing I can less about predictive policing like and more about how we can apply these areas to computer security in fact on this September of Steiner pitched in the UK with that question the question of can we predict malicious actors however for now that Ethan is talking into a closed if you have any questions feel free to ask me now come find me afterwards I'm also on Twitter this will change stephenson and if you're interested any of the research that's going to this

talk today in find it on github and hunch once again thanks all for coming along and thank you for the organizers that evening