{"id":22039394,"url":"https://github.com/mpolinowski/tf-mnist-digits","last_synced_at":"2026-05-08T18:34:12.006Z","repository":{"id":111484177,"uuid":"580655200","full_name":"mpolinowski/tf-mnist-digits","owner":"mpolinowski","description":"Tensorflow unsupervised learning to denoise images from the mnist digits dataset","archived":false,"fork":false,"pushed_at":"2022-12-21T05:20:59.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T13:14:11.810Z","etag":null,"topics":["denoise-images","mnist-image-dataset","representation-learning","tensorflow2","unsupervised-learning"],"latest_commit_sha":null,"homepage":"https://mpolinowski.github.io/docs/IoT-and-Machine-Learning/ML/2022-12-20-tf-representation/2022-12-19","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/mpolinowski.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":"2022-12-21T05:20:55.000Z","updated_at":"2022-12-21T05:55:42.000Z","dependencies_parsed_at":"2023-05-09T17:16:39.888Z","dependency_job_id":null,"html_url":"https://github.com/mpolinowski/tf-mnist-digits","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mpolinowski/tf-mnist-digits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Ftf-mnist-digits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Ftf-mnist-digits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Ftf-mnist-digits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Ftf-mnist-digits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpolinowski","download_url":"https://codeload.github.com/mpolinowski/tf-mnist-digits/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Ftf-mnist-digits/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32792196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["denoise-images","mnist-image-dataset","representation-learning","tensorflow2","unsupervised-learning"],"created_at":"2024-11-30T11:10:36.125Z","updated_at":"2026-05-08T18:34:11.985Z","avatar_url":"https://github.com/mpolinowski.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tensorflow Representation Learning\n\nUse Tensorflow/Keras to build an __Autoencoder__ to perform an unsupervised learning to de-noise image files. The Autoencoder is based on a regular Keras sequential model and consists of the encoder - that is basically the same convolution layer used in regular CNNs with supervised learning - and an decoder - that is an \"encoder in reverse\". The decoder takes the compressed representation of the image generated by the encoder from the representation layer and has to reconstruct the initial image from this compress data:\n\n\n```py\n# build autoencoder model\nautoencoder = tf.keras.models.Sequential()\n\n# build the encoder CNN\nautoencoder.add(tf.keras.layers.Conv2D(16, (3,3), strides=1, padding=\"same\", input_shape=(28, 28, 1)))\nautoencoder.add(tf.keras.layers.MaxPooling2D((2,2), padding=\"same\"))\n\nautoencoder.add(tf.keras.layers.Conv2D(8, (3,3), strides=1, padding=\"same\"))\nautoencoder.add(tf.keras.layers.MaxPooling2D((2,2), padding=\"same\"))\n\n# representation layer\nautoencoder.add(tf.keras.layers.Conv2D(8, (3,3), strides=1, padding=\"same\"))\n\n# build the decoder CNN \nautoencoder.add(tf.keras.layers.UpSampling2D((2, 2)))\nautoencoder.add(tf.keras.layers.Conv2DTranspose(8,(3,3), strides=1, padding=\"same\"))\n\nautoencoder.add(tf.keras.layers.UpSampling2D((2, 2)))\nautoencoder.add(tf.keras.layers.Conv2DTranspose(1, (3,3), strides=1, activation='sigmoid', padding=\"same\"))\n```\n\nFor the training we now feed the a noisy dataset into the encoder and have the Autencoder compress and reconstruct each image. After those steps we provide to original - noise-free - image to compare the reconstructed image to. The training is complete when we reach a minimum of differences between both of them:\n\n\n```py\n# fit model to dataset\nautoencoder.fit(X_train_noisy.reshape(-1, 28, 28, 1),          \n          X_train.reshape(-1, 28, 28, 1), \n          epochs=10, \n          batch_size=200)\n```\n\nAs an example, here are 15 \"noised\" images from the mnist digits dataset and the reconstructed de-noised image the Autoencoder generated from it:\n\n\n![Tensorflow Representation Learning](./Tensorflow_Transfer_Learning_05.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Ftf-mnist-digits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpolinowski%2Ftf-mnist-digits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Ftf-mnist-digits/lists"}