A diffraction neural network system based on variable neuron density topology and a training method thereof

By introducing a variable neuron density topology into the diffractive neural network, the problems of redundant neuron parameters and training convergence difficulties are solved, achieving efficient feature extraction and task adaptability, which is particularly suitable for training large-scale deep networks.

CN123180243APending Publication Date: 2026-11-27FUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611602150.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-16
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing multi-layer cascaded deep diffraction neural networks suffer from severe redundancy in neuron parameters, difficulty in training convergence, and the inability of uniform neuron density structures to adapt to the different contribution levels of features in different regions.

Method used

A diffractive neural network system based on variable neuron density topology is adopted. By setting a non-uniform spatial density distribution in the optical modulation layer, neurons in low contribution regions share phase modulation parameters, while neurons in high contribution regions have independent modulation parameters. The region is divided and processed by calculating the feature contribution, thus forming an adaptive neuron topology.

Benefits of technology

It improves parameter utilization, reduces training complexity, enhances feature extraction capabilities and adaptability to different optical information processing tasks, and is particularly suitable for efficient training of deep diffraction neural networks with millions of neurons.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123180243A_ABST
    Figure CN123180243A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of diffraction neural network system and training method based on variable neuron density topology structure, belong to optical computing and optical information processing technical field.For the technical bottleneck of existing multilevel cascading depth diffraction neural network, such as serious redundancy of massive neuron parameters and gradient easy to disappear in training process, the method introduces neuron feature contribution degree evaluation mechanism based on reverse gradient and light field information, and establishes the mapping relationship between diffraction neuron physical parameters and network feature extraction function;And on this basis, the adaptive optimization strategy of variable neuron density is constructed, the sparse of low contribution feature area and the densification of high contribution feature area are realized.The technical scheme of the present application not only greatly reduces the redundancy parameters of network, improves the training convergence performance of deep diffraction neural network, but also provides reliable technical support for efficient training of million-level neuron scale depth diffraction neural network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a diffractive neural network system and training method based on a variable neuron density topology. Background Technology

[0002] Diffractive optical neural networks utilize light field propagation, diffraction, and phase modulation processes to perform tasks such as image processing, target recognition, and image denoising. Compared to traditional electronic neural networks, diffractive optical neural networks have significant advantages such as high parallelism, fast propagation speed, and low power consumption, thus possessing important research value and promising prospects in the field of information processing.

[0003] To improve the performance of diffractive optical neural networks (DONs), existing methods mostly focus on increasing the number of diffraction layers, optimizing phase parameters, or introducing nonlinear activation layers. While these methods can improve the performance of DNIs to some extent, they largely employ a uniform neuron density topology, meaning that diffraction neurons of the same size and density are placed in different regions of the diffraction layer. This type of structure assumes that neurons in different regions have equal importance, failing to fully consider the different contributions of features from different diffraction layers and regions to the output. This results in insufficient modulation freedom in key feature regions, while low-contribution regions suffer from parameter redundancy, making it difficult to simultaneously achieve fine-tuning of key regions and parameter compression in non-key regions. Consequently, this leads to problems such as poor convergence and limited feature extraction capabilities. Summary of the Invention

[0004] The purpose of this invention is to address the problems of severe neuron parameter redundancy and gradient vanishing during training in existing multi-layer cascaded deep diffraction neural networks. It provides a diffraction neural network system and training method based on a variable neuron density topology to solve the problems of severe neuron parameter redundancy, difficulty in training convergence, and difficulty in adapting uniform neuron density structures to the differences in feature contributions of different regions in existing deep diffraction neural networks.

[0005] To achieve the above objectives, the technical solution of the present invention is: a diffractive neural network system based on a variable neuron density topology, comprising an input layer, an optical modulation layer, and an output layer; the optical modulation layer includes at least one optical diffraction layer, which is composed of a plurality of diffractive neurons for phase modulation; the diffractive neurons form a non-uniform spatial density distribution in the optical modulation layer; in the non-uniform spatial density distribution, multiple adjacent diffractive neurons in a low-contribution neuron region are mapped to the same phase modulation parameter, and adjacent diffractive neurons in a high-contribution neuron region are mapped to mutually independent phase modulation parameters; the low-contribution neuron region and the high-contribution neuron region are divided according to a feature contribution degree, which is determined by the gradient information corresponding to the phase modulation parameter and the optical field response.

