Help needed with AI & Zones

General discussion about Blue Iris

Moderators: HeneryH, TimG

Post Reply
SardoN
Posts: 5
Joined: Sat Jan 21, 2023 8:52 am

Help needed with AI & Zones

Post by SardoN » Fri Feb 03, 2023 10:28 pm

Hello

Ok well I don't know where to begin. Also, I know this is going to probably look really strange what I share here in terms of my custom zone I previously used, but the way I had blue iris working covering my balcony worked very well . The only problem is that on occasion with a car that drove past etc though the railing I'd get false alerts ping up. As I said it worked well and it took me ages to draw the mask over the railings. But to reiterate I would get false flags, but very rare.. lights appearing, overcast days etc...

So in the last couple of days I have setup and installed CodeProject.AI and it seems to work very well however, it doesn't work with my existing zone and I'm not sure why, I thought the object in this case a human would trigger the AI to capture but it isn't working with my old zone.. the zone is attached which you can see in yellow.

In order for AI to capture and alert me I have to completely turn off "Use zones and hot spots - Under Motion Sensor" or I get no alert notifications .. I'm confused to be honest.

So what I want to know is what is the best way to set this up now ? Do I delete this zone ? As you can see from the other attached image, it's picking up humans downstairs and I do not want this. All I want BI to capture is someone a human walking towards my door and that's it, so I've set the AI to capture "persons" but it's capturing humans downstairs :(

I also had an audio sound play on my PC when motion was detected and that was going nuts today every other second because steam/mist was being captured from my neighbour downstairs. I had to go into the settings and thank god there was an option to tie that audio alert to "Require AI Object" so that worked well.

So, the major problem I face is that I do not want to capture anything downstairs or through that railing.. So what do I need to do ? Ken from BI support said that zones work in conjunction with AI but my existing zone (the attached) does not work? Maybe because it's patchy, no idea. Please bare in mind the manual paint job took me ages to create over the railings and it was my best attempt to limit false flags downstairs prior to the implementation of AI and as previously stated, it worked very well. I was notified 100% when someone was coming toward my front door and only a very few false flags would happen..

However, now with CodeProject AI it's really going to limit false-flags but it does capture people downstairs. I've reached out to Ken and the peeps in support but haven't heard back.

Reading the online help documentation in the software it is saying something like you can define zones and they go on to say what can pass between zones .. I don't know it's confusing.. but if it's making reference to a possibility that I can create a zone A and then draw that over my balcony and then create a zone B downstairs and make a rule that allows objects only from Zone A to pass to into B and not the other way round then maybe that may be the solution I seek, I have no idea.

Does anyone know what I need to do in order to resolve the problem with capturing humans downstairs?

I can always turn off AI and go back to the way it was, and it really worked but I wanted to try and move forward and really limit false flags and AI seemed the best solution.

I hope I explained this properly and if someone can help me I'd really be ever so grateful

Kind regards,
SN
Attachments
Old-Zone.jpg
Balcony.20230203_160000.1401840.3-1.jpg
PaulDaisy
Posts: 83
Joined: Mon Jan 16, 2023 5:06 pm

Re: Help needed with AI & Zones

Post by PaulDaisy » Fri Feb 03, 2023 10:46 pm

Do you have another zone that does include the downstairs area? You can check if that area is masked out from detection by enabling the "Blackout" feature in Motion Detection. If blacked out, nothing there will trigger BI, but if something else triggers, then I think that the entire frame will pass to CPAI and it will detect persons downstairs.
From your picture it is not totally clear to me where the visitor you are interested in might pass through the camera view. If close to the railing on this side, then Object Size may be your friend. Increasing the object size should also eliminate the detection through the railing.
Here is a video that may help you understand if zone to zone passing is applicable in your case.
In the video, the author is very meticulous with creating isolated zones. I found that if I create zones that even overlap slightly, that still works to detect motion in those zones, but it triggers events like "Motion ABH" (motion detected in zones A, B and Hot zone).
SardoN
Posts: 5
Joined: Sat Jan 21, 2023 8:52 am

Re: Help needed with AI & Zones

Post by SardoN » Sat Feb 04, 2023 8:20 am

Hello and Good morning

Thanks for the reply.

I've attached another image AI created yesterday when I was in receipt of a delivery. You can see from the image which side I'm trying to capture this way.

No I have only the one zone which I created by drawing over the railing in yellow. I'm reluctant to delete it because if I have to revert back to a non AI setup I'll have to draw it again. But in answer to your question, no .. just the one zone

So will the blackout not work because of the AI ?

So basically individuals who walk from left (communal hall) to the right which is where my door is is all I want to capture and nothing else.

I was thinking maybe I could increase the object size last night but I've messed with these settings previously , prior to AI and for some reason which I cannot remember, something went wrong so in my settings my object size is set to the lowest (most sensitive) amount which may be a tad excessive. Maybe your right though, I could increase the object size to that bigger of the humans downstairs as they are obviously truncated because of the distance and it may rule them out altogether...

I basically want to only capture people walking from left to right or right to left on the side of the balcony where I live.. and the problem is that many people run around downstairs which will cause false flags which I'm trying to eliminate.

Like I mentioned above.. The way I created a zone was by painting over the railings in camera view and it worked very well, didn't capture people downstairs at all, and only if a car drove past in the railing section, or the sky went dark to light really quick would I ever get an alert which was great. I was hoping I'd get AI setup to eliminate this false flags even further but it's got much much worse..

Thanks for sending that video I'm going to make a coffee and watch it now thank you
Attachments
Balcony.20230203_080000.6998239.3-1.jpg
ducem
Posts: 65
Joined: Mon Dec 20, 2021 11:39 am

Re: Help needed with AI & Zones

Post by ducem » Sat Feb 04, 2023 12:04 pm

As PaulDaisy mentioned I also think object size is the way to go
PaulDaisy
Posts: 83
Joined: Mon Jan 16, 2023 5:06 pm

Re: Help needed with AI & Zones

Post by PaulDaisy » Sat Feb 04, 2023 6:21 pm

I think a couple of things are happening here. You have two processes taking place: motion detection and object recognition. They are almost independent: when motion is detected, those settings determine if there is a trigger. Then if there is a trigger, AI will either confirm or reject it, resulting in Confirmed or Cancelled alert. Either way, triggered events and clips are still kept in the BI DB. So you have two ways to keep only the objects of interest sending alerts, using all triggers and configuring those to reject uninteresting events, or using the AI confirmed alerts (which will confirm people below, if those are triggering).

First is to tune up the triggering. I understand your intricate Zone A, and you can certainly try to build other zones (like B or C), and test only those: you can un-select zone A in Alerts and it will stop being used, without altering it so you can always go back to it. So, I'd try and create one solid zone that includes the railing, the gaps in the railing and the floor, but clear out the area over the railing. Or even try to create zone B with the entire FOV active, and just increase object size to, like, a lot. Small object size definitely causes high sensitivity, which is not needed, and is a nuisance in this case really, since the person is so close to the camera that it takes up 1/4 of the FOV. What I would do is use a recorded clip, then turn On Testing and Tuning -> Motion detection, then increase object size until all you get is only the person walking in the front to *trigger* (BI will detect motion downstairs too, but the size of the object being greater than say 700 will cause the orange trigger rectangle not to appear on the downstairs or through-the-railing moving objects, even though they will cause green Motion rectangles). In your case I'd also check the Advanced -> Object detection -> Reset detector ... setting and set it to a large number, like 80% since your person can be probably 50% of the image. And if you make zones C and D from left to right, you can tell BI to only trigger when the person crosses in the direction you need (also in Object detection -> Advanced -> Object crosses zones).

AI shouldn't really matter much other than to put a little person figure on the alert since there isn't much else of interest that can happen in this view. If BI doesn't trigger on people downstairs and through the railing, then AI won't confirm those events, even though it looks at the entire frame and would otherwise detect people downstairs, if BI triggers.

You have an interesting challenge, and I think in your case finding a good clip showing the event of interest, and utilizing Testing and Tuning, then tweaking the settings and repeating, is the way to reach the desired result.
SardoN
Posts: 5
Joined: Sat Jan 21, 2023 8:52 am

Re: Help needed with AI & Zones

Post by SardoN » Sun Feb 05, 2023 10:31 am

Hey Paul

Thanks for the all info and appreciate the help.

What you are saying does indeed make sense. However, I have tried the Testing and Tuning using motion detection feature but it didn't seem to adjust the size of the motion which I am trying to adjust it in real-time which shows as blue blocks.. I even set it to the max 1100 just to rule this out out and the pre-recorded video on the balcony of someone approaching, by making changes, it didn't seem to make any adjustment to those blue motion blocks. Bit strange. Cleary I'm must be doing something wrong.

The zone thing for me is still quite confusing but I kind of understand the theory in which and why this should work and thanks for pointing about the zones in the alert section as checkboxes, being able to enable/disable I've never stumbled across that before.

What I ended up doing yesterday whilst there was lots of people (motion) downstairs I took your advice from the previous post and I increased the object size to 250 that size alone prevented objects from being triggered. I lowered it again until it triggering the AI and then I increased it again to find a floor value. I found that 250 put a stop to AI capturing the people downstairs and I continued to monitor it and if it caused another trigger I would have increased it slightly again, but it didn't. So 250 was a good value.

I basically just disabled the zone completely, because as I mentioned previously if I just enabled the customized Zone A which I created for the railing, nothing would be triggered, detected, alerted etc.. nothing.. so I just ended up disabling it and increased the object size to 250 and that seemed to do the trick.

I wanted to ask, is there any downside to not having a zone created and enabled ? As I said, I've disabled it and it seems to be working without capturing the noise downstairs.

However, slight little problem this morning when I went to take out the trash BI CPAI detected me leaving my door which is on the right hand side of the screen (which is good) it means the value of 250 is enough to capture me on the right leaving my premises and I walked towards the left and out of the scope of the camera. On the way back when I got in and checked BI to see if it captured me walking back, it didn't create an alert in the user interface which I thought was very odd of me walking back into the scope of the camera which I thought was very strange because from left to right the object of a person is way bigger in terms of FOV, so what I did is I enabled testing and tuning with AI and played back the footage and it detected me as a Teddy Bear which I thought was funny.. It did also detected me as a person looking through this frame by frame but detected me as a Teddy Bear initially, maybe this caused BI or the AI to cancel the alert I have no idea, but it has now instilled a semi loss of confidence..

I've just reviewed the footage again frame by frame whilst I write this and it did detect me initially as a person for 1 frame then a Teddy Bear for around 5/7 frames then as a Person for the rest of the frames maybe around 15/20 frames whilst walking to right then into my home.

I'm thinking I could leave this as is and add Teddy Bear to the objects "To Confirm" list.. I'm not sure why that would have caused it to cancel an alert or whatever the underlying issue for BI to not have triggered an alert be it BI or CPAI but it has caused me to become somewhat concerned - That should have alerted me regardless because it does state Person for many frame regardless of the Teddy Bear recognition. I'm confused.

Listen, I just want to say thank you anyway Paul for the insight and the help. But to be honest, I'm not really sure what to do at the moment, I cannot afford for BI to not capture someone coming to my door and it'll be the time when I need it most. By me going to take out the trash coming back and it not pushing me returning as an alert to my phone has caused me to become a bit worried. AI cancelled the alert and I don't know why, thus it didn't alert me. I think it's also setup so that blue iris deletes and doesn't display cancelled alerts in the little preview side panel..

I need to make make a choice here.. I either try and tweak this to get it to work or revert back to my old method which worked very well and have it capture everything that enters the custom zone A on the railings. At least that way a false flag at least goes to show the system is working by capturing any motion including the occasion Mag Pie who lands on the railings to say hello :D
PaulDaisy
Posts: 83
Joined: Mon Jan 16, 2023 5:06 pm

Re: Help needed with AI & Zones

Post by PaulDaisy » Sun Feb 05, 2023 8:02 pm

Did you happen to set up directional zone C -> D (or others) crossing the opposite way of what you intended? If not, then the following may apply.

I think what happened with BI not alerting when you went back, the CPAI didn't detect you as a person because you were so close. In the AI settings, you have the option to process the trigger frame and + X real time images afterwards. Usually that is set to a low number, so if the very first frame registers you as a Teddy Bear, and the next X frames don't register you as a person, BI will cancel the alert. You could of course add Teddy Bear to the Confirm list, too.

Note also that in the left panel, when you click the lightning bolt to see Alerts, it will not show the Cancelled alerts. Click on the Folder icon, choose Cancelled alerts and you should see you walking from the left. Then enable the Tuning and AI analysis, and it will show what did the AI see. Only the first detection counted though. I bet it didn't detect a Person in the first few frames, and cancelled the alert.

You have two choices I think: the first, increase the X in "+ real time images" on the AI tab, to say 10. That way AI will analyze many frames every time BI triggers, and likely discover a Person. Second, turn off AI altogether and let BI alert you on every trigger, since the object size now is large enough not to be triggered by things you are not interested in (BI will treat all triggers as Alerts, since there is no rejection by AI).

An observation: since you have Teddy Bear predictions showing, looks like you have Detect common objects turned on. Unless you do have pizzas, teddy bears and zebras coming, you might want to turn that off, and also limit your Custom models to only the relevant ones (ipcam-combined.pl usually suffices). It will make AI process faster.
SardoN
Posts: 5
Joined: Sat Jan 21, 2023 8:52 am

Re: Help needed with AI & Zones

Post by SardoN » Mon Feb 06, 2023 12:16 am

Ok so to quickly recap . No cross zones at all, as it's not even enabled.

Thanks for pointing out that folder option top left, I never even knew this existed and yes I found all the cancelled alerts that way. Thank you for pointing that out.

Upon checked the footage of me walking back, the very first frame and it was a just a single frame was person at 72% then 3 frames of Teddy Bear, ranging from 40-70% then the 6th frame Person , 7th frame Teddy Bear.. Then person then upon checking a tennis racket was detected with the person which were steps.

You've mentioned that I have detect common objects enabled but I cannot find it anywhere, where would this setting/option be located ?

Is it because ipcam-combined.pl is not specified in the Custom section? That section for me currently is blank?

See attached AI Panel of how I have this setup at present.

It would be nice to have AI running the show, but I'm more than happy to revert back to the railing zone A with increased object size and live happily ever after :)

Thanks again Paul for all your help
Attachments
AI_settings.jpg
PaulDaisy
Posts: 83
Joined: Mon Jan 16, 2023 5:06 pm

Re: Help needed with AI & Zones

Post by PaulDaisy » Mon Feb 06, 2023 4:37 pm

SardoN wrote: Mon Feb 06, 2023 12:16 am Upon checked the footage of me walking back, the very first frame and it was a just a single frame was person at 72% then 3 frames of Teddy Bear, ranging from 40-70% then the 6th frame Person , 7th frame Teddy Bear.. Then person then upon checking a tennis racket was detected with the person which were steps.

You've mentioned that I have detect common objects enabled but I cannot find it anywhere, where would this setting/option be located ?

Is it because ipcam-combined.pl is not specified in the Custom section? That section for me currently is blank?
When you tested the clip with Testing and Tuning, the first Person detecting may not be exactly the same as the AI delivered on the Trigger due to pre-trigger buffer, which is usually at least a second. So it most likely is that the Alert was Cancelled because AI never detected a Person in those exact frames it analyzed.

I would increase the "+real time images" to 4 or 6, and space then 100-250 ms apart, if your frame rate is >10. This way the AI will get the first few frames and hopefully will confidently detect a Person.

Common Objects are in the BI Global settings, not in the per-camera settings. Top left corner, Gearbox -> AI -> Default object detection. While you are at it. you can set Use custom model folder and point it to some folder that only ahs ipcam-combined and nothing else (don't try this if you run 5.6.9.x, in which case BI will flip out when you push the "..." next to "Use custom model folder").

I think you could try to turn off "Use zones and hot spot" altogether and see how BI does with just the large object size. Without zones it will use the entire FOV.
SardoN
Posts: 5
Joined: Sat Jan 21, 2023 8:52 am

Re: Help needed with AI & Zones

Post by SardoN » Fri Feb 10, 2023 10:45 am

Thanks for all the info. I'll give it a try and if it all goes pair shaped I'll revert back to the railing zone without AI which I know 100% works well and keeps my CPU usage to a minimum :-)

Thanks for all the help

Regards
SN
Post Reply