Pymiediff Enables Differentiable Mie Scattering of Core-Shell Particles in PyTorch for Machine Learning Applications

Summarize this article with:
Light scattering from particles comparable in size to the wavelength of light underpins numerous scientific disciplines, including chemistry, atmospheric science, and nanotechnology. Oscar K. C. Jackson, Simone De Liberato, and Otto L. Muskens, alongside their colleagues, address the growing need for efficient, differentiable frameworks for these calculations by introducing PyMieDiff. This new library, built in PyTorch, provides a fully differentiable implementation of Mie scattering for core-shell particles, and crucially, it operates efficiently on modern graphics processing units. By representing all input parameters as tensors, the team enables seamless integration with machine learning techniques such as gradient-based optimisation and physics-informed neural networks, opening new avenues for inverse design and parameter estimation in light scattering applications.
Efficient Mie Scattering with Automatic Differentiation PyMieDiff is a new, open-source library built using JAX, designed for calculating Mie scattering spectra and their derivatives efficiently. This toolkit accurately and rapidly computes spectra for spherical particles of any size, refractive index, and wavelength, with applications in atmospheric science, particle sizing, and optical microscopy. A key feature is its full differentiability, allowing direct computation of sensitivities and gradients with respect to particle properties and wavelengths, crucial for solving inverse problems and optimising designs. The implementation leverages JAX’s automatic differentiation and just-in-time compilation to significantly improve performance compared to traditional Mie scattering codes, particularly when dealing with complex optimisation tasks. The method refines the Mie scattering formalism, incorporating vectorisation and parallelisation to accelerate computations, and carefully handles singularities in the scattering cross-sections. PyMieDiff computes the full scattering matrix, enabling calculation of extinction, absorption, and scattering cross-sections, as well as the polarisation of scattered light. Its modular design allows for easy adaptation to different applications, and a well-documented API facilitates integration into existing scientific workflows. Validation against established codes and experimental data confirms the accuracy and robustness of the implementation, making it suitable for a wide range of scientific investigations. The focus is on designing core-shell nanoparticles, structures with a central core surrounded by a shell of a different material, used in sensing, imaging, and catalysis. Traditional methods for solving this inverse problem are often computationally expensive, particularly with complex structures. The proposed solution combines automatic differentiation with a differentiable Mie solver and machine learning techniques. Automatic differentiation efficiently calculates the gradients of the optical response with respect to the particle’s design parameters, such as core radius, shell thickness, and material refractive indices.
The team developed a differentiable Mie solver, a significant technical achievement, allowing calculation of the derivatives needed for gradient-based optimisation. This solver is integrated with machine learning algorithms, like Adam or L-BFGS, to efficiently search the design space and find optimal particle structures. The entire system is implemented in PyTorch, a deep learning framework providing tools for automatic differentiation and GPU acceleration. Key features of this approach include increased efficiency, flexibility in handling design constraints, accurate results from the differentiable Mie solver, open-source code promoting reproducibility, and scalability through GPU acceleration. The method also calculates the near-field electromagnetic properties of the particles.
Differentiable Mie Scattering for Inverse Design PyMieDiff represents a significant advance in computational nanophotonics, delivering a fully differentiable implementation of Mie scattering for core-shell particles within the PyTorch framework. This toolkit enables gradient-based optimisation and facilitates the development of hybrid physics-informed deep learning models, offering researchers new avenues for inverse design problems. The library’s design prioritises both flexibility and performance, providing interfaces compatible with SciPy and native PyTorch implementations with GPU support, allowing for efficient calculations. Researchers successfully demonstrated the capabilities of PyMieDiff through several examples, including reconstructing particle geometries from target scattering spectra, training neural networks using analytical Mie calculations, and designing diffractive lenses composed of core-shell spheres in combination with the multi-particle scattering toolkit, TorchGDM. The authors acknowledge a potential limitation in the stability of recurrence calculations for very large particles or those with strong plasmonic or dielectric interfaces, suggesting future work could focus on implementing more stable algorithms. The development of this differentiable formulation aligns with a growing interest in solving multiple-scattering problems, a crucial step towards the inverse design of complex photonic nanostructures, and a similar approach was independently developed by another research group, highlighting the timeliness and importance of this work. 👉 More information 🗞 PyMieDiff: A differentiable Mie scattering library 🧠 ArXiv: https://arxiv.org/abs/2512.08614 Tags:
