Enhance Your ML Workflows with Logic Stage: Use Cases & Examples

Logic Stage in V7 can save time and significantly improve the quality of training data. Find out how this functionality solves real-life problems.
Read time
min read  ·  
March 23, 2023
logic stages hero image

Building machine learning solutions that deliver accurate results requires high-quality training data. However, this process is far more complex than merely gathering files and feeding them to a model.

As reported by Gartner, a staggering 85% of machine learning projects fail. This is often due to an overemphasis on technology. Unsuccessful teams use traditional development frameworks and approaches. The ML projects that succeed prioritize building high-quality datasets instead.

Your project needs a structured and organized approach to ensure that all data points are labeled consistently and accurately. This requires rigorous quality control and validation procedures.

Logic stages, a new feature in V7, offer enhanced control over advanced data annotation flows. 

By incorporating the logic stage module into your V7 workflow, you can:

  • Filter out low-quality data points [# links to specific H2s]
  • Route files to review stages
  • Send custom notifications to team members
  • Split annotation tasks between different teams
  • Compare the performance of different models
  • Validate the output of a model

The Logic Stage element allows you to add custom if/else statements and conditional rules. When a dataset item reaches this stage, it is sent through different routes based on the criteria specified in the logic stage.

logic stage in v7 workflow

Logic stages can save your time and significantly improve the quality of your data.


Let's explore some real-world scenarios where this feature can be applied.

1. Removing unwanted data points from your dataset

Case: A vertical farming company wants to use machine learning to identify diseased plants. They grow plants indoors and collect close-up images of their crops to identify the presence of disease. However, they often encounter issues with blurry or noisy images that can lead to inaccurate annotations and incorrect disease identification.

good and bad quality images in a training dataset

Solution: To address this challenge, the company can use the logic stage feature in V7. By creating custom tag rules, they can filter out low-quality data points such as blurry or noisy images.

First, they can label a set of blurry photos with a custom tag (e.g. Out-of-focus). Then, they can train an auxiliary model that will assign the tag to new images. It is also possible to register an external model for detecting blurry photos.

Now, they can design a workflow that automatically detects if an image is out of focus.

The model will assign tags automatically and the logic stage will send tagged items to the archive. This way, the images that are out of focus will be discarded for training purposes. This solution ensures that only high-quality data points are used for training, improving the accuracy of the final disease detection model.

💡 Read more: Explore more AgTech V7 use cases

2. Complex QA flows with multiple review stages

Case: A manufacturing company produces electronic devices and wants to use machine vision to detect defects during the production process. The company captures video footage of the devices during various stages of production and uses annotations to label the presence of defects. They struggle to review and validate all cases before selected frames of the footage are used for training. The QA process is very time-consuming and inefficient.

stage where surface defects are labeled manually in v7
During the inspection process, there is a stage where surface defects are labeled manually. The colors are inverted to make scratches, cracks, and dents easier to notice

Solution: V7 logic stages let you set up parallel quality control flows. The manufacturing company can create dedicated review stages where team members can validate the annotations and focus on a single category of defects.

During the review process, team members can add additional comments, ratings, and subannotations. Breaking down the process into several separate steps spread among different members or dedicated teams can significantly speed up the development of your training data.

💡Read more: How Abyss Uses V7 for Critical Infrastructure Defect Inspections

3. Setting up custom notifications when a class is detected or missing

Case: A medical research clinic is using machine learning to develop a system that can detect lung nodules in chest X-rays. The majority of cases are quite straightforward and the annotations are performed by junior radiology technicians. But, in some cases, they require assistance from senior radiologists.

Solution: To overcome this challenge, the medical research clinic can utilize the logic stages feature in V7 to create custom notifications when a particular class of lung nodule is detected and flagged as urgent. The system can be configured to alert senior radiologists when an X-ray image with an unusual lung nodule requires their immediate review.

workflow with logic stage, reviews, and webhoooks

To implement this solution, the clinic can create a conditional rule in the logic stage that detects the presence of a lung nodule in the X-ray image. If this condition is satisfied, the image will undergo an additional check for the presence of the "Urgent" tag. When the tag is there, the system will generate a notification and send it to the senior radiologist for a secondary evaluation.

It is important to note that the flow above systematically directs all X-rays with nodules to a review stage. However, webhook notifications are triggered if there is also a special tag assigned. This approach ensures that the final diagnosis is not only accurate and reliable but also prompt, when necessary.

💡 Read more: How to Annotate Radiology Data for Machine Learning

4. Automated routing of data to different teams

Case: A logistics company is using machine learning to identify package damages. They send photos from multiple locations and use annotations to label the presence of damage. They also collect images from package receivers who file complaints. The company wants to streamline their workflow by routing images based on their location to a specific team responsible for validating annotations.

Solution: To address this challenge, the company can use the Logic Stage feature in V7 to automate the routing of data based on location. They can set up conditional logic rules that route images to specific teams responsible for validating annotations based on their location.

First, they can set up conditional rules in the logic stage that will detect the location of the package in the image. If the location is in a particular area, the system will route the image to the team responsible for that region.

setting conditions in logic stage in v7

This solution ensures that images are automatically routed to the appropriate team based on their location, saving time and streamlining the workflow.

💡 Read more:AI in Supply Chain and Logistics [20+ Practical Applications]

5. Comparing model performance with conditional logic

Case: A retail company is using machine learning to analyze photos on social media and identify fashion trends. To achieve this, they label different fashion items in thousands of images each day using multiple models. They employ separate models for identifying clothing items, accessories, and other wearables. However, the company wants to ensure that only the best-performing models are used.

Solution: The company can detect mislabeled images and compare the performance of different models. They can set up a conditional logic rule that filters out cases when a new model recognizes items that are ignored by the old version of the model.

Let’s consider their computer vision models that can perform handbag segmentation.

The company’s ML flow designer can set up a rule that filters out cases when a new model recognizes items that are ignored by the old version. To do this, they will map the "Handbag" class onto two separate classes that correspond to the two models being compared. After processing the images, any problematic photos will be sent for review.

workflow that compares two models' performance in v7

Note that you can also compare models with the Consensus Stage feature. However, Logic Stages can also give you an extra layer of control when it comes to routing conditions. In an upcoming V7 update, model confidence score thresholds will also be available as additional parameters for logic rules.

💡 Read more: AI in Retail: Applications Shaping the Future

6. Validating the output of your models

Case: A construction company uses machine learning to analyze building structures from photographs. One of their models detects windows. However, due to the complexity of the images, the model can occasionally make mistakes and misidentify objects. For example, it may detect a building without any windows, or detect windows in areas where there are no buildings.

windows in a building annotated in v7

Solution: To improve the accuracy of the model, the company can use a sequence of logic stage elements to validate the output of their window segmentation model. If there are any unusual situations, for example buildings with no windows detected, photos are reviewed manually.

The first stage can check if the model has detected a building. If a building is detected, the Logic Stage can then verify if any windows have been detected in the same image. If the model has correctly identified windows, the image can be sent directly for further processing. However, if no windows have been detected, the image can be sent to a review stage. A human annotator will check if it is indeed a building without any windows or a model mistake.

By implementing this Logic Stage workflow, the construction company can focus on verifying only unusual cases. In the long run, it saves them a lot of time and resources.

Key takeaways

As the examples above demonstrate, logic stages give you great flexibility as they can be adopted for your individual needs and industry. By filtering out low-quality data, setting up advanced quality control flows, or sending custom notifications, logic stages can save time and reduce errors.

Implementing logic stages in your machine learning workflow can increase the chances of success for your project and help you deliver accurate results.

Are you ready to design your custom workflow?

You can set it up right here.

More resources:

Casimir is a tech journalist and content writer with a keen interest in all things AI. His main areas of focus are computer vision, AI-generated art, and deep learning. He's also a fan of contemporary digital art and photography.

“Collecting user feedback and using human-in-the-loop methods for quality control are crucial for improving Al models over time and ensuring their reliability and safety. Capturing data on the inputs, outputs, user actions, and corrections can help filter and refine the dataset for fine-tuning and developing secure ML solutions.”
Automate repetitive tasks with V7's new Gen AI tool
Explore V7 Go
Ready to get started?
Try our trial or talk to one of our experts.
V7’s new Gen AI product