{"id":22868476,"url":"https://github.com/robcyberlab/image-pixel-clustering","last_synced_at":"2025-03-31T10:50:50.018Z","repository":{"id":263171169,"uuid":"889550808","full_name":"RobCyberLab/Image-Pixel-Clustering","owner":"RobCyberLab","description":"🌀Image Pixel Clustering📏","archived":false,"fork":false,"pushed_at":"2024-11-16T20:16:11.000Z","size":2643,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T15:53:29.150Z","etag":null,"topics":["clustering","data-science","data-visualization","dbscan-clustering","euclidean-distances","hierarchical-clustering","image-processing","kmeans-clustering","machine-learning","python","single-linkage-clustering"],"latest_commit_sha":null,"homepage":"","language":"Python","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/RobCyberLab.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":"2024-11-16T16:05:13.000Z","updated_at":"2024-11-16T20:16:15.000Z","dependencies_parsed_at":"2025-02-06T15:43:14.692Z","dependency_job_id":null,"html_url":"https://github.com/RobCyberLab/Image-Pixel-Clustering","commit_stats":null,"previous_names":["robcyberlab/image-pixel-clustering"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobCyberLab%2FImage-Pixel-Clustering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobCyberLab%2FImage-Pixel-Clustering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobCyberLab%2FImage-Pixel-Clustering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobCyberLab%2FImage-Pixel-Clustering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobCyberLab","download_url":"https://codeload.github.com/RobCyberLab/Image-Pixel-Clustering/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246458022,"owners_count":20780675,"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":["clustering","data-science","data-visualization","dbscan-clustering","euclidean-distances","hierarchical-clustering","image-processing","kmeans-clustering","machine-learning","python","single-linkage-clustering"],"created_at":"2024-12-13T12:35:17.808Z","updated_at":"2025-03-31T10:50:49.999Z","avatar_url":"https://github.com/RobCyberLab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌀Image Pixel Clustering📏\n\nNote: Due to privacy policies, I am not allowed to post the dataset publicly.\n\n---\n\n## Table of Contents📋\n1. [Overview](#overview)\n2. [Clustering Techniques](#clustering-techniques)\n3. [Dataset Description](#dataset-description)\n4. [Distance Metric](#distance-metric)\n5. [Neighbor-Based Clustering](#neighbor-based-clustering)\n\n---\n\n## Overview📖\nIn this laboratory, we will test at least two of the following clustering techniques:\n- **k-means**\n- **Single Linkage**\n\n---\n\n## Clustering Techniques🌀\nThe focus of this lab is to experiment with and understand the following clustering methods:\n\n1. **k-means**  \n   - **Description**: A partition-based clustering algorithm that divides data into `k` clusters, where each data point belongs to the cluster with the nearest mean (centroid).  \n   - **Steps**:\n     1. Initialize `k` centroids randomly or using specific initialization methods (e.g., k-means++).\n     2. Assign each point to the nearest centroid using a distance metric (e.g., Euclidean distance).\n     3. Update centroids by calculating the mean position of points in each cluster.\n     4. Repeat steps 2-3 until convergence (i.e., centroids stabilize or a maximum number of iterations is reached).\n   - **Key Benefits**: Simple and efficient for large datasets.\n   - **Limitations**: Sensitive to the initial placement of centroids and may converge to a local minimum.\n\n2. **Single Linkage**  \n   - **Description**: A hierarchical clustering method that merges clusters based on the minimum distance between any two points in the clusters.\n   - **Steps**:\n     1. Treat each data point as an individual cluster.\n     2. Compute the distance between all pairs of clusters.\n     3. Merge the two clusters with the smallest distance.\n     4. Repeat steps 2-3 until all points are in a single cluster or the desired number of clusters is achieved.\n   - **Key Feature**: Preserves spatial relationships by linking clusters through their closest members.\n   - **Applications**: Effective for identifying elongated or irregularly shaped clusters.\n   - **Limitation**: Can be sensitive to outliers, as single linkage focuses only on the nearest points.\n\n---\n\n## Dataset Description📊\nThe dataset consists of images containing black pixels. Each point will have the following features:\n- **x-coordinate**\n- **y-coordinate**\n\n---\n\n## Distance Metric📏\n### Euclidean Distance Formula 🌐\n\nThe Euclidean distance measures how far apart two points are in a space. For two points on a 2D plane, we can think of them as having **x** and **y** coordinates. To find out how far apart the two points are, we use this formula:\n\n$$\ntext{Distance} = \\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}\n$$\n\nWhere:\n- **(x₁, y₁)** and **(x₂, y₂)** are the coordinates of the two points.\n- **(x₂ - x₁)** is the horizontal distance between the points.\n- **(y₂ - y₁)** is the vertical distance between the points.\n- Squaring the differences and adding them together gives the total squared distance.\n- Finally, we take the square root to get the actual distance between the points.\n\n---\n\n### Simple Steps to Calculate:\n1. **Subtract** the x-coordinates of the two points: \\( x_2 - x_1 \\)\n2. **Subtract** the y-coordinates of the two points: \\( y_2 - y_1 \\)\n3. **Square** each difference.\n4. **Add** the squared differences.\n5. **Take the square root** of the sum to get the distance.\n\nThis will give you the \"straight line\" distance between the two points, as if you were measuring with a ruler.\n\n---\n\n## Neighbor-Based Clustering🌍\nPerform clustering on points from the previous lab, considering only the points in **neighboring \"cells\"**. Compare the **number of distance function calls** between this approach and classic methods.\n\nThis technique leverages spatial locality to reduce computation overhead, providing insights into the efficiency of clustering based on spatial constraints.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobcyberlab%2Fimage-pixel-clustering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobcyberlab%2Fimage-pixel-clustering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobcyberlab%2Fimage-pixel-clustering/lists"}