Keras: an open source library for developing neural networks
Artificial intelligence plays a key role in today’s digital world – including in the development and use of video games (or other applications) as well as in web services, devices, and machines. One of the most important fields of research and subfields that intensively explores the key features of “virtual intelligence” is neural networks, and the implementation of neural networks is greatly simplified by the use of Keras. Read on to learn what this open source library is and how it can simplify the development of neural networks.
What is Keras?
Keras is an open source library (MIT license) written in Python which is primarily based on the work done by Google developer François Chollet as part of project ONEIROS (Open-ended Neuro-Electronic Intelligent Robot Operating System). The first version of this platform-independent software was published on March 28, 2015. The purpose of this library is to enable neural networks to be rapidly developed. In this case, Keras is not a separate framework but a beginner-friendly interface (API) for accessing and programming a variety of machine learning frameworks. Theano, Microsoft Cognitive Toolkit (formerly CNTK) and TensorFlow are among some of the frameworks supported by Keras.
As of the release of TensorFlow 1.4, Keras has become an integral part of the TensorFlow kernel API. Nevertheless, this library will continue to be developed as independent software since it was intended to be an interface for different frameworks from the start, and this is still the case.
The current version of Keras is compatible with Python 2.7 and higher. The full project is accessible at any time via the official Keras GitHub repository.
How does Keras work?
Keras is a library that works with models. It provides the building blocks for developing complex deep learning models. Unlike independent frameworks, this open source software does not deal with simple low-level operations itself. Instead, it uses the libraries from associated machine learning frameworks for this purpose. These act as a kind of back-end engine for Keras. Since the idea is to be modular, the desired layers for the neural network being developed are connected to each other without the actual backend of the selected framework needing to be understood or controlled by the Keras user.
As previously mentioned, Keras uses the three tools TensorFlow, Theano, and Microsoft Cognitive Toolkit. These have ready-to-use interfaces which enable fast intuitive access to the respective backend. There is no need to decide on a single framework because you can easily switch between the different backends. It is also possible to choose a different backend from the three solutions named here. You just need to specify it in the configuration file (Keras.json), and it has to have the following three functions available: “placeholder”, “variable” and “function”.
You can find more detailed information about back-end management and general usage in our extensive Keras tutorial.
What are the advantages of using Keras?
Keras has been an excellent addition to the existing tools out there for developing neural networks since this open source library greatly simplifies the process. Usability is key here. Keras functions as an interface that is designed explicitly for humans and only secondarily for machines. User actions are reduced to a minimum, and if errors still occur, relevant feedback is provided to help correct them. This makes it comparatively easy to learn how to use Keras – and allows for an increased level of productivity. Furthermore, due to the incorporation of deep learning frameworks, this simplicity is not accompanied by functional limitations. You can integrate any desired features via the customised interfaces (or disable them as needed).
Here is an overview of some additional advantages provided by Keras:
- Broad platform support for developed models: Models developed with Keras can be easily deployed on different platforms. For example, iOS (Apple CoreML), Android (Keras TensorFlow Android Runtime), Google Cloud, and Raspberry Pi setups are supported by default.
- Support for multiple back-end engines: Keras gives you the freedom to choose the backend you want and combine multiple backends. You can also transfer a developed model to another backend at any time.
- Outstanding multi-GPU support: When using Keras, the computing work for the developed deep learning processes can easily be distributed over multiple graphics chips or cards.
- Development power from major companies: The maintenance and further development of Keras is supported by the most prominent companies in the industry. Google, Amazon AWS, Microsoft, Apple, and Nvidia are some of the companies involved in the project.
What projects is Keras suitable for?
As a universal interface for machine learning platforms, Keras is currently being used in a variety of projects in the field of AI. By mid-2018, this library already had more than 250,000 individual users – and this number has greatly increased since its inclusion in the TensorFlow software. Due to the freedom to choose the underlying framework, free licensing, and its platform independence, Keras is the perfect all-rounder solution for professional neural network applications in both industry and research. For example, well-known companies such as Netflix, Uber, and Yelp as well as organisations such as NASA and CERN use Keras or the TensorFlow Keras package in their projects.