[0006] Furthermore, the feature contribution is calculated as follows: the gradient magnitude of the target loss function relative to the phase modulation parameter of the neuron is multiplied by the optical field response at the corresponding position of the neuron; the optical field response is the squared modulus of the complex amplitude of the optical field incident on the optical diffraction layer.

[0007] Furthermore, the input layer includes a light source, a beam expander and collimator unit, and an optical mask or digital micromirror device; the light beam emitted by the light source illuminates the optical mask or digital micromirror device after passing through the beam expander and collimator unit, encoding the information of the object to be processed into the amplitude information of the input light field; the optical modulation layer also includes a lens unit; the lens unit is used to perform a Fourier transform on the input light field, so that the input light field forms a frequency domain light field on the Fourier transform surface; the optical diffraction layer is disposed on the Fourier transform surface or at a position adjacent to the Fourier transform surface, and is used to apply phase modulation to different frequency components of the frequency domain light field.

[0008] Furthermore, the phase modulation parameters loaded on each diffraction neuron in the optical diffraction layer are obtained through training; the phase modulation parameters are converted into a phase map or grayscale map and loaded onto a spatial light modulator, or a diffraction optical element is prepared based on the phase modulation parameters; the spatial light modulator or the diffraction optical element is disposed in the optical path to apply phase modulation to the incident light field corresponding to the phase modulation parameters at each position.

[0009] This invention also provides a training method for a diffractive neural network based on a variable neuron density topology, comprising the following steps:

[0010] S1. Construct an optical diffraction neural network model including an input layer, an optical modulation layer and an output layer, and establish an initial uniform neuron density topology in the optical modulation layer. Each diffraction neuron is set according to a uniform spatial interval and corresponds to a trainable phase modulation parameter.

[0011] S2. Establish a forward propagation model of the optical field from the input layer to the output layer. Input the training samples into the optical diffraction neural network under the current neuron topology and calculate the target loss function according to the target task.

[0012] S3. Based on error backpropagation, the gradient information of the target loss function relative to the phase modulation parameters of each diffraction neuron is obtained by combining the optical field forward propagation model. Combined with the optical field response at the corresponding position of each diffraction neuron, the neuron region feature contribution degree used to divide the low contribution region and the high contribution region is calculated.

[0013] S4. Based on the feature contribution, perform sharing and merging processing on low contribution neuron regions and preservation or proliferation processing on high contribution neuron regions to obtain the updated neuron topology.

[0014] S5. Based on the updated neuron topology, reconstruct the mapping relationship between neuron regions and phase modulation parameters, and continue to train the phase modulation parameters of the optical diffraction neural network under the updated topology.

[0015] S6. Determine whether the preset training termination condition is met; if not, use the updated neuron topology as the current neuron topology and return to step S2; if met, stop training and output the final variable neuron density topology and its phase modulation parameters.

[0016] Furthermore, the forward propagation model of the light field includes a free-space propagation model, a lens Fourier transform model, and a diffraction optical modulation model; the free-space propagation model uses the angular spectrum propagation method to calculate the complex amplitude transmission of the light field between adjacent optical layers; the lens Fourier transform model is used to calculate the phase transformation applied to the incident light field by the lens unit; and the diffraction optical modulation model is used to calculate the phase modulation value of the incident light field superimposed by each optical diffraction layer.

[0017] Furthermore, the method for calculating the feature contribution of the neuron region in step S3 is as follows:

[0018] For the Coordinates in the optical diffraction layer The feature contribution of a neuron at a given location can be defined as:

[0019]

