Allwinner v831 too low confidence on image classification when running resnet18
Nurali125 opened this issue · 1 comments
While working on resnet18, I found some interesting issues.
- I custom trained resnet18 using transfer learning techniques for 10 classes. Then tested on my laptop using webcam (webcam is the same as on maix-ii dock board) and it showed good results. If I point webcam at a person, it results "people: 99.9%". Shows max confidence up to 100%.
Then, I converted this model to awnn form and uploaded to allwinner v831. Here is interesting - percentage of confidence was only between 15 - 45% no matter on what object (no threshold set, but anyway starts at around 15%). I tried to change focus of camera, bring the objects closer or further from camera, even showed images, on which the model was trained - it showed only this small range of confidence. But, on laptop, it was showing up to 100% confidence. Exact model, but converted to awnn showed much lower confidence.
-
Also, I looked at first 5 most confidence scores, first 2-3 objects were showing exact same percentage of confidence (e.g. airplane: 23.45%, car 23.45%, buildings 23.45%, road 3%, pheasant 0.23%). This is so weird, it must not show exactly the same confidence on any of objects.
-
I tried the model that was provided by allwinner (I run python app.py on therminal) --- just in rare cases it reached up to 70% confidence, but frequently ranged between 10 - 50% (10% threshold).
I could not find any reason for such behavior of resnet18 on allwinner v831, but I am thinking now is - a) either there are some bugs on converter pytorch - awnn OR b) there are bugs on libraries OR c) hardware performance
P.S. I attached link to videos and codes to make my words clearer. https://drive.google.com/drive/folders/17eKPOSqrP54RyBei_gemIOxNq8uV38Uo?usp=sharing
P.S. P.S. if you open sample_output folder, you can see all images of detected "airplanes". But, if you open "airplane.txt" file, you will see first 5 confidence scores of each image. Images are named: class + time + ".jpg". Each row of "airplane.txt" file is
named: time + date + confidence scores. Each row has its corresponding image (match them by time).
It's turned out that when you convert ncnn files to awnn using sipeed's website, part of dataset must be included in folder 'image' together with ncnn files. I thought that 'image' file is not so important, but in fact it is.