DrAlexLiu / OctoPrint-PiNozCam

AI model running on RPi for failure detection
GNU Affero General Public License v3.0
39 stars 4 forks source link

Flying Bear Ghost 5, false detection #24

Closed om2804 closed 2 months ago

om2804 commented 4 months ago

Triggers the logo on the table. What can you do about it?

photo_2024-05-07_10-29-04

My settings изображение

DrAlexLiu commented 4 months ago

For such a situation,

  1. use tape to cover the logo
  2. increase the failure score threshold >0.83, but I recommend that this threshold would not go above 0.88 for pi4 and 0.93 or pi5.
  3. I believe the size of false alarm is fine. but if the logo is small, you can increase the image sensitivity >=failure area*1.33. Failure area will show up in your telegram or discord notification.

Last, this mode is only designed for nozzle camera. So it has not optimized to exclusive diagram etc. I am working on an AI model for a normal camera like Logitech C920.

om2804 commented 3 months ago

изображение изображение

many false detections

DrAlexLiu commented 3 months ago

Thank you for testing.

As I said, the AI model is for the nozzle camera, It is not designed for the camera sitting beside the printing bed.

Also, I will release an AI model to design for your situation.

If you really want to use the current model for a camera sitting beside the printing bed instead of nozzle camera, the failure score threshold will be from 0.97 to 0.995 (nozzle camera's setup won't work in this situation, like only 0.7 or 0.8). Because your camera is not moving, and there is no motion blur. The reason behind that is the nozzle camera moves with printing head, and it has so high motion blur, so lowing failure score threshold is necessary. While if you use a camera sitting beside the printing bed, it is a stable camera and it won't have any motion blur. so putting high threshold is necessary.

om2804 commented 3 months ago

Also, I will release an AI model to design for your situation.

cool, I'll wait

DrAlexLiu commented 3 months ago

Thanks. Give me some time. I will let you know the update.

May I ask why you don't try nozzle camera? Just because Flying Bear Ghost 5 has an outer frame/enclosure?!

DrAlexLiu commented 3 months ago

Please use: https://github.com/DrAlexLiu/OctoPrint-PiNozCam/archive/master.zip

Then, set the parameter like this: Image Sensitivity:0.02 (0.02-0.04) Failure Scores Threshold: 0.94 (0.94-0.99)

For failures like second pictures, Notify Mode Set to: After reaching the Max Failure Count Max Failure Count: 2 or above

I believe that false alarm, like 2nd picture, would not happen often. But for a real failure, it will send you a lot of messages in a short time.

om2804 commented 3 months ago

Thank you, I installed the new version Doesn't define spaghetti in this case.

Screenshot_3 Screenshot_4 Screenshot_2

DrAlexLiu commented 3 months ago

OK.

In Octoprint, would you please enable the virtual printer? And put the spaghetti on your printing bed. Better to have a desk lamp to provide good light?! I believe your image is a little bit dark. image

You can find a cheap headlight on Aliexpress or Temu. https://www.temu.com/search_result.html?search_key=Headlamp&search_method=user https://www.aliexpress.us/w/wholesale-Headlamp.html?spm=a2g0o.productlist.search.0 Those cheap headlight actually can improve the AI accuracy. And just buy a cheapest one, no need to go for expensive ones.

Also, why don't you put your camera higher, like the first picture. Now your camera may focus on the near printing bed corner, not zoom into the remote spaghetti?!

Start the virtual print, AI will run, but your printer won't print. Check the AI can detect spaghetti or not?! Also, the AI needs some time to get the spaghetti detect. When Notify Mode Set to: After reaching the Max Failure Count, the AI needs to count 2 speghetti founds to trigger the message sent.

Last, may I ask you use pi4 or pi5?

om2804 commented 3 months ago

Без имени

not detect spaghetti :(

Also, why don't you put your camera higher, like the first picture. Now your camera may focus on the near printing bed corner, not zoom into the remote spaghetti?!

The camera is attached to the frame. The table moves along the Z axis.

DrAlexLiu commented 3 months ago

image

Thank you for your update. Here is the result by using the AI, the confidence score is 0.78.

  1. Would you move your camera higher? Because your camera may not focus on the printing object. It may focus on the closer word "flying bear"? Image with focusing not very well leads the low confidence score.

I understand you want to lower the camera position, so the camera can see the first several layers. That is the webcam's shortcoming: The object you print is between the narrow space between the nozzle head and printing bed. And the camera is far away to watch this. I would strongly recommend to use NOZZLE camera mode in this case. The nozzle camera is just below the nozzle, and it can find any error immediately.

  1. Would you please move the light in the position like the third and fourth pictures (Counted from top to down in this thread)? It is better to put the light coming from the back of the camera.

  2. May I ask your camera model? Logitech webcam has a very good auto focus. I encourage you use this brand, like C920, if you really do not want to use nozzle camera.

  3. May I ask your pi model? or other pi? I need to know how fast your Arm CPU is. Thanks.

You can try to lower your confidence threshold:

Image Sensitivity:0.02 (0.02-0.04) Failure Scores Threshold: 0.75 Max Failure Count:2 Notify Mode: After reaching the Max Failure Count Set the undetect zone to put logo and word "flying bear" to black.

Also, in telegram, you also can manually check your printing status. IMG_0774

Last, a PEI sheet will improve your chance of successful print. https://3dflyingbear.com/products/flying-bear-pei-plate-for-ghost5

om2804 commented 3 months ago

1 and 2. I will try

  1. HBVCAM-F2170HD V22, from aliexpress
  2. Orange Pi zero 3
DrAlexLiu commented 3 months ago
  1. Orange Pi zero 3

Could you return this and buy an Orange pi 3B, RK3566 chip? My AI model can use RK3566 NPU and its speed is even faster than RPi5 (75 images per minute). It just 30USD, similar price with Orange Pi Zero 3.

I will release the RKNPU model very soon.

Orange Pi 3B 2GB RAM

om2804 commented 2 months ago
  1. Orange Pi zero 3

Could you return this and buy an Orange pi 3B, RK3566 chip? My AI model can use RK3566 NPU and its speed is even faster than RPi5 (75 images per minute). It just 30USD, similar price with Orange Pi Zero 3.

I will release the RKNPU model very soon.

Orange Pi 3B 2GB RAM

i can't return it

DrAlexLiu commented 2 months ago

Anyway, thank you very much. If you still have any questions related to this, feel free to reopen this.