Seeking Assistance with Eliminating False Positives in Motion Detection

General discussion about Blue Iris
User avatar
Sardon
Posts: 114
Joined: Sun Nov 19, 2023 10:50 am

Re: Seeking Assistance with Eliminating False Positives in Motion Detection

Post by Sardon »

Just when I was on the brink of giving up, I came across the the latest response from Pogo, which has reignited a bit of hope in me to not throw in the towel just yet.

Your input has sparked an idea in me. I've revisited the alerts from yesterday morning and carried out the analysis using motion detection feature. Not sure if this sheds any light, no pun, but here is the link:

Analysis of motion detection: https://drive.google.com/file/d/1-XuZhd ... sp=sharing

As for the camera, its placement is here:
camera-position.jpg
camera-position.jpg (33.79 KiB) Viewed 1329 times
I'm also considering uninstalling CodeProject. Before I do, I'd like to pick TimG's brain on this matter.

I believe if it detected a human, this system would be effective. Whenever someone approaches the door, or there's another false positive, I receive an audio notification, which is excellent. So, Pogo's zone method is working, with the image being passed to the AI, although it reports no findings.

My guess is that it's due to my inability to specify a custom model – it's all greyed out
Restart-AI.jpg
Restart-AI.jpg (46.11 KiB) Viewed 1329 times
Selecting the custom model option just prompts a message to restart the AI server to refresh the list. Despite restarting everything, the message frustratingly remains.

If it were to actually detecting a human, it would help me determine whether the system works. However, I suspect the issue lies with the beta version of CPAI 2.3.4-Beta

This is my last attempt before I remove it all and revert to the trip wire method (easily done) until further steps can be taken. I have a hunch that if the AI could recognise a person, as shown in the cancelled alerts below, it would certainly enable me to rule out if it helps with the issue with the light changes:
nothing-found.jpg
nothing-found.jpg (17.93 KiB) Viewed 1329 times
In the interim, I think this would be helpful to utilise while I search for a simpler solution, as suggested by Pogo and obtaining a better spec camera. At this point, I simply cannot cope with 10 alerts every minute. Whether it's AI, Poor-Mans, Rich-Mans methods, any solution that can circumvent these alerts would be welcome.

I'm still hopeful. I believe the AI might work if I could just select a custom model, like 'ipcam-general', as previously advised.

I'm unsure why it's reporting back with Nothing Found as confidence has even been set to 50%. I'd welcome a Pizza or Teddy Bare alert at this stage like it used to previously...

I've also figured out how to access and analyse the .dat files by importing them into Blue Iris by means of drag and drop. Tests in my hallway work, detects my cat and myself as a human however sometimes the cat is flagged up as a dog. But it proves it's working just not on that balcony.

However, the recent cancelled alerts didn't update nor create the .dat file, as it was deemed 'Nothing Found' so I presume reason for not being created was because nothing was written to it as it was disregarded.

As I've read online, during some hours doing research on this matter, some suggest the issue with the custom models not being able to be selected might be due to the beta version. Where can one find and download the standard non-beta 2.3.4 version? There's even a 2.5.1 beta version, but I can't find a link to that. All download pages including on codeproject.com all lead to this inadequate beta version, which doesn't support custom models, even on GitHub.

No pun intended, but despite my endeavours, "Nothing Found!

Pogo, I'm definitely on the lookout for a new camera, but in the interim I would just like to exhaust all options including Code Project before proceeding. Rest assured, your advice has not been in vain. I'm still utilising the tripwire zone which seems to work great in conjunction with the AI, it's just a shame that AI is being a bit of a pain by telling me it's finding nothing yet it's even capturing the event and logging and storing it in cancelled.. I just want to test and see if this Code Project can overcome the issue with the lighting changes. Both the effort from you and TimG who have clearly invested in this thread have been immensely appreciated.

Depending on TimG's response to the AI aspects, I'll decide whether to remove CPAI completely and bid it farewell.

Best regards,
User avatar
TimG
Posts: 2098
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: Seeking Assistance with Eliminating False Positives in Motion Detection

Post by TimG »

Off for Zzz's now, but if you can show us your actual camera AI settings I will look tomorrow.

Also the easy way to view DAT files is to hold Ctrl and double click an Alert video that has DAT enabled.

All CPAI is beta, as it simply isn't quite ready for main stream usage yet. It gets closer with every release though. You should be OK with your present version.

My CPAI now does things like:
1. My drive lights only turn on for a person, but not a car or a dog etc. BI5, CPAI and Homeseer.
2. My garage lights flash three times when my car approaches the house. BI5, CPAI ALPR and Homeseer.

