slightly opened silver MacBook

TensorFlow - AI Revolution

TensorFlow is an Open Source Deep Learning Library fueling AI Revolution

ARTIFICIAL INTELLIGENCE

Jeugene John V

9/19/20252 min read

selective focus of blue-eyed person
selective focus of blue-eyed person

Beginning

TensorFlow is a open source neural network framework most widely used to create AI models. Originally developed by  Google Brain Team it acted as a replacement for machine learning libraries. The framework became public in 2015,  under the Apache License.

Architecture

The basic building blocks of  the framework includes 

  • Tensors: They are multi dimensional arrays or matrices that store data. This can be text, pictures, audio or video samples acting as input to a model. Tensors can be 1D, 2D, or multiple dimensions.

  • Graph: Shows the outlay of the total operations performed on the tensor. This can be addition, multiplication or weight adjustment. Can be understood as a flow diagram with steps defining each execution.

  • Session: This is the time frame showing the actual execution of the operation. The internal arithmetic calculations are performed during this phase.

Work Flow

The data processing of the framework goes through five main stages. They include

  • Training the model: Here the inputs from sensors or other data aggregation devices are converted into tensors. This is then fed into a model for training. Weights are adjusted based on the output accuracy. The operation can be either supervised or unsupervised.

  • Conversion: The final model is converted into a mobile, stand alone format. This is known as TensorFlow Lite. The extension is .tflite. The output has a lower data size and memory usage.

  • Optimization: Usage of quantization, optimization and weight management to further trim the model size. This is to reduce the overall digital footprint.

  • Deployment: The refined model is downloaded into a edge device such as a smartphone, or an embedded system like raspberry pi / esp32 module. It can also be integrated into a website or mobile app. 

  • Make Inference: The model is field tested for validity. Checks are done for low latency, and reduced online connectivity. The model must be able to perform basic operations without external assistance or cloud connectivity. Also the power  consumption should be kept to a minimum.

Others

There are also other deep learning frameworks which performs the same computational analysis. However they do lack in certain areas where TensorFlow excels.

  • PyTorch: Is used for rapid prototyping and research. Provides support for deep learning models and has a large online community. However deployment to end devices is currently not supported. Easier learning curve specially for beginners.

  • Keras: Built on top of TensorFlow, they provide libraries for deep learning models. Some of them include Convolutional Neural Network (CNN), Recurrent Neural Network (RNN). Learning curve is harder given the complexity of the framework.

  • SciKit: Used for implementing Machine Learning models such as Regression and Classifications. Used in academia and for prototyping. Learning curve is comparatively easy.

TensorFlow supports a wide range of programming languages such as  C++, Python and even Java Script. What make it stand out is the rapid deployment of AI models to end devices and peripherals. With integration of Keras, most of the complex computation is taken care of and developers can focus on optimizing their AI models.