{"id":15655607,"url":"https://github.com/graykode/dac","last_synced_at":"2025-05-05T14:42:02.528Z","repository":{"id":110172942,"uuid":"163491887","full_name":"graykode/DAC","owner":"graykode","description":"Deep Adaptive Image Clustering Paper Implementation","archived":false,"fork":false,"pushed_at":"2018-12-29T08:21:45.000Z","size":182,"stargazers_count":29,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T21:51:10.824Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graykode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-29T08:17:09.000Z","updated_at":"2024-12-20T20:41:00.000Z","dependencies_parsed_at":"2023-04-22T16:45:23.584Z","dependency_job_id":null,"html_url":"https://github.com/graykode/DAC","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graykode%2FDAC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graykode%2FDAC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graykode%2FDAC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graykode%2FDAC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graykode","download_url":"https://codeload.github.com/graykode/DAC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252516156,"owners_count":21760737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T13:00:01.439Z","updated_at":"2025-05-05T14:42:02.521Z","avatar_url":"https://github.com/graykode.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"Deep Adaptive Image Clustering\n---\n\n![](pic/summary.jpg)\n\n### Paper Summarize\n\n**DAC(Deep Adaptive Image Clustering) is Unsupervisor Learning that use Adaptive Deep Learning Algorithm**\n\n1. Each Images(Train Set \u0026 Test Set) labels of features is generated by ConvNet(7 Convloutions Layer and 2 Fully-Connected Layer)\n\n   ```python\n   def ConvNetwork(in_img, num_cluster, name='ConvNetwork', reuse=False):\n       ...\n   \treturn out\n   ```\n\n2. This Label features is calculated by cosine similarities\n\n   ```python\n   label_feat = ConvNetwork(image_pool_input, num_cluster, name='ConvNetwork', reuse=False)\n   label_feat_norm = tf.nn.l2_normalize(label_feat, dim=1)\n   sim_mat = tf.matmul(label_feat_norm, label_feat_norm, transpose_b=True)\n   ```\n\n3. Adaptive Algorithm can Optimize Which Images is more similar using this Cost Function\n\n   ```python\n   pos_loc = tf.greater(sim_mat, u_thres, name='greater')\n   neg_loc = tf.less(sim_mat, l_thres, name='less')\n   pos_loc_mask = tf.cast(pos_loc, dtype=tf.float32)\n   neg_loc_mask = tf.cast(neg_loc, dtype=tf.float32)\n   \n   pred_label = tf.argmax(label_feat, axis=1)\n   \n   # Deep Adaptive Image Clustering Cost Function Optimize\n   pos_entropy = tf.multiply(-tf.log(tf.clip_by_value(sim_mat, eps, 1.0)), pos_loc_mask)\n   neg_entropy = tf.multiply(-tf.log(tf.clip_by_value(1-sim_mat, eps, 1.0)), neg_loc_mask)\n   \n   loss_sum = tf.reduce_mean(pos_entropy) + tf.reduce_mean(neg_entropy)\n   train_op = tf.train.RMSPropOptimizer(lr).minimize(loss_sum)\n   ```\n\n4. This Algorithm runs Until u \u003e l confidence is right\n\n\n\n## Usage\n\n- MNIST : You can run MNIST DAC on [This Google Colab](https://colab.research.google.com/drive/1OdoFwOnVvpR1jhlLweqM90pltyQYjeLm)\n\n\n\n#### Common Images\n\nFolder Structure Example\n\n```\n+-- train\n|   12345678_000001.jpg\n|   12345678_000002.jpg\n|   1111111_000001.jpg\n|   1111111_000002.jpg\n+-- test\n|   12345678_000003.jpg\n|   12345678_000004.jpg\n|   1111111_000003.jpg\n```\n\nFile name `12345678_000001.jpg` The front of `_` means label of image and back is image's ID.\n\n\n\nParameter Setting\n\n```python\nmode = 'Training'\nnum_cluster = 153\neps = 1e-10\nheight = 300\nwidth = 300\nchannel = 3\n```\n\n\n\n## Reference\n\n- [The original ICCV paper](http://openaccess.thecvf.com/content_ICCV_2017/papers/Chang_Deep_Adaptive_Image_ICCV_2017_paper.pdf)\n- [Deep Adaptive Image Clustering Youtube](https://www.youtube.com/watch?v=03sq7GPHc6E)\n- [Author implementation in Keras](https://github.com/vector-1127/DAC)\n- [DAC-tensorflow(MNIST)](https://github.com/HongtaoYang/DAC-tensorflow)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraykode%2Fdac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraykode%2Fdac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraykode%2Fdac/lists"}