Defect detection with image analysis
Image classification is one of the most popular areas of AI. One application of image classification that is already seeing application in industry is the detection of quality issues on assembly lines during manufacturing. In a typical production line, components travel down the assembly line from one station to another, at the end of which a human inspector will step in to detect any problems. This is a very manual and error prone process. By using AI-driven image classification, it is possible to reduce human effort and deploy a system that automatically classifies images into pass and fail. This can greatly speed up the efficiency of the human operators in their validation process and improves the quality of the overall manufacturing process.
When preparing your data for an image classification solution, you will need two sets of images to train your model: a set of images to represent ‘pass’ examples, and a set of images to represent ‘fail’. These images can either be chosen from a generic dataset such as Kaggle or can be a set of custom images created for your business. Having a set of homogeneous images can help, for example a set of similarly sized 224 pixel x 224 pixel JPG files at the same scale resolution. Preparing the data also requires dividing the images into training and validation sets.
Build & train
Once a homogeneous and organized set of images is ready, the data can be read into an analytics engine. Neural networks and transfer learning are often a good way to handle image data in AI solutions. Transfer learning allows you to use the pre-trained models that already know how to classify an image. The existing model may perform a task very well, for example detecting people or cats. However, the task it was trained for probably differs from the specific scenario you are solving for. Retraining an existing model is usually much faster than starting from scratch so transfer learning can substantially shorten the training process. Lastly, in image classification, a neural network is sometimes paired with a secondary model to provide the final prediction. For example, a convolutional neural network architecture with 50 hidden layers can be used to process the image, pairing it with a boosted decision tree to classify the image as pass or fail.
Once a trained image classification model is ready, the model can be deployed as a web service with a REST end point. Analytics dashboards and alerting can call the web service for information and predictions. Because image processing tends to be computationally expensive, many similar solutions make use of cloud-based cluster deployments that can be scaled when needed. A service like Azure Machine Learning can assist with this, creating a rest endpoint that can be easily deployed to an Azure Kubernetes cluster for massive-scale out