Event detection with machine learning