Serverless deployment of a KNN image classifier on AWS Lambda using Docker and SAM
Traditional cloud deployments like AWS Elastic Beanstalk require always-active provisioned resources (EC2 instances, Elastic Load Balancers) even when idle, burdening developers with infrastructure management overhead and unnecessary cost.
The previous approach using AWS Elastic Beanstalk was largely automated but kept servers provisioned continuously, making it less cost-effective for infrequent ML prediction workloads.
A KNN classifier achieving 96% cross-validation accuracy on MNIST was successfully containerized with Docker and deployed as a serverless AWS Lambda function, accessible via an API Gateway endpoint and invocable on demand.
Frequently asked questions
What did this team achieve with this AI workflow?
A KNN classifier achieving 96% cross-validation accuracy on MNIST was successfully containerized with Docker and deployed as a serverless AWS Lambda function, accessible via an API Gateway endpoint and invocable on de…
What tools did this team use?
AWS SAM, Docker, AWS S3, API Gateway, boto3, Amazon ECR.
What results were reported?
KNN cross-validation accuracy: 96% (source-reported, not independently verified).
What failed first in this deployment?
The previous approach using AWS Elastic Beanstalk was largely automated but kept servers provisioned continuously, making it less cost-effective for infrequent ML prediction workloads.
How is this workflow AI workflow structured?
Train and serialize KNN model → Store test data in S3 → Containerize and deploy via SAM → HTTP POST triggers Lambda → Download features from S3 → KNN inference and response.