deepjavalibrary / djl

An Engine-Agnostic Deep Learning Framework in Java
https://djl.ai
Apache License 2.0
4.07k stars 650 forks source link

BinaryImageClassification #1664

Closed DxsSucuk closed 1 year ago

DxsSucuk commented 2 years ago

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.

KexinFeng commented 2 years ago

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.

DxsSucuk commented 2 years ago

I mean with Binary image classification a one class classification.

KexinFeng commented 2 years ago

@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 commented 1 year ago

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

frankfliu commented 1 year ago

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

DxsSucuk commented 1 year ago

Thanks I will look into it!