[0020] in, This represents the task loss function. Indicates the first Layer diffraction layer in Phase modulation parameters at the location, Indicates the first Complex optical field in front of the diffraction layer, This represents the light field response at the corresponding location;

[0021] The average feature contribution calculated from multiple samples on the validation set can be expressed as:

[0022]

[0023] in, The number of validation samples used for statistical purposes. Indicates the first The feature contribution of each sample;

[0024] When the network uses shared parameters or grouping to represent the diffraction layer, the feature contribution of the shared group is calculated first, and then the group feature contribution is backfilled to the corresponding pixel position; for the first... The first in the layer The contribution of a shared group to its group characteristics is defined as follows:

[0025]

[0026] in, Indicates the first Layer A shared phase parameter, This represents the set of pixels covered by the group. This indicates the number of pixels in the group;

[0027] Then, based on the pixel-to-group mapping relationship The group importance is backfilled to the pixel level, and the backfilling relationship is as follows:

[0028]

[0029] Thus, pixel-level thermals are obtained under a shared parameter structure. Figure 1 The distribution of regional importance is determined to support subsequent adaptive variable neuron density topology updates.

[0030] Furthermore, the shared merging process includes: dividing multiple adjacent diffractive neurons within a low-contribution neuron region into the same shared region, so that all diffractive neurons within the shared region share the same phase modulation parameter, and the shared region corresponds to a single trainable parameter variable; the retention process includes: maintaining independent phase modulation parameters for each adjacent diffractive neuron within a high-contribution neuron region, so that each diffractive neuron corresponds to mutually independent trainable parameter variables; the proliferation process includes: splitting the high-contribution and already shared / merged neuron region into multiple independent sub-regions, so that each independent sub-region corresponds to mutually independent trainable parameter variables.

[0031] Furthermore, the method for reconstructing the mapping relationship between neuronal regions and phase modulation parameters in step S5 includes: regenerating the neuronal region division based on the updated neuronal topology; establishing a correspondence between each neuronal region and the phase modulation parameters, so that multiple diffractive neurons in the same shared region are mapped to the same phase parameter variable, each diffractive neuron in the reserved region is mapped to a different phase parameter variable, and each independent sub-region in the proliferation region is mapped to a different phase parameter variable; and updating the parameter set called by the forward propagation model and the backward propagation model based on the mapping relationship.

[0032] Furthermore, the preset training termination conditions include at least one of the following: the target loss function reaches the preset convergence condition, the target task performance index reaches the preset performance index, the number of topology updates reaches the preset number, and the number of training iterations reaches the preset number; after training, the final output phase modulation parameters are converted into a phase map or grayscale map and loaded into a spatial light modulator, or a diffractive optical element is prepared according to the phase modulation parameters.

[0033] Furthermore, the target tasks include image denoising, target recognition, image classification, and image generation tasks; the phase modulation parameters obtained through training are converted into phase maps or grayscale maps and loaded into a spatial light modulator, or diffractive optical elements are prepared based on the phase modulation parameters.

[0034] Compared with existing technologies, this invention has the following advantages: It is no longer limited to phase parameter optimization under a fixed topology in traditional uniform-density diffractive optical neural networks, but incorporates neuron density distribution and topology design into the training process; through neuron importance evaluation, redundant parameters can be reduced in low-importance regions, and modulation capabilities can be enhanced in high-importance regions; the resulting variable neuron density topology can improve parameter utilization, reduce training complexity, and enhance the feature extraction capability of diffractive neural networks, thereby enhancing adaptability and inference performance for different optical information processing tasks, and providing reliable technical support for the efficient training of deep diffractive neural networks with millions of neurons. Attached Figure Description

[0035] Figure 1 This is a flowchart illustrating the diffraction neural network based on variable neuron density topology and its training method according to the present invention.

[0036] Figure 2 This is a schematic diagram of the optical implementation structure of a diffractive neural network based on a variable neuron density topology according to the present invention.

[0037] Figure 3 This is a schematic diagram illustrating the steps of a diffractive neural network training method based on a variable neuron density topology according to the present invention.

