_images/cartesiam_logo.png

Frequently Asked Questions

_images/banner.png

I. NanoEdge AI Studio

A. Input data and formatting

1. How should my input data be structured?

Input files contain m lines each composed of n numerical values per line, which are separated by a uniform separator. Each line represents an independent signal example. The number of values per line is specific to each project, but always depends on the number of axes of the sensor used, and its buffer size (number of samples per axis).

Mono-sensor

Here is an example for a 3-axis sensor. We have a collection on m signals (lines) with a buffer size of 256 on each axis, which results in 256x3 = 768 values per line.

_images/input_example.png

Warning

We have NUMBER_OF_AXES * BUFFER_LENGTH values per line. A line represents a signal snapshot consisting of several samples.

Multi-sensor

Here is an example for a 3-axis accelerometer, 3-axis magnetometer, 3-axis gyroscope coupled with a temperature sensor (10 variables in total).

_images/input_example_multi.png

Warning

We only have NUMBER_OF_VARIABLES values per line (effectively, a buffer length of 1). A line represents a single sample of the signal, not a full signal snapshot anymore.

Note

If your input files contain formatting errors, or suspicious data, you will see warnings or errors in NanoEdge AI Studio. You can click on those warnings/errors for more information and advice.

_images/checks.png

For more information, see Studio: input file format.


2. Is overlapping supported?

Neither the Studio nor the Library will explicitly take signal overlapping into account, as each line of the input files is independent.

Signal overlapping may still be included if you have good reasons to use it, but be aware that it might hurt performances (e.g. by “diluting” useful signal features).


3. How much data should my input files contain?

Each line of an input file (normal/abnormal signals for anomaly detection, or classes for classification )represents an independent signal example.

Each of these lines will be passed independently to the NanoEdge AI functions: learn/detect (AD), or classify (Cl). These signal examples will be seen one by one by the algorithms, and used to establish a model and/or enrich its knowledge.

Warning

For best performances, never use too few (< 20-50 lines) or too many (hundreds of thousands, or more).
A realistic range would be between ~100 and ~1000, although ~100 is usually enough.

4. Which signals should I put into which input files?

Please check the following section from the Studio documentation: Which signals to put in which files.


5. How do I choose the best buffer size / sampling frequency?

Those parameters highly depend on each use case, and each project’s specificities.
Please consider these 3 important parameters:
  • n: buffer size
  • f: sampling frequency
  • L: signal length

They are linked together via: n = f * L. In other words, by choosing two (according to your use case), the third one will be constrained.

Here are general recommendations. Make sure that:

  • the sampling frequency is high enough to catch all desired signal features. To sample a 1000 Hz phenomenon, you must at least double the frequency (i.e. sample at 2000 Hz at least).

  • your signal is long (or short) enough to be coherent with the phenomenon to be sampled. For example, if you want your signals to be 0.25 seconds long (L), you must have n / f = 0.25. For example, choose a buffer size of 256 with a frequency of 1024 Hz, or a buffer of 1024 with a frequency of 4096 Hz, and so on.

    For more information, see Studio: sampling frequency.

Note

For best performances, always use a buffer size n that is a power of two (e.g. 128, 512…).


6. [Anomaly Detection] Should I include all possible anomalies in my “abnormal signals”?

Of course not. If would defeat the purpose, and be almost impossible to do in practice.

The “abnormal signals” file doesn’t have to be exhaustive. Just include examples of some anomalies that you’ve already encountered, or that you suspect could happen. If needed, don’t hesitate to create “anomalies” manually.

Note

It is OK to have fewer “abnormal” than “regular” signals, but try to include as many as possible.
Realistically, it could make sense to include any number between a few tens and a few hundreds.

In order for the selected nanoEdge AI Library to detect very “subtle anomalies”, we recommend that the data provided as abnormal signals includes at least some examples of subtle anomalies as well, and not only very gross, obvious ones.


7. [Anomaly Detection] If I provide “abnormal signals”, is the learning really unsupervised?

NanoEdge AI Studio’s purpose is to search for the best possible NanoEdge AI Library for your application, among millions of possibilities. The “abnormal signals” are only provided to give some context context, to narrow down the scope of this search.

After the best Library is found, this Library will be able to learn behaviors, specific to your use case, but will have no knowledge yet. All knowledge must be acquired in-situ, by running some learning iterations after the Library is embedded on the microcontroller.

No information is learned regarding anomalies. The Library only learns what is normal, and figures out what is an anomaly by itself. As such, when embedded, the learning is completely unsupervised.


8. [Anomaly Detection] Should I concatenate data into single files, or use “signal couples”?

