Developers
July 22, 2020

5 Steps To Build Responsible AI With TensorFlow

Here are 5 simple steps that will make you develop consciously and safely with TensorFlow.

Today we will talk about how you can use AI in TensorFlow. The idea of using AI is being consciously aware of how to use it responsibly and safely.

As we speak, billions of people throughout the entire world are using products and services that are built with AI. The priority has to be always in the trust between the user and the provider (company, developer, etc)

In 2018, two years back, Google introduced the AI principles. This is a guide for the ethical development and use of AI in the provided products. These principles have AI standards for privacy, accountability, and security. 

TensorFlow, one of the most popular machine learning frameworks, counts with millions of downloads and a huge community. The AI Toolkit is currently being expanded so that developers worldwide can integrate the principles into their ML development.

As developers build their products, there is a consistent workflow that is established in the TensorFlow platform. There are stages in the workflow. Following the responsible AI principles, the responsible AI toolkit is born.

The workflow is made up of 5 steps.Define the problem

  1. Collect and prepare the data
  2. Build and train the model
  3. Evaluate performance
  4. Deploy and monitor 

All models are iterated multiple times once they are deployed. The previously mentioned steps are always repeated. Developers train models, test performance, collect data, and deploy. 

The tools and resources that can be used in the workflow are not exclusive to any step in particular. Fairness Indicators and ML Metadata can be used to evaluate and monitor your models.

Step 1: Define the problem 

Several questions have to be asked when defining the problem. What is being built? What is the purpose? Who is my client? What is my solution if the application fails or crashes?

The first step for any development process is to know the problem. In this case, one has to know if AI is a viable solution. What problem is it tackling and solving? It is recommended to always have a customer-first mindset, where at the time of developing, your goal is to deliver the best possible experience and product.

There are a couple of tools within the Responsible AI Toolkit in TensorFlow that can help your development. One is the Pair Guidebook, and the other is the AI Explorable's.  

The Pair Guidebook focuses on the design of human-centered AI. It works as a companion when you build, giving you a couple of questions to think while you develop. It was built with the help of 40 teams of Google. It is recommended to read it and base your problem finding on the guidebook.

On the other hand, AI explorable is a set of interactive tools that provide an introduction to AI concepts

Step 2: Collect and prepare Data 

Who does my dataset represent? How is my dataset being collected? How do I prioritize the privacy of my users?

Once you know the problem you are solving, the next step is to collect the necessary data so that you can solve your problem based on information. Based on machine learning, a dataset is an individual product and has to be considered that way. By treating a dataset with such relevance, you will understand and use it in a different way than considering it only as a tool. The dataset helps you collect data efficiently. For this step, you can use TensorFlow Data Validation.

Step 3: Build and Train the Model

How do I prioritize privacy over anything else? How do I train my model? What techniques can I use to train my model?

This is considered the most important step, as it is the hands in action of the entire workflow. The previous steps are a preparation for this step, and the next steps are a continuation of this one.

Training your TensorFlow model is the most complex part of the entire development process. You should prioritize optimization and user privacy. With the help of some tools, you will be able to build and train your model the way you need it.
You can use TensorFlow Federated, TensorFlow Privacy, TensorFlow Constrained Optimization, and TensorFlow Lattice. For more information check out the TensorFlow website and you will find tutorials and guides for each tool.

Step 4: Evaluate the model

Is my model preserving privacy? How much? Is my model performing at its best? If no, why not? Is my model failing often?

Once a model is trained, the iteration step begins. Very often with models as with any technological product, the first version is not the desired and most optimized version. It works to launch soon and small. This way you can work on mistakes by testing and building on a working product.

In this step, the key is to identify where is it failing. Sometimes developers can't identify failures as they see it working, but you should always compare your actual product with the optimum version of the product. Maybe it is not failing, but it can be improved.

For these steps, you can use Privacy Tests, Fairness Indicators, TensorFlow Model Analysis, TensorBoard, and the What-If-Tool. You can also explore TensorFlow's suite to dig deeper into how each tool works.

Step 5: Deploy and Monitor

How is my model performing? How does it perform in different situations? How do I track improvement and progress?

All models and products are continually being improved. User demands constantly change, and technology adapts to fit customer needs. Developers have to always focus on the next move, on what is coming next, and always listening to the user. They may have a strong opinion of how things work, but if the client or market responds a different way, one has to always adapt.

For this step, you can use the following tools. ML Metadata, and Model Cards. ML Metadata helps you track your development process. From the point of training data to the point of exporting your model. This way you can evaluate with the use of metrics.

TagsAITensorFlowGoogleMachine Learning
Lucas Bonder
Technical Writer
Lucas is an Entrepreneur, Web Developer, and Article Writer about Technology.

Related Articles

