SabaKore

Home / Articles / AI guides

How to Think About Running Image Recognition AI on a VPS

Image recognition, which identifies what appears in a picture, is a lighter workload than image generation. This article explains why, and what a realistic VPS setup looks like.

Ren, a junior infrastructure engineer

Ren

I heard image generation needs a GPU. Is image recognition, where the AI works out what's in a picture, just as heavy?
Procura, a cloud AI robot who explains

Procura

Those two are worth separating. Generation creates a new image, while recognition decides what an existing image contains, and the amount of computation is very different. Depending on the model, recognition can run at a practical speed even on a CPU.

Why recognition is lighter than generation

Generation repeats a calculation dozens of times, building an image from noise bit by bit. Recognition examines one existing image once and answers "what is in it?" Because the number of repetitions is smaller by orders of magnitude, the computing resources needed are smaller too.

Where recognition is used

  • Checking whether images posted by users violate your rules
  • Classifying the type of product shown in a product photo
  • Detecting the text regions in an image of a document (actually reading the text is a separate process)
Ren, a junior infrastructure engineer

Ren

So it could be used for checking images on a posting site, too!
Procura, a cloud AI robot who explains

Procura

It really is used that way a lot. Having people check every posted image is too much work, so a realistic setup has two stages: the AI makes a rough first judgment, and people review only the suspicious ones.

Setup when running on a VPS

  • Separate the process that uploads images from the process that classifies them
  • If classification takes time, design it to be asynchronous and apply the result afterward
  • Know what the model is good and bad at, and decide in advance how to handle uncertain results
Ren, a junior infrastructure engineer

Ren

Is it okay to apply the AI's judgment automatically, as is?
Procura, a cloud AI robot who explains

Procura

That's where I'd ask you to be careful. When a wrong call has a big impact, such as wrongly deleting a legitimate post, don't make the AI's judgment the final decision. It's safer to leave room for a person to check.

Consideration for the images you handle

If you send images posted by users to an external classification API, check in its terms how those images are handled. This matters especially for images that contain people: you need to understand how long they are stored and whether they are used for training before you use the service.

Ren, a junior infrastructure engineer

Ren

What should I do if the accuracy feels insufficient?
Procura, a cloud AI robot who explains

Procura

First, review whether the model you're using suits your purpose. If a general-purpose model isn't enough, simply switching to a model tuned on data closer to your subject can sometimes improve things. Before retraining a model yourself, it's worth trying the existing options.

How to handle results you aren't confident about

Many image recognition models return a value showing how confident they are, along with the result. If you keep processing automatically while that value is low, you end up acting wrongly on a wrong judgment. If you prepare a branch in advance that stops automatic processing and sends the item to a person when confidence falls below a certain level, you can keep the impact of misjudgments small.

  • Check whether you can get the confidence level along with the result
  • Send low-confidence results to a person instead of processing them automatically
  • Adjust the threshold by trying it on your actual data
Procura, a cloud AI robot who explains

Procura

Image recognition isn't flashy, but it ties directly into practical work. Don't give up just because you have no GPU. Try a lightweight model first.
Ren, a junior infrastructure engineer

Ren

It's not as heavy as generation. So classification is realistic on a VPS, too.

This article is translated from the Japanese original. If the two differ, the Japanese version is the one we keep up to date.