Let’s consider that you have several data sources, i.e. multiple input files for both “regular signals” or “abnormal signals”.

  1. Should you concatenate all nominal data into the “regular signals” file, and all abnormal data into the “abnormal signals” file?
  2. Or instead, should you keep multiple “regular” and “abnormal” files, and select multiple signal couples via the benchmark window just before starting it?

There are two possibilities:

  1. When considering different regimes/behaviors on a single machine, or several anomaly types on a single machine, then you should CONCATENATE.
  2. When considering different machines that all have the same behavior (the data will slightly differ, because the two machine can never be 100% identical), then you should ADD SIGNAL COUPLES.

Note

  • For more information and examples, please check Studio: which signals to put in which files.
  • In case you are not sure which option to choose, go with option 1: concatenate all regular data in one file, and all abnormal data in another file.

B. Performance issues

1. How can I improve my benchmark results?

Click here for a list of tips to try to improve your benchmark performances.

Also bear in mind that additional procedures may be implemented outside of the NanoEdge AI Library (e.g. in the main C code), such as confirmation mechanisms (based on counters, averages, or other), to limit the number of false positives, etc.


2. How can I improve my Emulator / Library performances?

Click here for a list of suggestions to try to improve your emulator / library performances.

Also check this section about signal verification / confirmation using the emulator with serial data. Although it is about classification, it may be applied to anomaly detection in the same manner.


3. Why is my benchmark taking so long?

During benchmark, our search algorithms test tens of thousands of libraries, in order to find the best possible candidate among millions of possibilities. Please be patient and let the process finish properly.

Benchmarks may be paused / resumed.

You may speed up the benchmark process by:

  • increasing the number of CPU cores dedicated to the search (just before clicking “Validate” and starting the benchmark).
  • reducing the amount of data provided in both “regular” and “abnormal” signals files (which may severely hurt performances).

Note

At any point during benchmark, even if it is still running, you may jump right to the Emulator step (Step 5 in Anomaly Detection, or Step 4 in Classification) to test the performances of the best Library found up to this point.


4. My benchmark is stuck at 5% and nothing is happening.

After starting a benchmark (Step 4: Optimize and Benchmark), the progress bar goes to 5% and some graphs start appearing. If nothing is happening within a minute (no plot, or axes with no data points) please stop the benchmark, and start a new benchmark.

If the same issue keeps happening, please quit and relaunch the Studio. Then, start a new benchmark.

If the issue persists, send us your log files (in Documents/workspaceNanoEdgeAi/logs/) at support@cartesiam.com. We will investigate the issue and come back to you.


C. Errors and bugs

1. I have problems installing NanoEdge AI Studio / Studio is stuck on loading screen.

Sometimes the installer has troubles intalling NanoEdge AI Studio, or at launch, the Studio is stuch on an endless loading screen. This can happen when the connection between the Studio’s API and the internet is being blocked by something.

First, close the Studio / Installer (make sure all tasks have ended via Task manager), and relaunch.

In case the issues persist, here is a list of the most common causes:

  • antivirus silently blocking connections (try to deactivate them)
  • firewall (e.g. windows defender, or other… try to add an exception for NanoEdge AI Studio, or deactivate them)
  • proxy (if using any, check settings or deactivate)
  • VPN (if using any, check settings or deactivate)
  • wrong DNS settings on your computer
  • trying to install the Studio in a virtual machine (which is not allowed, won’t work)

Here are a few other solutions that you may try independently (on Windows), after checking the points above: quit the Studio, and:

  • delete the file api_settings in Users\<your_username>\AppData\Roaming\nanoedgeaistudio\ and relunch the Studio.
  • edit the file init.json in Users\<your_username>\AppData\Roaming\nanoedgeaistudio\, replace "port":5000 by another port number that is available on your computer, for example "port":5001 then save and relaunch the Studio.

2. Why is my worskpace directory “not accessible”?

If you get the following error message:

_images/folder-error.png

This may be due to the “Controlled folder access” feature of Windows Defender in Windows 10. It can block Studio access to the folder /Documents which is used to store NanoEdge AI Studio’s workspace.

You need to allow both executables NanoEdge AI Studio.exe and neai_api_app.exe to run.

_images/allow-exe.png

Please check Windows Support: Allow an app to access controlled folders.


3. Why does the Studio keep asking for my license key?

NanoEdge AI Studio usually asks for your license key after installing an important update, after updating your license, or after some time has passed. NanoEdge AI Studio shouldn’t continually ask for your license key every time you launch it.