[0038] Figure 4 This is a schematic diagram of an adaptive variable neuron density mechanism in this invention.

[0039] Figure 5 The images show a comparison of the denoising effects of this invention when applied to image denoising tasks. The left image is a noisy input image, the middle image is the denoising result without using the variable neuron density topology, and the right image is the denoising result with the variable neuron density topology.

[0040] Figure 6This is a comparison diagram of the training parameters of each diffraction layer before and after the change in the density of the neuron topology in this invention. Detailed Implementation

[0041] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the following embodiments are only for explaining the present invention and are not intended to limit the scope of protection of the present invention. Without departing from the core idea of ​​the present invention, those skilled in the art can adjust the number of diffraction layers, propagation distance, input method, loss function form, and topology update rules.

[0042] This invention provides a diffractive neural network system based on a variable neuron density topology, comprising an input layer, an optical modulation layer, and an output layer. The optical modulation layer includes at least one optical diffraction layer, which is composed of a plurality of diffractive neurons for phase modulation. The diffractive neurons form a non-uniform spatial density distribution in the optical modulation layer. In the non-uniform spatial density distribution, multiple adjacent diffractive neurons in a low-contribution neuron region are mapped to the same phase modulation parameter, while diffractive neurons in a high-contribution neuron region are mapped to mutually independent phase modulation parameters. The low-contribution neuron region and the high-contribution neuron region are divided according to a feature contribution degree, which is jointly determined by the gradient information corresponding to the phase modulation parameter and the optical field response.

[0043] This invention also provides a training method for a diffractive neural network based on a variable neuron density topology, comprising the following steps:

[0044] S1. Construct an optical diffraction neural network model including an input layer, an optical modulation layer and an output layer, and establish an initial uniform neuron density topology in the optical modulation layer. Each diffraction neuron is set according to a uniform spatial interval and corresponds to a trainable phase modulation parameter.

[0045] S2. Establish a forward propagation model of the optical field from the input layer to the output layer. Input the training samples into the optical diffraction neural network under the current neuron topology and calculate the target loss function according to the target task.

[0046] S3. Based on error backpropagation, the gradient information of the target loss function relative to the phase modulation parameters of each diffraction neuron is obtained by combining the optical field forward propagation model. Combined with the optical field response at the corresponding position of each diffraction neuron, the neuron region feature contribution degree used to divide the low contribution region and the high contribution region is calculated.

[0047] S4. Based on the feature contribution, perform sharing and merging processing on low contribution neuron regions and preservation or proliferation processing on high contribution neuron regions to obtain the updated neuron topology.

[0048] S5. Based on the updated neuron topology, reconstruct the mapping relationship between neuron regions and phase modulation parameters, and continue to train the phase modulation parameters of the optical diffraction neural network under the updated topology.

[0049] S6. Determine whether the preset training termination condition is met; if not, use the updated neuron topology as the current neuron topology and return to step S2; if met, stop training and output the final variable neuron density topology and its phase modulation parameters.

[0050] The following is a detailed implementation process of the present invention.

[0051] In one embodiment of the present invention, such as Figure 1 The diagram shows a flowchart of the diffractive neural network training method based on variable neuron density topology according to the present invention. The process includes: constructing an initial uniform neuron density topology; training under the current topology; calculating the gradient during backpropagation of the error; handling neuron merging or proliferation; determining the convergence of the loss function; reconstructing the topology and continuing training; and finally outputting the variable neuron density topology.

[0052] In one embodiment of the present invention, such as Figure 2 The diagram illustrates an optical implementation of the diffraction neural network of the present invention. The diffraction neural network includes an input layer, a lens unit, an optical diffraction layer, and an output layer. The input image is modulated by the input layer to form an input light field. This input light field passes through the lens unit to form a frequency domain light field, which then propagates and undergoes phase modulation through multiple optical diffraction layers. Finally, an output light intensity distribution is formed in the output layer. The lens unit is used to focus the light field and perform frequency domain transformation, while the optical diffraction layer modulates the phase of the incident light field based on phase modulation parameters obtained during training. Figure 2 The structure shown is only one specific implementation of the present invention. The core of the present invention lies in the adaptive updating of the neuron density topology in the optical diffraction layer based on the feature contribution of the neuron region.

