djl icon indicating copy to clipboard operation
djl copied to clipboard

BinaryImageClassification

Open DxsSucuk opened this issue 2 years ago • 3 comments

Description

A requests for the Implementation of BinaryImageClassification and a documentation for this feature, it would benefit developers which are trying to detect if a Image is similiar to another one or not. This Feature can then be used for checks like, Image similiarity and filtering Systems. It would also benefit newer developers, like me, which do not completly understand the way of how everything directly works.

DxsSucuk avatar May 19 '22 08:05 DxsSucuk

Could you be more specific about what binary image classification task you are looking for? You mentioned "detect if a Image is similiar to another one", it sounds a lot like one-class classficiation, or anomaly detection, see paper. But a generic binary image classification deals with the data set that are labelled either positive or negative. So could you be more specific about which one it is?

In terms of image similarity used in filtering system, I think the crucial part is to obtain a vector embedding of pictures. This will be part of transfer learning project, which is currently being worked on.

KexinFeng avatar Jun 30 '22 18:06 KexinFeng

I mean with Binary image classification a one class classification.

DxsSucuk avatar Jun 30 '22 18:06 DxsSucuk

@DxsSucuk You can consider using transfer learning; use pre-trained model to get vector embedding of pictures. Then it can be used for the downstream tasks like one-class classification. We are working on part of this feature now.

KexinFeng avatar Jul 17 '22 16:07 KexinFeng

Here is an example of binary classification on image, using transfer learning. It should be able to similarly apply to the use case you mentioned. https://github.com/deepjavalibrary/djl/pull/2070

KexinFeng avatar Dec 15 '22 19:12 KexinFeng

Here is another example: https://github.com/frankfliu/visrec-djl/blob/master/jsr381/src/main/java/ai/djl/jsr381/spi/DjlBinaryClassifierFactory.java#L45

frankfliu avatar Dec 27 '22 19:12 frankfliu

Thanks I will look into it!

DxsSucuk avatar Dec 27 '22 19:12 DxsSucuk