{"id":13715211,"url":"https://github.com/zakizhou/CAPTCHA","last_synced_at":"2025-05-07T04:30:38.787Z","repository":{"id":215215699,"uuid":"70329703","full_name":"zakizhou/CAPTCHA","owner":"zakizhou","description":"implement classification for CAPTCHA in TensorFlow","archived":false,"fork":false,"pushed_at":"2017-11-17T11:02:16.000Z","size":136,"stargazers_count":68,"open_issues_count":9,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-14T03:34:25.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zakizhou.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":"2016-10-08T12:27:52.000Z","updated_at":"2024-08-22T06:39:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"14919bab-3b90-4edc-90e0-229960b3b7da","html_url":"https://github.com/zakizhou/CAPTCHA","commit_stats":null,"previous_names":["zakizhou/captcha"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakizhou%2FCAPTCHA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakizhou%2FCAPTCHA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakizhou%2FCAPTCHA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakizhou%2FCAPTCHA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zakizhou","download_url":"https://codeload.github.com/zakizhou/CAPTCHA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252813611,"owners_count":21808359,"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-08-03T00:00:55.881Z","updated_at":"2025-05-07T04:30:38.777Z","avatar_url":"https://github.com/zakizhou.png","language":"Python","funding_links":[],"categories":["Łamanie","验证码破解与识别"],"sub_categories":["Ogólne"],"readme":"# CAPTCHA\nNewbie about Deep Learning and TensorFlow?\n\nBoring with MNIST? \n\nWant a more interesting and complicated application?\n\nThis is for you.\nThis repo contains a cnn model for recognizing\nnumbers of captcha\n\n\n\n## WHAT IS CAPTCHA\nCAPTCHA is kind of images that contains chars and digits for people to recognize, it is used\nin website log in to test you whether you are a robot or a person. In this repo we will develop\na small convolutional neural network with TensorFlow to recognize it.\n\nFor simplicity, images will only contain four digits with noise\n\n**we say a image is classified correctly if and only if four digits inside this image are all classified correctly**\n\nTwo sample images are listed below\n\n![image1](https://raw.githubusercontent.com/zakizhou/CAPTCHA/master/2_2704.png)\n\n![image2](https://raw.githubusercontent.com/zakizhou/CAPTCHA/master/3_5723.png)\n\n## requirements\npython 2.7 with following packages installed should work fine\n1. numpy\n2. TensorFlow(verison \u003e= 1.4) (because we will use `tf.data`)\n3. captcha(you can install it with `pip install captcha`)\n\n(anaconda environment is strongly recommended for managing these packages)\n\nwindows and python 3.X are not tested but should be OK.\n\nGPU is not a must, but without it, training might be very slow.\n\n## SOME FEATURES\n* Train and validation images are generated on the fly, doesn't need to download any big datasets.\n\n* Inputs of model is built on top of `tf.data` instead of old queue-based api, so reading\nthe code combined with the [official document](https://www.tensorflow.org/programmers_guide/datasets) about `tf.data` will help you understand how \nto write it yourself.\n\n* Very short code, easy to read.\n\n## USAGE\nFirst clone this repo\n```\ngit clone https://github.com/zakizhou/CAPTCHA\n```\nBefore run training, training and validation images should be \n generated, change to the root dir of this repo and run\n ```\n cd CAPTCHA\n mkdir -p images/train\n mkdir -p images/validation\n mkdir -p tfrecords\n mkdir -p save\npython captcha_producer.py -n 30000 -p images/train\n ```\nThis will generate 30000 training images in the images/train/ and also convert infomation about \nthese images into `tfrecords/train.tfrecords` file.\n\nfor validation set:\n ```\npython captcha_producer.py -n 3000 -p \"images/validation\"\n ```\n\nNow you can run this model with\n ```\npython captcha_train.py\n ```\n\n## Result\nAfter 10000 steps (you can manually change num of steps in `captcha_train.py` file) training on single GTX1060, this model achieved \naround 70% accuracy, adjusting the scale of parameters or adding dropout\nshould still improve this performance\n\n## Details about files\n* `images/train` and `images/validation` will contains generated train and validation images\n* `tfrecords` will contains about generated tfrecords(`train.tfrecords`, `validation.tfrecords`)\n* `save` will contains saved model after training\n* `captcha_producer.py` is used to generate images and tfrecords\n* `captcha_model.py` contains utils functions for defining the model\n* `captcha_data.py` is used for build input for model\n* `captcha_config.py` contains configs for model\n* `captcha_train.py` is used for training model\n## TODO\n* add multi gpu training code\n* add tensorboard code\n* add functions for keep on training after shutdown\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakizhou%2FCAPTCHA","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzakizhou%2FCAPTCHA","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakizhou%2FCAPTCHA/lists"}