[0053] In one embodiment of the present invention, such as Figure 3 The diagram shows a flowchart of a training method for a diffractive neural network based on a variable neuron density topology. This embodiment includes the following steps:

[0054] S1. Construct a diffractive neural network model including an input layer, an optical modulation layer, and an output layer, and establish an initial uniform neuron density topology.

[0055] S2. Establish a forward propagation model of the light field from the input layer to the output layer, train the diffraction neural network under the current neuron topology, and calculate the target loss function according to the target task.

[0056] Specifically, in establishing the forward propagation model, the input light field sequentially undergoes free-space propagation, lens phase modulation, and diffraction layer phase modulation, ultimately forming the output light field intensity distribution at the output layer. Free-space propagation between adjacent optical layers can be represented using the angular spectrum method as follows:

[0057]

[0058] in, Indicates the input complex optical field. This represents the output complex optical field after propagation. and These represent the Fourier transform and the inverse Fourier transform, respectively. Indicates the propagation distance as The angular spectrum propagation transfer function at time.

[0059] When the light field passes through the lens unit, the lens phase modulation can be expressed as:

[0060]

[0061] in, Indicates wave number, Indicates the operating wavelength. This indicates the focal length of the lens. The lens unit enables the input light field to form a frequency domain light field at or near the focal plane, providing a basis for subsequent frequency domain response analysis and neuron importance evaluation.

[0062] When the light field passes through the first When a diffracting layer is formed, the phase modulation process of that layer can be expressed as:

[0063]

[0064] in, Indicates the first Complex optical field in front of the diffraction layer, Indicates after the first Complex optical field modulated by the diffraction layer Indicates the first Layer diffraction layer in coordinate The phase modulation parameters at each point are obtained through training.

[0065] Under the current neuron topology, training samples are input into the diffraction neural network, and the output light field or output light intensity distribution is calculated using the aforementioned light field forward propagation model. Subsequently, a target loss function is established based on the target task. For example, for image denoising, the mean square error between the output light intensity image and the target image can be used as the loss function; for target recognition or image classification, the energy distribution of the output region can be used to construct the classification loss function. By optimizing the target loss function, the phase modulation parameters under the current neuron topology are trained.

[0066] S3. Based on error backpropagation, obtain the gradient information of the target loss function relative to the neuron phase modulation parameters, and combine it with the light field response at the corresponding location to calculate the feature contribution of the neuron region.

[0067] Specifically, the gradient information of the target loss function relative to the phase modulation parameters of each optical diffraction layer is calculated based on the error backpropagation algorithm, and the feature contribution of the neuron region is formed by combining the light field response at the corresponding location. For the th Coordinates in the optical diffraction layer The feature contribution of a neuron at a given location can be defined as:

[0068]

[0069] in, This represents the task loss function. Indicates the first Layer diffraction layer in Phase modulation parameters at the location, Indicates the first Complex optical field in front of the diffraction layer, This represents the light field response at the corresponding location. The feature contribution is used to evaluate the degree of contribution of different neurons to the output of the target task.

[0070] To improve the stability of feature contribution evaluation, it is preferable to average the feature contributions calculated from multiple samples on the validation set. The average feature contribution can be expressed as:

[0071]

[0072] in, The number of validation samples used for statistical purposes. Indicates the first The feature contribution value corresponding to each sample can be obtained. This allows us to obtain the distribution of neuron importance in different regions of each optical diffraction layer.

[0073] In one embodiment of the present invention, when the network represents the diffraction layer using shared parameters or a grouping method, the feature contribution of the shared group can be calculated first, and then the group feature contribution can be backfilled to the corresponding pixel position. For the first... The first in the layer The contribution of a shared group to its group characteristics is defined as follows:

[0074]

