Rule-based VS AI-based Machine Vision: Which one should you choose?

Rule-based VS AI-based Machine Vision: Which one should you choose?

Quality is essential in any industry, which is why quality control represents a crucial step in any production chain. Nowadays, the AFNOR study reveals that for 53% of companies, the cost of Non-Quality is between 1 and 5% of turnover. For 34% of them, this cost amounts to more than 5% or even more than 10% of turnover. Historically, the majority of quality control tasks were performed by human beings. However, this task can be repetitive and ultimately prevents humans from working on high-value tasks.

Cost of Non-Quality: 5% of Turnover 

This is where industrial vision cameras come in, with all their technological options to replace human visual inspection. The goal is to improve productivity by allowing humans to focus on high-value tasks and letting technology handle repetitive tasks.

Rule-based machine vision is becoming increasingly democratized, but there are some cases where it encounters limits: high variability in the same piece or modular tolerance of defects.

A solution then emerges: Artificial Intelligence. Based on Machine Learning and Deep Learning principles, this solution is still too little known and used, but is very effective in complementing the traditional rule-based approach.

Artificial intelligence may be the missing element in your production chain.

To find out, we will discuss the advantages and disadvantages of Rule-based and AI-based approaches.

  1. What is Rule-based machine vision?
  2. What is AI-based machine vision?
  3. Pros and cons of each approach
  4. Which approach should you choose?
  5. Conclusion

What is Rule-based machine vision?

Rule-based machine vision involves analyzing images obtained through industrial vision cameras. It uses a set of image processing algorithms to perform either direct tasks (relatively high level) or intermediate treatments (image segmentation, for example).
This approach uses predefined "rules" to identify and classify objects in an image. These "rules" are more like parameters that are adjusted on algorithms to obtain what is desired. They must be strictly mathematically described to be easily interpreted.

The goal of this approach is to automate visual inspection according to strict rules predefined by the user.

Rule-based machine vision is a deterministic approach and requires a precise context to reliably detect defects. That is, each part must be inspected under the same conditions, whether it be lighting, tilt or angle.
Therefore, rule-based vision is limited in its ability to model a normal situation, compared to AI-based vision. It can model something simple, definable by rules applied to image processing algorithm results, but it cannot model something more complex and variable.


What is AI-based machine vision?

Instead of applying strict rules imposed by a vision expert, Artificial Intelligence models a situation. AI trains itself by analyzing an image database.

Based on these images, the software, on its own, will build a model capable of predicting the state of new images. It is thus capable of categorizing new images without them being part of the image database used during its training. The larger and higher quality the image database provided, the more efficient the model will be.

In summary, unlike rule-based vision, which is based on a set of a priori defined by its user, Artificial Intelligence autonomously creates its own modeling as close to reality as possible based on multiple real-world examples.

Pros and cons of each approach

Both approaches exist and have their advantages and disadvantages. It is therefore necessary to select the most appropriate one for your use case.

Rule-based Machine Vision: 
  • Pros:

    It requires very little data and does not require a prior data collection or labeling mechanism.

    It is a fully customizable approach, all criteria are configured in advance. Rule-based vision is very effective in achieving precise measurements and thresholds that can be configured to meet specifications.

    It is explainable. Based on a system of strict rules, its behavior is entirely predictable.
  • Cons:

    This solution requires resources. Due to its complex configuration, it necessarily requires the intervention of a vision engineer/technician during the programming and maintenance stages.

    It is difficult to implement rules for all possible scenarios, especially in complex and dynamic environments, which limits the performance of this approach. Recognizable defects can only be defects that are already known and encountered. A brand new type of defect, therefore not covered by a rule, cannot be detected.
Artificial Intelligence:
  • Pros:

    Very flexible, its ability to constantly improve on its own allows it to easily and automatically adapt to changes in the environment. Kind of like a human would, AI is able to continuously train itself and learn from its mistakes.

    It allows for significant resource savings since its configuration is simple and does not require a vision expert.

    Very effective in complex and dynamic environments, it allows for automation of cases that were previously too difficult due to variability in factors such as brightness, structure, shape, and texture.
  • Cons:

    Training the software requires data of quality and in quantity. The data must be representative of production and properly exploitable to achieve reliable results.

    It is not possible to set or extract metrological values. Only a compliance status is provided, and no measurements are taken.

Which approach should you choose?

The best choice for you depends entirely on the use case scenario.

Artificial intelligence cannot extract metrological data. Therefore, Rule-based machine vision is preferred in certain cases. Since it is based on a fixed set of rules and cannot evolve without the intervention of a vision expert, rule-based vision will be particularly effective for relatively simple tasks that will not evolve.
For example, if you want to detect an error in the dimensions of a part, rule-based vision will be the best choice.

However, rule-based vision cannot adapt to a context where the rules change and/or are too numerous to define.

Artificial intelligence addresses this limitation by allowing for the continuous identification of the most complex defects, despite variability. AI is particularly effective in the analysis of products that differ in color, shape, texture, and arrangement of elements.

For example, color or the presence of oil stains in the detection of the presence/absence of seals can lead to a lot of variability. Using rule-based vision would require a very large number of rules and would certainly result in many incorrect computer decisions. Artificial intelligence adapts and provides much more reliable results.



Both approaches have their strengths and weaknesses, and the choice of approach depends on the specific requirements of the use case. AI-based vision opens the door to applications that would have been impossible a few years ago. Defect detection is particularly well-suited to an AI-based vision approach.

At Visionairy, we have decided to make AI-based vision accessible.

Our solution allows you to automate visual inspections directly on your production lines without any knowledge of industrial vision. Requiring very few samples, our solution is functional with only 30 OK images.

Want to learn more about our solution?

Check out our product page or book a demo.

Published on
Written by
Anne-lys LANORE

Latest articles

See more