MagMap – Accurate Magnetic Characteristic Mapping Using Machine Learning

PGR JGI Seed Corn Funding Project Blog 2023/24: Binyu Cui

Introduction:

Magnetic components, such as inductors, play a crucial role in nearly all power electronics applications and are typically known to be the least efficient components, significantly affecting overall system performance and efficiency. Despite extensive research and analysis on the characteristics of magnetic components, a satisfactory first-principle model for their characterization remains elusive due to the nonlinear mechanisms and complex factors such as geometries and fabrication methods. My current research focuses on the characterization and modelling of magnetic core loss, which is essential for power electronics design. This research has practical applications in areas such as the fast charging of electric vehicles and the design of electric motors.

Traditional modelling methods have relied on empirical equations, such as the Steinmetz equation and the Jiles-Atherton hysteresis model, which require parameters to be curve-fitted in advance. Although these methods have been refined over generations (e.g., MSE and iGSE), they still face practical limitations. In contrast, data-driven techniques, such as machine learning with neural networks, have demonstrated advantages in addressing multivariable nonlinear regression problems.

Thanks to the funding and support from the JGI Institute, the interdisciplinary project “MagMap” has been initiated. This project encompasses testing platform modifications, database setup, and neural network development, advancing the characterization and modelling of magnetic core loss.

Outcome

Previously, a large-signal automated testing platform is produced to evaluate the magnetic characteristics under various conditions. Fig. 1 shows the layout of the hardware section of the testing platform and Fig. 2 shows the user interface of the software that is currently used for the testing. With the help of JGI, I have managed to update the automated procedure of the platform including the point-to-point testing workflow and the large signal inductance characterizing. This testing platform is crucial for generating the practical database for the further machine learning process as its automated function has largely increased the testing efficiency of each operating point (approx 6-8s per data point).

Labelled electrical components in a automated testing platform
Fig. 1. Layout of the automated testing platform.
Code instructions for the interface of the automated testing platform
Fig. 2. User interface of the automated testing platform.

Utilizing the current database, a Long Short-Term Memory (LSTM) model has been developed to predict core loss directly from the input voltage. The model shows a better performance in deducing the core loss than traditional empirical models such as the improved generalized Steinmetz equation. A screenshot of the code outcome is shown in Fig. 3 and an example result of the model for one material is shown in Figure 4. A feedforward neural network has been tried out as a scalar-to-scalar model to deduce the core loss directly from a series of input scalars including the magnetic

flux density amplitude, frequency and duty cycle. Despite the accuracy of the training process, there are limitations in the input waveform types. Convolutional neural networks have also been tested before using the LSTM as a sequence-to-scalar model. However, the model size is significantly larger than the LSTM with hardly any improvement in accuracy.

Code for the demo outcome of the LSTM
Fig. 3. Demo outcome of the LSTM.
Bar chart showing ratio of data points against relative error code loss (%)
Fig. 4. Model performance against the ratio of validation sets used in the training.

Future Plan:

Although core loss measurement and modelling is a key issue in industrial applications, the reason behind these difficulties is the non-linear relationship between the magnetic flux density and the magnetic field strength which is also known as the permeability of the magnetic material. The permeability of ferromagnetic is very sensitive to a series of external parameters including temperature, induced current, frequency and input waveform types. With an accurate fitting between the relationship of magnetic flux density and field strength, not only

the core loss can be precisely calculated but also the current modelling method that is used in Ansys and COMSOL can be improved.

Acknowledgement:

I would like to extend my gratitude to JGI for funding this research and for their unwavering support throughout the project. I am also deeply thankful to Dr. Jun Wang for his continuous support. Additionally, I would also like to express my appreciation to Mr. Yuming Huo for his invaluable advice and assistance with the neural network coding process.

Unveiling Hidden Musical Semantics: Compositionality in Music Ngram Embeddings 

PGR JGI Seed Corn Funding Project Blog 2023/24: Zhijin Guo 