[0075] in, Indicates the first Layer A shared phase parameter, This represents the set of pixels covered by the group. This indicates the number of pixels in the group. Then, based on the pixel-to-group mapping... The group importance is backfilled to the pixel level, and the backfilling relationship is as follows:

[0076]

[0077] This allows for pixel-level thermal analysis to be obtained under a shared parameter structure. Figure 1 The distribution of regional importance is determined to support subsequent adaptive variable neuron density topology updates.

[0078] S4. Based on the feature contribution, low-contribution neuron regions are shared and merged, while high-contribution neuron regions are preserved or proliferated to obtain the updated neuron topology.

[0079] Specifically, such as Figure 4 As shown, after obtaining the feature contribution of neuron regions, the importance of each neuron region is evaluated based on its feature contribution. For low-contribution neuron regions, multiple adjacent neurons are divided into the same shared region, and all neurons within the shared region share the same phase modulation parameter, thereby performing a shared merging process. This process reduces the neuron density in low-contribution regions and decreases the number of trainable parameters in the network, achieving sparsity in low-contribution feature regions.

[0080] For regions with high-contribution neurons, a preservation process is performed on the neurons within them, ensuring they retain independently trainable phase modulation parameters. Alternatively, for regions where high-contribution neurons have been shared and merged, a proliferation process is performed, splitting them into multiple independent sub-regions, each with its own independently trainable phase modulation parameters. This process increases the neuron density in high-contribution regions, enhances the light field modulation capability, and achieves a denser distribution of high-contribution feature regions. This results in an updated neuron topology, which has a non-uniform neuron density distribution compared to the initial uniform neuron density topology.

[0081] S5. Based on the updated neuron topology, reconstruct the mapping relationship between neuron regions and phase modulation parameters, and continue training under the updated neuron topology.

[0082] Specifically, after completing the sharing and merging, retention, or proliferation processes, the neuron region mapping relationships are regenerated based on the updated neuron topology, and a mapping relationship is established between each neuron region and its corresponding phase modulation parameter. Multiple diffraction neurons belonging to the same shared region are mapped to the same phase modulation parameter, while diffraction neurons belonging to the retained or proliferating regions are mapped to different phase modulation parameters. Subsequently, the diffraction neural network training model is reconstructed based on these mapping relationships, and training continues under the updated neuron topology to optimize the updated phase modulation parameters.

[0083] S6. Determine whether the preset training termination condition is met; if not, use the updated neuron topology as the current neuron topology and return to step S2 to continue training; if met, output the final variable neuron density topology and its corresponding phase modulation parameters.

[0084] Specifically, the preset training termination conditions include at least one of the following: the target loss function reaches a preset convergence condition, the target task performance reaches a preset performance index, the number of topology updates reaches a preset number, and the number of training iterations reaches a preset number. When the preset training termination conditions are not met, the updated neuron topology is used as the current neuron topology, and training returns to step S2 to continue; when the preset training termination conditions are met, topology updates and phase modulation parameter training are stopped, and the final variable neuron density topology and its corresponding phase modulation parameters are output.

[0085] In one embodiment of the present invention, such as Figure 5 As shown, taking image denoising as an example, the PSNR of the noisy input image is 14.45 dB and the SSIM is 58.05; the PSNR of the denoising result without changing density is 16.79 dB and the SSIM is 59.06; the PSNR of the denoising result after adopting the variable neuron density topology structure of the present invention is improved to 17.93 dB and the SSIM is improved to 67.61. Compared with the structure without changing density, the method of the present invention improves PSNR by 1.14 dB and SSIM by 8.55, indicating that it can further improve the noise suppression effect and image quality preservation ability.

[0086] In one embodiment of the present invention, such as Figure 6As shown, under the initial uniform density topology, the number of trainable parameters for diffraction layers 1, 2, and 3 is 176,400. After adopting the variable neuron density topology of this invention, the number of trainable parameters for diffraction layers 1, 2, and 3 is reduced to 55,977, 56,211, and 56,931, respectively. Therefore, the total number of trainable parameters for the three diffraction layers is reduced from 529,200 to 169,119, a reduction of approximately 68.04%.