Back
DevelopersJuly 22, 2020
5 Steps To Build Responsible AI With TensorFlow
Here are 5 simple steps that will make you develop consciously and safely with TensorFlow.

Today we will talk about how you can use AI in TensorFlow. The idea of using AI is being consciously aware of how to use it responsibly and safely.

As we speak, billions of people throughout the entire world are using products and services that are built with AI. The priority has to be always in the trust between the user and the provider (company, developer, etc)

In 2018, two years back, Google introduced the AI principles. This is a guide for the ethical development and use of AI in the provided products. These principles have AI standards for privacy, accountability, and security. 

TensorFlow, one of the most popular machine learning frameworks, counts with millions of downloads and a huge community. The AI Toolkit is currently being expanded so that developers worldwide can integrate the principles into their ML development.

As developers build their products, there is a consistent workflow that is established in the TensorFlow platform. There are stages in the workflow. Following the responsible AI principles, the responsible AI toolkit is born.

The workflow is made up of 5 steps.Define the problem

  1. Collect and prepare the data
  2. Build and train the model
  3. Evaluate performance
  4. Deploy and monitor 

All models are iterated multiple times once they are deployed. The previously mentioned steps are always repeated. Developers train models, test performance, collect data, and deploy. 

The tools and resources that can be used in the workflow are not exclusive to any step in particular. Fairness Indicators and ML Metadata can be used to evaluate and monitor your models.

Step 1: Define the problem 

Several questions have to be asked when defining the problem. What is being built? What is the purpose? Who is my client? What is my solution if the application fails or crashes?

The first step for any development process is to know the problem. In this case, one has to know if AI is a viable solution. What problem is it tackling and solving? It is recommended to always have a customer-first mindset, where at the time of developing, your goal is to deliver the best possible experience and product.

There are a couple of tools within the Responsible AI Toolkit in TensorFlow that can help your development. One is the Pair Guidebook, and the other is the AI Explorable's.  

The Pair Guidebook focuses on the design of human-centered AI. It works as a companion when you build, giving you a couple of questions to think while you develop. It was built with the help of 40 teams of Google. It is recommended to read it and base your problem finding on the guidebook.

On the other hand, AI explorable is a set of interactive tools that provide an introduction to AI concepts

Step 2: Collect and prepare Data 

Who does my dataset represent? How is my dataset being collected? How do I prioritize the privacy of my users?

Once you know the problem you are solving, the next step is to collect the necessary data so that you can solve your problem based on information. Based on machine learning, a dataset is an individual product and has to be considered that way. By treating a dataset with such relevance, you will understand and use it in a different way than considering it only as a tool. The dataset helps you collect data efficiently. For this step, you can use TensorFlow Data Validation.

Step 3: Build and Train the Model

How do I prioritize privacy over anything else? How do I train my model? What techniques can I use to train my model?

This is considered the most important step, as it is the hands in action of the entire workflow. The previous steps are a preparation for this step, and the next steps are a continuation of this one.

Training your TensorFlow model is the most complex part of the entire development process. You should prioritize optimization and user privacy. With the help of some tools, you will be able to build and train your model the way you need it.
You can use TensorFlow Federated, TensorFlow Privacy, TensorFlow Constrained Optimization, and TensorFlow Lattice. For more information check out the TensorFlow website and you will find tutorials and guides for each tool.

Step 4: Evaluate the model

Is my model preserving privacy? How much? Is my model performing at its best? If no, why not? Is my model failing often?

Once a model is trained, the iteration step begins. Very often with models as with any technological product, the first version is not the desired and most optimized version. It works to launch soon and small. This way you can work on mistakes by testing and building on a working product.

In this step, the key is to identify where is it failing. Sometimes developers can't identify failures as they see it working, but you should always compare your actual product with the optimum version of the product. Maybe it is not failing, but it can be improved.

For these steps, you can use Privacy Tests, Fairness Indicators, TensorFlow Model Analysis, TensorBoard, and the What-If-Tool. You can also explore TensorFlow's suite to dig deeper into how each tool works.

Step 5: Deploy and Monitor

How is my model performing? How does it perform in different situations? How do I track improvement and progress?

All models and products are continually being improved. User demands constantly change, and technology adapts to fit customer needs. Developers have to always focus on the next move, on what is coming next, and always listening to the user. They may have a strong opinion of how things work, but if the client or market responds a different way, one has to always adapt.

For this step, you can use the following tools. ML Metadata, and Model Cards. ML Metadata helps you track your development process. From the point of training data to the point of exporting your model. This way you can evaluate with the use of metrics.

AI
TensorFlow
Google
Machine Learning
About the author
Lucas Bonder -Technical Writer
Lucas is an Entrepreneur, Web Developer, and Article Writer about Technology.

Related Articles