Skip to main content
Share Your Experience: Take the 2024 Developer Survey
4 votes

How to implement an "unknown" class in multi-class classification with neural networks?

The usual way to implement this would be to add the new class with data examples. Some things you need to address: Sourcing new data for your "other" class. Ensuring the amount and variation of ...
Neil Slater's user avatar
  • 32.5k
4 votes
Accepted

Why do we use the softmax instead of no activation function?

Short answer: Generally, you don't need to do softmax if you don't need probabilities. And using raw logits leads to more numerically stable code. Long answer: ...
Kostya's user avatar
  • 2,534
3 votes
Accepted

How do I calculate the probabilities of the BERT model prediction logits?

Your call to model.predict() is returning the logits for softmax. This is useful for training purposes. To get probabilties, you need to apply softmax on the logits....
Neil Slater's user avatar
  • 32.5k
3 votes
Accepted

Why would the "improvement" be the result of random initialization, and so why should we use multiple runs?

Neural networks use random number generators in multiple places. Most notably for weight initialisation, but also for features such as dropout, selecting minibatches within epochs, and train/cv split ...
Neil Slater's user avatar
  • 32.5k
3 votes

How to implement an "unknown" class in multi-class classification with neural networks?

If you are using a softmax distribution for your classification, then you could determine what your baseline max probability is for correctly classified samples, and then infer if a new sample doesn't ...
Karl Wenzel's user avatar
3 votes
Accepted

How can I prevent the CNN from classifying a new input into one of the existing labels (it was trained with) when the input has a new different label?

You can introduce another class to your network - "not a book". After that, you will need to add new data to your dataset, random images that do not contain books to classify and train your network on ...
Andrew's user avatar
  • 276
2 votes
Accepted

What is the general procedure to use and train neural networks for multi-class classification?

Let's say we have $K$ classes. For $K$ classes, we will be training $K$ different neural networks. No, you still train one network. With binary classification tasks, where you have only two mutually ...
cantordust's user avatar
2 votes

What is the general procedure to use and train neural networks for multi-class classification?

Let us suppose that you are training a neural network for classfing images of vehicles , then the input vector , image of the "vehicle" will be a 2D array of pixels. This undergoes several ...
thecomplexitytheorist's user avatar
1 vote

Does a Random Forest leaf give a specific output for a specific class in a multi class random forest

Yes, the regularization which is typically done on decision trees which makes the leaves non-pure is not needed in random forests due to the structure of the algorithm.
foreverska's user avatar
  • 1,263
1 vote
Accepted

How can a Regression based Neural Network learn class thresholds?

First thing to notice, is that the assumptions on the target don't match the ones of multi-classifications: in particular, in multi-class classification, it's generally assumed that any other class ...
Alberto's user avatar
  • 2,173
1 vote

Image classification problem with multiple right classes

This is a good question. There are definitely good reasons for wanting a loss function that evaluates whether at least one of the classes was picked up by the model. To do what you are attempting, I ...
Snehal Patel's user avatar
1 vote

1D Sequence Classification with self-supervised learning

In SSL (language modelling, for example), you do not have any explicit labels, just sequences of words that make sense together. SSL tries to model the language by next-word prediction, but the words ...
Andrei-Cristian Rad's user avatar
1 vote

Low accuracy and high loss in multi-class classification

Your model is completely underfit Reasons: You have a very small neural network that can't generalize your problem. you mentioned 17 classes but in the last layers, you are specifying 16 class ...
Engr Ali's user avatar
  • 111
1 vote

How to label unsupervised data for deep learning multi-classification

"is it okay to use another machine learning technology such as K-Means clustering to label the data?" In computer vision there's an entire branch called automatic image annotation dedicated ...
Edoardo Guerriero's user avatar
1 vote

Multi-class classification but a single feature sometimes boils it down to a binary-classification

I think a custom loss function would be an overkill in this situation. A linear pattern like this would be easily learned by any loss desinged for multi class classification. If I were you I would try ...
Edoardo Guerriero's user avatar
1 vote

When to use Multi-class CNN vs. one-class CNN

I am not really a fan of the One vs All approach. From my experience it is never convenient to transform a multi-class classification problem with, say, $N$ possible classes to a bunch of binary ...
danin's user avatar
  • 71
1 vote

How do I select the class weights for the loss function in the case of more than 2 classes?

Is that what you want? w_0 = (n_0+n_1+ ... +n_5) / (5.0 * n+0) If so, it can be achieved by: ...
Andre Goulart's user avatar
1 vote
Accepted

What is the difference (if any) between semantic segmentation and multi-class, mutually exclusive classification?

Image/object classification (or recognition) (Multi-class) image/object classification (or recognition) typically refers to the task of assigning one label to an image, so we typically assume that ...
nbro's user avatar
  • 40.8k
1 vote

How to perform multi-class text classification with a dataset of 80 documents?

For pretrained models in NLP, look at BERT and RoBERTa. If you can find a language model trained on your data's superset on Huggingface, then, use that pretrained model. In order to multiclass ...
Abhishek Verma's user avatar
1 vote

Is Mask R-CNN suited to solve a multi-class classification problem where the classes are related?

Mask RCNN can be a very heavy function for a simple class classification. It is designed to handle multiple object in a single image. So I would suggest you could use much simpler models like VGGnet ...
Jayanthan Ramesh Vellore's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible