COMPUTER VISION IMAGE MODERATION ENGINE

COMPUTER VISION / DEEP LEARNING / SECURITY

ABOUT THIS PROJECT

An open-source, high-performance image moderation gateway that integrates deep learning computer vision models into an asynchronous Discord bot infrastructure.

The system utilizes a custom-trained CNN along with pre-trained architectures (such as MobileNetV2, ResNet50V2, and VGG16) fine-tuned for high-speed binary image classification. To demonstrate visual classification safely for public audiences, the model was trained using cat images to represent the harmful/unsafe class, validating the exact math and pipeline of content moderation filtering. The backend dynamically extracts the target model input shape at launch and resizes incoming attachments on-the-fly using Pillow before tensor normalization.

To ensure zero event-loop blocking, the system implements a decoupled asynchronous MySQL pool (`aiomysql`) alongside a strict TTL caching layer (`TTLCache`) protected by asyncio locks to prevent race conditions during high-volume server moderation.