Hackaday provides a good description about how the filament sensor works. The eyeball people are a little creepy though...
http://hackaday.com/2016/02/05/filament-thickness-sensors-what-are-they-and-what-are-they-good-for/
http://hackaday.com/2016/02/05/filament-thickness-sensors-what-are-they-and-what-are-they-good-for/