Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GSoC 2021] Automatic Realization of AI-Based EM Models #294

Open
wants to merge 54 commits into
base: devel
Choose a base branch
from

Conversation

utsav-akhaury
Copy link

@utsav-akhaury utsav-akhaury commented Aug 17, 2021

[GSoC 2021] Automatic Realization of AI-Based EM Models

This pull request contains the work done by me during GSoC 2021. Throughout this project, I, along with my mentors, worked on integrating an automatic AI-based scheme into the gprMax environment that provides real-time FDTD solutions to the user.

The project was divided into two main sub-tasks:

  1. Modifying the gprMax code to allow the user to generate multiple GPR models with randomly varying parameters (introduced as the Random Parameter Generation feature in the devel branch).
  2. Implementing a Machine Learning (ML) based Forward Solver that is trained on a batch of GPR models generated using the Random Parameter Generation feature.

Random Parameter Generation Mode

This new feature allows the generation of random parameters for a specific EM model. It allows the user to specify the probability distribution function (PDF) from which these parameters are randomly drawn. Subsequently, for every parameter inside a hash command, the user must enter two values (in pairs) that define the specified PDF's parameters.

All the randomly generated parameters are automatically saved to a pickle file in the same directory as the input file.

This feature can easily be used along with the -n command line argument. For every iteration, a new set of random parameters would be generated and a new row would be appended to the pickle file.

We also introduced a new command line flag: --no-h5, which instructs gprMax to skip saving the output .h5 files.

The detailed documentation can be found here.

Machine Learning-based Forward Solver

The implemented ML framework uses an innovative training method that combines a dimensionality reduction technique (such as PCA or SVD) and a large data set of modeled GPR responses from gprMax. The ML-based forward solver is parameterized for a specific GPR application, but the framework can be applied to many different classes of GPR problems.

Here is a summary of the performance of different ML algorithms on our sample test dataset (after compressing A-scans with PCA):

(NMSE = Normalized Mean Squared Error - Lower NMSE implies better performance)

Method NMSE (on 1250 test samples) Training Time (s)
Random Forest 0.0182 2.8
Random Forest + Chain Regression 0.0809 179.5
XGBoost 0.0285 8.8
XGBoost + Chain Regression 0.1011 17.4
SVM 0.2488 25.7
SVM + Chain Regression 0.2487 22.3
SGDRegressor 0.2394 0.1
SGDRegressor + Chain Regression 0.2402 0.4
Gradient Boosting Regressor 0.1191 17.4
Gradient Boosting Regressor + Chain Regression 0.1302 74.1

The ML folder inside the gprMax devel branch demonstrates the usage of the implemented ML-based solver.

Further Scope & Usage

The ML-based solver can be trained on many different scenarios, depending on the user's needs. We have provided a sample Jupyter notebook along with some useful utility functions (inside the ML repository in the gprMax devel branch). Depending on the scenario being modelled, the user may need to change the hyper-parameters (or use a different ML model) to better fit the data.

utsav-akhaury and others added 30 commits June 15, 2021 23:55
@utsav-akhaury utsav-akhaury marked this pull request as ready for review August 19, 2021 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant