{ "info": { "author": "Anurag Mishra", "author_email": "anuragmishracse@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Build Tools" ], "description": "# smart_image_classifier \n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/anuragmishracse/smart_image_classifier/blob/master/LICENSE)\n\n**SM**art **I**mage **C**lassifier (abbreviated and named as **SMIC**) is a _deep learning_ library built on top of keras using the TensorFlow backend for building models for _image classification_. \nSpecialities of this library:\n1. It searches for the optimum set of hyperparameters for the classification model\n2. Works for any training set, given it's organized in a format that the library understands\n3. One can build an Image Classifier in under 5 lines of code\n\n_It is advised that you use a GPU for training your models, as it might take days using a CPU._\n\n---------------------\n\n## Requirements\nCurrent implementation of the library depends on the following:\n```\n1. tqdm\n2. pandas \n3. numpy\n4. opencv-python\n5. tensorflow\n6. h5py\n7. keras==2.0.9\n```\nPlease make sure that the requirements are satisifies.\nRequirements can be installed by `pip install -r requirements.py`\n\n## Installation\nThis package can be installed by\n```\npip install smic\n```\nand you're done.\n\n## Train / Test data organization\nThe train and test images should be put in seperate directories. The required data format is,\n```\n/path/to/data/folder/\n|---->train\n|----|----->trainImage1 #Image names can be anything\n|----|----->trainImage2\n|----|----->trainImage3\n|----|----->___so on___\n\n|---->test\n|----|----->testImage1 #Image names can be anything\n|----|----->testImage2\n|----|----->testImage3\n|----|----->___so on___\n\n|---->trainLabels.csv #Contains records in `\"trainImage1\",\"cat\"` format\n\n|---->testLabels.csv #Contains records in `\"testImage1\",\"dog\"` formmat\n```\n\n## Usage\nBuilding an image classification model is made really easy. \n\n```python\nfrom smic import SMIC\nclf = SMIC()\nclf.prepare_train_data('/path/to/data/folder')\nhyperparameters = clf.search_optimal_parameters()\nclf.fit(hyperparameters, epochs = 50, batch_size=32)\n```\n\n`hyperparameters` is a dict returned by `search_optimal_parameters()` and contains the hyperparameters that seem to work best for the current task at hand. \n\nIf you want you can use your own hyperparameters; skip line [4] and create your own hyperparameters dict like\n```python\nhyperparameters = {'transfer_model' : 'vgg16', 'optimizer' : 'sgd', \n\t\t\t\t\t'top_layers' : [['dense', 512, 'relu'],['dense', 512, 'relu']]}\n```\nPass this dict as an argument to `.fit()`. \n\n### Supported hyperparameters and values:\n```\n'transfer_model' : ['vgg16', 'vgg19', 'resnet50', 'inception_v3']\n'optimizer': ['sgd', 'rmsprop', 'adam']\n'top_layers': A list of all the layers that you want to add on top of the pre-trained CNN.\n\t\tEg: [['dense', 512, 'relu'],['dense', 512, 'relu'],...]\n\t\tHere 'dense' is the type of layer, 512 is the output dimension and\n\t\t'relu' is the activation function.\n```\n\n## TODO\n1. An assumption used is that the dataset fits into memory; use batch processing to fit > RAM sized datasets.\n2. The hyperparameter tuning currently searches for an optimizer, tranfer learning CNN and number of top layers; Add support for more hyperparameters like momentum value, Dropouts, Regularization etc.\n3. Add image data augmentation, that can potentially help learn from fewer datasets.\n4. The dataset needs to be organized in the above mentioned format; add support for other formats like:\n```\nTrain\n|--->Cat\n|--->|----catImage1\n|--->|----catImage2\n|--->|----......\n|--->Dog\n|--->|----dogImage1\n|--->|----dogImage2\n|--->|----......\n.............\n```\n5. Add tests; figure out a way to test changes so that it doesn't corrupt the repo; use CI.\n\n\n## Note to community\n1. A lot of effort needs to be put in, as a community, to develop a systematic approach for hyperparameter tuning, hence suggestions/ ideas welcome.\n2. Pull requests are welcome for the above TODO or any other improvement.\n3. In case of any issues/ queries, open a new issue or contact me over email.\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/anuragmishracse/smart_image_classifier", "keywords": "image-classification deep-learning keras", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "smic", "package_url": "https://pypi.org/project/smic/", "platform": "", "project_url": "https://pypi.org/project/smic/", "project_urls": { "Homepage": "https://github.com/anuragmishracse/smart_image_classifier" }, "release_url": "https://pypi.org/project/smic/1.0.1/", "requires_dist": [ "numpy", "opencv-python", "pandas", "tensorflow", "tqdm", "h5py", "keras" ], "requires_python": "", "summary": "Image Classification library built on top of Keras. Identifies the best set of hyperparameters and trains a classification model accordingly, hence, smart.", "version": "1.0.1" }, "last_serial": 3312674, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "1945cda6bce05e4005f6e9e40fcce081", "sha256": "cef550bd1c64645f0886919fce82f9b7d88200e568e4c539136c265420003d78" }, "downloads": -1, "filename": "smic-1.0.1-py2.7.egg", "has_sig": false, "md5_digest": "1945cda6bce05e4005f6e9e40fcce081", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 5585, "upload_time": "2017-11-07T13:20:27", "url": "https://files.pythonhosted.org/packages/44/9e/06c8571322e4b3858d6ca0d5768bf8a92256aeb80b02a5e0a6414c4742e3/smic-1.0.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "d8c8a61ad799182f89c1fd385103cdf2", "sha256": "7e7714196bd33ab7015c84899a263fdf7827dadbd12ed30ca9ff2f24060eec7f" }, "downloads": -1, "filename": "smic-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d8c8a61ad799182f89c1fd385103cdf2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8110, "upload_time": "2017-11-07T13:20:26", "url": "https://files.pythonhosted.org/packages/e2/4f/5636123aa73eed0ea26b3fea5d026c531f2b1be6a640852b10a4f2d7f991/smic-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "13066fd1ecc832eef8808a8f89814b5d", "sha256": "4781ebe0df117518b3f12ddc146baba82262dd1ffc294af97820d1d5df3991f7" }, "downloads": -1, "filename": "smic-1.0.1.tar.gz", "has_sig": false, "md5_digest": "13066fd1ecc832eef8808a8f89814b5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5012, "upload_time": "2017-11-07T13:20:30", "url": "https://files.pythonhosted.org/packages/81/6a/e6acab06c9911684981bf84fcf3fae8a70f904569147e7f9ab8bd35ac265/smic-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1945cda6bce05e4005f6e9e40fcce081", "sha256": "cef550bd1c64645f0886919fce82f9b7d88200e568e4c539136c265420003d78" }, "downloads": -1, "filename": "smic-1.0.1-py2.7.egg", "has_sig": false, "md5_digest": "1945cda6bce05e4005f6e9e40fcce081", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 5585, "upload_time": "2017-11-07T13:20:27", "url": "https://files.pythonhosted.org/packages/44/9e/06c8571322e4b3858d6ca0d5768bf8a92256aeb80b02a5e0a6414c4742e3/smic-1.0.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "d8c8a61ad799182f89c1fd385103cdf2", "sha256": "7e7714196bd33ab7015c84899a263fdf7827dadbd12ed30ca9ff2f24060eec7f" }, "downloads": -1, "filename": "smic-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d8c8a61ad799182f89c1fd385103cdf2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8110, "upload_time": "2017-11-07T13:20:26", "url": "https://files.pythonhosted.org/packages/e2/4f/5636123aa73eed0ea26b3fea5d026c531f2b1be6a640852b10a4f2d7f991/smic-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "13066fd1ecc832eef8808a8f89814b5d", "sha256": "4781ebe0df117518b3f12ddc146baba82262dd1ffc294af97820d1d5df3991f7" }, "downloads": -1, "filename": "smic-1.0.1.tar.gz", "has_sig": false, "md5_digest": "13066fd1ecc832eef8808a8f89814b5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5012, "upload_time": "2017-11-07T13:20:30", "url": "https://files.pythonhosted.org/packages/81/6a/e6acab06c9911684981bf84fcf3fae8a70f904569147e7f9ab8bd35ac265/smic-1.0.1.tar.gz" } ] }