Harnessing AI for Video Content Moderation
Location:

usa

Collaboration:

2022

Industry:
Expertise:

Technologies:

fastapi logo
redis logo
aws logo

About the Client

Our client was an international IT company Yellow Media with which we cooperated under the white-label model. The company provides services to clients from various industries and markets, and develops unique, effective, and innovative software products for leading enterprises. Accordingly, they provided our Data Scientists as outsourced specialists for their client.

Business Context

Date Amazinum scientists performed a white-label task. YelowMedia’s client planned to create a certain social network for video content. Accordingly, end users have to upload videos that do not violate the policies of the social network. Such requirements usually include checking for violence, explicit nudity, sexual situations, etc.

Tasks for Data Scientists

Among the main tasks that the client set before our specialists were:

  • The process of checking videos for prohibited content such as violence, explicit nudity, sexual situations, etc.
  • Setting technical conditions for videos such as:
  • Uploading short videos up to a minute
  • Parallel processing of a large number of videos

Amazinum Data Scientists in Action

Before starting the task, our specialists researched the capabilities of the model to determine whether they could train a custom model or use one of the existing services. Training required data – a labeled video dataset. However, since the client did not provide the necessary data, Data Scientists analyzed cloud services that would provide an opportunity to use the existing proprietary model. In conclusion, specialists chose AWS Rekognition. After gaining access, they made an API that would use this service and provide conclusions on moderation.

The solution provided by our Data Scientists consisted of two parts.

To handle the flow of simultaneous requests from the client, our developers have developed an API that works asynchronously. It runs separate preprocessing for video, as AWS recognition has clear standards for video characteristics, to run video moderation jobs. Such characteristics are:

  • Video codec H.264
  • Extension of MP4
  • Additional custom characteristic – maximum resolution of the video (we resize the video for faster analysis since the experiments show that the resolution affects the running time of the job)

After processing, the video is sent to S3 (Amazon bucket storage) and added to the Redis queue waiting for the analysis.

Amazinum Data Scientists also developed a background script that checks the queue every second. Thus, the whole process went like this:

The script looks at the status of jobs for videos processed through Rekognition and checks their completion status. If the analysis is finished, it saves the results in the Redis, frees the queue, and runs the Rekognition Content Moderation job for a video from the waiting queue. In this way, all videos that were added via the API are processed as soon as possible by incoming order.

Challenges for Amazinum Data Scientists

During the execution of the task, our specialists encountered certain difficulties:

Latency – The process of publishing videos goes a long way and processing speed is a crucial metric for a client. During the processing workflow, we get links to user videos that are stored on local storage, perform preprocessing, upload them to cloud storage, run the analysis in Rekognition, process the results, and save them to Redis. This way we face the latency problem because we get many intermediate steps which reduce the throughput.

As a result, the architecture was designed modularly – split into two major parts. As well as parallelizing everything as much as possible. Separate processes for separate modular tasks.

Service Limitations and Scaling – AWS Rekognition has a quota for the number of videos that can be processed simultaneously. The service allows you to launch 20 jobs, but we aim to handle a constant stream of customer requests.

Accordingly, we designed an architecture with queue management that will work around such limitations. We aimed to develop a solution that can scale easily by demand due to the nature of the business domain which is also one of the advantages of using assembly with cloud services. Also, the service allows the client to contact AWS Support to increase the quota.

Monitoring Efficiency – AWS Rekognition starts the analysis in the form of Jobs, accordingly, it does not give information about when the analysis ended.

The monitoring problem was taken into account during development. The solution was designed to address this correspondingly, flexibly, and efficiently.

Review

YellowMedia logo

AI Development for IT Company

Their easy solutions to complex problems, pleasant communication, and the team members’ responsibility are impressive.

Amazinum impresses the client with their ability to provide easy solutions to complex issues. Their responsible team manages the project efficiently, ensuring everything is at a high level. They also facilitate pleasant communication through online meetings.

Content:

Vitaliy Fedorovych

CEO, Data Scientist at Amazinum

Vitaliy Fedorovych contact us photo

Hello there!

Amazinum Team assists you through all data science development processes:
from data collection to valuable insights generation.
Get in touch with our CEO and Data Scientist to figure out the next move together

Contact Us

Click or drag a file to this area to upload.

This will close in 0 seconds

Book a FREE consultation today and get

a 10% discount on your next project

You will receive:

  • A qualified specialist with experience in your field
  • High-quality and fast solution for your business
  • Convenient models of cooperation from POC to a full-fledged project

Leave your email and we will contact you

No limits to solutions with Amazinum