Overview
Content moderation is considered very important for organizations, especially for social media, advertising, and education. Any organization requires special analysis for media.
The basic definition of content moderation is reviewing media and content to ensure it complies with the standards and guidelines set by the organization.
Achieving that manually will be very difficult, since you are going to review every content that is uploaded by a user, and it's even impossible if we are talking about a large user base platform.
In this article, we will discuss deploying a content moderation solution on AWS and how to utilize different AWS services to achieve this.
First, we will break down our core components.
Core Components
- User
- Content
Then we will have our high-level design. Keep in mind that you can have different architectures for this, and you are not only restricted to this.
Architecture
Core Services
- S3 Bucket --> It will be our storage services which will be used to store our content.
S3 has a feature called S3 event notification, which allows S3 to trigger events in case of uploading, deleting, or replication events. You can find a list of types of events here and the destinations that can receive this notification.
Lambda Function --> it will be used to put messages contains object details to SQS whenever any object uploaded to S3 and another one will pull SQS messages and triggers Rekognition API to start the content moderation process.
SQS --> It will be utilized to decouple upload and moderation process from each other to avoid bursts and spikes
Rekognition --> The actual moderation process happens here since AWS Rekognition is an AI service that is used for an image/video analysis, the results will be stored in another bucket
Sequence Diagram
The below sequence shows how the flow should be
The user will upload content to an S3 bucket. In the real world, the S3 bucket is the storage for the front-end layer, which can be a mobile or web app. I just used S3 directly for simplicity and explanation.
An S3 event notification will be triggered once an object is uploaded, and the destination will be a Lambda function.
The Lambda function will send a message containing details about the uploaded object to the SQS for decoupling the architecture.
A moderator Lambda function will pull the message from SQS and trigger the Rekognition API (DetectModerationLabels). More info here related to label categories.
The results will be stored into another S3 bucket for better isolation.
Conclusion
For sure, content moderation is used across nearly all social media and advertising organizations, and it became easier with the help of AWS's different AI services. You don't need to have experts in AI or machine learning to deploy your own content moderator, just go through the AWS documentation.
Hope this article helps you, and please let me know if you have any comments.
Top comments (0)