Code Monkey home page Code Monkey logo

cohesive_clustering's Introduction

Cohesive_clustering

Clustering approach where the consistency is preserved.

Concept

Using approach in the paper The The Chosen One: Consistent Characters in Text-to-Image Diffusion Models , I augmented clustering approach to identify consistent image clusters for a given dataset.

consistency refers to finding a shared representation across all the other given instances.

Mathematically, we can represent cohesion as below,

For the above image, the most cohesive cluster would be the cluster depicting black dots as its instances are more closer to its cluster centroid(higher consistency).

If the clustering approach works well, we can find the optimal set clusters that each of them has unique set of patterns. Then we can find the most cohesive cluster, aka the cluster that shows the most consistency across all the instances(features are same and consistent).

Installation

Install necessary packages,

pip install -r requirements.txt

Usage

# Edit the config files
 - edit main_config file
 - set the hyperparametes in preferred algorithm

# Run the script
python clustering.py

TODO

Clustering Algorithms

  • Implemented kmeans++
  • Implemented DBSCAN
  • Implemented BIRCH
  • Testing with Graph Clustering

Other

  • Top-k retrieval
  • Support for rotational invariance of the images(see below)

Results

  • Overall results are fine, there are some edge cases that need to handle seperately.
    • Some clusters might have mixed-images(probably due to either extracted features or clustering algorithm in used.)
    • Sensitive to the rotation of the image, needs to be addressed (Make this as Rotational Invariant Method).
  • Enhance the feature extraction process: Incoporate more features that make them unique!

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

cohesive_clustering's People

Contributors

vimukthirandika1997 avatar

Stargazers

 avatar Markus Stoll avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.