Optimization method of optical diffraction neural network
By designing a multi-objective loss function to optimize the phase parameters of the optical diffraction neural network and combining classification inference and diffraction efficiency performance, the problem of low classification accuracy and diffraction efficiency of the optical diffraction neural network in image classification tasks is solved, and an efficient optical diffraction neural network model is realized.
Patent Information
- Application Number
- CN202411570776.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-11-06
AI Technical Summary
Existing optical diffraction neural networks suffer from low classification accuracy and low diffraction efficiency in image classification tasks.
A multi-objective loss function is designed, combining classification inference and diffraction efficiency performance, to optimize the phase parameter distribution of the optical diffraction neural network. The phase parameters are then optimized through forward and backward propagation models.
This improves the diffraction efficiency and classification accuracy of the optical diffraction neural network, alleviates the stray problem of the output plane field distribution, and enhances the robustness of the system.
Smart Images

Figure CN119540720B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an optimization method for optical diffraction neural networks, belonging to the field of optical diffraction neural network technology. Background Technology
[0002] Optical diffraction neural networks fully leverage the advantages of optical computing, such as high speed, low power consumption, and parallel processing, giving them unique advantages in computer vision tasks, such as image classification, salient object detection, and diffusion medium imaging. By designing a loss function to optimize the modulation information of the phase of the diffraction layer, specific computational inference tasks can be achieved.
[0003] Currently, there are two main types of loss functions for optical diffraction neural networks used in image classification tasks: mean squared error (MSE) loss function and cross-entropy loss function. The MSE loss function, based on the principle of regression loss, can effectively ensure that the output light field of the optical diffraction neural network is distributed according to a directional region, maintaining high diffraction efficiency, but the image classification accuracy is not high. The cross-entropy loss function, based on the principle of classification loss, can achieve higher classification accuracy, but it leads to a decrease in the overall diffraction efficiency of the optical diffraction neural network system, affecting subsequent detection and analysis.
[0004] Therefore, those skilled in the art need to overcome the problem that optical diffraction neural network models in image classification tasks achieve high classification accuracy but have low overall diffraction efficiency. Summary of the Invention
[0005] Objective: To overcome the shortcomings of existing technologies, this invention provides an optimization method for optical diffraction neural networks. By combining classification reasoning and diffraction efficiency performance to design a multi-objective loss function, the phase parameter distribution of the optical diffraction neural network is jointly optimized to achieve an optical diffraction neural network model with high classification accuracy and high diffraction efficiency.
[0006] Technical solution: To solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0007] An optimization method for an optical diffraction neural network, specifically including:
[0008] Step 1: Obtain an optical diffraction neural network based on phase modulation, wherein the optical diffraction neural network includes an input plane, an output plane, and multiple phase modulation diffraction layers.
[0009] Step 2: Define M detection regions in the output plane based on the total number of categories M in the image training dataset. Each detection region corresponds to a category. Calculate the energy of each detection region and the total energy of the output plane. Determine the category of the input image based on the maximum energy of the M detection regions. Normalize the ratio of the energy of the detection region corresponding to each category to the total energy of the output plane and calculate the performance loss of classification inference.
[0010] Step 3: Based on the diffraction efficiency of the optical diffraction neural network, construct a loss function of diffraction efficiency that represents the relative relationship between the energy of the detection region corresponding to the correct category and the total energy of the input plane.
[0011] Step 4: Correct the loss function of diffraction efficiency performance, set the reference value of the ideal diffraction efficiency of the system, and obtain the performance loss of the corrected diffraction efficiency.
[0012] Step 5: Combining the performance loss of classification inference and the performance loss of the corrected diffraction efficiency, construct a multi-objective loss function, and use the multi-objective loss function to jointly optimize the phase parameters of the optical diffraction neural network to obtain the optimized phase parameters.
[0013] Step 6: Update the optical diffraction neural network based on the optimized phase parameters to obtain the optimized optical diffraction neural network.
[0014] As a preferred embodiment, the optical diffraction neural network includes a forward propagation model and a backward propagation model. The forward propagation model is established based on Rayleigh-Sommerfeld diffraction theory, which realizes the transmission of the input light field to the output plane for image classification tasks. The backward propagation model is implemented based on the backward propagation algorithm to optimize the phase parameter distribution of the optical diffraction layer.
[0015] As a preferred embodiment, the expression for the forward propagation model is as follows:
[0016]
[0017] in, This represents the forward propagation model. It is the superposition of the incident light fields from all k diffraction neural units in the (l-1)th layer to the i-th diffraction neural unit in the l-th diffraction layer. λ represents the operating wavelength of the incident light. Represents the coordinates of the i-th diffractive neural unit. The coordinates of the l-th layer are: The output light field at the diffraction neural unit is transmitted to the (l-1)th layer at coordinates of The light transmission coefficient at the diffractive neural unit, This represents the transmission coefficient corresponding to the i-th diffraction neural unit in the l-th layer.
[0018] As the preferred solution
[0019] in, Representing coordinates and coordinates The Euclidean distance between the diffractive neural units, where λ represents the operating wavelength of the incident light. , Represents pi (π). This represents the natural exponential function.
[0020] t i l ( x i , y i , z i , λ ) = a i l ( x i , y i , z i , λ ) exp [ j ϕ i l ( x i , y i , z i , λ ) ]
[0021] in, Indicates the amplitude coefficient. This represents the phase coefficient, with the amplitude coefficient set to a constant 1. The phase coefficient is a learnable parameter, and its value range is [value range missing]. [ 0 , 2 π ] .
[0022] As a preferred embodiment, the backpropagation model employs a stochastic gradient descent algorithm to convert the phase coefficients of the phase-modulated diffraction layer. Optimize as learnable parameters.
[0023] As a preferred approach, the cross-entropy loss function is used to calculate the performance loss of classification inference.
[0024] As a preferred solution, the performance loss of the classification reasoning The calculation formula is as follows:
[0025]
[0026] in, The hot-coded vector representing the true label of the image sample. This represents the normalized value of the energy in the m-th detection region, where M represents the total number of detection regions.
[0027] As the preferred solution
[0028] in, This represents the energy of the m-th detection region. Let M represent the natural exponential function, and M represent the total number of probe areas.
[0029] As a preferred embodiment, the expression for the loss function of the diffraction efficiency is as follows:
[0030]
[0031] in, Indicates the energy of the probe area. This represents the total energy of the input plane.
[0032] As a preferred embodiment, the performance loss of the corrected diffraction efficiency The calculation formula is as follows:
[0033]
[0034] in, This represents a reference value indicating the ideal diffraction efficiency of the system.
[0035] As a preferred embodiment, the expression for the multi-objective loss function is as follows:
[0036]
[0037] in, This indicates a configurable hyperparameter, with a value range of [value range missing]. [ 0 , 1 ] .
[0038] Beneficial effects: The present invention provides an optimization method for optical diffraction neural networks, which designs a multi-objective loss function by combining classification inference performance and diffraction efficiency performance, and jointly optimizes the phase parameter distribution of the diffraction layer of the optical neural network, thereby greatly improving the diffraction efficiency of the trained optical diffraction neural network.
[0039] Compared with existing technologies, the advantages of this invention are:
[0040] 1) Compared with the traditional cross-entropy loss function training method, the method of the present invention greatly improves the diffraction efficiency of the optical diffraction neural network by adding a diffraction efficiency performance loss function to the original cross-entropy loss function of classification performance.
[0041] 2) The trained optical diffraction neural network alleviates the problem of stray distribution in the output plane field, has high signal contrast, enhances the robustness of the system, and further promotes the application of optical diffraction neural networks in practical image classification scenarios. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the optical diffraction neural network phase optimization method of the present invention.
[0043] Figure 2 This is a diagram showing the results of phase optimization training of the multi-objective loss function provided in this embodiment of the invention on a handwritten digit dataset. Figure 2 In the middle (A), the change in the overall loss value during the training process is shown. Figure 2 (B) shows the changes in classification inference accuracy and diffraction efficiency of the optical diffraction neural network model tested on the validation set.
[0044] Figure 3 This is a parameter distribution diagram of the phase modulation diffraction layer of the optical diffraction neural network provided in an embodiment of the present invention.
[0045] Figure 4 This is a confusion matrix diagram of the optical diffraction neural network provided in this embodiment of the invention on a handwritten digit data test set.
[0046] Figure 5 This is a comparison of the optimization results (using a multi-objective loss function) obtained on a handwritten digit dataset in an embodiment of the present invention with the results before optimization (using a traditional cross-entropy loss function). Figure 5 (A) represents the result before optimization. Figure 5 (B) is the optimized result. Figure 5 (C) shows the performance comparison of the optical diffraction neural network before and after optimization. Detailed Implementation
[0047] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0048] The present invention will be further described below with reference to specific embodiments.
[0049] Example 1:
[0050] This embodiment introduces an optimization method for an optical diffraction neural network, such as... Figure 1 As shown, the method described in detail is as follows:
[0051] Step 1: Construct an optical diffraction neural network based on phase modulation. The optical diffraction neural network includes an input plane, an output plane, and multiple phase modulation diffraction layers.
[0052] Step 2: Define M detection regions in the output plane based on the total number of categories M in the image training dataset. Each detection region corresponds to a category. Calculate the energy of each detection region and the total energy of the output plane. Determine the category of the input image based on the maximum energy of the M detection regions. Normalize the ratio of the energy of the detection region corresponding to each category to the total energy of the output plane. Use the cross-entropy loss function to calculate the performance loss of classification inference.
[0053] Step 3: Based on the diffraction efficiency of the optical diffraction neural network, construct a loss function of diffraction efficiency that represents the relative relationship between the energy of the detection region corresponding to the correct category and the total energy of the input plane.
[0054] Step 4: In order to balance the problem of the performance loss of diffraction efficiency being too small in Step 3 during the training process, the performance loss function of diffraction efficiency is modified, a reference value of the ideal diffraction efficiency of the system is set, and the performance loss of diffraction efficiency after modification is obtained.
[0055] Step 5: Combining the performance loss of classification inference and the performance loss of the corrected diffraction efficiency, construct a multi-objective loss function, and use the multi-objective loss function to jointly optimize the phase parameters of the optical diffraction neural network to obtain the optimized phase parameters.
[0056] Step 6: Update the optical diffraction neural network based on the optimized phase parameters to obtain the optimized optical diffraction neural network.
[0057] Preferably, the optical diffraction neural network includes a forward propagation model and a backward propagation model; the forward propagation model is established based on the Rayleigh-Sommerfeld diffraction theory, and the forward propagation model realizes the transmission of the light field from the input light field to the output plane, which is used for image classification tasks; the backward propagation model is implemented based on the backward propagation algorithm to optimize the phase parameter distribution of the optical diffraction layer.
[0058] Preferably, the expression for the forward propagation model based on Rayleigh-Sommerfeld diffraction theory is as follows:
[0059]
[0060] in, This represents the forward propagation model. It is the superposition of the incident light fields from all k diffraction neural units in the (l-1)th layer to the i-th diffraction neural unit in the l-th diffraction layer. λ represents the operating wavelength of the incident light. Represents the coordinates of the i-th diffractive neural unit. The coordinates of the l-th layer are: The output light field at the diffraction neural unit is transmitted to the (l-1)th layer at coordinates of The light transmission coefficient at the diffractive neural unit, This represents the transmission coefficient corresponding to the i-th diffraction neural unit in the l-th layer.
[0061] in,
[0062] in, , Representing coordinates and coordinates The Euclidean distance between the diffractive neural units, where λ represents the operating wavelength of the incident light. , Represents pi (π). This represents the natural exponential function.
[0063] in, t i l ( x i , y i , z i , λ ) = a i l ( x i , y i , z i , λ ) exp [ j ϕ i l ( x i , y i , z i , λ ) ]
[0064] in, Indicates the amplitude coefficient. The phase coefficient is used in this invention, employing a phase-modulated optical diffraction neural network. The amplitude coefficient is set to a constant 1, and the phase coefficient is a learnable parameter with a value range of [value range missing]. [ 0 , 2 π ] .
[0065] The expression for the forward propagation model describes the light wave traveling from layer l at coordinates... The i-th diffractive neural unit propagates to the next layer at coordinates i. The light field transmission process of the diffractive neural unit.
[0066] The forward propagation model described is a recursive model. Image information is loaded onto the input plane, i.e., the 0th layer of the optical diffraction neural network. The optical diffraction neural network model has N layers. Therefore, after the forward propagation model, the true light intensity energy distribution on the output plane, i.e., the (N+1)th layer of the optical diffraction neural network, is represented as follows: , The coordinates of the (N+1)th layer of the optical diffraction neural network are . The true light intensity energy distribution of the diffractive neural unit.
[0067] Preferably, the backpropagation model employs a stochastic gradient descent algorithm to calculate the phase coefficients of the diffraction layer. Optimize as learnable parameters.
[0068] Preferably, the performance loss of the classification reasoning The calculation formula is as follows:
[0069]
[0070] in, The hot-coded vector representing the true label of an image sample. For example, the true label 2 can be encoded as (0, 0, 1, 0, 0, 0, 0, 0, 0, 0). This represents the normalized energy value of the m-th detection region. M represents the total number of detection regions.
[0071] Performance loss of classification reasoning Used to calculate the classification loss during the training process of the phase parameters of the optical diffraction neural network, based on the forward propagation model of the optical diffraction neural network, the true light intensity energy of the i-th diffraction neuron in the output plane is calculated as follows: The statistical output plane defines the energy distribution of the detection area corresponding to the M categories, respectively. . , representing the energy of the m-th detection region. The value after Softmax normalization corresponds to the probability value of predicting the m-th class.
[0072] Preferably, the expression for the loss function of the diffraction efficiency is as follows:
[0073]
[0074] in, Indicates the energy of the probe area. This represents the total energy of the input plane.
[0075] Preferably, the performance loss of the corrected diffraction efficiency The calculation formula is as follows:
[0076]
[0077] in, The reference value representing the ideal diffraction efficiency of the system is obtained through multiple experimental tests. The loss convergence value of the optical diffraction neural network under standalone action is obtained to ensure that the performance loss of classification reasoning during backpropagation is on the same order of magnitude as the performance loss of diffraction efficiency.
[0078] Preferably, the multi-objective loss function expression is:
[0079]
[0080] in, This indicates a configurable hyperparameter, with a value range of [value range missing]. [ 0 , 1 ] .
[0081] The multi-objective loss function uses a weighted approach to balance the classification inference accuracy and diffraction efficiency of the optical diffraction neural network system.
[0082] Example 2:
[0083] This implementation introduces the computational process of an optimization method for an optical diffraction neural network. The method combines classification inference performance and diffraction efficiency performance to design a multi-objective loss function, jointly optimizing the phase parameter distribution of the diffraction layer in the optical neural network. The specific description of the method is as follows:
[0084] 1) Construct an optical diffraction neural network based on phase modulation.
[0085] Based on the Rayleigh-Sommerfeld diffraction formula and further simplified by using the angular spectral method, a Python program was used to simulate the propagation of the input light field in free space. A five-layer diffraction layer phase modulation was designed, and the initial phase values of the diffraction layers were set. The Adam stochastic gradient descent algorithm was used for backpropagation to update the phase values. The structural parameters of the optical diffraction neural network satisfy the fully connected condition. According to the wavelength λ of the illumination source, the physical parameters of the optical diffraction neural network were designed. The parameters involved include: the number of diffraction neural units N in each layer of the optical diffraction neural network is 200×200, the characteristic size a of the diffraction unit is 0.53λ, and the spacing d between the diffraction layers is 40λ.
[0086] 2) On a standard handwritten digit training set, a multi-objective loss function combining the classification inference performance loss and diffraction efficiency performance loss is used to calculate the overall loss after passing through the optical diffraction neural network output.
[0087] On the handwritten digit dataset, after multiple experimental tests and training, the ideal reference values for diffraction efficiency are 0.18, 0.2, and 0.22. In this embodiment, 0.18 is selected as the reference value for diffraction efficiency, and the diffraction efficiency loss function is improved to ensure that the performance loss of classification reasoning during backpropagation is on the same order of magnitude as the performance loss of diffraction efficiency.
[0088] To balance classification inference performance and diffraction efficiency performance on the handwritten digit training set, the weighting ratio of the two is 0.8:0.2. The resulting multi-objective loss function for training and optimizing the phase of the optical diffraction neural network is expressed as follows:
[0089]
[0090] Among them, the performance loss of classification reasoning The diffraction efficiency performance loss is calculated using the cross-entropy loss function. Specifically, it is expressed as follows:
[0091]
[0092] The loss variation on the handwritten digit training set is as follows Figure 2 As shown in (A), Figure 2 Figure (B) shows the changes in classification inference accuracy and diffraction efficiency of the optical diffraction neural network model on the validation set. The parameters of the network model that performed best during training are saved.
[0093] 3) After the optical diffraction neural network model is trained on the handwritten digit training set, the phase modulation parameter distribution of each diffraction layer of the model is obtained, such as... Figure 3 As shown, the confusion matrix of the model on the handwritten digit test set is also obtained, as follows: Figure 4 As shown.
[0094] 4) Figure 5 This demonstrates the optimization of phase parameters in an optical diffraction neural network using a multi-objective loss function that combines classification inference performance and diffraction efficiency performance (optimized results). Figure 5 As shown in (B), the traditional cross-entropy loss function (result before optimization) is as follows: Figure 5 As shown in (A). The performance results on the handwritten digit set are compared, as shown in... Figure 5 As shown in (C), it can be seen that the energy distribution of the output field of the optical diffraction neural network trained by the multi-objective loss function proposed in this invention is more concentrated in the target region, which alleviates the problem of stray energy distribution of the output field of the model trained by the traditional cross-entropy loss function. At the same time, based on the signal contrast performance on the handwritten digit test set, it can be seen that the signal contrast of the output field of the model trained by the multi-objective loss function proposed in this invention is higher and the model performance is better.
[0095] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An optimization method for an optical diffraction neural network, characterized in that: Specifically, it includes: Step 1: Obtain an optical diffraction neural network based on phase modulation, wherein the optical diffraction neural network includes an input plane, an output plane, and multiple phase modulation diffraction layers; Step 2: Define M detection regions in the output plane based on the total number of categories M in the image training dataset. Each detection region corresponds to a category. Calculate the energy of each detection region and the total energy of the output plane. Determine the category of the input image based on the maximum energy of the M detection regions. Normalize the ratio of the energy of the detection region corresponding to each category to the total energy of the output plane and calculate the performance loss of classification inference. Step 3: Based on the diffraction efficiency of the optical diffraction neural network, construct a loss function of diffraction efficiency that represents the relative relationship between the energy of the detection region corresponding to the correct category and the total energy of the input plane. Step 4: Correct the loss function of diffraction efficiency performance, set the reference value of the ideal diffraction efficiency of the system, and obtain the performance loss of the corrected diffraction efficiency. Step 5: Combining the performance loss of classification inference and the performance loss of the corrected diffraction efficiency, construct a multi-objective loss function, and use the multi-objective loss function to jointly optimize the phase parameters of the optical diffraction neural network to obtain the optimized phase parameters; Step 6: Update the optical diffraction neural network based on the optimized phase parameters to obtain the optimized optical diffraction neural network; The performance loss of classification reasoning The calculation formula is as follows: ; in, The hot-coded vector representing the true label of the image sample. This represents the normalized energy value of the m-th detection region, and M represents the total number of detection regions. The expression for the loss function of the diffraction efficiency is as follows: ; in, Indicates the energy of the probe area. This represents the total energy of the input plane; The performance loss of the corrected diffraction efficiency The calculation formula is as follows: ; in, A reference value representing the ideal diffraction efficiency of the system; The expression for the multi-objective loss function is as follows: ; in, This indicates a configurable hyperparameter, with a value range of [value range missing]. , For the performance loss of classification reasoning, This represents the performance loss due to the corrected diffraction efficiency.
2. The optimization method for an optical diffraction neural network according to claim 1, characterized in that: The optical diffraction neural network includes a forward propagation model and a backward propagation model. The forward propagation model is established based on the Rayleigh-Sommerfeld diffraction theory. The forward propagation model realizes the transmission of the light field from the input light field to the output plane and is used for image classification tasks. The backward propagation model is implemented based on the backward propagation algorithm to optimize the phase parameter distribution of the optical diffraction layer.
3. The optimization method for an optical diffraction neural network according to claim 2, characterized in that: The expression for the forward propagation model is as follows: ; in, This represents the forward propagation model. It is the superposition of the incident light fields of all k diffractive neural units in the (l-1)th layer to the i-th diffractive neural unit in the l-th diffractive layer; λ represents the working wavelength of the incident light. Represents the coordinates of the i-th diffractive neural unit. The coordinates of the l-th layer are: The output light field at the diffraction neural unit is transmitted to the (l-1)th layer at coordinates of The light transmission coefficient at the diffraction neural unit, This represents the transmission coefficient corresponding to the i-th diffraction neural unit in the l-th layer.
4. The optimization method for an optical diffraction neural network according to claim 3, characterized in that: ; in, Representing coordinates and coordinates The Euclidean distance between the diffractive neural units, where λ represents the operating wavelength of the incident light. , Represents pi (π). Represents the natural exponential function; ; in, Indicates the amplitude coefficient. This represents the phase coefficient, with the amplitude coefficient set to a constant 1. The phase coefficient is a learnable parameter, and its value range is [value range missing]. .
5. The optimization method for an optical diffraction neural network according to claim 2, characterized in that: The backpropagation model described above employs a stochastic gradient descent algorithm to measure the phase coefficients of the phase-modulated diffraction layer. Optimize as learnable parameters.
6. The optimization method for an optical diffraction neural network according to claim 1, characterized in that: ; in, This represents the energy of the m-th detection region. Let M represent the natural exponential function, and M represent the total number of probe areas.
Citation Information
Patent Citations
Single-layer phase regulation diffraction deep neural network optimization method
CN115034378A
Devices and methods employing optical-based machine learning using diffractive deep neural networks
WO2019200289A1