I understand Pogo looks for the simplest way, but I do think he could be missing out with ONVIF commands which some cameras can send out for Person/ Car/ Dog, and BI5 can read them directly. I've been experimenting with this for a couple of weeks now with my Reolink doorbell.
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
User avatar
Pogo
Posts: 396
Joined: Tue Jul 18, 2023 7:21 pm
Location: Reportedly in the Area

Re: Seeking Assistance with Eliminating False Positives in Motion Detection

Post by Pogo »

Pogo, I'm definitely on the lookout for a new camera, but in the interim I would just like to exhaust all options including Code Project...

You sure are a stubborn one! LOL

And speaking of exhaustion, I sure am.

With the thread at over a half million views and counting, it would certainly be refreshing to hear others' suggestions, methods and observations..., even Tim's! :D

I've enjoyed the exercise tremendously, but I'm all out of bullets.

Best of luck as your journey continues. Please don't give up.

Feel free to shoot me a PM if there is anything you may wish to discuss on the side.

Otherwise, I respectfully yield the floor.

TimG wrote: Tue Jan 23, 2024 10:23 pm I understand Pogo looks for the simplest way, but I do think he could be missing out with ONVIF commands which some cameras can send out for Person/ Car/ Dog, and BI5 can read them directly.
You haven't been paying attention. And for the record, I look for the best way. LOL
louyo
Posts: 161
Joined: Sat Apr 18, 2020 1:16 am

Re: Seeking Assistance with Eliminating False Positives in Motion Detection

Post by louyo »

Not sure if this helps. I run CPAI in a docker image on another system but that shouldn't matter. The AI page in BI just shows a list of the available models, the one(s) you want to use get specified in the camera settings. On the camera alert page, I specify persons and ipcam-general (contains persons and vehicles).
BI_AI.PNG
BI_AI.PNG (178.91 KiB) Viewed 1300 times
alertAi.PNG
alertAi.PNG (205.68 KiB) Viewed 1300 times
User avatar
Sardon
Posts: 114
Joined: Sun Nov 19, 2023 10:50 am

Re: Seeking Assistance with Eliminating False Positives in Motion Detection

Post by Sardon »

louyo wrote: Wed Jan 24, 2024 2:36 am Not sure if this helps. I run CPAI in a docker image on another system but that shouldn't matter. The AI page in BI just shows a list of the available models, the one(s) you want to use get specified in the camera settings. On the camera alert page, I specify persons and ipcam-general (contains persons and vehicles).BI_AI.PNGalertAi.PNG
Thank you for highlighting that, Louyo.

All settings are now correctly adjusted. In fact, for testing purposes I'll send ten images of the balcony to CPAI for analysis, spaced 500 milliseconds apart, and observe the outcomes with a 50% confidence level.

Hopefully this works!
User avatar
Sardon
Posts: 114
Joined: Sun Nov 19, 2023 10:50 am

Re: Seeking Assistance with Eliminating False Positives in Motion Detection

Post by Sardon »

I'm still experiencing issues on the balcony. My hallway camera works fine and integrates flawlessly with CPAI using the ipcam-general model or others.

I've attached a photo of the hallway, of me re-entering my home and I was perfectly identified.
hallway-fine.jpg
hallway-fine.jpg (12.14 KiB) Viewed 1272 times
Other models, such as ipcam-combined, detect objects like my chair and cat. However, CPAI's use in the hallway is only for testing, and it's performing satisfactorily.

Here are my settings for the main and balcony-specific configurations:
Main.jpg
Main.jpg (29.84 KiB) Viewed 1272 times
Alert-conf.jpg
Alert-conf.jpg (33.42 KiB) Viewed 1272 times
The only distinction between the Balcony and Hallway cameras is that the latter doesn't have a designated zone and relies solely on motion detection being enabled.

I also came across a forum thread that sparked my curiosity:

DeepStack: Alert Cancelled: Nothing Found: viewtopic.php?t=2197

Another piece of info I stumbled across elsewhere was to disable half-precision, which I've done. It makes no difference to the hallway camera, whether it's on or off.

This led me to suspect a zone issue. After examining the .dat file, (thanks for pointing out holding the CTRL key) it was clear that insufficient imagery was being passed to CP by using the tripwire zone, to confirm whether the subject is a person. I wouldn't have realised this without reviewing the .dat file.
Consequently, I restored my original zone from the backup (drawn over railings edition) to increase coverage, but to no avail.

The .dat file shows the following:

https://drive.google.com/file/d/1-i3Yza ... sp=sharing

Despite this zone layout, the tops of heads are cropped off. However, I didn't expect this to be problematic. The ipcam-general model used in the hallway identified a partially visible hanging jacket as a person. The images sent to CP on the balcony cover much more than just a partial jacket and a sleeve.

Balcony settings: confidence set to 50%, 10 real-time images at 500ms intervals.

