- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have two deep learning models, that is a CNN model and a hybrid CNN-LSTM model, both are used for image classification tasks. Note that CNN has no pre-processing required and CNN-LSTM requires pre-processing.
TensorFlow environment: The training performance of the CNN model is about 98% accuracy; the CNN-LSTM model is about 96% accuracy with pre-processing applied.
TensorFlow environment: The inference performance of the CNN model is about 100% accuracy; the CNN-LSTM model is about 75% accuracy without pre-processing, and 100% accuracy with pre-processing applied.
OpenVINO environment: The inference performance of the CNN model is about 100% accuracy; the CNN-LSTM model is about 75% accuracy without pre-processing, and 6% accuracy with pre-processing applied.
The pre-processing is a simple code as shown below:
if(np.max(image)>1):
image = image/255.0
Why does the CNN-LSTM model accuracy in the OpenVINO environment drops significantly once the pre-processing is applied?
Regards,
nat98
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Wan,
Thanks for your reply.
I found out that the problem is the pre-processing code:
if(np.max(image)>1):
image = image/255.0
The pre-processing code is simply to make the input images in the range of 0 to 1 instead of 0 to 255. Not sure why I can't use it.
The solution is to implement this pre-processing code during conversion, which uses the "Use Scales" of the Model Optimizer command. (Screenshot attached).
Now I'm able to get 100% accuracy in the OpenVINO environment.
Regards,
nat98
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Nat98,
Thanks for reaching out to us.
Please share the following information with us for investigation purposes:
- Steps to set up TensorFlow environment
- Steps to set up OpenVINO environment
- CNN and CNN-LSTM model in TensorFlow and Intermediate Representation
- Model Optimizer command used to convert TensorFlow model into Intermediate Representation.
- Scripts to check accuracy for both TensorFlow and Intermediate Representation model
Regards,
Wan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Wan,
Thanks for your reply.
I found out that the problem is the pre-processing code:
if(np.max(image)>1):
image = image/255.0
The pre-processing code is simply to make the input images in the range of 0 to 1 instead of 0 to 255. Not sure why I can't use it.
The solution is to implement this pre-processing code during conversion, which uses the "Use Scales" of the Model Optimizer command. (Screenshot attached).
Now I'm able to get 100% accuracy in the OpenVINO environment.
Regards,
nat98
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Nat98,
Thanks for sharing your solution in OpenVINO™ toolkit community!
This thread will no longer be monitored since the issue has been resolved.
If additional information is required, please submit a new question.
Regards,
Wan
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page