Machine Vision for Defect Detection

Selecting fruits and vegetables in a sorting and packing facility is incredibly complex. You must consider size, color, defects, and more—for everything. Moreover, you have to do this extremely quickly to ensure the quality of the product when it reaches the consumer. In the past, this was all done by hand, with scores of humans manually sorting and packing fruit. Now, this process is streamlined by machine vision in large and small warehouses. By using high-quality optical illumination platforms, image acquisition hardware, and finely tuned software, industrial machines can obtain the high-quality images required for accurate defect detection. In this way, machine vision greatly improves efficiency, quality, and reliability.

The Intricacies of Defect Detection

Different retailers and customers have different requirements for defect detection. Furthermore, food products, in particular, have varying lifespans based on their condition at the point of inspection. As if that isn’t complicated enough, classifying defects is rather subjective when left to the human eye. And all of that must be done very quickly, especially in relation to packing houses. Complete precision is not required, unlike in the medical industry, but the process does have to be fast and reliable. We’re talking about one conveyor processing up to fifteen apples per second; multiply that by six or more lanes and multiple machines, and tons of product are being processed every hour, every day.

The conditions in industrial settings also create a big challenge for defect detection. Packing houses are very rough environments for sensors, owing to dust and variations in temperature. Machines have to operate in temperatures above 40°C, and they have to be able to function when particles are in the air.

How Machine Vision Improves Defect Detection

Today, machine vision is one of the key technologies used to replace manual visual inspection for defect detection. The systems automatically receive and process images of real objects through optical devices and sensors. While human perception is limited to the visible side of the electromagnetic spectrum, machine vision technology covers the whole spectrum, from gamma rays to radio waves. Combined with image processing algorithms, machine vision is perfectly tasked to detect defects at a level of accuracy, scale, and speed impossible with traditional alternatives.

Machine vision’s ability to improve defect detection efficiency, enhance real-time performance, and reduce manual processes make it a vital technology for large-scale industrial processes. As such, machine vision has emerged as the main technology involved in intelligent manufacturing. These days, cell diagnostics are in the software for everything—voltages, cameras, signals, pulses, missing solenoids, and more. It all comes down to the ability to incorporate numerous self-diagnostics that can flag a mechanical or electronic engineer when required to ensure the ongoing effectiveness and reliability of the system.

The Technology Behind Machine Vision Systems

Most visual inspection systems in industrial settings consist of an optical illumination platform, image acquisition hardware such as cameras, and image processing algorithms to perform classifications. Image processing and analysis are essential in enabling computers to understand, analyze, and take actions based on image features.

Machine vision systems use a wide light spectrum—ultraviolet, invisible light, infrared, and so on—for optical illumination platforms. Different lights are suitable for different defects and, therefore, need to be tested. However, it’s not just about looking at colors; a machine vision system can measure chemical components—for example, the chlorophyll content of fruit. In this way, a machine vision system can measure much more precisely how mature that fruit is compared to relying on color alone. The same process occurs for defects: marks and blemishes produce a different spectral signature. By applying a sensor and combining it with cameras and lights, defect detection becomes much more expansive. This even works for decay that doesn’t show externally. With the right spectral wavelength in the infrared, detecting certain kinds of defects can be done without touching the item in question.

Of course, regardless of how sophisticated the optical illumination systems and cameras are, they only produce the image. The computer software processes that image, makes a decision, and activates solenoids to remove items from the conveyor. This requires hardware, a software platform, drivers, networking protocols, and more. System-on-Modules (SOMs) are often used to simplify the development process and enable sensors, cameras, and Internet of Things (IoT) systems to be embedded. One such solution is the Digi International ConnectCore® 93 SOMs, which are designed for a wide range of medical, industrial, energy, and transportation applications. Digi ConnectCore modules are intended for high-end edge devices, offering high-performance compute and camera interfaces that are ideal for delivering industrial reliability to connected and embedded devices. Notable specs include a Cortex-M33 core, an artificial intelligence/machine learning (AI/ML) Arm Ethos U65 micro neural processing unit, and an NXP power management integrated circuit for maximum power efficiency.

How AI and Deep Learning Are Changing Machine Vision Systems

While there may have been some initial hesitancy to use AI, it’s now entering manufacturing processes more and more. Prior to AI, developing an image processing algorithm had to be based on analyzing morphology, creating thresholds, and making measurements and comparisons to detect a defect. It was all very involved, almost completely manual, and ultimately, involved mostly trial and error. With AI and deep learning, it’s possible to capture thousands of images, classify them, and then train the AI on those data.

AI removes human indecision and subjectivity and ensures the reliability of machine vision systems. The initial training data is critical, and although it still involves a manual process, it’s essential to continue training those deep learning algorithms because different requirements and systems emerge each year. However, machines can be deployed that are constantly saving images automatically, so when changes are required, the necessary data is available to take action. As we move forward, AI will undoubtedly dominate how defects are detected and sorted in industrial settings.

The Future of Machine Vision in Industrial Settings

At the time of writing, processing all this information requires very powerful computers with incredibly expensive boards, and these are large machines and systems. I imagine that in the future, all these sophisticated, expensive systems will be incorporated into smaller systems that will be integrated in the cameras themselves. As with everything else, you start with a big tool and then make it cheaper and more accessible. Then, eventually, perhaps it won’t take 50,000 images to classify a defect. If machine vision trends continue, we’ll likely see everything simplified, with electronics system costs reduced and all of these elements integrated into one holistic system.

Another major development in defect detection is detecting internal defects. For instance, with produce classification, the use of spectrometers enables manufacturers to detect characteristics like juice levels or sugar and fat content. For now, these sophisticated sensors are very expensive and complicated to keep calibrated. However, as customer expectations continue to rise, so will the use of these spectrometer-based sensors, allowing manufacturers to offer an even higher level of customer service.


Defect detection has long been a complicated process, especially for food products. However, machine vision leverages high-quality optical illumination platforms, image acquisition hardware, and finely tuned software to obtain the high-quality images required to improve defect detection. Machine vision systems will continue to improve the efficiency, quality, and reliability of defect detection, especially as technologies advance and emerge in the future.