The issue is, if removing the zone works it'll result in capturing people in the drive path and playground downstairs, which will probably be or par to the amount of alerts caused by lighting changes. No win situation if this is the case. I recall from the last time I was experimenting with all this it was detecting humans downstairs as small as ants. I believe TimG suggested in my very old thread to increasing the object detection size. I wish I could return to that precise point to make further adjustments.

Hopefully, what I've shared illuminates some insight into the possible issue. It might be the zone, but then again, AI should be able to identify a person even without seeing their head.

P.S. In the middle of the night, I did in fact, read a complete setup guide and it was in there in which it suggested to use a minimum or 10 real time images set to 500ms.. walk out past the camera and was captured thus a successful alert was triggered.. However, it didn't catch me on the way back "Nothing Found".. Hmmm

Any input would be greatly appreciated as always
louyo
Posts: 161
Joined: Sat Apr 18, 2020 1:16 am

Re: Seeking Assistance with Eliminating False Positives in Motion Detection

Post by louyo »

>>AI should be able to identify a person even without seeing their head.
AI, in our use, is nothing more than a (very good, free) program that looks through a database (the ipcam-general "model") to compare our passed in images for a person or vehicle match. We do not, at this time, have the ability to try to correct the model. We could, if we wanted to learn how, create our own models. Keep in mind that this is all provided by people who volunteer their time and effort. Only the Blue Iris side is paid, and it is very reasonable IMO.
None of our cameras hits 100% in avoiding false or missed captures. When I looked at cancelled alerts (in the Web GUI), I could usually see why the "mistake" was made. I could see how a cat would identify as a person due to shadows at night, why some steel steps alerted as a vehicle at night. Why a missed trigger in BI was due to contrasts of colors. I have my settings on those cameras using AI after much experimentation. I took jpegs and fed them directly into CPAI to see what was found (or not found). My cameras seem to do better with those settings, because of our environment.
If you are missing persons due to the angle/view of your camera, I think your choices are:
1. Move the camera.
2. Create your own AI model.
3. Stop using AI and live with the false alerts.
Opinion: We are using a very powerful and flexible NVR program that needs to react to real time. Alas, it is not running on a real time operating system. Although one might think we can do better with a hardware NVR, my experience with a Hikvision NVR is otherwise. Maybe some day down the line this magical AI world will make it all perfect. I will probably not live so long. :)

BTW: The option of using main stream is a waste of resources from what I am told. The image resolution is sized before being passed in. I also think that things can happen that would be missed at half second intervals.

Just my 2 cents. I hope you find a balance that satisfies you. Keep experimenting and enlighten us with your findings. We are all in this together.
User avatar
TimG
Posts: 2098
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: Seeking Assistance with Eliminating False Positives in Motion Detection

Post by TimG »

"Begin analysis with motion leading image" is great for movement detection, but bad for identifying what the edge of something actually is. I turn it off in ALPR as I need the car in the middle of the image, try it here too.
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
User avatar
Sardon
Posts: 114
Joined: Sun Nov 19, 2023 10:50 am

Re: Seeking Assistance with Eliminating False Positives in Motion Detection

Post by Sardon »

Regarding my setup, I believe I've made a significant breakthrough. By analysing the .dat file in which I recently shared via URL video it was clearly obvious the zone was cutting he heads off thus affecting the AI models and by removing the specific zone completely, I've managed to achieve detections and it seems to now be capturing whilst cancelling out false alerts to some degree. No need to relocate the camera isn't feasible due to aesthetic and coverage concerns.

In terms of the main stream issue you mentioned, The Foscam camera appears to lack a sub stream option. My Annke has both main/sub streams which are visible in the options. I'm currently deliberating whether to keep the main stream enabled or disable it as things appear to be working at present?

I'll continue to monitor how this affects performance, especially with varying light conditions and the movement of people below.

Additionally, I'm exploring the possibility of integrating motion detection with a strategically newly created zone. My thought is to include a zone that captures and includes the head of a person, minimising extraneous outside boundary captures. I understand this might still result in some unwanted detections, but I'm hoping that by adjusting the object detection size, perhaps with a setting of a threshold of 400 or above, in conjunction with a new zone might refine the process further.

I wanted to enquire, and it might seem like a basic question about the object size setting. Can I directly correlate this to the size of a person detected by the AI downstairs, and simply adjust the object size by using the slider to make it larger than the detected object in terms the box size? Hope that makes sense.

I've also just updated to the latest version, 2.5.1, which was released this morning. I'm eager to see how these adjustments play out in real-world scenarios.

Thanks again

Best regards,
SN
User avatar
TimG
Posts: 2098
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: Seeking Assistance with Eliminating False Positives in Motion Detection

Post by TimG »

We will be asking you for advice now 8-)
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
Post Reply