I have a data set of 10,000 images of 5 different recycling items. The goal of my neural network is to tell me if an item is recyclable or not. The problem is that I only have data for the 5 different classifications (soda can, crushed soda can, water bottle, glass bottle, cardboard boxes). If you feed the trained network something that is not one of these 5 items (something like a plastic bag) it will still try to label it as one of these 5. Is there a way to logically separate out the garbage items without having data of the garbage. I don't have time to collect more data of garbage items and add a 6th classification to the neural network.
Yes, but it the most focused treatment takes a different approach. You need to choose a model type that will train each class on an "is or is-not". This is also called "one-vs-all". Your result will be, effectively, a separate set of weights for each of the five classes, five models that will decided whether or not the observation (one datum) is a member of that class. If none of the five sub-models claims the item, it winds up in the "garbage" class.
SVM (support vector machine) is good for this, given compatible input. There are more sophisticated treatments, but a discussion of those broadens beyond the typical scope of Stack Overflow.
Yes, and this is called: one-class classification when you train a model only on the positive data and try to predict the outliers. check this it might help: https://medium.com/squad-engineering/one-class-classification-for-images-with-deep-features-69182fb4c9c5
I think you need to look at this problem in a different aspect. Based on your case, instead of training your model to recognize 'if this item is recyclable', you can approach this problem as 'if this item is not recyclable'. The reason is you only have 5 recyclable items, which is much less that those of in reality. So, by the way, you can look at this problem as an unsupervised learning way or a semi-supervised learning way, with the assumption that you have access to the items that are NOT recyclable. In detail, the suggested approaches are of two:
unsupervised learning: design your problem as an outlier detection problem. Build the training information with most of non-recyclable item with very few recyclable item. Follow the approaches such as k-means clustering, Gaussian mixture model, etc.
semi-supervised learning: in this one, you are doing a regression on only the non-recyclable item. If you provide a item that is recyclable to your trained model, your model will predicted a value with large deviation comparing with you predefined value. Please refer to one-class SVM or one-class neural network. In your subject, for image based detection, probably constitutional neural network will be better...