However this might happen for some users due to poor network performances, or when rebooting your computer, or when using an older machine, and so on.

Make sure your antivirus or firewall software are not blocking any incoming or outgoing connexion, and that you are not using third party software that may remove some temporary files created by NanoEdge AI Studio.


4. How should I configure my proxy?

If you’re using a proxy, use the following settings:

Here are the IP adresses that need to be whitelisted:

Licensing API: Cartesiam API for library compilation:
54.147.158.222 52.178.13.227
54.147.163.93  
54.144.124.187  
54.144.46.201  
or via URL: https://api.cryptlex.com:443 or via URL: https://api.cartesiam.net

5. My license key is invalid, what can I do?

Double check that you entered your license key properly.

In some cases (poor internet connexion, issues with the licensing platform, firewall or proxy issues) you will have to do an offline activation.
Here are the steps to follow:
  1. Choose Offline activation and enter your license key.
  2. Copy the long string of characters that appears.
  3. Go to the Cryptlex login page (https://cartesiam.cryptlex.app/auth/login).
  4. Reset your password using the email address provided when downloading NanoEdge AI Studio.
  5. Log into your Cryptlex dashboard using your new password.
  6. Click on your license key, then Activations and Offline activation
  7. Click ACTIVATION, then paste the string of characters copied in step 2, and click Download response.
  8. In NanoEdge AI Studio, click Import file and open the downloaded .dat file.

If still unable to activate your license, please contact us at support@cartesiam.com.


6. Why do I keep seeing the “Port XXXX is used” message?

It happens when the port used for communication (between the local Cartesiam API, on your machine, and NanoEdge AI Studio) is used by some other program. It is set to 5000 by default. You may change it to any other port that you know is not currently being used.

Double check that:

  • you have a sufficient amount of resources on your machine for NanoEdge AI Studio to run properly (RAM, CPU cores).
  • the background scanning process of your antivirus or firewall is not interfering with the Studio.
  • you’re not trying to quit and relaunch the Studio too quickly.
  • you’re not running multiple instances of the studio.

7. I see a blank page and nothing happens when I click XXX.

After clicking somewhere, if nothing happens, and the window stays blank for more than one minute, please consider closing and restarting the Studio.

When starting a benchmark, progress graphs and plots should appear within one or two minute. If nothing happens, and the lower half of your screen appears blank, please quit and relaunch the Studio. Then, start a new benchmark.

Note

Don’t hesitate to give feedback and report bugs using the Freshdesk platform, we appreciate it, and it helps us improve our software faster.


8. How can I open Serial / COM / USB ports on Linux?

  1. Install the following package by entering:

    sudo apt-get install libgconf-2-4
    
  2. Add yourself to the “dialout” group:

    sudo usermod -a -G dialout $USER
    
  3. Create a rule file to automatically enable permissions when a device is connected:

    sudo nano /etc/udev/rules.d/50-local.rules
    
  4. Paste this line in the file you just created (where /dev/ttyACM0 targets your USB port).

    ACTION=="add", ATTRS{idProduct}=="0042", ATTRS{idVendor}=="2341", DRIVERS=="usb", RUN+="chmod a+rw /dev/ttyACM0"
    
  5. Press Control-O and then Control-X to save the file and exit.

Note

You may need to log out and log back in (or reboot your computer) for the changes to take effect.


II. NanoEdge AI Library / Emulator

1. Why are my Emulator results so poor?

If, in the Studio, the benchmark results were good, and the selected Library was properly tested and validated using the Emulator, then the embedded Library will give similar performances if used in the same conditions, with data that is coherent with those used for Library selection.

Please check the following section: Emulator: possible causes for poor results.


2. How can I get a Library that is very general (or very specific)?

The library yielded by NanoEdge AI Studio will be the result of the data taken as input. Depending on your use case, it can be either:

  • very specialized, extremely specific to one specific application or machine;
  • or very versatile, adaptable to a wide range of different machines (of the same type).

To get a very specific library, your imported data (Studio: Steps 2 and 3) must be focused and have low variance. It should contain many examples of the same signals, which must be as repeatable as possible.

To get a general and adaptable library, your imported data must contain a wide range of signals, that represent different behaviors, possibly on logged using several kinds machines (e.g. industrial vibrating machines used for different tasks).

Please also check: Which signals to put in which files.


3. [Anomaly Detection] What is the “recommended number of iterations”?

The minimum iterations is a recommended number that appears at the end of a benchmark. It is a minimum number of iterations that summarizes how fast the Library can learn once embedded.

_images/minimum_iterations.png

It corresponds to the minimum number of times the NanoEdgeAI_learn function has to be called in order for the knowledge acquired by the Library’s model to be rich enough.

Warning

If your use case has several regimes, or modes of nominal behavior, these should all be included within the learning iterations.

For instance, when monitoring vibration patterns on a 3-speed fan, the Studio recommends a minimum of 90 iterations. It means that you must provide at least 90 examples of signals in total, including all 3 speeds (e.g. 30 iterations, or lines, per speed at the very minimum). Of course you could also provide more, e.g. 200 examples per speed (totaling 600 iterations).

Note

This number is a strict minimum. Realistically, don’t hesitate to use more, e.g. 10x this number, if needed.


4. [Anomaly Detection] How does sensitivity work?

The NanoEdgeAI_set_sensitivity function changes the sensitivity of the model dynamically at any time, without having to go through a new learning phase. This sensitivity has no influence on the knowledge acquired during the learning steps; it only plays a role in the detection step.

It acts as a linear scaler of the pre-set internal sensitivity (optimized during benchmark in the Studio). It influences the similarity percentages that are returned by the NanoEdgeAI_detect function.

Note

  • The default sensitivity value is 1. A sensitivity value between 0 and 1 (excluded) decreases the sensitivity of the model, while a value in between 1 and 100 increases it. We recommend increasing or decreasing sensitivity by steps of 0.1.
  • Sensitivity 1.1 - 100 will tend to decrease the percentages of similarity returned, while sensitivity 0 - 0.9 will decrease them.

5. [Anomaly Detection] Can the Library learn several regimes / machine behaviors?

Yes. If the data contained in the “regular signals” file imported in NanoEdge AI Studio correspond to different regimes, then the Library will be able to detect those different regimes and consider them as “nominal”. This selected Library will include a machine learning model that has the ability to adapt to those differences in machine behavior.

It is also important, before embedding the Library, to properly design learning cycles, so that all the different regimes to be considered as “nominal” are learned. You may run a learning phase for each of those different regimes, or a single learning phase that includes all of them.


6. [Anomaly Detection] What is the similarity score?

The similarity score is a measure of how mathematically similar a given sample is, compared to the existing knowledge base of the Library.

If a sample “looks” like something seen before, it will have a similarity score near 100 (%), and if it completely new (looks dramatically different), the score will be close to 0.


7. [Anomaly Detection] How can I use the “learn” and “detect” functions properly?

When building a smart device, the final features will heavily depend on the way those functions are called. It is entirely up to the developer to design relevant learning and detection strategies, depending on the project’s specificities and constraints.

_images/ild.png
The learn and detect functions can be triggered by external data (e.g. from sensors, buttons, to account for and adapt to environment changes).
The scores returned by these functions can trigger all kinds of behaviors on your device.

For example for a hypothetical machine, one strategy could be to:

  • initialize the model;
  • establish an initial knowledge base by calling learn() every minute for 24 hours on that machine;
  • switching to inference mode by calling detect() 10 times every hour (and averaging the returned scores), each day;
  • blink a LED and ring alarms whenever detect() returns any anomaly (average score < 90%);
  • run another learning cycle to enrich the existing knowledge, if temperature rises above 60°C (and the machine is still OK)
  • send a daily report (average number of anomalies per hour, with date, time, machine ID…) using Bluetooth or LoRa.

8. [Anomaly Detection] Can I save the Library’s knowledge and use it on another device?

Yes. For more information, see Library: creating backups.

Note

This feature is mainly used to prevent loss of knowledge, e.g. in case of power failure.

Warning

While it is possible to transfer the knowledge acquired on one device, to another device, we strongly discourage it. Indeed, it defeats the purpose of acquiring knowledge in-situ.

The knowledge acquired on one device isn’t necessarily transferable to another device. For example, even a very subtle misplacement of an accelerometer could be enough to kill the Library’s performances, during vibrational analysis, if no additional learning was done in-situ.

If you really intend to transfer some knowledge, then run at least a few learning cycles in-situ on the new device, to enrich the knowledge and adapt it to the new environment.


9. [Classification] What is the probability percentage returned by the classifier?

The classifier function returns a class ID, and the percentage of probability associated to this class. It corresponds to the degree of certainty that the correct class has actually been detected.

The classifier therefore calculates a probability for each of the possible classes (which all add up to 1, or 100%), and only returns the class with the highest probability. See the Classification Library documentation for more details.


Resources

Documentation
All NanoEdge AI Studio documentation is available here.
Tutorials
Step-by-step tutorials, to use NanoEdge AI Studio to build a smart device from A to Z:

Useful links: