Snake detection AI - Page 1
Forum section: electronics / general

author: NiHaoMike
author_rank: Super Contributor
timestamp: October 02, 2022, 10:29:16 pm
content: Is there a good existing project for detecting snakes in videos? It doesn't have to identify the kind of snake, just whether or not there's a snake in the frame.The problem I'm trying to solve is that a good friend of mine is absolutely terrified of snakes even in videos, I want to screen videos so I can watch them with her without her freaking out and completely spoiling the experience. (It could be a completely harmless snake in a situation where it can't get near her and she'll still freak out, that's what makes it so problematic.)

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 04, 2022, 12:51:06 pm
content: This is not the answer you are looking for, but... ophidiophobia is quite treatable with exposure therapy and cognitive behavioural therapy. Even though it is natural (like arachnophobia; that is, these phobia may be naturally evolved in us humans), there is absolutely no reason to suffer from it.I have slight arachnophobia myself –– that is, I still jump a bit initially at seeing one –– but it is no longer an issue: I can even let an arachnid walk on me. In my case, it happened naturally, because where I grew up, they were very efficient in nabbing mosquitoes, gnats, and no-see-ums ("hyttynen", "mäkäräinen", "polttiainen"), especially indoors. Basically, they were preying on pests thatreallybothered me. I just couldn't perceive something doing such a favour for me as any kind of a danger, especially because there are zero arachnid species dangerous to humans in Finland (and only a single venomous ophid species, vipera berus, with venom not much worse than a bee sting). The change didn't happen before I was an adult, though.I do like ophids (and mustelids and foxes) a lot, specifically because they prey on bank voles, which can carry thePuumala orthohantavirus. Native Finns seem to have a natural, inherited1protection against it, so much so that children usually show no symptoms or mild cold like symptoms at most, but it is dangerous to anyone without genetic roots in Northern Europe.Again, when something or someone does me so big a favour and expecting nothing in return, and are physically no danger to myself at all, I just cannot help but feel they're a positive thing in my life. I still jump a bit, but that's all.Perhaps your friend could find something similar? As someone who has had issues with panic attacks –– the first one when I was thirty years old or so! –– and dealt with them in a similar manner, I can attest that dealing with this kind of thing is much better, and much less work, than just trying to avoid it.1Analysis of5000-year-old DNA taken from remains found in Swedenmost closely matched modern-day Finnish individuals, which indicates that the majority of modern Finnish population has resided in the Fennoscandic area for at least 5000 years; even though this is an unacceptable concept to modern Finns and most Swedes, who insist Finns are a recent arrival, a Turanic people originating from a bend in the river Volga in current Russia about a thousand years ago, with the Sámi having been pushed North due to the invading Finns. Because archaeological record matches the bog body DNA samples, Finland has stopped supporting any research into this, to retain the political and ideologicalstatus quo, and stop facts from muddying an 'useful' political narrative.

author: NiHaoMike
author_rank: Super Contributor
timestamp: October 04, 2022, 11:46:40 pm
content: She's really afraid, I don't think it would be an easy fix. Actual message from her:QuoteAlthough in the long term fixing the problem would be better, in the near term I think an AI would be a good workaround.

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 05, 2022, 12:43:58 am
content: Quote from: NiHaoMike on October 04, 2022, 11:46:40 pmIt is not as easy as shown in some TV shows, but with a therapist specializing in this (via cognitive behavioural therapy and exposure therapy), it is quite straightforward and effective. The fear itself does not "go away", the end result is more that you do not get a panic attack or lose control of your body or want to run away: you stay fully functional and aware that there is no danger. Essentially, you just overcome the fear. (Well, many do lose the fear too, in time, via repeated exposure, but that can take years.)As to the image detection, I don't think such a project would be particularly successful, because many pets mistake ropes and cucumbers with snakes. Expecting "an AI" to do better is not very realistic, I think.

author: NiHaoMike
author_rank: Super Contributor
timestamp: October 05, 2022, 12:55:18 am
content: Quote from: Nominal Animal on October 05, 2022, 12:43:58 amI'm thinking of a script I can run that would flag times where there may be a snake, then I can review to confirm. False positives are OK as long as they don't happen so often that the script becomes useless.

author: rstofer
author_rank: Super Contributor
timestamp: October 06, 2022, 03:30:08 pm
content: Good luck finding a pretrained model. If it exists, it will be buried in academia.In any event, the project goes toward Computer Vision and Object Detection:https://towardsdatascience.com/object-detection-using-google-ai-open-images-541ea601cfa5It's a fairly well understood process but it takes a LOT of images. Probably on the order of 10,000 images with snakes (there are lots of kinds of snakes and many poses) and 10,000 images of similar backgrounds without snakes. Getting the images is the real problem. Maybe Google has some, probably not.A little study in Convolutional Neural Networks will help because one thing is certain, you need to reduce the dimensionality of a million+ pixel image. Starting with Tensorflow and Keras is probably good although there are several alternatives. MATLAB has a very easy CNN approach. It takes about 50 lines of code to recognize hand written digits.https://youtu.be/py5byOOHZM8https://towardsdatascience.com/mnist-handwritten-digits-classification-using-a-convolutional-neural-network-cnn-af5fafbc35e9https://www.mathworks.com/help/deeplearning/ug/data-sets-for-deep-learning.htmlConsidering the size of the problem, I have no idea how much compute time it will take to train the snake model but I'll bet it is months on a CPU and weeks on a GPU. Google, among others, sells time on their massively parallel GPUs and parallelism is important when you are multiplying million element tensors.Good luck! I'm one of those with an unhealthy fear of snakes. Probably a result of nearly being eaten in a couple of rattlesnake encounters. And, yes, southern fried rattlesnake does taste like chicken.ETA: I ran across this but haven't pursued it:https://deeplearning.cms.waikato.ac.nz/user-guide/class-maps/IMAGENET/