{"id":16254216,"url":"https://github.com/sumn2u/neuralnetwork-jpeg","last_synced_at":"2025-03-19T21:30:27.248Z","repository":{"id":54607127,"uuid":"113640100","full_name":"sumn2u/neuralnetwork-jpeg","owner":"sumn2u","description":"Convolutional Neural Network (CNN) Image Compression 🤖🖼️📉","archived":false,"fork":false,"pushed_at":"2023-06-25T15:26:01.000Z","size":5957,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T21:05:54.604Z","etag":null,"topics":["cnn","compression","convolutional-neural-networks","deep-learning","machine-learning","neural-network","tensorflow"],"latest_commit_sha":null,"homepage":"https://sumn2u.github.io/neuralnetwork-jpeg/","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/sumn2u.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":"2017-12-09T03:58:44.000Z","updated_at":"2024-07-06T08:40:36.000Z","dependencies_parsed_at":"2024-10-27T21:32:31.684Z","dependency_job_id":"1b91ff61-350d-4d55-bc3b-29460ee3583a","html_url":"https://github.com/sumn2u/neuralnetwork-jpeg","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/sumn2u%2Fneuralnetwork-jpeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumn2u%2Fneuralnetwork-jpeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumn2u%2Fneuralnetwork-jpeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumn2u%2Fneuralnetwork-jpeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sumn2u","download_url":"https://codeload.github.com/sumn2u/neuralnetwork-jpeg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244021707,"owners_count":20385122,"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":["cnn","compression","convolutional-neural-networks","deep-learning","machine-learning","neural-network","tensorflow"],"created_at":"2024-10-10T15:20:37.692Z","updated_at":"2025-03-19T21:30:26.584Z","avatar_url":"https://github.com/sumn2u.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convolutional Neural Network (CNN) Image Compression\n\nEncode/decode natural images using Neural Network.\n\n\n**Motivation :**\n\u003e That said, a research paper must include some original contributions,\nintroducing novel ideas and proving its validity and improved performance.\nIn fact, writing a research paper is the culmination of an intense dedication to research,\nhaving analysed different hypothesis and assessed their appropriateness.\n\n**Goals :**\n- use different image compression techniques to get compressed images\n- compare different image enhancement algorithms\n- purposed own algorithm\n- compare it to other alogorithms \n\n## Status\n\nWork in progress\n--updated by Suman kunwar\n\n## Try it out\n\n```bash\n$ cd npeg\n$ ipython -i train.py\n```\n\nthen type in one of the following commands:\n\n```python\n# strong noise training (should converge to 0.0008 loss)\nfor i in range(5):\n    r(cnoise=15.0)\n\n# weak noise pretraining (no difference in final loss)\nfor i in [0.1, 0.3, 1.0, 5.0, 15.0]:\n    r(cnoise=i)\n\n# save weights to file\nsave()\n\n# load weights from file\nload()\n\n# test model on randomly sampled CIFAR\nshow()\n```\n\nDependencies:\n\n- TensorFlow r1.0\n- Canton library: `pip install canton`\n- Keras (mainly for downloading CIFAR)\n\nIf you need visualization functionality:\n\n- cv2 (install via conda is recommended)\n- cv2tools (pull from \u003chttps://github.com/ctmakro/cv2tools\u003e then `pip install -e \u003cdirname\u003e`)\n- or modify the code to use other visualization libraries you prefer\n\n## How it works\n\n\u003e CNN Image Compression - Neural Network Image Compression：\u003chttps://sumn2u.github.io/neuralnetwork-jpeg\u003e\n\nTraining:\n\n- image -\u003e Encoder CNN -\u003e features\n- features += gaussian noise\n- features -\u003e sigmoid -\u003e code\n- code -\u003e Decoder CNN -\u003e reconstruction\n- loss = mean((image-reconstruction) ** 2) + mean(code**2) * 0.01\n\nTo reduce reconstruction loss, the best encoding strategy for the encoder is to drive its output (\"features\") large, to reduce artifacts caused by the gaussian noise.\n\nTherefore by increasing the magnitude of the gaussian noise, the code will eventually saturate to 0 or 1.\n\nWe encourage sparsity of the code (to allow for further compression) by adding a penalty term (`mean(code**2) * 0.01`), after which the code will tend to include more zeros and less ones.\n\nTesting:\n\n- image -\u003e Encoder CNN -\u003e features\n- features -\u003e sigmoid -\u003e binary quantization -\u003e code\n- code -\u003e Decoder CNN -\u003e reconstruction\n\n## About\n\nOriginal Author: Qin Yongliang and Suman Kunwar\n\n\nLicense: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumn2u%2Fneuralnetwork-jpeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsumn2u%2Fneuralnetwork-jpeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumn2u%2Fneuralnetwork-jpeg/lists"}