Deploy Keras neural network to Flask web service | Part 9 - Information Privacy, Data Protection
text
Information privacy and data protection - Keras neural network deployment
In this episode, we're going to talk about key points to consider when deploying a neural network: information privacy and data protection.
So far, we've covered several bases for deploying a deep learning model to a web service, and then calling or interacting with that model from front end applications, like a web app, Powershell, or bash. We're going to now take a step back and talk about how the topics of data privacy and data protection fit into the conversation when we're deciding on deployment options.
With our current setup, our model runs in the backend, in a web service. When we want to get a prediction from the model, we send our data over the network via HTTP from the front-end application, whatever that may be, to the web service.
If our front end application and back end web service aren't on the same network, then that data is going to be traveling over the internet.
Actually, if you've ever tried out a deep learning or neural network demo online somewhere, this is likely how it's working. You, as a user, supply some type of data through a web application, or maybe even a mobile app, and that data is being sent over the internet to the company's or organization's model.
So with this in mind, at a high level, understand that we need two things to make this happen, a model and data. We have to bring these two things together in order to get anything useful, like a prediction.
This can be illustrated as a typical client-server relationship. With what we've seen so far, we've observed how to bring the data from the client to the model on the server. We haven't discussed how, if it's even possible, we could bring the model to the data, but more on this topic in a bit!
Consider the data we've been working with in our examples, arbitrary images of cats and dogs. The fact that this data is being sent over a network or over the internet to reach our model really isn't that concerning since it's not sensitive data.
But, what if it was sensitive data? Then what?
Considerations for sensitive data transfer
What if, instead of sending cat and dog image data to our model, users were sending personally identifiable data, or healthcare data, or financial data, for example.
Well, then we'd need to be more careful. We can't be careless when handling sensitive data. For this, we need to put in the effort and the research to understand how to handle and protect the specific type of data we're working with when sending or retrieving it over the internet.
There are several laws and regulations, differing by data type and differing by country, for what types of protocols should be followed to handle sensitive data. So, while it is a lot to take in, this is a serious consideration.
Going back an earlier part of our discussion, remember, to do anything, we have to bring the data and the model together. We know all about how to bring the data to the model, and that's where all of this data privacy discussion comes into play.
But, what about the other way around, bringing the model to the data?
Keeping data with the user
What if rather than having data travel over the network or over the internet to reach a model, wherever that model may be, the data instead stays local to the front end application, and the model is sent to run within that frontend app.
Think about when we used the front end web application running in the browser on the user's local machine to send images of cats and dogs to the model running in the backend web service.
With the alternative we're talking about now, the data would not leave the client application, but instead, the model would be sent to the client, and would run right inside the browser too. So the data could be directly passed to the model within the browser, never needing to travel anywhere.
Turns out we can do just that! That's exactly what we're about to do in the upcoming episodes s using TensorFlow.js, TensorFlow's Javascript API. Lots more to cover on that, so stay tuned, and I'll see ya in the next one!
quiz
resources
updates
Committed by on