{"id":15361549,"url":"https://github.com/muhd-umer/aecc","last_synced_at":"2025-04-15T08:41:38.345Z","repository":{"id":211562086,"uuid":"723080065","full_name":"muhd-umer/aecc","owner":"muhd-umer","description":"AeCC: Autoencoders for compressed communication","archived":false,"fork":false,"pushed_at":"2023-12-30T09:40:33.000Z","size":218216,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T18:12:06.891Z","etag":null,"topics":["autoencoder","cnn","communication","compression","computer-vision","python","pytorch","vision-transformer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhd-umer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-11-24T16:25:03.000Z","updated_at":"2025-01-07T12:52:13.000Z","dependencies_parsed_at":"2023-12-27T06:22:05.124Z","dependency_job_id":null,"html_url":"https://github.com/muhd-umer/aecc","commit_stats":null,"previous_names":["muhd-umer/aecc"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhd-umer%2Faecc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhd-umer%2Faecc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhd-umer%2Faecc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhd-umer%2Faecc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhd-umer","download_url":"https://codeload.github.com/muhd-umer/aecc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249038887,"owners_count":21202803,"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":["autoencoder","cnn","communication","compression","computer-vision","python","pytorch","vision-transformer"],"created_at":"2024-10-01T12:55:35.298Z","updated_at":"2025-04-15T08:41:38.324Z","avatar_url":"https://github.com/muhd-umer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AeCC: Autoencoders for Compressed Communication\n\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![PyTorch](https://img.shields.io/badge/PyTorch-2.1.1-orange.svg)](https://pytorch.org/)\n\nIn the field of communication systems, the transmission of images over noisy channels poses a significant challenge. To address this challenge, a novel communication system is proposed that employs a vision transformer-based autoencoder for image compression and a denoising network for noise removal. The proposed system operates by first encoding the input image into a lower-dimensional latent space representation using the vision transformer-based autoencoder. This compressed representation is then transmitted through a noisy channel, where it is inevitably corrupted by noise. At the receiver, the denoising network is employed to reconstruct the original image from the received, noisy representation.\n\n## Block Diagram\n\u003cimg align=\"center\" src=\"resources/flow.png\"/\u003e\n\n## Installation\nTo get started with this project, follow the steps below:\n\n- Clone the repository to your local machine using the following command:\n\n    ```fish\n    git clone https://github.com/muhd-umer/aecc.git\n    ```\n\n- It is recommended to create a new virtual environment so that updates/downgrades of packages do not break other projects. To create a new virtual environment, run the following command:\n\n    ```fish\n    conda env create -f environment.yml\n    ```\n\n- Alternatively, you can use `mamba` (faster than conda) package manager to create a new virtual environment:\n\n    ```fish\n    wget -O miniforge.sh \\\n         \"https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh\"\n    bash miniforge.sh -b -p \"${HOME}/conda\"\n\n    source \"${HOME}/conda/etc/profile.d/conda.sh\"\n\n    # For mamba support also run the following command\n    source \"${HOME}/conda/etc/profile.d/mamba.sh\"\n\n    conda activate\n    mamba env create -f environment.yml\n    ```\n\n- Activate the newly created environment:\n\n    ```fish\n    conda activate aecc\n    ```\n\n- Install the PyTorch Ecosystem:\n\n    ```fish\n    # pip will take care of necessary CUDA packages\n    pip3 install torch torchvision torchaudio\n\n    # additional packages (already included in environment.yml)\n    pip3 install einops python-box timm torchinfo \\\n                 lightning rich wandb rawpy\n    ```\n\n## Dataset\nA custom Imagenette dataset is used for training and testing the model. The dataset can be downloaded from [here](https://github.com/muhd-umer/aecc/releases/tag/v0.0.1).\n\nOr, you can use the following commands to download the dataset:\n\n```fish\nwget -O imagenette.zip \\\n    \"https://github.com/muhd-umer/aecc/releases/download/v0.0.1/imagenette320p.zip\"\n\n# unzip the dataset\nunzip -q data/imagenette.zip -d data/\n```\n\nCIFAR100 can be downloaded from [here](https://www.cs.toronto.edu/~kriz/cifar.html). CIFAR10 can also be downloaded in a similar manner.\n\nOr, you can use the following commands to download the dataset:\n\n```fish\n# download as python pickle\ncd data\ncurl -O https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz\ntar -xvzf cifar-100-python.tar.gz\n\n# download as ImageNet format\npip3 install cifar2png\ncifar2png cifar100 data/cifar100\n```\n\nFor MNIST, `torchvision` can be used to download the dataset:\n\n```fish\n# download MNIST dataset\npython3 -c \"import torchvision; torchvision.datasets.MNIST('data/', download=True)\"\n```\n\n## Training\nTo train the model from scratch, run the following command:\n\n```fish  \n# train the model from scratch using default config\npython3 train.py --model-name MODEL_NAME \\  # name of the model\n                 --dataset DATASET  # name of the dataset\n\n# Train the model from scratch using overrides\npython3 train.py --model-name MODEL_NAME \\  # name of the model\n                 --dataset DATASET \\  # name of the dataset\n                 --model-cfg MODEL_CFG \\  # path to the model config file\n                 --data-cfg DATA_CFG \\  # path to the data config file\n                 --data-dir DATA_DIR \\  # directory containing data\n                 --model-dir MODEL_DIR \\  # directory to save model\n                 --batch-size BATCH_SIZE \\  # batch size\n                 --num-workers NUM_WORKERS \\  # number of workers\n                 --num-epochs NUM_EPOCHS \\  # number of epochs\n                 --lr LR \\  # learning rate\n                 --val-size VAL_SIZE \\  # validation size\n                 --noise-factor NOISE_FACTOR \\  # noise factor\n                 --rich-progress \\  # use rich progress bar\n                 --accelerator ACCELERATOR \\  # type of accelerator\n                 --devices DEVICES \\  # devices to use for training\n                 --weights WEIGHTS \\  # path to weights file\n                 --resume \\  # resume training from the provided weights\n                 --test-only \\  # only test the model, do not train\n                 --logger-backend LOGGER_BACKEND \\  # logger backend (tensorboard, wandb)\n                 --normalize NORMALIZE \\  # normalize the data (default, standard, neg1to1)\n                 --val-freq VAL_FREQ  # validate every n epochs\n```\n\n## Project Structure\nThe project is structured as follows:\n\n```shell\naecc\n├── config/           # configuration directory\n├── data/             # data directory\n├── models/            # model directory\n├── resources/        # resources directory\n├── utils/            # utility directory\n├── LICENSE           # license file\n├── README.md         # readme file\n├── environment.yml   # conda environment file\n├── upscale.py        # upscaling script\n└── train.py           # training script\n```\n\n## Contributing ❤️\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhd-umer%2Faecc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhd-umer%2Faecc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhd-umer%2Faecc/lists"}