
Build a production ready ML app with AWS SageMaker notebooks, the built-in image classifier, data prep, Kaggle API access, S3 storage, and secure deployment.
Explore building a production ml web app with mongodb, express, react, next, and node.js; deploy to digital ocean, enable authentication, image inferences for pneumonia, and scalable logging and infrastructure.
Join this hands-on introduction to deploying machine learning models to production, covering scalability, robustness, and security for enterprise-level image classifier projects.
Set up IAM accounts and policies to onboard new users with least privileges, avoid root access, assign administrator access, and provide S3 access.
Set up and configure Amazon SageMaker notebook instances to run Jupyter notebooks, choose memory, CPU, and GPU, manage S3 access and roles, and explore pricing and free tier options.
Learn how to migrate from SageMaker Studio Classic to JupyterLab, set up a private JupyterLab space, and leverage preinstalled PyTorch and Transformers for faster notebook work.
Launch SageMaker Studio to start a Jupyter notebook with a data science Docker image and Python 3 kernel, choosing an instance such as t3.medium for efficiency or GPU-enabled for training.
Learn budget optimization by monitoring billing and shutting down SageMaker instances after use, and navigate service limits with support cases for GPU training access.
Learn to use the Kaggle API to download any dataset directly into a SageMaker notebook, then unzip and organize it into a data folder for quick machine learning work.
Explore a chest X-ray pneumonia dataset from Kaggle by inspecting train, test, and validation folders, viewing normal and pneumonia images, and performing exploratory data analysis.
Always shut down your cloud instances before leaving your environment to avoid charges, since even small hourly costs can add up when deploying a production machine learning model.
Visualize random chest x-ray images from train, test, and validation folders, selecting pneumonia or normal cases to verify labeling and data readiness for a SageMaker image classifier.
Clarify data splitting by confirming that train, test, and validation directories contain unique images from the same dataset, ensuring no image repeats across splits.
Organize your image dataset by creating a unified train folder and labeling pneumonia and normal images, then resize to 224 by 224 for transfer learning with a pre-trained model.
Explore how the color maps in my plot lib affect image encoding and why saving chest x-ray images in grayscale is essential for reliable model training.
Explore loading and inspecting images with Pillow, identify JPEG and PNG formats, and convert grayscale and RGBA images to RGB for a 224 by 224 input via SageMaker preprocessing.
Resize each image to 224 by 224 and convert to grayscale. Save into train, test, and validation folders, naming files to preserve pneumonia and normal labels with gray color mapping.
Verify grayscale images are resized to 224 by 224 across train, validation, and test sets, consolidate files into the train folder, and confirm dimensions with quick checks.
Visualize dataset balance for pneumonia vs normal images by building a three-column dataframe from train, val, and test folders, including file path, and plotting with seaborn.
Create a pandas data frame for chest x-ray images by parsing train, test, and validation folders, building category, lung condition, and file name lists, then assemble the data frame.
Create three bar graphs with seaborn to count x-ray results by dataset type (train, test, validation), reveal unbalanced training data, and improve plot styling for clearer numbers.
Enhance three bar graphs by adding on-bar labels that show class counts, positioning labels on each bar for clear comparison in the validation data set.
Create trained lst files for training and test data, listing index, zero-based class labels, and image paths for binary and multiclass classifiers; Sage Maker uses them during training.
Create a pandas data frame that mirrors an .lst file for chest x-ray data, labeling pneumonia or normal, mapping image paths for train and test sets, ready for S3 upload.
Create a function to save train and test data frames as LSD files with tab separation, index true, header false, then verify unique IDs and labels before creating S3 buckets.
Create and configure an S3 bucket, link it to the speechmaker notebook, and upload train and test images plus train and test LSD files using Python and Boto3 in AWS.
Verify uploads to the S3 bucket, check train and test folders for pneumonia and normal images, correct mistakes, then begin training and hyper parameter optimization.
Configure the estimator for training by pulling the image classifier docker image from aws ecr, setting the sage maker session and execution role, and selecting a single ml.p3.2xlarge instance.
Count training images to guide hyperparameter tuning and configure the image classifier’s hyperparameters, including image shape and two-class transfer learning, with early stopping and a learning rate scheduler.
Learn to configure dynamic hyperparameters for model training in sage maker: set learning rate as a continuous range, choose batch sizes 8/16/32, and select optimizers like sgd or adam.
Set up data augmentation with crop color transformation and random rotations to reduce overfitting on a pneumonia dataset; rerun the cell to save settings and avoid changing the learning rate.
Set the objective to validation accuracy and maximize it, configure five hyperparameter tuning jobs with one parallel job, and use bayesian search in the tuner to learn from prior runs.
Delete the train and test folders to avoid elastic file system costs, leaving only validation. Then start and monitor the tuning training job in CloudWatch logs.
Explore training multiple synchronous jobs with 15 epochs, achieving 84–85% validation accuracy; use SageMaker training hyperparameter tuning to identify the best model and preview enterprise-level adjustments like 50 epochs.
Deploy the best model in a SageMaker notebook, run local inference, and set up an endpoint for internet access to enable online predictions.
Deploy a SageMaker endpoint for inferences, perform local validation data tests, monitor cost and manage deployment by deleting and redeploying when not in use.
Construct and evaluate a pneumonia detector by building a confusion matrix and classification report from true and predicted labels, analyzing false positives and false negatives in chest x-ray images.
Create and interpret a classification report to measure precision, recall, and F1 score from true/false positives and negatives, and iterate model endpoints in SageMaker.
Learn to stop idle endpoints to save costs by deleting a SageMaker endpoint, redeploying later via a Jupyter notebook, and integrating with lambdas for production ML deployment on AWS.
Create a lambda function in Python 3.9, attach a custom IAM policy, and configure an API gateway to trigger the lambda and return endpoint inference.
Build a lambda function to invoke a deployed deep learning endpoint and return the inference. Expose the result via an api, handle base64 image input, and test with postman.
Create a rest api in AWS API Gateway to host a pneumonia prediction endpoint, connect a Lambda function, enable binary image input, and deploy to production for Postman testing.
Learn to wire API gateway to a named lambda endpoint by copying the endpoint name, deploying changes, and testing the endpoint with Postman to ensure the correct lambda is invoked.
SageMaker automatically resizes inference images to 224 by 224, so you can test nonstandard image sizes with your endpoint using Postman in the next video.
Test your lambda endpoint via api gateway and postman by sending base64 encoded images and validating responses, logs, and performance before deleting the SageMaker endpoint to avoid charges.
Learn how to configure lambda concurrency with reserved and provisioned options to serve multiple requests simultaneously. Balance cost and latency, and understand when to publish a version for provisioned concurrency.
Set up a MongoDB atlas database for the marine app by creating a free cluster, configuring username/password and IP access, and retrieving the Node.js connection string for environment variables.
Download the medicated backend and medical front end repositories, unzip them, and follow the readme directions to set up an end-to-end machine learning app with authentication, MongoDB, Express, and React.
Launch and test a full stack app locally by configuring backend and frontend with separate ports, setting up a proxy in Next.js, and running development servers before deployment.
Set the Axios URL to the deployed api gateway endpoint by updating the backend predict endpoint with the correct URL, ensuring production inference works.
Walk through a MERN app walkthrough part 1, covering login and registration with MongoDB, Mongoose schemas, bcrypt hashing, and front-end routing with context API and protected routes.
Redeploy the endpoint in SageMaker Studio by running bucket script, algorithm image script, get execution role script, and model script, then run endpoint script to continue.
See how a React front end uploads images, converts them to base64, and posts to a Node.js backend via /api/predict on AWS, with CSRF token protection.
Learn how auto scaling creates multiple endpoint instances to handle high request concurrency with lambda concurrency in a production ml deployment on AWS.
Deploy and validate the endpoint by testing pneumonia predictions on images, then configure SageMaker auto scaling: target 15 concurrent requests for 5 minutes, max 3 instances, with a scale-out cooldown.
Secure the endpoint by configuring an api gateway resource policy to allow only specific IP addresses, deploy the api, and verify access is blocked for unauthorized clients.
Secure your endpoint by applying a resource policy for your IP and deploying an API stage called allowed IP, then test image classification with a 96.8% pneumonia probability.
Begin the deployment phase by creating a DigitalOcean account, claim a $100 credit, and prepare to deploy your web application to DigitalOcean with Google sign-in.
Set up a droplets server on DigitalOcean using the basic $12/mo plan with a $100 credit for two months, using password authentication in Frankfort, then deploy.
Master secure access to a DigitalOcean droplet by creating an admin user, enabling sudo, disabling root logins, and verifying login via ssh with the provided ip.
Install node version 16 (16.14.0) and npm to avoid compatibility issues with node 17, using admin rights and sudo apt install, then prepare front-end and back-end deployments to digital ocean.
Create two GitHub repositories, backend and frontend, initialize git in each, add all files, and push while ignoring node_modules and EMV files; then clone them to droplets.
Clone backend and frontend repos from GitHub into DigitalOcean droplets, install node modules, and configure Nginx to serve the api on port 8000 and react app on port 3000.
Create and configure env files on both server and client, set the API endpoint with the correct IP, and install and start MongoDB on Ubuntu to support the backend database.
Start the backend with PM2 and verify the API is online; then build the client app and prepare for deploying a production machine learning model with AWS and React.
Test the frontend by logging in and uploading an image, and observe that inference requires API gateway IP access; next, configure the site's IP to authorize the endpoint.
Update the api gateway resource policy with the new allowed ip, redeploy the api, and validate the digital ocean endpoint by running inference for pneumonia probability.
Test the model on random chest x-ray images from the internet to classify pneumonia versus normal, highlighting high-confidence predictions and testing beyond pediatric training data.
In this course we are going to use AWS Sagemaker, AWS API Gateway, Lambda, React.js, Node.js, Express.js MongoDB and DigitalOcean to create a secure, scalable, and robust production ready enterprise level image classifier. We will be using best practices and setting up IAM policies to first create a secure environment in AWS. Then we will be using AWS' built in SageMaker Studio Notebooks where I am going to show you guys how you can use any custom dataset you want. We will perfrom Exploratory data analysis on our dataset with Matplotlib, Seaborn, Pandas and Numpy. After getting insightful information about dataset we will set up our Hyperparameter Tuning Job in AWS where I will show you guys how to use GPU instances to speed up training and I will even show you guys how to use multi GPU instance training. We will then evaluate our training jobs, and look at some metrics such as Precision, Recall and F1 Score. Upon evaluation we will deploy our deep learning model on AWS with the help of AWS API Gateway and Lambda functions. We will then test our API with Postman, and see if we get inference results. After that is completed we will secure our endpoints and set up autoscaling to prevent latency issues. Finally we will build our web application which will have access to the AWS API. After that we will deploy our web application to DigitalOcean.