[0087] As can be seen from the above embodiments, the present invention does not merely optimize the phase parameters of the diffractive neural network, but introduces a neuron region feature contribution evaluation and topology update mechanism during the training process. By performing shared merging processing on low-contribution regions and preservation and proliferation processing on high-contribution regions, a variable neuron density topology structure that differs from the uniform density structure can be formed. This reduces redundant parameters while enhancing the light field modulation capability, improving the parameter utilization, convergence efficiency, and task adaptability of the diffractive neural network.

[0088] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.

Claims

1. A diffractive neural network system based on a variable neuron density topology, characterized in that, The system includes an input layer, an optical modulation layer, and an output layer. The optical modulation layer includes at least one optical diffraction layer, which is composed of a plurality of diffraction neurons for phase modulation. The diffraction neurons form a non-uniform spatial density distribution in the optical modulation layer. In the non-uniform spatial density distribution, multiple adjacent diffraction neurons in a low-contribution neuron region are mapped to the same phase modulation parameter, while adjacent diffraction neurons in a high-contribution neuron region are mapped to mutually independent phase modulation parameters. The low-contribution neuron region and the high-contribution neuron region are divided according to a feature contribution degree, which is determined by the gradient information corresponding to the phase modulation parameter and the optical field response.

2. The diffraction neural network system based on variable neuron density topology according to claim 1, characterized in that, The feature contribution is calculated as follows: the gradient magnitude of the target loss function relative to the phase modulation parameter of the neuron is multiplied by the optical field response at the corresponding position of the neuron; the optical field response is the squared modulus of the complex amplitude of the optical field incident on the optical diffraction layer.

3. The diffraction neural network system based on variable neuron density topology according to claim 1, characterized in that, The input layer includes a light source, a beam expander and collimator unit, and an optical mask or digital micromirror device; the light beam emitted by the light source is irradiated by the optical mask or digital micromirror device after passing through the beam expander and collimator unit, and the information of the object to be processed is encoded into the amplitude information of the input light field; The optical modulation layer further includes a lens unit; the lens unit is used to perform a Fourier transform on the input light field, so that the input light field forms a frequency domain light field on the Fourier transform surface; the optical diffraction layer is disposed on the Fourier transform surface or at a position adjacent to the Fourier transform surface, and is used to apply phase modulation to different frequency components of the frequency domain light field.

4. The diffraction neural network system based on variable neuron density topology according to claim 1, characterized in that, The phase modulation parameters loaded on each diffraction neuron in the optical diffraction layer are obtained through training; the phase modulation parameters are converted into a phase map or grayscale map and loaded onto a spatial light modulator, or a diffraction optical element is prepared based on the phase modulation parameters; the spatial light modulator or the diffraction optical element is disposed in the optical path to apply phase modulation to the incident light field corresponding to the phase modulation parameters at each position.

5. A training method for a diffractive neural network based on a variable neuron density topology, characterized in that, Includes the following steps: S1. Construct an optical diffraction neural network model including an input layer, an optical modulation layer and an output layer, and establish an initial uniform neuron density topology in the optical modulation layer. Each diffraction neuron is set according to a uniform spatial interval and corresponds to a trainable phase modulation parameter. S2. Establish a forward propagation model of the optical field from the input layer to the output layer. Input the training samples into the optical diffraction neural network under the current neuron topology and calculate the target loss function according to the target task. S3. Based on error backpropagation, the gradient information of the target loss function relative to the phase modulation parameters of each diffraction neuron is obtained by combining the optical field forward propagation model. Combined with the optical field response at the corresponding position of each diffraction neuron, the neuron region feature contribution degree used to divide the low contribution region and the high contribution region is calculated. S4. Based on the feature contribution, perform sharing and merging processing on low contribution neuron regions and preservation or proliferation processing on high contribution neuron regions to obtain the updated neuron topology. S5. Based on the updated neuron topology, reconstruct the mapping relationship between neuron regions and phase modulation parameters, and continue to train the phase modulation parameters of the optical diffraction neural network under the updated topology. S6. Determine whether the preset training termination condition is met; If the condition is not met, the updated neuron topology is used as the current neuron topology and the process returns to step S2; if the condition is met, training is stopped and the final variable neuron density topology and its phase modulation parameters are output.

