Automatic recognition of rapid eye movement (REM) sleep by artificial neural networks