Introduction

The overall aim of this project is to analyse music scores by machine learning.  These of course are different from sound recordings of music, since they are symbolic representations of what musicians play.  But with encoded versions of these scores (in which the graphical symbols used by musicians are rendered as categorical data) we have the chance to turn these instructions in various sequences of pitches, harmonies, rhythms, and so on. 

What were the aims of the seed corn project? 

CRIM concerns a special genre of works from sixteenth century Europe in which a composer took some pre-existing piece and adapted the various melodies and harmonies in it to create a new but related composition. More specifically, the CRIM Project is concerned with polyphonic music, in which several independent lines are combined in contrapuntal combinations. As in the case of any given style of music, the patterns that composers create follow certain rules:  they write using stereotypical melodic and rhythmic patterns. And they combine these tunes (‘soggetti’, from the Italian word for ‘subject’ or ‘theme’) in stereotypical ways. So, we have the dimensions of melody (line), rhythm (time), and harmony (what we’d get if we slice through the music at each instant. 

A network of musical notations
Figure 1. An illustration of music graph, nodes are music ngrams and edges are different relations between them. Image generated by DALL·E.

We might thus ask the following kinds of questions about music: 

  • Starting from a given composition, what would be its nearest neighbour, based on any given set of patterns we might chose to represent?  A machine would of course not know anything about the composer, genre, or borrowing involved in those pieces, but it would be revealing to compare what a machine might tell us about this such ‘neighbours’ in light of what a human might know about them. 
  • What communities of pieces can we identify in a given corpus?  That is, if we attempt to classify of groups works in some way based on shared features, what kinds of communities emerge?  Are these communities related to Style? Genre? Composer? Borrowing? 
  • In contrast, if we take the various kinds of soggetti (or other basic ‘words’) as our starting point, what can we learn about their context?  What soggetti happen before and after them?  At the same time as them?  What soggetti are most closely related to them? And through this what can we say about the ways each kind of pattern is used? 

Interval as Vectors (Music Ngrams) 

How can we model these soggetti?  Of course they are just sequences of pitches and durations.  But since musicians move these melodies around, it will not work simply to look for strings of pitches (since as listeners we can recognize that G-A-B sounds exactly the same as C-D-E).  What we need to instead is to model these as distances between notes.  Musicians call these ‘intervals’ and you could think of them like musical vectors. They have direction (up/down) and they have some length (X steps along the scale). 

Here is an example of how we can use our CRIM Intervals tools (a Python/Pandas library) to harvest this kind of information from XML encodings of our scores.  There is more to it than this, but the basic points are clear:  the distances in the score are translated into a series of distances in a table.  Each column represents the motions in one voice.  Each row represents successive time intervals in the piece (1.0 = one quarter note). 

An ngram for a section of music
Figure 2. An example of ngram: [-3, 3, 2, -2], interval as vectors. 

Link Prediction 

We are interested in predicting unobserved or missing relations between pairs of ngrams in our musical graph. Given two ngrams (nodes in the graph), the goal is to ascertain the type and likelihood of a potential relationship (edge) between them, be it sequential, vertical, or based on thematic similarity. 

  • Sequential is tuples that come near each other time.  This is Large Language Model which computes ‘context’. LLM then produces the semantic information that is latent in the data. 
  • Vertical is tuples that happen at the same time.  It is ANOTHER kind of context. 
  • Thematic is based on some measure of similarity.   

Upon training, the model’s performance is evaluated on a held-out test set, providing metrics such as precision, recall, and F1-score for each type of relationship. The model achieved a prediction accuracy of 78%. 

Beyond its predictive capabilities, the model also generates embeddings for each ngram. These embeddings, which are high-dimensional vectors encapsulating the essence of each ngram in the context of the entire graph, can serve as invaluable tools for further musical analysis. 

AskJGI Example Queries from Faculty of Science and Engineering

All University of Bristol researchers (from PhD student and up) are entitled to a day of free data science support from the Ask-JGI helpdesk. Just email ask-jgi@bristol.ac.uk with your query and one of our team will get back to you to see how we can support you. You can see more about how the JGI can support data science projects for University of Bristol based researchers on our website.

We support queries from researchers across all faculties and in this blog we’ll tell you about some of the researchers we’ve supported from the Faculty of Health and Life Sciences here at the University of Bristol. 

Aerosol particles

A researcher approached us with Python code they’d written for simulating radioactive aerosol particle dynamics in a laminar flow. For particles smaller than 10 nanometers, they observed unexplained error “spikes” when comparing numerical to analytical results, suggesting that numerical precision errors were accumulating due to certain forces being orders of magnitude smaller than others for the tiny particles.

We provided documentation and advice for implementing higher-precision arithmetic using Python’s ‘mpmath’ library so that the researcher could use their domain knowledge to increase precision in critical calculation areas, balancing computational cost with simulation accuracy. We also wrote code to normalise the magnitude of different forces to similar scales to prevent smaller values from being lost in the calculation.

This was a great query to work on. Although Ask-JGI didn’t have the same domain knowledge for understanding the physics of the simulation, the researcher worked closely with us to help find a solution. They provided clear and well documented code, understood the likely cause of their problem and identified the solutions that we explored. This work highlights how computational limitations can impact the simulation of physical systems, and demonstrates the value of collaborative problem-solving between domain specialists and data scientists.

Diagram A shows straight arrow lines and B shows curvy arrow lines
Laminar flow (a) in a closed pipe, Turbulent flow (b) in a closed pipe. Image credit: SimScale

Training/course development

The JGI offers training in programming, machine learning and software engineering. We have some standard training courses that we offer as well as upcoming courses being development and shorter “lunch and learn” sessions on various topics.

Queries have come in to both Ask-JGI and the JGI training mailbox (jgi-training@bristol.ac.uk) asking follow up questions from training courses which people have attended. Additionally, requests have come through for further training to be developed in specific areas (e.g. natural language processing, advanced data visualisation or LLM useage). The JGI training mailbox is the place to go, but Ask-JGI will happily redirect you!

People sitting at tables in a computer lab looking at a large computer screen at the end of the table
Introduction to Python training session for Bristol Data Week 2025.

Network visualization

Recently Ask-JGI received a query from a PhD researcher in the School of Geographical Sciences. The Ask JGI team offered support on exploring visualisation options for the data provided, and provided example network visualisations of the UK’s industries’ geographical distribution similarity. Documented code solution was also provided so that further customisation and extension of the graphs is possible. At the Ask JGI, we are happy to help researchers who are already equipped with substantive domain knowledge and coding skills to complete small modules of their research output pipeline.

Network made up with lines and dots. Each colour represents a different UK industry
Network visualisation of similarity of UK industry geographical distribution.

Spin Network Optimisation

The aim of this query was to accelerate the optimization of a spin network which is a network of nodes coupled together by a certain strength, to perform transfer of information (spin) from one node to another by implementing parallel processing. The workflow involved a genetic algorithm (written in Fortran and executed via a bash script) and a Python-based gradient ascent algorithm.

Initial efforts focused on parallelizing the gradient ascent step. However, significant challenges arose due to the interaction between the parallelized Python code and the sequential execution of the Fortran-based Spinnet script.

Code refactoring was undertaken to improve readability and introduce minor speed enhancements by splitting the Python script into multiple files and grouping similar function calls.

Given the complexity and time investment associated with these code modifications, it was strongly recommended to explore the use of High-Performance Computing (HPC) facilities. Running the current code on an HPC system went on to provide the desired speed improvements without requiring any code changes, as HPC is designed for computationally intensive tasks like this.

Grant development

The Ask-JGI helpdesk is the main place researchers get in contact with the JGI with regards to getting help with grant applications. The JGI can support with grant idea development, giving letters of support for applications and costing in JGI data scientists or research software engineers to support the workload for potential projects. You can read more about how the JGI team can support grant development on the JGI website!

Using ‘The Cloud’ to enhance UoB laboratory data security, storage, sharing, and management

JGI Seed Corn Funding Project Blog 2023/24: Peter Martin, Chris Jones & Duncan Baldwin

Introduction

As a world-leading research-intensive institution, the University of Bristol houses a multi-million-pound array of cutting-edge analytical equipment of all types, ages, function, and sensitivity – distributed across its Schools, Faculties, Research Centres and Groups, as well as in dozens of individual labs. However, as more and more data are captured – how can it be appropriately managed to comply with the needs of both researchers and funders alike?  

What were the aims of the seed corn project? 

When an instrument is purchased, the associated computing, data storage/resilience, and post-capture analysis is seldom, if ever, considered beyond the standard Data Management Plans. 

Before this project, there existed no centralised or officially endorsed mechanism at UoB supported by IT Services to manage long-term instrument data storage and internal/external access to this resource – with every group, lab, and facility individually managing their own data retention, access, archiving, and security policies. This is not just a UoB challenge, but one that is endemic of the entire research sector. As the value of data is now becoming universally realised, not just in academia, but across society – the challenge is more pressing than ever, with an institution-wide solution to the entire data challenge critically required which would be readily exportable to other universities and research organisations. At its core, this Seed Corn project sought to develop a ‘pipeline’ through which research data could be; (1) securely stored within a unified online environment/data centre into perpetuity, and (2) accessed via an intuitive, streamlined and equally secure online ‘front-end’ – such as Globus, akin to how OneDrive and Google Drive seamlessly facilitate document sharing.   

What was achieved? 

The Interface Analysis Centre (IAC), a University Research Centre in the School of Physics currently operates a large and ever-growing suite of surface and materials science equipment with considerable numbers of both internal (university-wide) and external (industry and commercial) users. Over the past 6-months, working with leading solution architects, network specialists, and security experts at Amazon Web Services (AWS), the IAC/IT Services team have successfully developed a scalable data warehousing system that has been deployed within an autonomous segment of the UoB’s network, such that single-copy data that is currently stored locally (at significant risk) and the need for it to be handled via portable HDD/emailed across the network can be eliminated. In addition to efficiently “getting the data out” from within the UoB network, using native credential management within Microsoft Azure/AWS, the team have developed a web-based front-end akin to Google Drive/OneDrive where specific experimental folders for specific users can be securely shared with these individuals – compliant with industry and InfoSec standards. The proof of the pudding has been the positive feedback received from external users visiting the IAC, all of whom have been able to access their experiment data immediately following the conclusion of their work without the need to copy GB’s or TB’s of data onto external hard-drives!  

Future plans for the project 

The success of the project has not only highlighted how researchers and various strands within UoB IT Services can together develop bespoke systems utilising both internal and external capabilities, but also how even a small amount of Seed Corn funding such as this can deliver the start of something powerful and exciting. Following the delivery of a robust ‘beta’ solution between the Interface Analysis Centre (IAC) labs and AWS servers, it is currently envisaged that the roll-out and expansion of this externally-facing research storage gateway facility will continue with the support of IT Services to other centres and instruments. Resulting from the large amount of commercial and external work performed across the UoB, such a platform will hopefully enable and underpin data management across the University going forwards – adopting a scalable and proven cloud-based approach.  


Contact details and links

Dr Peter Martin & Dr Chris Jones (Physics) peter.martin@bristol.ac.uk and cj0810@bristol.ac.uk 

Dr Duncan Baldwin (IT Services) d.j.baldwin@bristol.ac.uk  

Ask-JGI Example Queries from Faculty of Health and Life Sciences 

All University of Bristol researchers (from PhD student and up) are entitled to a day of free data science support from the Ask-JGI helpdesk. Just email ask-jgi@bristol.ac.uk with your query and one of our team will get back to you to see how we can support you. You can see more about how the JGI can support data science projects for University of Bristol based researchers on our website (https://www.bristol.ac.uk/golding/supporting-your-research/data-science-support/). 

We support queries from researchers across all faculties and in this blog we’ll tell you about some of the researchers we’ve supported from the Faculty of Health and Life Sciences here at the University of Bristol. 

AI prediction on video data 

Example of AI video prediction using video data taken from the EPIC-KITCHENS-100 study. The image shows qualitative results of action detection. Predictions with confidence > 0.5 are shown with colour-coded class labels.

One particularly interesting query came from a PhD researcher with no prior experience in programming or AI. She was exploring the idea of using AI to predict how long doctors at different skill levels would need to train on medical simulators to reach advanced proficiency. Drawing inspiration from aviation cockpit simulators, her project involved analysing simulation videos to make these predictions. We provided guidance on the feasibility of using AI for this task, suggesting approaches that would depend on the availability of annotated data and introducing her to relevant computer vision techniques. We also recommended Python as a starting point, along with resources to help her build foundational skills. It was exciting to help someone new to AI navigate the early stages of their project and explore how AI could contribute to improving medical training. 

Species Classification with ML 

Bemisia tabaci (MED) (silverleaf whitefly); two adults on a watermelon leaf. Image by Stephen Ausmus.

Another engaging query came from a researcher in biological sciences aiming to classify different species of plant pest insects—Bemisia, tabaci and two others—based on flight data. Her goal was not only to build machine learning classifiers but also to understand how different features contributed to species differentiation across various methods.

She approached the Ask-JGI data science support for guidance on refining her code and ensuring the accuracy of her analysis. We helped restructure the code to make it more modular and reusable, while also addressing bugs and improving its reliability. Additionally, we worked with her to create visualizations that provided clearer insights into model performance and feature importance. This collaboration was a great example of how machine learning can be applied to advancing research in ecological data analysis.  

Providing guidance for HPC, RDSF, and statistical software users 

High performance computing (HPC) and the Research Data Storage Facility (RDSF) have been used by an increasing number of people at our university. We also recommend them to students and staff when these tools align with their projects’ needs. However, getting started can be challenging—each system has its own frameworks, rules, and workflows. Researchers often find themselves overwhelmed by extensive training materials or stuck on specific technical issues that aren’t easily addressed.  

We provide tailored guidance to make these tools more accessible and practical for our clients, which includes troubleshooting, script modifications, and directing researchers to relevant university services. 

Additionally, this year’s Ask-JGI Helpdesk has brought together experienced users of SPSS, Stata, R, and Python. For researchers transitioning to new statistical software or adapting their workflows, we’ve helped them navigate the subtle differences in syntax across platforms and achieve their analysis goals. 

Handling Group-Level Variability in Quantitative Effects: A Multilevel Modelling Perspective

A visualisation of a multilevel model, original figure produced by JGI Data Scientist, Dr Leo Gorman.

We had a client who was researching differences in fluorescence intensity. This may be potentially due to factors such as antibody lot variation, differences in handling between researchers, or biological heterogeneity. This raises the question: How should such data be represented to ensure meaningful interpretation without misrepresenting the underlying biological processes? One of the key solutions that we recommend is to introduce multilevel modelling.  

Modelling fluorescence intensity at one or multiple levels (e.g., individual, batch, researcher) can help distinguish biological effects from biases. To be specific, for example, by applying mixed effects, we can account for between-individual variation in baseline fluorescence levels (random intercept), as well as differential responses to experimental conditions (random slope). Sometimes, the application of multilevel modelling also appears to be limited by the group-level sample size. If this is the case, as we discussed with the client, we don’t need to go as extreme as fitting multilevel models. To control for variations with such a small amount of changes, we can use alternative strategies, such as correcting standard errors and introducing dummy variables to achieve similar performance.