hammad93 / hurricane-net

A deep learning framework for forecasting Atlantic hurricane trajectory and intensity.
Creative Commons Zero v1.0 Universal
45 stars 11 forks source link

Loss Function of Geographic Coordinates #13

Open hammad93 opened 1 year ago

hammad93 commented 1 year ago

When understanding something like mean squared error as a loss for the neurons in a machine learning model, the formula wants to calculate the difference between two values. When these two values represent geographic locations like latitude and longitude, arithmetic subtraction is not an accurate estimate of the distance. We have to incorporate the Great Circle calculations with a projection like WGS84 to get a better estimate of the distance.

Because the neural network optimizes based on this loss, a custom loss function that is similar to mean squared error but incorporates the error of geographic coordinates utilizing the Great Circle formula will likely do better on validating steps that also utilize the Great Circle formula.

hammad93 commented 10 months ago

The differences in distance is on a cartesian plane for things like mean squared error but it should be in a spherical coordinate plane. This more accurately describes the error in real distance.

https://mathworld.wolfram.com/CircularSegment.html image

If we take the arithmetic difference between the two coordinates, it will produce the length in the diagram a or chord length but we are trying to get the arc length, s

We might need to find another way to implement our error functions like Mean Squared Error or Mean Average Percent Error such that it is taking the arc length since this more accurate models the position and distance a tropical storm travels.

hammad93 commented 10 months ago

Earth can be approximated with an ellipsoid and WGS84 has these ellipsoid parameters that we can use to construct arc length.

https://epsg.org/ellipsoid_7030/WGS-84.html

hammad93 commented 10 months ago

A moonshot solution to this would be to utilize the SRTM topography data to get a better approximation. In 2023, we don't have the computational resources to incorporate it into current neural network loss functions.

hammad93 commented 10 months ago

https://stats.stackexchange.com/questions/565038/why-doesnt-mean-square-error-work-in-case-of-angular-data https://stats.stackexchange.com/questions/6896/best-distance-measure-to-use-to-compare-vectors-of-angles?rq=1

hammad93 commented 9 months ago

Why do we have lossly maps?