# AutoKeras — AutoML for Deep Learning with Keras > AutoKeras automatically searches for optimal neural network architectures and hyperparameters for image classification, text classification, regression, and structured data tasks using the Keras API. ## Install Save in your project root: # AutoKeras — AutoML for Deep Learning with Keras ## Quick Use ```bash pip install autokeras python -c " import autokeras as ak import tensorflow as tf (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data() clf = ak.ImageClassifier(max_trials=10) clf.fit(x_train, y_train, epochs=3) print(clf.evaluate(x_test, y_test)) " ``` ## Introduction AutoKeras is an AutoML library built on top of Keras that automates neural architecture search and hyperparameter tuning. It lets developers train high-quality deep learning models with minimal machine learning expertise by specifying only the task type and data. ## What AutoKeras Does - Searches for optimal neural network architectures using efficient NAS algorithms - Automatically selects preprocessing, data augmentation, and normalization strategies - Supports image classification, text classification, structured data, and regression tasks - Tunes hyperparameters like learning rate, layer sizes, and dropout rates - Exports the best model as a standard Keras model for deployment ## Architecture Overview AutoKeras uses Keras Tuner as its search backend. It defines a search space of possible architectures as a graph of interchangeable blocks (convolutional, dense, transformer). The tuner explores this space using Bayesian optimization or greedy search, training candidate models and evaluating them on a validation set. The best architecture is returned as a standard Keras Sequential or Functional model. ## Self-Hosting & Configuration - Install via pip; requires TensorFlow 2.x as the backend - Set max_trials to control how many architectures are evaluated - Use overwrite=True to restart a search or False to resume a previous one - Configure epochs and validation_split in the fit() call - Export the final model with export_model() for serving with TensorFlow Serving or ONNX ## Key Features - Task-oriented API covers image, text, structured data, and time-series problems - Multi-modal input support combines images and tabular data in a single model - Customizable search space lets advanced users constrain architecture blocks - Integrated early stopping prevents wasted compute on poor candidates - Exports standard Keras models compatible with the full TensorFlow ecosystem ## Comparison with Similar Tools - **Auto-Sklearn** — AutoML for scikit-learn classical models; AutoKeras targets deep learning architectures - **H2O AutoML** — enterprise platform covering many model types; AutoKeras focuses on neural networks with Keras - **Ludwig** — declarative config-based training; AutoKeras automates architecture search - **FLAML** — fast lightweight AutoML; AutoKeras specializes in neural architecture search - **Google AutoML** — managed cloud service; AutoKeras is open-source and runs locally ## FAQ **Q: How long does an AutoKeras search take?** A: Depends on max_trials and dataset size. A 10-trial search on MNIST finishes in minutes; larger datasets with more trials can take hours. **Q: Can I use a GPU?** A: Yes. AutoKeras uses TensorFlow, which automatically detects and uses available GPUs. **Q: Is AutoKeras suitable for production models?** A: The exported Keras model is a standard TensorFlow model that can be served with TF Serving, converted to TFLite, or exported to ONNX. **Q: Can I customize the search space?** A: Yes. Use AutoModel with custom blocks from the autokeras.blocks module to define which layers and hyperparameters to search. ## Sources - https://github.com/keras-team/autokeras - https://autokeras.com/ --- Source: https://tokrepo.com/en/workflows/asset-9bbd460e Author: AI Open Source