<p>I believe what you're describing is an anomaly detection model. Other ML models exist for this purpose, such as the one class support vector machine (<a href="https://scikit-learn.org/stable/modules/generated/sklearn.svm.OneClassSVM.html" rel="nofollow noreferrer">https://scikit-learn.org/stable/modules/generated/sklearn.svm.OneClassSVM.html</a>) and isolation forest (<a href="https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html" rel="nofollow noreferrer">https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html</a>). It's possible to implement a neural network, but you will need to have a customized loss function - as in, binary cross-entropy doesn't make sense for this application.  One example of such a loss function is described here: <a href="https://arxiv.org/pdf/1802.06360.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1802.06360.pdf</a> which is based on the one class SVM. </p>

<p>I have an implementation of a one class fully connected network here in Keras: <a href="https://github.com/danielenricocahall/One-Class-NeuralNetwork" rel="nofollow noreferrer">https://github.com/danielenricocahall/One-Class-NeuralNetwork</a> which utilizes a loss function based on the one described in that paper, if that helps.</p>

<p>Good luck!</p>
Can I build a one class cnn in keras?
<p>Can I build a cnn in keras with only one class (class - 0) so it can predict if the given date belongs to this class?
Thanks in advance</p>

<p>Edite :Thanks for the answer and comments so far. My data is acceleration time series from a healthy structure but I don't have access to damaged state acceleration signals, so I have only data for class 0. </p>