# What type of neural network should I use to detect meteors in images?

I am currently building a project that takes fisheye images from cameras and detects whether the picture contains a meteor, and if it does it tries to identify where the meteor is.

The images look like this:

I am currently building a project that takes fisheye images from cameras and detects whether the picture contains a meteor.

The images look like this:

The 'circle' in the middle is the actual sky, everything outside it is just black pixels

The meteor is the long flash of light in the middle, the small flashes of light on the 'sides' are lights that come from the cities nearby.

Using opencv's HoughLines I was able to create a program that detects the meteors, however it also detects the lights on the 'sides', so my idea was to train a neural network to only detect the meteors.

How would I go about doing this? I was thinking of using a U-Net neural network, using the images and masks of the images where only the meteor is 'detected' for training, sort of like this example.

This is not a NN solution but can you adjust the parameters to opencv's HoughLine? There should be a way to find just the straight lines. There should be a way to adjust the minimum line length value to be considered a meteors. Meteors will always appear straight. So only keep the results when the points have similar slopes and are near each other?

See this example:

import cv2
import numpy as np

gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(gray,50,150,apertureSize = 3)
minLineLength = 100
maxLineGap = 10
lines = cv2.HoughLinesP(edges,1,np.pi/180,100,minLineLength,maxLineGap)
for x1,y1,x2,y2 in lines[0]:
cv2.line(img,(x1,y1),(x2,y2),(0,255,0),2)

cv2.imwrite('houghlines5.jpg',img)


Source

• Why will meteors always appear straight? – kbrose Dec 19 '18 at 23:46
• Yes, the meteors will pretty much always be straight, or have only a very slight curvature – HmirceaD Dec 20 '18 at 6:26
• Thank you for the opencv solution, I will try this along the nn :) – HmirceaD Dec 20 '18 at 6:28

A convolutional neural network will almost certainly work well for this problem. A U Net is overkill. You would use that if you need to identify where in the image the meteorite is.

Just make sure you augment your data set by rotating your example images.

• And due to that, you need to augment the front layer to accommodate for the additional non rotation invariant filter you sill require. – Matthieu Brucher Dec 19 '18 at 19:07
• I don't know what you mean. Can you explain what the "that" is in "And due to that"? – kbrose Dec 19 '18 at 23:45
• Actually could you explain your whole comment? I don't know what you mean by any of it. – kbrose Dec 19 '18 at 23:48
• Yes, I forgot to mention I also need the position of the meteor on the image in orded to get it's real life coordinates and to do some further analyzing – HmirceaD Dec 20 '18 at 6:25
• To accommodate for the rotation, you need to get more nodes on your CNN layer. That means more training, more data, more chance for under or overfitting. – Matthieu Brucher Dec 20 '18 at 8:12

As you want some rotation invariance to your neural network, traditional convolutional layers will not be enough. Of course, you can try to see how much data you would need to use only traditional CNN layers.

I would advise to look at RIFD-CNN as a starting point (cited lots of times despite being "quite" recent).

To get the position, you can backtrace in your NN up to the pool layers to see which part where activated. Once you have the part that are activated, you can know the position of your object.

"detects whether the picture contains a meteor, and if it does it tries to identify where the meteor is."

This sounds like a classical object detection problem.

So you can find some existing object detection models and train them on your own dataset.