+++
title = 'Potential Fields Modeling for ML Target Detection'
description = 'Modeling magnetic targets to support machine learning applications in maritime environments'
date = 2025-03-31T16:00:00-05:00
draft = false
categories = ['USM', 'magnetics']
tags = ['data science', 'KarstTech', 'UUV', 'modeling', 'machine learning', 'COMSOL']
+++

# Potential Fields Modeling to Support Machine Learning Applications in Maritime Environments

The summary below is from a published paper that I co-authored with my colleagues at USM Magnetics. If you would rather read the full paper, you can find it [here](https://www.comsol.com/paper/potential-fields-modeling-to-support-machine-learning-applications-in-maritime-environments-135922).

The primary goal of our magnetic models in this paper is to support detection classification and localization of magnetically active targets using an unmanned underwater vehicle. In addition to helping classify targets, this sensing is used to augment navigation alongside other more traditional sensors. Our team has developed a comprehensive framework using COMSOL Multiphysics as well as other tools, to model gravity and magnetic fields underwater in support of these goals.

## The Challenge We Addressed

We recognized a critical gap in our ability to detect underwater objects like unexploded ordnance, shipwrecks, and geological features. The Earth's constantly changing magnetic field makes predictions based solely on field observations unreliable, and large portions of the earth aren't magnetically mapped at sufficient resolution for anomaly detection. In addition to the lack of data, collection of local geomagnetic anomalies is traditionally done using expensive survey vessels, and adding this sensing capability to low cost UUVs may allow small swarms of autonomous vehicles to map larger areas far more quickly and cheaply.

## Our Simulation Environment

We chose COMSOL Multiphysics 6.2 for our sandbox environment, specifically utilizing the Magnetic Fields, No Currents interface. This allowed us to solve the Poisson equation for magnetostatics and create detailed simulations of how various targets would influence the surrounding magnetic field. We focused on how the interaction between ferromagnetic targets and the Earth's magnetic field would be affected by the target's size, shape, and magnetic permeability, and how that field would be detected by a vehicle equipped with a vector magnetometer.

We modeled different targets—thin, hollow cylinders ("isopipes") of 12 or 24 inches in length—with varying magnetic permeabilities (50, 100, or 200). These targets were not only modeled within our COMSOL simulation environment, but also using other tools including MagPyLib, as well as a magnetic induction ellipsoid model co-developed with the Colorado School of Mines. All of these models were tested against real world data collected in a detailed field experiment.

![Isopipe COMSOL Model](Simplified-COMSOL-Model.jpg "Isopipe COMSOL Model")

## Validation Through Field Tests

To ensure our models were accurate, we conducted field experiments with a low magnetic test platform. This platform had no propulsion to ensure that the only magnetic field influence was from the targets nearby. We drew this platform between two points across water (about 70 meters) using a winch system to maintain a consistent linear path. We placed a variety of known targets underneath this path and collected data using an array of high precision vector magnetometers, with RTK-enhanced GPS to reference position.

![Field Test Sensor Platform](sensor-platform.jpg "Field Test Sensor Platform")

### Sensor Fusion

We used sensor fusion with the IMU, magnetic, and GPS data from the test platform to create a georeferenced magnetic field for our sensor data. The georeferenced data allows combining collections from multiple test passes to create a more complete picture of the magnetic field in the area.

![Sensor Fusion](T7-Magnet-Orientation-Correction-3D.gif "Sensor Fusion")

The sensor fusion techniques that we developed for this project are described in more detail in [this post](/professional-projects/usm-magnetics-sensor-fusion/).

## Agreement with Simulations

![Cylindrical Magnet Target (Left) and Isopipe Target (Right)](sim-vs-test-examples-sidebyside.jpg "Cylindrical Magnet Target (Left) | Isopipe Target (Right)")

For all of the targets tested, the simulated and measured data showed good agreement. A formal study of error sources is briefly mentioned in the paper, but such a thing is difficult to do well since the sources of error are numerous and complex. As an example, the magnetic permeability of the target is a huge factor in the amount of magnetic field anomaly created by induced magnetization, and the difference in permeability can be hundreds of times with only asmall difference in steel alloy composition.

## Machine Learning for Target Classification

With simulations that were refined based on field test data, we proceeded to generate simulated data sets for use in training machine learning models for target classification and localization. Several methods were tested and mentioned in the paper, but since the work is ongoing and rapidly progressing, I will save more details for a future post!


## Future Directions

There's still much work ahead. We're particularly interested in:
- Testing observational data as validation for ML models trained on simulations, including data collected from open water tests with a real UUV.
- Generating predictive models for field operations to estimate distance to target and target type
- Addressing edge computing challenges for deploying these models on UUVs with limited resources
- Developing robust data pipelines for the high-volume sensor data these applications generate, including processing real world data for fine tuning models.