6. The training method for a diffractive neural network based on a variable neuron density topology according to claim 5, characterized in that, The forward propagation model of the optical field includes a free-space propagation model, a lens Fourier transform model, and a diffraction optical modulation model. The free-space propagation model uses the angular spectrum propagation method to calculate the complex amplitude transmission of the optical field between adjacent optical layers. The lens Fourier transform model is used to calculate the phase transformation applied to the incident optical field by the lens unit. The diffraction optical modulation model is used to calculate the phase modulation value of the incident optical field superimposed by each optical diffraction layer.

7. The training method for a diffractive neural network based on a variable neuron density topology according to claim 5, characterized in that, The method for calculating the feature contribution of the neuron region in step S3 is as follows: For the Coordinates in the optical diffraction layer neurons at that location, Its characteristic contribution can be defined as: in, This represents the task loss function. Indicates the first Layer diffraction layer in Phase modulation parameters at the location, Indicates the first Complex optical field in front of the diffraction layer, This represents the light field response at the corresponding location; The average feature contribution calculated from multiple samples on the validation set can be expressed as: in, The number of validation samples used for statistical purposes. Indicates the first The feature contribution of each sample; When the network uses shared parameters or grouping to represent the diffraction layer, the feature contribution of the shared group is calculated first, and then the group feature contribution is backfilled to the corresponding pixel position; for the first... The first in the layer The contribution of a shared group to its group characteristics is defined as follows: in, Indicates the first Layer A shared phase parameter, This represents the set of pixels covered by the group. This indicates the number of pixels in the group; Then, based on the pixel-to-group mapping relationship The group importance is backfilled to the pixel level, and the backfilling relationship is as follows: This allows for the acquisition of a region importance distribution consistent with the pixel-level heatmap under a shared parameter structure, supporting subsequent adaptive variable neuron density topology updates.

8. The training method for a diffractive neural network based on a variable neuron density topology according to claim 5, characterized in that, The sharing and merging process includes: dividing multiple adjacent diffractive neurons within a low-contribution neuron region into the same shared region, so that all diffractive neurons within the shared region share the same phase modulation parameter, and the shared region corresponds to a single trainable parameter variable; the retention process includes: maintaining independent phase modulation parameters for each adjacent diffractive neuron within a high-contribution neuron region, so that each diffractive neuron corresponds to mutually independent trainable parameter variables; the proliferation process includes: splitting the high-contribution and already shared and merged neuron region into multiple independent sub-regions, so that each independent sub-region corresponds to mutually independent trainable parameter variables.

9. The training method for a diffractive neural network based on a variable neuron density topology according to claim 8, characterized in that, The method for reconstructing the mapping relationship between neuronal regions and phase modulation parameters in step S5 includes: regenerating the neuronal region division based on the updated neuronal topology; establishing the correspondence between each neuronal region and the phase modulation parameters, so that multiple diffractive neurons in the same shared region are mapped to the same phase parameter variable, each diffractive neuron in the reserved region is mapped to a different phase parameter variable, and each independent sub-region in the proliferation region is mapped to a different phase parameter variable; and updating the parameter set called by the forward propagation model and the backward propagation model based on the mapping relationship.

10. The training method for a diffractive neural network based on a variable neuron density topology according to claim 5, characterized in that, The preset training termination conditions include at least one of the following: the target loss function reaches the preset convergence condition, the target task performance index reaches the preset performance index, the number of topology updates reaches the preset number, and the number of training iterations reaches the preset number. After training, the final output phase modulation parameters are converted into a phase map or grayscale image and loaded into a spatial light modulator, or a diffractive optical element is prepared based on the phase modulation parameters.