cancel
Showing results for 
Search instead for 
Did you mean: 

Why is oneclass_result always 0(Nanoedge ai studio)

haiyishw
Associate II

I compiled a 1C library using nanoedge ai studio and verified the sample successfully using the emulator. I also successfully added it to my Keil project, but the result was always 0 when I ran it.

My code:

Error_code = neai_oneclass(input_user_buffer, &oneclass_result);

onecclasss_result is always 0, regardless of the data. Why?

11 REPLIES 11
Julian E.
ST Employee

Hello

 

Here is the documentation about the neai_oneclass function:

https://wiki.st.com/stm32mcu/wiki/AI:NanoEdge_AI_Library_for_1-class_classification_(1CC)

JulianE_0-1716904330972.png

As you can see, if it returns 0, it means that the library predicts that the signal is not an outlier. So, if your library output only 0, it means that the library is classifying all the signal as not an outlier.

 

1-class classification is a type of project made to help user without anomalies, but in practice, it is very hard to get a good model without any example of anomalies.

In certain use case, 1-class classification model can be of some help and detect some anomalies, but in other it is not helpful and cannot make the difference between normal or abnormal signals.

 

If you have abnormal data, please do an anomaly detection or N-class classification project. 

If you don't have abnormal data, please try to obtain some, and if it is not possible, there might be no solution for you.

 

Best regards,

Julian


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

thanks.

Why is status "regular using the emulator, but status is "outlier" using the liberay in the keil

Julian E.
ST Employee

Hello, 

 

Indeed, in NanoEdge AI Studio, in the emulator step, the "classes" are regular and abnormal, and it should be outlier.

In the emulator that you can download, it is regular or outlier

In the library it is 0 or 1, 0 being regular and 1 outlier.

 

We will change abnormal to outlier in the NanoEdge AI Studio emulator.

Thank you for the remark.

 

Best regards,

Julian


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Okay, so when will the new version be released

Julian E.
ST Employee

Hello,

 

Our updates are scheduled on a quarterly basis, so you can expect the next one around the summer.

 

Best regards,

Julian


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
haiyishw
Associate II

Has the new version(v4.5.0) been fixed?

Julian E.
ST Employee

Hello,

 

If I understood your previous remark correctly, yes it has been fixed. In any case, it is a naming issue, the 1 class classification libraries return 0 or 1.

Please let me know if you have any other remark concerning this matter or any other one in NanoEdge AI Studio.

 

Best regards,

Julian


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
haiyishw
Associate II

I mean:

I gave the function an all-zero data set in the keil project, but the function returned 0. But the emulator of the ZIP package returns 1, why?

Hello,

 

Thank you for the clarification.

Can you send me your project (if you don't want to share the data, please send the emulator and your library).

To export a project in NanoEdge AI Studio, on the main page, select your project > click the 3 dots and click Export Project:

JulianE_0-1719406870365.png

 

Thank you

Julian


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.