5
$\begingroup$

I have been tasked with detecting if a bot is clicking randomly around a web page. I was thinking of splitting up the web page into 20 by 20 pixel squares, and then assigning each click to a square from the x and y coordinates of the click. I can then take a sample of clicks, and use Chi-Square to determine if the click sample is from the the random distribution or the human distribution. What do you guys think? Is there a more clever way to do this for clicks?

$\endgroup$
3
  • 1
    $\begingroup$ Do you also have the time between clicks, as well as the position? Combining the two could be very informative (eg I'd guess clicks in very quick succession in different corners of the screen are strong evidence for bot). $\endgroup$
    – Silverfish
    Jan 11, 2015 at 8:11
  • 2
    $\begingroup$ I'm not sure, if it's feasible, but here it goes. Alternatively, I would consider creating a statistical model, hypotheses of which would be derived from modeling of the probability of sequencing and timing of users' actions, based on a web page's contents (both positionally and contextually). $\endgroup$ Jan 11, 2015 at 8:16
  • $\begingroup$ Testing for randomness will have little power to achieve anything useful. Instead, it sounds like you want to detect non-human behavior. To this end, consider comparing the clicking to that predicted by Fitts's Law as applied to all the relevant targets on a page. Only a few clicks would be needed to distinguish an unguided procedure from a human being who is trying to click on something. For this to be applicable, you would need information about the visible clickable regions on the page. Do you have this info? $\endgroup$
    – whuber
    Jan 11, 2015 at 15:59

1 Answer 1

7
$\begingroup$

I presume your intent is to identify the agent as human or random by choosing the one with the smaller chi-square (assuming you can get an expected human pattern), essentially treating it as a classification problem. If you are treating it as one, you might want to consider the costs of the two types of misclassification error.

Your approach might be sufficient (if you can get data for the human case), but I have some comments:

1) the same size of clicks is unlikely to be high enough to pick anything up with a chi-square especially on a 20x20; it would suggest you would need something well over 500 clicks, probably more like a couple of thousand. That's a lot of clicks.

2) if you instead want instead to treat it as a hypothesis testing problem then you'd need to either

a) only identify the agent as human if the behavior is inconsistent with random clicking. The problem with this is that it by default says you're a bot ... which if there's only a few clicks may classify a lot of humans as bots.

b) only act as if they aren't human when the clicking behavior is inconsistent with human behavior even when the match with random clicking is better, then you'd just check for consistency with a previously known human pattern --- the problem is different humans may exhibit different patterns

Again, if this is done with a chi-square, sample size may be a problem.

3) there's information in a sequence of clicks that may help to pin down non-randomness much better. That is, I suggest you consider instead the serial-dependence in human clicks compared to random clicking.

4) Perhaps even easier, you might consider the distribution of the average distance between consecutive clicks, compared to random clicking, or the distribution of time between clicks (e.g. a bot may click fast, or a bot may well have time between clicks unrelated to distance, where a human has to move a mouse-cursor from place to place, so may have distinctive relationship between time and distance). This is likely to show up an issue at relatively smaller sample sizes.

[It may also be that humans and robots have very different numbers of clicks. That might be useful]

5) If you do get data on humans, you might consider trying to identify some tell-tale characteristics, then use those to construct a good test statistic to apply to the random-case (i.e. something that rarely happens in random data but often happens in the human data).

6) if you do want the classification route, and you have a substantial amount of human data, it may help to do some sample splitting to use some of the data to try to identify some suitable characteristics that would better distinguish the two than the chi-square approach.

7) You may want to consider a Bayesian approach.

$\endgroup$
3
  • $\begingroup$ On top of point 7, I wonder whether a machine learning approach might be particularly effective on this kind of data. $\endgroup$
    – Silverfish
    Jan 11, 2015 at 8:13
  • $\begingroup$ @Silverfish -- no doubt (though most of them will be some form of classification); I expect the ML people will chime in with additional suggestions. $\endgroup$
    – Glen_b
    Jan 11, 2015 at 8:20
  • $\begingroup$ #4 is very clever $\endgroup$ Jan 11, 2015 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.