Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckDigitIncreaseConsistency not working for model dig-cont_0712_s3_q.tflite #3533

Open
fsck-block opened this issue Jan 31, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@fsck-block
Copy link
Contributor

The Problem

I'm using a meter with a very early analog to digital transition
This results (despite other problems) to inaccuracy when the analog pointer reaches values from .8 to .99 and the lowest digit is nearly switched to the next one.

Image
Note: Meter shows value 232.91

The parameter CheckDigitIncreaseConsistency promises some help,

An additional consistency check. It especially improves the zero crossing check between digits.

but the check is skipped caused by wrong model

checkDigitIncreaseConsistency = true - ignored due to wrong CNN-Type (not Digit Classification)

Using a other digit models (e.g dig-class11_1701_s2.tflite) is not an option, because they have a worse recoginition rate with my meter.

Is there a reason why the continuous output networks models are ignored?

Version

15.7.0

Logfile

n/a

Expected Behavior

Parameter CheckDigitIncreaseConsistency is effective for all digital models

Screenshots

No response

Additional Context

No response

@fsck-block fsck-block added the bug Something isn't working label Jan 31, 2025
@SybexX
Copy link
Collaborator

SybexX commented Jan 31, 2025

As far as i know, this option is only being available for digital ROIs, but you also activated analog ROIs.

@fsck-block
Copy link
Contributor Author

I'm talking exactly about the that, what the description of the correction algorithm describes.
This is exactly what I need

Image

But unfortunately this not available for the digital ROI model "dig-cont_0712_s3_q.tflite"

Have a look at jomjol_flowcontroll/ClassFlowPostProcessing.cpp@869

if (NUMBERS[j]->checkDigitIncreaseConsistency) {
    if (flowDigit) {
        if (flowDigit->getCNNType() != Digit) {
            ESP_LOGD(TAG, "checkDigitIncreaseConsistency = true - ignored due to wrong CNN-Type (not Digit Classification)");
        }

The model "dig-cont_0712_s3_q.tflite" has CNNType DoubleHyprid10 not Digit even it classifies "Digits", as far as I understand.

@SybexX
Copy link
Collaborator

SybexX commented Feb 1, 2025

@fsck-block
Copy link
Contributor Author

Yes, setting AnalogDigitTransitionStart to 6.0 helps a little bit, but even with this setting problems occur on zero-crossing.

Made a development version of the software with activated CheckDigitIncreaseConsistency for DoubleHyprid10 model.
Zero-crossing works well, CheckDigitIncreaseConsistency corrects the raw value (within range 232.98 to 232.99).

As far as i understand the CheckDigitIncreaseConsistency is a subsequent calculation, so it might be usefull for all models classifying digits.

@SybexX
Copy link
Collaborator

SybexX commented Feb 1, 2025

Simply put the last two digits up a bit, then they should be recognized as 2.8 or 2.9.

@fsck-block
Copy link
Contributor Author

Simply put the last two digits up a bit, then they should be recognized as 2.8 or 2.9.

Great, you are right. Moving the digit ROI up by four pixel leads to a perfect classification during zero-crossing.

Before

After

So my original problem is solved, I no longer need the calculation of CheckDigitIncreaseConsistency.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants