How to adjust AI model prediction option parameters using macro command code?

Dear Sir,
We are currently utilizing the AI Deep Learning feature in Image-Pro 11.1. In most cases, the default models provide excellent object contours. We have also successfully trained our own custom models for testing.

Our target objects vary significantly in size (large vs. small), so we group and image them based on the product model. Consequently, when switching between different samples, we need to adjust the Object Diameter, and occasionally fine-tune the Strictness (%) and Probability Threshold (%). Since each trained model takes up several hundred megabytes, we would prefer to use a single trained model and dynamically adjust these parameters programmatically for batch analysis, rather than training separate models for each size.

However, during our Macro testing using DeepLearningCommands, changing the values programmatically did not seem to take effect. The AI analysis still relies on the values currently set in the Prediction UI instead.


Here is a snippet of the VB.NET code we used:
-------------------
With Measure.DeepLearningCommands.Options(Nothing)
    .CellDiameter = 90
    .FlowThreshold = 0.4F
    .CellProbabilityThreshold = 0.5F
    .Run()
End With
-------------------

Is it possible to fine-tune these three parameters (Object Diameter, Strictness, Probability Threshold) via Macro/Scripting for a single model?

If yes, what is the correct object model, syntax, or command sequence to successfully override the UI values before running the prediction?

Any guidance or code examples would be greatly appreciated.

Best regards,
Wesan

Answers

  • Hi Wesan,

    All model prediction options can be saved to an IQO file (measurement options file), so you can create IQOs for every type and then load that IQO file by macro.

    Yuri