In the last decade many researchers have shown interest in the sleep analysis field. The reason behind it relies on the fact that it could lead to the early discovery of some health issues, especially for elders. In this article, a new method was presented to detect anomalies in patients' sleep habits. This method is based on creating a new database of 2500 patients divided into 5 different habits. Then we used this data set to test the categorization of the patient by using the mean-shift clustering method. Finally, a presentation of the auto-encoder method to detect the anomalies was made. Using an auto-encoder based on Long Short Term Memory (LSTM) network, we were able to reach satisfying results.