Method and apparatus for fatigue detection