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

Procura
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

Procura
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

Procura
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

Procura
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

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