Dataset and algorithm to perform Spatial implicit neural representation for structured electron-beam patterns
收藏Zenodo2026-03-26 更新2026-05-26 收录
下载链接:
https://zenodo.org/doi/10.5281/zenodo.19232272
下载链接
链接失效反馈官方服务:
资源简介:
A README file is provided with the complete instructions.
Brief description:
This code implements a coordinate-based neural network that predicts image intensity from two inputs:
1. the spatial coordinate `(x, y)` of each pixel, and2. a vector of experimental control parameters (for example electrode biases).
The intended application is the forward modelling of structured electron-beam illumination patterns, where one wants a fast surrogate model of the mapping
`control parameters -> illumination pattern`.
A second workflow is also included: once the network has been trained, the input parameter vector can be optimized to reproduce a desired target pattern. This corresponds to an inverse-design step in control-parameter space.
## What the code does
The module is organized around five tasks.
### 1. Data loading and normalization
`load_pattern_dataset()` reads a stack of `.npy` images from disk together with the corresponding control-parameter array. Images are rescaled to the interval `[0, 1]`. Labels are standardized by subtracting the mean and dividing by the standard deviation.
### 2. Conversion to coordinate-based training data
`flatten_dataset()` converts an image stack of shape `(n_images, nx, ny)` into a flattened regression dataset where each training sample is a single pixel. For each pixel, the model receives:
- its spatial coordinate `(x, y)`, and- the control-parameter vector associated with the parent image.
The regression target is the pixel intensity.
This is the standard way to train an implicit neural representation (INR).
### 3. Model construction
`build_model()` creates a branched neural network with:
- one branch for spatial coordinates,- one branch for experimental parameters,- additive fusion of the two branches,- additional hidden layers after fusion,- a scalar output corresponding to image intensity.
Two variants are supported:
- a standard dense network with `tanh` activations,- a SIREN-based model using `SinusodialRepresentationDense` from `tf_siren`.
Please reference the provided README file for the rest of the details
完整操作说明已附于README文件中。
### 简要说明
本代码实现了一款基于坐标的神经网络,可通过两类输入预测图像像素强度:
1. 每个像素的空间坐标`(x, y)`;
2. 实验控制参数向量(例如电极偏置电压)。
本项目的目标应用为结构化电子束照明图案的前向建模,即构建从「控制参数」到「照明图案」的快速替代模型。
此外本项目还包含另一工作流程:在神经网络完成训练后,可通过优化输入参数向量来复现指定的目标图案,这对应于控制参数空间中的逆向设计步骤。
## 代码功能说明
本代码模块围绕五大任务构建。
### 1. 数据加载与标准化
`load_pattern_dataset()` 函数可从磁盘读取`.npy`格式的图像栈及其对应的控制参数数组。图像将被归一化至`[0, 1]`区间,标签则通过减去均值并除以标准差完成标准化。
### 2. 转换为基于坐标的训练数据
`flatten_dataset()` 函数可将形状为`(n_images, nx, ny)`的图像栈转换为扁平化的回归数据集,其中每个训练样本对应单个像素。对于每个像素,模型的输入包括:
- 其空间坐标`(x, y)`;
- 所属图像对应的控制参数向量。
回归任务的目标为该像素的强度值。这是训练隐式神经表示(Implicit Neural Representation, INR)的标准流程。
### 3. 模型构建
`build_model()` 函数可构建分支式神经网络,结构如下:
- 用于处理空间坐标的分支;
- 用于处理实验参数的分支;
- 两支特征的加性融合;
- 融合后增设的隐藏层;
- 对应图像强度的标量输出。
本实现支持两种网络变体:
- 采用`tanh`激活函数的标准全连接网络;
- 基于SIREN的模型,使用`tf_siren`库中的`SinusodialRepresentationDense`层。
其余细节请参阅附带的README文件。
提供机构:
Zenodo创建时间:
2026-03-26



