Answers.Body: <p>While it won't work as you've possibly imagined it, you might find that implementing it as an autoencoder will allow you to train on one class and then identify things that are &quot;not that.&quot;</p>
  <p>With an autoencoder, the network works to build a latent, significantly lower dimensionality, representation of <span class="math-container">$x$</span>.  Rather than generating a <span class="math-container">$\hat{y}$</span> prediction, you are really generating <span class="math-container">$\hat{x}$</span>.  As a result, the loss function is measuring how well the output of the network matches the original input.</p>
  <p>To apply this to your problem, after training the autoencoder you might either measure the binary cross-entropy loss of <span class="math-container">$(x, \hat{x})$</span> or the KL loss.  If you graph output loss of items within the class vs items that are not in the class you will <em>usually</em> find that a very clear linear boundary can be defined to distinguish things that are not of the class you're interested in.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-05T23:12:32.350Z
Answers.LastActivityDate: 2021-06-05T23:12:32.350Z
Answers.UserDisplayName: David Hoelzer
Answers.Body: <p>The first answer is correct in that you can't use discrimitive learning for binary classifucation here since you only have one class. There are a few things you can try however. If you can convert your images to feature vectors, kernal density estimation can be used to assign a probability density over the space of images, and then for any new image you can get a probability of it being similar to the training data. Generalising, you could use outlier detection methods such as isolation forest to determine if new images are &quot;inliers&quot; (i.e. landslide images) or &quot;outliers&quot;.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-06T19:40:22.833Z
Answers.LastActivityDate: 2021-05-06T19:40:22.833Z
Answers.UserDisplayName: Mike NZ
Answers.Body: <p>It probably won't work because of in the training of the artificial intelligence, it'll set the weights to always answer <em>class 1</em>, and your data will say <em>you're right</em>, and it'll continue forever.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-06T14:42:14.803Z
Answers.LastActivityDate: 2021-05-06T14:42:14.803Z
Answers.UserDisplayName: Tiago Cavalcante
Body: <p>Is binary classification using CNN possible if the training data only consists of one class?</p>
  <p>I am working on landslide risk assessment using Convolutional Neural Networks and I want to train a network that can recognize high-risk areas using multi-spectral imagery. The bands will contain numeric and categorical data that I have found to be related to my field of work.</p>
  <p>The problem is that I only have historical data indicating where a landslide has happened before and defining zones as low-risk is not reliable in this field (since we are not yet sure how these variables affect the risk or susceptibility, and I don't want to bias my categorization) and my training data will be made up of only one class.</p>
  <p>Can this be done? Is training a network from scratch using only one class of training data possible?</p>
  <p>If so, after building this network, can I use it to classify any zone and get any meaningful data from its output for risk assessment (for example, output value &quot;1&quot; being &quot;similar to past landslides&quot; and &quot;0&quot; being &quot;not similar at all&quot;)?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-06T13:56:41.580Z
Comments.Text: I think it wouldn't work, as the machine learning algorithm cannot determine any features that point towards a landslide risk.
Comments.UserDisplayName: Oliver Mason
Tags: <machine-learning><convolutional-neural-networks><binary-classification><training-datasets>
Title: Is binary classification using CNN possible if the training data only consists of one class?
UserDisplayName: Rmin
ThreadText: # Is binary classification using CNN possible if the training data only consists of one class?
  
  (Asked by: username_0 on 2021-05-06)
  
  Is binary classification using CNN possible if the training data only consists of one class?
  
  I am working on landslide risk assessment using Convolutional Neural Networks and I want to train a network that can recognize high-risk areas using multi-spectral imagery. The bands will contain numeric and categorical data that I have found to be related to my field of work.
  
  The problem is that I only have historical data indicating where a landslide has happened before and defining zones as low-risk is not reliable in this field (since we are not yet sure how these variables affect the risk or susceptibility, and I don't want to bias my categorization) and my training data will be made up of only one class.
  
  Can this be done? Is training a network from scratch using only one class of training data possible?
  
  If so, after building this network, can I use it to classify any zone and get any meaningful data from its output for risk assessment (for example, output value "1" being "similar to past landslides" and "0" being "not similar at all")?
  
  **Tags:** machine-learning, convolutional-neural-networks, binary-classification, training-datasets
  > **Comments:**
  > **username_1**: I think it wouldn't work, as the machine learning algorithm cannot determine any features that point towards a landslide risk.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2021-06-05. Score: 1
  
  While it won't work as you've possibly imagined it, you might find that implementing it as an autoencoder will allow you to train on one class and then identify things that are "not that."
  
  With an autoencoder, the network works to build a latent, significantly lower dimensionality, representation of $x$. Rather than generating a $\hat{y}$ prediction, you are really generating $\hat{x}$. As a result, the loss function is measuring how well the output of the network matches the original input.
  
  To apply this to your problem, after training the autoencoder you might either measure the binary cross-entropy loss of $(x, \hat{x})$ or the KL loss. If you graph output loss of items within the class vs items that are not in the class you will *usually* find that a very clear linear boundary can be defined to distinguish things that are not of the class you're interested in.
  
  
  ---
  
  ### Answer by username_3 on 2021-05-06. Score: 0
  
  The first answer is correct in that you can't use discrimitive learning for binary classifucation here since you only have one class. There are a few things you can try however. If you can convert your images to feature vectors, kernal density estimation can be used to assign a probability density over the space of images, and then for any new image you can get a probability of it being similar to the training data. Generalising, you could use outlier detection methods such as isolation forest to determine if new images are "inliers" (i.e. landslide images) or "outliers".
  
  
  ---
  
  ### Answer by username_4 on 2021-05-06. Score: 0
  
  It probably won't work because of in the training of the artificial intelligence, it'll set the weights to always answer *class 1*, and your data will say *you're right*, and it'll continue forever.
  
  
  ---
  
  