What is AIaaS?
All the power of AI on the Cloud
Intro
Is that some new technology or some terminology brewing on the horizon? It must be a new day indeed. OK, just recently I’ve found out about the concept around AI as a Service (AIaaS), and wanted to explore this subject matter a bit more and share my thoughts and experiences with you. I should mention that I’m not an AI scientist or ML engineer (not yet, at least) before diving into any further content. I’m just a curious software developer with a healthy hunger for new technologies and their potential impact on our daily workflows and lives.
What I hope is that your curiosity is ignited by the end of this article and that you’ll continue with further exploring this new interesting world and emerging concepts around the fabulous topic of Artificial Intelligence. Let’s just jump in and see what is what.
Artificial Intelligence as a Service (AIaaS) is a new way in which companies and developers can access and utilize artificial intelligence capabilities to benefit their goals. In this article, we’ll dive into the concept of AIaaS, clarify common misconceptions, and explore a practical solution using some popular programming languages and frameworks.
Beyond the Definition
As mentioned earlier, AIaaS focuses around the delivery of AI power through cloud-based platforms and services. It enables organizations to access and utilize AI technologies without the need for in-house expertise, infrastructure, or significant investment. Which, all in by itself, can save countless of development and research hours. AIaaS includes a wide range of AI services, such as machine learning, computer vision (images), natural language processing (NLP), and even speech recognition, each offered by specialized cloud ad AI service providers.
What could be perceived as positive in having such powerful tools delivered and integrated in our own solutions (other than the already mentioned that is)? Some additional benefits can be one or more of the following:
- Scalability: AIaaS platforms are designed to handle variable workloads, allowing organizations to scale their AI capabilities as needed
- Reduced costs: When usinAIaaS, businesses can only pay for the services they use, without the need for new investments in additional work hours and/or any hardware equipment
- Experiment: Companies can experiment with different AI technologies and easily switch between them as requirements change. No need to tie oneself with any particular solution
- Race to the market: Pre-trained AI models and services and help companies to implement their solutions and deliver them to the target audiences much faster
- Access to new technologies: AIaaS is something that is still being carefully explored and continuously developed and any company can have the front-row seat to new updates and solutions emerging from AIaaS providers
AIaaS works by offering AI capabilities through APIs or web interfaces, which developers can use to integrate new AI functionalities into their applications and services. AIaaS providers typically offer pre-made AI models, algorithms, and tools, which have been trained on versatile and vast amounts of data. Organizations can also train custom models using their own data, depending on the service provider capabilities. In the past few years, we witnessed AIaaS solutions slowly growing their market presence, fueled by the increased demand for AI solutions and the maturity of AI technologies. We are far of the old language models and flaky AI solutions, aren’t we? Some major cloud providers, such as Google Cloud AI, Microsoft Azure AI, and Amazon Web Services (AWS) AI, of course make a large portion of the existing AIaaS landscape with their wide range of AI services and tools. In addition to these large providers, there are numerous specialized AIaaS companies targeting specific industries or use cases, such as healthcare, finance, and marketing.
Common Misconceptions
As with any new or upcoming technology or solution, there are bound to be some misconceptions surrounding them. Misconceptions regarding some technologies can take on a life of their own and spread beyond the fenced safety of uninformedy. We can only remember situations like the Y2K problem. So, here are some of the misconceptions surrounding AIaaS:
- AIaaS is here to replace human expertise: This is common one whenever AI, in general, is mentioned, isn’t it? AIaaS is mainly designed to support and enhance developer experience, not replace it. While AI can automate repetitive tasks and provide valuable insights, it still requires a level of human interaction and guidance in order to make critical decisions and ensure ethical considerations are addressed. AI models can sometimes produce unexpected or biased results, and human oversight is necessary to ensure that AI-driven decisions align with company goals and values.
- AIaaS can replace data scientists: This is a continuation on the previous point, and everything mentioned there can be applied in this case as well. While AIaaS simplifies the process of integrating AI capabilities into various apps, data scientists still need to claim an important role in the development and implementation of those solutions. Data scientists have the needed domain knowledge and expertise to choose the right algorithms, models, and data analytics tools to interpret the obtained data. This is essential for the success of any AI projects. While AIaaS can streamline some of the the work currently occupied by data scientists, it does not replace their knowledge and judgment.
- Everything can be achieved with one solution: AIaaS platforms offer a wide variety of AI tools and services designed to cater to different industries and use cases. Every company should carefully evaluate their specific requirements and choose the appropriate AIaaS service that meets their needs. The most common scenario could be tailoring and customizing of AI models and algorithms or joining multiple AI services in order to deliver on the requirements set by some use case.
- Everything is a security risk: While AIaaS does introduce new security concerns, many AIaaS providers place a strong emphasis on security and privacy of their services. Providers tend to follow industry best practices in securing their infrastructure and protecting User data. Since everything about this technology is new, mistakes are most likely to manifest themselves from time to time, but each and every mistake should lead to more precise improvements and less errors in the future. Companies are presented with security measures implemented by AIaaS providers and it’s up to them to analyze and choose those that meet their security criteria. It’s always recommended to use additional, abstract security layers in order to have a bit more confidence that the security measures in place will suffice.
These are just some of the most saturated misconceptions surrounding AIaaS at the time of this writing, and by looking a bit deeper into them, we can better understand the true potential of this new tool and make informed decisions for all of our existing or upcoming projects when regarding the integration with any AIaaS.
Use Cases in the Industry
While it might be early to form an extensive case study of the whole AIaaS ecosystem since it might not be seen as a go-to solution by many, there are existing use cases and examples where this technology has already made strides in the industry. These are just some of the examples where existing AI solutions were utilized in order to enhance the overall product in some kind of way.
- Medicine and healthcare: Early on, it was shown that AI has the needed potential to revolutionize healthcare by enabling the development of diagnostic tools, treatment plans, and remote patient monitoring solutions. Some AIaaS medical image analysis services can help in identifying diseases and anomalies in medical images, such as X-rays, MRIs, and CT scans. Companies like Zebra Medical Vision provide AIaaS solutions specifically tailored for healthcare applications.
- ChatBots: What company doesn’t use some form of ChatBots today? OK, this might be an exaggeration, but chatbots seem to be everywhere now, don’t they? Nevertheless, AIaaS can be used to create intelligent chatbots for handling customer inputs and queries, provide personalized support and even automate tedious tasks. Natural language processing (NLP) and machine learning (ML) services can be integrated into chatbots in order to better understand customer queries, generate responses, and even advance complex issues to human company personnel. Google, for example, has its own solution for a very true-to-life chatbot in the form of Dialogflow,and it can be easily integrated with existing customer support systems.
- Content writing and content moderation: I’ve already used, for example, OpenAI’s ChatGpt service in various of ways, and to even enhance my own articles. This only shows that AIaaS can be utilized for automating content writing and moderation on social media platforms, comment boards, and websites, making sure that any user-generated content adheres to community guidelines and policies. There are AI content moderation services that can with a great deal of success analyze text patterns, images, and even video content in order to identify and filter out inappropriate content, based on whatever criteria is needed of it. Google Cloud Vision is one such service that offers pre-built content moderation and it can be integrated into existing products. On the other hand, JasperAI is one AIaaS platform that offers content creation and copywriting services tailored to any company’s needs that is less likely to be detected as AI-generated content by other AIaaS’s.
- Data analytics: AI solutions can be used to extract valuable insights from large volumes of data, enhancing the decision-making and overall business performance. Data processing can be automated with producing shorter feedback loops when trying to identify trends and patterns on the market and potentially predict future outcomes.
- Marketing to a target audience: It can be very tedious to tailor content specifically made for each and every costumer of our services, bit that’s required nowadays in order to stay competitive on the market. AI-driven solutions can help and enhance the marketing jobs by providing personalized customer experiences, targeted advertising, and behavior analysis. AIaaS-based NLP and ML services can analyze customer data in order to identify preferences, predict behavior, and create tailored marketing campaigns (and content). IBM Watson Campaign Automation is one such solution, tailored for businesses to step up their marketing game.
- Quality control: Improving manufacturing processes and quality control can be a difficult enough task, but by automating anomaly detection, optimizing task scheduling, and predicting machine failures with the usage of AI, we can definitely mitigate those concerns. The cost-to-effectiveness can be proven significant. Computer vision services can be used to scan different products for defects, while ML services can be used in the same way to analyze various sensor data to identify patterns and anomalies that may point to potential (upcoming) issues. As an example, Sight Machine offers specialized solutions for various industries by transforming the manufacturing processes.
These are just some of the existing use cases where various AIaaS solutions have been implemented and where the same solutions have enhanced existing work pipelines. The potential is definitely there to introduce this new technology and services into other fields.
A Practical Example? Why not?
We already covered some of the basis surrounding AIaaS and those familiar with SaaS (software as a service), pretty much know what this new AI provisioning is all about. But, can we showcase an example AIaaS solution with real, down-to-earth, technologies and frameworks, one of our own liking? Let’s see what we can do, shall we?
Problem Statement
First off, we need a valid use case for our AIaaS solution and since this is only an introduction article about AIaaS, we can focus on the vary basics. In this section we’ll design a profanity filter for User submitted textual data. I should note that this won’t be a step-by-step tutorial.
Backend
Our backend will be built around Python, PyTorch and Flask. We’ll train our profanity model using bi-directional long-short term memory (BiLTSM) neural network on a very plain CSV dataset. It should be noted that the success and accuracy of our profanity filter detection service greatly relies on the size and variety of the dataset on which the model will be trained on. The dataset contains only two columns, “text” and “label” for matching a given String data to the Boolean flag (0,1).
To get started, let’s make sure that we have the right dependencies installed on our host machine:
pip3 install Flask flask-cors torch torchtext spacy pandas sklearn
python3 -m spacy download en_core_web_sm
With all dependencies installed, we can proceed with creating our first python class for pre-processing the given dataset.csv file:
import pandas as pd
from sklearn.model_selection import train_test_split
from torchtext.data.utils import get_tokenizer
from torchtext.vocab import build_vocab_from_iterator
import torch
import spacy
from torch.utils.data import Dataset
class TextDataset(Dataset):
def __init__(self, data, tokenizer, vocab):
self.data = data
self.tokenizer = tokenizer
self.vocab = vocab
def __len__(self):
return len(self.data)
def __getitem__(self, idx):
text, label = self.data.iloc[idx]
tokens = self.tokenizer(text)
token_indices = [self.vocab[token] for token in tokens]
return torch.tensor(token_indices), torch.tensor(label)
def yield_tokens(data_iter):
tokenizer = get_tokenizer("spacy") #en_core_web_sm
for _, row in data_iter:
yield tokenizer(row['text'])
nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner"])
def preprocess_text(text, vocab): # add vocab as an argument
tokenized_text = [token.text for token in nlp(text)]
numerized_text = [vocab[token] for token in tokenized_text]
return numerized_text
def load_dataset(file_path):
data = pd.read_csv(file_path)
train_data, test_data = train_test_split(data, test_size=0.2, random_state=42)
tokenizer = get_tokenizer("spacy")
vocab = build_vocab_from_iterator(yield_tokens(train_data.iterrows()))
train_dataset = TextDataset(train_data, tokenizer, vocab)
test_dataset = TextDataset(test_data, tokenizer, vocab)
return train_dataset, test_dataset, len(vocab), vocab
if __name__ == "__main__":
train, test, vocab_size, vocab = load_dataset("dataset.csv")
print(f"Vocabulary size: {vocab_size}")
With the preprocess.py file in place, we need to create the actual model. We proceed with creating a new model.py file:
import torch
import torch.nn as nn
class BiLSTM(nn.Module):
def __init__(self, vocab_size, embedding_dim, hidden_dim, output_dim, num_layers, dropout):
super(BiLSTM, self).__init__()
self.embedding = nn.Embedding(vocab_size, embedding_dim)
self.rnn = nn.LSTM(embedding_dim, hidden_dim, num_layers, bidirectional=True, dropout=dropout, batch_first=True)
self.fc = nn.Linear(2 * hidden_dim, output_dim)
self.dropout = nn.Dropout(dropout)
def forward(self, text):
embedded = self.dropout(self.embedding(text))
output, (hidden, _) = self.rnn(embedded)
hidden = self.dropout(torch.cat((hidden[-2, :, :], hidden[-1, :, :]), dim=1))
return self.fc(hidden)
The BiLSTM class inherits form the nn.Module and uses the nn.Embedding for creating new vectors. We use the nn.Linear class to apply linear transformation and create a new connecting layer. At the end, we apply the nn.Dropout for regularizing and preventing co-adaptation in the neural network. This is almost certainly required since we have a small dataset to train our model with.
The next file we need to create is train.py:
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence
import torch.optim as optim
from torch.utils.data import DataLoader
from model import BiLSTM
from preprocess import load_dataset
def train(model, iterator, optimizer, criterion):
model.train()
epoch_loss = 0
for batch in iterator:
text, label = batch
text, label = text.to(device), label.to(device)
optimizer.zero_grad()
predictions = model(text).squeeze(1)
loss = criterion(predictions, label.float())
loss.backward()
optimizer.step()
epoch_loss += loss.item()
return epoch_loss / len(iterator)
def custom_collate(batch):
texts, labels = zip(*batch)
padded_texts = pad_sequence([torch.tensor(t) for t in texts], batch_first=True)
labels = torch.tensor(labels)
return padded_texts, labels
if __name__ == "__main__":
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
train_data, test_data, vocab_size, vocab = load_dataset("dataset.csv")
batch_size = 32
train_iterator = DataLoader(train_data, batch_size=batch_size, shuffle=True, collate_fn=custom_collate)
test_iterator = DataLoader(test_data, batch_size=batch_size, shuffle=False, collate_fn=custom_collate)
embedding_dim = 100
hidden_dim = 64
output_dim = 1
num_layers = 2
dropout = 0.5
model = BiLSTM(vocab_size, embedding_dim, hidden_dim, output_dim, num_layers, dropout).to(device)
optimizer = optim.Adam(model.parameters())
criterion = nn.BCEWithLogitsLoss()
num_epochs = 10
for epoch in range(num_epochs):
train_loss = train(model, train_iterator, optimizer, criterion)
print(f"Epoch {epoch+1}/{num_epochs}, Loss: {train_loss:.4f}")
torch.save(model.state_dict(), "profanity_model.pt")
We train the new model for one epoch (one iteration through the dataset), define the parameters needed for the BiLSTM and finally save the newly trained model into a new .pt file.
To train the model, we need to be sure that we have a dataset.csv file in our project directory at root level and that all of the dependencies have been installed. Now we can train our model by executing the following command:
python3 train.py
If we’ve done everything correctly, we should now have a profanity_model.pt file in our project directory and we can continue our AIaaS solution by defining a simple REST service.
For the API layer, we’ll utilize Flask and create a simple controller and one POST endpoint /check. We can now proceed by creating an entry-point app.py file:
import torch
from model import BiLSTM
from preprocess import preprocess_text, load_dataset
from flask import Flask, request, jsonify
from flask_cors import CORS
# Load the dataset to get the vocab object
_, _, _, vocab = load_dataset("dataset.csv")
# Define the model parameters
vocab_size = len(vocab)
embedding_dim = 100
hidden_dim = 64
output_dim = 1
num_layers = 2
dropout = 0.5
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Profanity threshold
threshold = 0.5
app = Flask(__name__)
CORS(app)
# Load the trained model
model = BiLSTM(vocab_size, embedding_dim, hidden_dim, output_dim, num_layers, dropout)
model.load_state_dict(torch.load("profanity_model.pt"))
model.eval()
@app.route("/check", methods=["POST"])
def check():
if not request.json or "text" not in request.json:
return jsonify({"error": "Missing 'text' key in the JSON request object."}), 400
text = request.json["text"]
preprocessed_text = preprocess_text(text,vocab)
tensor_text = torch.tensor([preprocessed_text]).to(device)
output = model(tensor_text).squeeze(1)
prob = torch.sigmoid(output).item()
contains_profanity = prob > threshold
return jsonify({"profanity_probability": prob, "contains_profanity": contains_profanity})
if __name__ == "__main__":
app.run(debug=True)
In this simple Flask controller, we are importing the previously created model class and preprocessor functions, load our new vocabulary and define a threshold of accuracy (we are receiving float values as return statements from our model) for the generated output values. We then load our newly created model and enable the evaluation state. We define a new check endpoint function and method (POST) by utilizing a new Flask app instance. In the function body we check for the request JSON object validity, extract any textual data, check the vocabulary for the existence of the said data and then pass it to our model, validate the probability for any profanity detected and output the result into a new JSON object.
To run our service we need to execute the following command:
python3 app.py
Our service should be up and running on localhost:5000 and we can make a simple POST request using the following JSON object in the request body:
{
"text": "Check me for any profanity."
}
Just to be complete, we can also execute the following curl:
curl -X POST -H "Content-Type: application/json" -d '{"text": "text": "Check me for any profanity."
}' http://127.0.0.1:5000/check
Frontend
For the frontend component of our new service, we chose the React framework to help us with quickly setting up a new client application. For the next steps, we need to make sure that we’ve installed NodeJS and npm on our workstations.
We can create a new React client application by running the create-react-app command:
npx create-react-app profanity_filter_client
After the new React application has been created, we can verify that everything is setup correctly by running npm start. Our React template app should be available on http://localhost:3000/ (make sure no other service is running on this port on your machine).
Next we’ll install Axios as our networking client:
npm install axios
We can now create our new ProfanityFilter.js component:
import React, { useState } from 'react';
import axios from 'axios';
const API_ENDOINT = 'http://127.0.0.1:5000/check';
const ProfanityFilter = () => {
const [inputText, setInputText] = useState('');
const [hasProfanity, setHasProfanity] = useState(null);
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState(null);
const checkProfanity = async (text) => {
try {
setIsLoading(true);
const response = await axios.post(API_ENDOINT, {
text: text,
});
setHasProfanity(JSON.parse(response.data.contains_profanity));
} catch (err) {
setError('Problem executing API call!');
} finally {
setIsLoading(false);
}
};
const handleSubmit = (e) => {
e.preventDefault();
checkProfanity(inputText);
};
return (
<div>
<h1>Profanity Filter</h1>
<form onSubmit={handleSubmit}>
<div>
<label htmlFor="input-text">Enter text to be checked:</label>
<textarea
id="input-text"
value={inputText}
onChange={(e) => setInputText(e.target.value)}
/>
</div>
<button type="submit">Check Profanity</button>
</form>
{isLoading && <p>Loading...</p>}
{error && <p>{error}</p>}
{hasProfanity !== null && (
<p>
{hasProfanity
? 'Text contains profanity!'
: 'Text does not contain profanity.'}
</p>
)}
</div>
);
};
export default ProfanityFilter;
In this component we firstly import the necessary dependencies and define our service target API_ENDPOINT (make sure that our backend service is running). Then we create a new functional React component with two functions: checkProfanity and handleSubmit. The checkProfanity function makes the API call to our backend service and passes the input data we’ll provide as our input data. We display a simple isLoading message while we wait for the response data to arrive and set the response value in our hasProfanity state. Based on the response that we receive, two messages can be displayed.
Deployment and Scaling
Containerization via Docker and Kubernetes or similar tools can be a valid approach in deploying our backend and frontend components onto dedicated hosting platforms. We can also utilize specialized platforms like Heroku or Netlify for hosting our backend and frontend components individually. These platforms can help us with monitoring, scaling, load balancing, and logging of our services. We can also significantly improve the performance and response time of our solutions with implementing some basic or advanced caching mechanisms. In-Memory data stores like Redis can help us achieve our performance goals.
It should be noted that this is a very rudimental example of what an AIssS solution can be and there’s a lot of room for improvement and expansion.
I’ve intentionally omitted the whole end-to-end solution details such as authentication, rate limiting, error handling, internationalization, styling, MLOps and tests for the sake of brevity. These all can be subject for future articles on their own.
Best Practices
Like most software solutions, the best practices surrounding AIaaS are techniques that cascade through all the different areas of software development. Techniques like screaming architecture and organized codebase, form the very foundation that we’ll base our new and interesting (preferably profitable too) solutions on. We can organize our codebase by individual features or by type, but no matter what approach we decide to go with, we should aim to consider clear separation of concerns. What does that mean? It means that we shouldn’t mix and match different types of components and classes or functions in huge blobs of code. Each type of component should have their own place in the project structure and their own package/folder to reside in. When two or more components of different types need to communicate with each other we can use dependency injection (DI) along with composition to satisfy the component relationship requirements.
Other notable practices we should adhere to can be of the following:
- Shared code style and commit message rules
- Use virtual environments to avoid dependency conflicts between two or more projects
- All sensitive information (secrets,API keys, passwords, etc.) should stay off any version control system (Git, Subversion, Mercurial). Preferably, all of that information should stay in environment configurations or special vaults when using different online repositories
- Logging and handling of exceptions
- Input validations across all layers of the system. This can be enforced by using domain layer rules
- Standardized http status codes in our API responses also leak prevention of the underlying platform (stack traces)
- Unit, integration and end-to-end tests
- Following the DRY (do not repeat yourself) and KISS (keep it simple and straightforward) principles
If we try to follow these best practices, we can truly build a well-structured and maintainable AIaaS solution. This will make it easier to scale any application, implement new features, and collaborate with other team members, ensuring that this kind of solution keeps it’s focus on the problem domain rather than combating spaghetti code or endless time in searching for underlying issues.
Architectural Recommendations
Depending on the company’s needs and long-term projection goals for a AIaaS solution, different architectures can be utilized for creating and setting an easily maintainable environment for the new product. Let’s take a look at some of the different architecture and patters at our disposal:
Clean Architecture
Those who follow my articles and posts, realize that I like to talk about clean architecture a lot. I’m certainly no expert in this field. What always fascinated me about clean architecture is its abstract nature. There is a simple rule, the dependency direction, at that’s basically it. But by trying to implement any solution around that simple rule, can be challenging to say the least, and if we try to migrate existing solutions to a clean architecture, the development pain gets higher and higher.
Just to be complete, let’s look what clean architecture means. Clean architecture is mostly a design principle that focuses on separation of concerns, maintainability, and testibility at its core. Each system layer has its own responsibility and role in the overall solution. For AIaaS solutions, we can apply clean architecture by separating the AI model, data processing, presentation and API logic into distinct layers all of which should adhere to a common business/domain rules and contracts layer. This ensures that changes in one layer have minimal to no impact on others, making it easier to update or extend your solution.
Microservices Architecture
The microservices architecture focuses around developing and deploying small, independent services that communicate with each other. The main concept around this architecture is the loose coupling between individual services, allowing each service to be developed, and deployed independently. In the context of AIaaS, we can create separate services for different AI models or functionalities and scale them independently based on business requirements.
Event-driven Architecture
An event-driven architecture focuses on producing, detecting, and reacting to events fired by different components in the system. Services communicate asynchronously using events, which can be triggered by changes made to the global system state. Other components subscribe to the events needed for their functionalities and react and update their individual states based on the defined criteria. This has a huge impact in the overall system performance and responsiveness, as well as the promotion of decoupling between components. AIaaS solutions can use this type of architecture in order to handle asynchronous processing, such as updating AI models or processing large datasets.
Serverless Architecture
I have to admit, I have the least experience with this type of architecture, but when talking about AIssS it’s nonetheless one of the more important architecture principles. A serverless architecture allows us to focus on writing code without having to worry about any infrastructure management. With serverless, we can deploy functions that automatically scale based on demand. The business model around this is to pay only for the resources we already used. This can help reduce operational costs and significantly improve scalability of systems. There are certain pitfalls to this, with some cases of high resource usage spikes that reflect on the monthly bills and as such we have to be careful how we implement our solutions. In AIaaS we can use serverless platforms like AWS Lambda or Azure Functions to deploy our AI models and services.
API Gateways
In the API gateway solutions we define a single entry point for managing and routing API requests to different microservices. This approach simplifies client interactions by providing a single interface, handling request routing, and receiving responses from multiple services. If our AIaaS solutions revolves around different microservices, we can use an API gateway to manage access control, load balancing, and caching.
It can be a bit ungrateful talking about architecture recommendations for different software solutions since they vastly depend on the use cases we require. These are just some example architectures, and not nearly all of them, that we can use to structure our AIaaS solutions around. We are also not limited to a single architecture for our solutions. Mixing and matching different architecture for different areas of our solutions can provide a significant stronghold for a system that is adaptable to upcoming market requirements. If we go with the multi-architecture approach, we should consider the maintainability and scalability of such solutions since we are adding additional complexity to them for which additional resources might be required. If this peaks your interest, I recommend looking into more advanced software architectures that could possibly be a better fit for whatever solution you had in mind.
Future of AIaaS
AI seems to be here to stay, at least for a while and it might be safe to say that we’ve only scratched the surface when it comes to the potential for this amazing new tool. As software developers we need to make informed decisions regarding future project roadmaps. AIaaS has the potential to display AI to a broader range of Users with some ease-of-access and ease-of-use techniques. Bringing down the unknown concepts surrounding this technology and making it understandable to a wide audience, can help the process of advancing AI to new, as of yet, unimaginable levels. In addition, AIaaS with affordable pricing models can make it more accessible to small businesses and individual Users.
In the world of IoT (internet-of-things) and edge computing, AIaaS solutions can provide large advantages. Specifically trained AI models for edge devices, can help in improving latency, minimize data transfers (and costs) and advance real-time processing. Certain trends can emerge in which specialized IoT devices for smart cities, help in managing power output, traffic data and waste management. AIaaS can also help in improving in the effectiveness of predicting device sensor failures and even schedule maintenance service where required. We shouldn’t also skip over the various health and wearable device data that could potentially improve the greater wellbeing of patients.
At the time of of writing this article, a few concerns have popped-up regarding AI and specific language models. One of which is undoubtedly plagiarism. Naimley, the most popular AI tools out there, use specific language models, and to be extremely crude in explaining now, ‘splice’ together various data on which the various models have been trained on, in order to create an global illusion of consciousness. A large portion of the current AI tools out there have copious amounts of data that they combine and form new, coherent data, that is context-sensitive and relevant to the request input data. The more prevalent an issue is documented in the training data, the more precise and relevant the output data produced by the AI tools is. This has a huge advantage of the current search engines since context is everything nowadays. Since the training data out of which the AI models are based on, had to come out of somewhere and not just materialize itself out of nowhere, we are witnessing large amount AI-produced content that seems to be way too similar to existing articles, codebases, books and other copyright-protected material that is stored somewhere. A large number of content creators out there, had put significant amounts of time and effort into creating their work, only for it to be fed into training models and further passed on as seemingly original content for other Users inquiries. This is definitely a two-sided coin, since the larger the input data for the models, the more unique and exact output will be produced, on the other side is intellectual property. There a certainly way around this. A lot of companies that specialize in various fields, train their AI models on their own data that is composed from years of working in the industry. AI models trained in such a way, are transparent to other intellectual properties.
AI models can also be biased! Yes, that’s a thing nowadays. There can also be a layer of discrimination if a model is trained on biased data. Look no further than our little profanity filter example from earlier. Who says what ‘profanity’ is? We can train our model in any direction we want to. AIaaS providers should be aware of potential biases when developing their AI solutions with certain ethical boundaries in place. There are already solutions or at least techniques, bespoke in addressing these potential issues. One such technique is explainable AI (XAI) that aims to de-structure the process of AI model ‘reasoning’ and analyze what goes into making a model more accurate and transparent. I’m certainly not here to pass any judgment on this subject, but mostly to showcase a potential issue when using specific AI models for the future development of new solutions.
We’ve only touched upon this in the previous paragraphs but we have seen, AIaaS solutions often process sensitive data, and it’s important to also implement a different kind of security measures. In AIaaS solutions, providers need to address issues surrounding data storage, data migrations, and authorizations. Data encryption, access roles and regular security audits can help address potential risks.
Final Notes
Many companies have already recognized the potential in AIaaS, and by jumping onto the bandwagon early on, managed to secure their place as providers of knowledge and experience for others who are about to join them.
AI as a Service (AIaaS) can be a powerful tool for organizations to make use AI capabilities without ever having to invest into their own development and research. It’s recommended for sure, but not necessary. Also the costs of infrastructure and trainings can be significantly reduced by delegating such tasks to existing providers on the market. With AIaaS, AI solutions are made more accessible, scalable and affordable. In this article, I tried to present this new concept, showcase an example solution along with a few use cases, debunk common misconceptions and even dance a bit with future ideas and concerns.
What are your thoughts on AIaaS? As always, your feedback and thoughts are greatly valued, so feel free to leave a comment, question or message me. Only with your input and feedback can I improve the quality of this kind of content.
The complete source code for the profanity filter project discussed in this article can be found on here.
Thank you for reading, and happy coding!