Technical Projects of Rocscience Co-ops - Winter 2021
Every year, the Rocscience Internship Program attracts many talented students from top Canadian Universities. The program that started in the early 2000s, enables students with the opportunity to work on real-life geotechnical projects that are mentored by our engineers. Students from backgrounds in Civil, Mining, Mathematics, Geotechnical, and Software Engineering work on various projects that range from research to the development of the software. This gives the students the exposure they need while they get ready to take on their career in the field of geotechnical and software engineering as well as benefits Rocscience since a lot of these projects have helped towards building the foundations for a lot of our software features over the years.
The Winter 2021 (January - April) Internship term saw as many as 10 students, all working on extremely interesting projects. Following are the details of two of the projects, essayed by the student themselves:
Regional Convergence Detection by Samanvay Vajpayee (University of Waterloo)
Model non-convergence in RS3 happens due to several modelling issues including missing faces, poor mesh quality, mesh complexity, and other geometrical factors. This project aims at developing a neural network that can predict, with relative accuracy, the probability of different mesh regions causing non-convergence. The overall functionality improves upon the current Mesh Quality functions built into RS3 and defines a process that could increase the ability to identify problem areas. We started by defining two datasets with converging and non-converging models. Customer support tickets helped provide a source for some non-converging models. Based on our discussions with the RS3 FEA engine developers, we came up with a list of geometrical features that affect finite element results accuracy. The Neural Network is trained on features such as the aspect ratio of an element, mesh density, element quality scores, dihedral angles of an element, number of neighboring elements, element volume, and more. We used a Graph Convolutional Network (GCN) to model this problem. GCN operates in layers, which you can stack together to be as deep as you want. Inside each layer, three things are happening: first, the graph structure is normalized. Second, the normalized graph structure is multiplied by the node properties. Finally, each GCN layer has a nonlinearity function applied to the node properties and weights.
Each element in a mesh for a model defines a node with its features. To get these elements with their features, we developed and integrated an element parsing tool with RS3 that lets us export the elements in a model with the features in a CSV file. The tool was optimized for performance and can parse a model with ~10M elements in under a minute. I conducted various experiments with different pre-processing techniques throughout my co-op term when extracting elements from these models with 500K-10M elements before feeding them to the neural network for training. By trying out multiple preprocessing techniques, I optimized the GCN’s prediction accuracy and other evaluation metrics. When trained on the geometrical features only, the ML pipeline’s prediction accuracy was 88%, and the F1 score: 87.8%. After these experiments, we expanded our features to more material-based features like distances of elements from areas of interest like excavations. After conducting numerous experiments, the ML pipeline’s prediction power was optimized to an accuracy of 85.4% and the F1 score: 84.8%. As we can see, the pipeline is relatively accurate at predicting what regions in a mesh would likely cause non-convergence. These predictions from the pipeline are then tied back with the mesh quality tool. The mesh quality tool visualizes these predictions to help the user predict the mesh regions that are most likely the cause of model non-convergence. This project aims to provide more insight to a user when their model doesn’t converge. The pipeline also outputs the correlation between the features, so a user gets the option to see how they can change the values of features of a mesh region to increase its probability of convergence.
Using CPT Data to Output Correlation Length and a Spatially Variable Field by Peter He (University of Waterloo)
The project that I worked on during my term with Rocscience was to create a library of algorithms that would, given Cone Penetration Test (CPT) data, estimate the correlation length over a certain area of soil/rock. The correlation length is defined as the distance over which certain parameters of the soil/rock are similar. This library would be added onto Rocscience's 3D Settlement Analysis program, Settle3, and potentially other software. The creation of this library and its method of estimation is entirely based on the work of Professors Jianye Ching and Zhiyong Yang, from National Taiwan University, and Professor Kok-Kwang Phoon, from the National University of Singapore. These researchers had provided their MATLAB code, which would implement the estimation method that they have presented in their corresponding paper (Phoon et al. 2021). My goal was to understand their paper and the provided code and to create an equivalent library in C++.
The method of estimation that the authors describe in their paper is a combination of sparse Bayesian learning (SBL) and maximum likelihood estimation. Specifically, they use a stochastic expectation maximum (SEM) algorithm to estimate certain parameters of interest, such as correlation length, from a maximum likelihood function and use those estimates to simulate ideal data. With this ideal data, an SBL method can be applied for the purpose of probabilistic site characterization.
This project has personally benefitted me in many ways. Through understanding the research paper and the corresponding MATLAB code, I learned a lot about novel techniques in statistics, and how they can be applied in the real world, such as in geotechnical applications. For instance, the SEM algorithm used in this project solves a maximum likelihood problem when there is missing data, which is definitely something that caught my interest and is a technique I may use in the future.
When I began migrating the MATLAB code to C++, I realized there were many functions and tools that were available in MATLAB by default, but not available in C++. This includes operations on matrices and vectors, as well as the optimization of multivariable functions. I learned a lot more about how linear algebra functions are implemented in code, as well as how to import a third-party C++ library into a large software application such as Settle3 with Visual Studio.
Rocscience is always eager to study and incorporate the latest research in their software and this project has helped us do just that. Beginning as an add-on to Settle3, we intend to add this library to other software in the future. In Slide2 for example, where a spatial variability analysis can be performed, this library can be used for the estimation of the correlation lengths needed to set up such an analysis.
Reference: Ching, J., Phoon, K.K., Zhiyong Yang (2020). Dealing with non-lattice data in three-dimensional probabilistic site characterization, ASCE Journal of Engineering Mechanics, 147(5)