Filter training and energy distribution matrix generation method, device and equipment

By determining the number of sub-coupling steps in the optical waveguide coupling region and performing energy tracing processing, a partial energy distribution matrix is ​​generated and interpolation prediction is performed using a filter. This solves the problems of high computational complexity and low efficiency in the existing technology and achieves efficient energy distribution matrix generation.

CN121837484APending Publication Date: 2026-04-10SEEV OPTOELECTRONICS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing energy tracing algorithms require the entire number of coupling steps to be calculated, resulting in high computational complexity and low efficiency in generating the energy distribution matrix of the optical waveguide coupling region.

Method used

By determining the number of sub-coupling steps, energy tracing is performed to generate a partial energy distribution matrix. Then, a filter is used for interpolation prediction to generate the complete energy distribution matrix of the target optical waveguide coupling region.

Benefits of technology

It reduces computational complexity, saves computational resources, and improves the efficiency of generating energy distribution matrices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837484A_ABST
    Figure CN121837484A_ABST
Patent Text Reader

Abstract

The invention discloses a filter training and energy distribution matrix generation method, device and equipment, and relates to the technical field of image processing, and the method comprises the steps: carrying out the energy tracing processing according to the sub-coupling-out step number of light in a target optical waveguide coupling-out region, and generating a partial energy distribution matrix; determining a sample matrix region from the partial energy distribution matrix, and determining a predicted energy value of an interpolation matrix region according to a first actual energy value of the sample matrix region and a to-be-trained weight of the to-be-trained image interpolation filter; updating the to-be-trained weight according to the predicted energy value, and generating a target image interpolation filter; wherein the target image interpolation filter is used for performing interpolation prediction on the complete energy distribution matrix. According to the method, the complete energy distribution matrix of the optical waveguide coupling-out region can still be generated without introducing all coupling-out steps for operation, the operation complexity is reduced, the operation resources are saved, and the generation efficiency of the energy distribution matrix is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus, and device for training filters and generating energy distribution matrices. Background Technology

[0002] An optical waveguide is an optical element that transmits an image projected by an optical engine to the human eye through grating diffraction, and it is one of the important implementation schemes in the field of augmented reality. Among them, the energy tracing algorithm is an algorithm that calculates the energy distribution of the coupling region of an optical waveguide by tracking the propagation and energy changes of light within the waveguide. It is a key simulation algorithm used to measure the brightness, uniformity, and other qualities of an optical waveguide.

[0003] The computational complexity of the energy tracing algorithm depends on the diffraction order and the number of coupling steps in the waveguide coupling region. If the diffraction order is fixed, all coupling steps need to be calculated to generate a complete energy distribution matrix in the waveguide coupling region. This results in high computational complexity, requiring significant computational resources to generate the energy distribution matrix and also leading to low generation efficiency. Summary of the Invention

[0004] This invention provides a method, apparatus, and device for training filters and generating energy distribution matrices, in order to solve the problem that existing energy tracing algorithms require all decoupling steps for computation, resulting in high computational resource consumption and low efficiency in generating energy distribution matrices.

[0005] According to one aspect of the present invention, a method for training a filter is provided, the method comprising:

[0006] The number of sub-coupling steps is determined based on the total number of coupling steps of the light in the target optical waveguide coupling region, and energy tracing processing is performed based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region; wherein, the number of sub-coupling steps is less than the total number of coupling steps;

[0007] Based on the filter size of the interpolation filter of the image to be trained, a sample matrix region is determined from the partial energy distribution matrix. Based on the first actual energy value of the sample matrix region and the training weights of the interpolation filter of the image to be trained, the predicted energy value of the interpolation matrix region corresponding to the interpolation filter of the image to be trained in the partial energy distribution matrix is ​​determined.

[0008] The training weights are updated based on the predicted energy values ​​to generate a target image interpolation filter; wherein, the target image interpolation filter is used to interpolate and predict the complete energy distribution matrix of the target optical waveguide coupling region.

[0009] According to another aspect of the present invention, a method for generating an energy distribution matrix is ​​provided, the method comprising:

[0010] The number of sub-coupling steps is determined based on the total number of coupling steps of the light in the target optical waveguide coupling region, and energy tracing processing is performed based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region; wherein, the number of sub-coupling steps is less than the total number of coupling steps;

[0011] Based on the matrix size of the complete energy distribution matrix of the target waveguide coupling region and the matrix size of the partial energy distribution matrix, a matrix to be filled is generated, and a reference matrix region is determined from the partial energy distribution matrix according to the filter size of the target image interpolation filter, wherein the target image interpolation filter is generated using any of the filter training methods described above.

[0012] Based on the third actual energy value of the reference matrix region and the trained weights of the target image interpolation filter, the energy value to be filled in the interpolation matrix region corresponding to the target image interpolation filter in the matrix to be filled is determined, and the matrix to be filled is filled with energy value according to the energy value to be filled to generate the remaining energy distribution matrix.

[0013] The complete energy distribution matrix is ​​generated based on the remaining energy distribution matrix and the partial energy distribution matrix.

[0014] According to another aspect of the present invention, a filter training apparatus is provided, the apparatus comprising:

[0015] The first energy distribution matrix generation module is used to determine the number of sub-coupling steps based on the total number of coupling steps of light rays in the target optical waveguide coupling region, and to perform energy tracing processing based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region; wherein, the number of sub-coupling steps is less than the total number of coupling steps;

[0016] The predicted energy value determination module is used to determine a sample matrix region from the partial energy distribution matrix according to the filter size of the interpolation filter of the image to be trained, and to determine the predicted energy value of the interpolation matrix region corresponding to the interpolation filter of the image to be trained in the partial energy distribution matrix according to the first actual energy value of the sample matrix region and the training weights of the interpolation filter of the image to be trained.

[0017] The weight update module is used to update the weights to be trained according to the predicted energy value to generate a target image interpolation filter; wherein, the target image interpolation filter is used to interpolate and predict the complete energy distribution matrix of the target optical waveguide coupling region.

[0018] According to another aspect of the present invention, an energy distribution matrix generation apparatus is provided, the apparatus comprising:

[0019] The second energy distribution matrix generation module is used to determine the number of sub-coupling steps based on the total number of coupling steps of light in the target optical waveguide coupling region, and to perform energy tracing processing based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region; wherein, the number of sub-coupling steps is less than the total number of coupling steps;

[0020] The reference matrix region determination module is used to generate a matrix to be filled based on the matrix size of the complete energy distribution matrix of the target optical waveguide coupling region and the matrix size of the partial energy distribution matrix, and to determine the reference matrix region from the partial energy distribution matrix based on the filter size of the target image interpolation filter, wherein the target image interpolation filter is generated using any of the filter training methods described above.

[0021] The residual energy distribution matrix generation module is used to determine the energy value to be filled in the interpolation matrix region corresponding to the target image interpolation filter in the matrix to be filled, based on the third actual energy value of the reference matrix region and the trained weights of the target image interpolation filter, and to fill the matrix to be filled with energy value according to the energy value to be filled, thereby generating the residual energy distribution matrix.

[0022] The complete energy distribution matrix generation module is used to generate the complete energy distribution matrix based on the remaining energy distribution matrix and the partial energy distribution matrix.

[0023] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0024] At least one processor; and

[0025] A memory communicatively connected to the at least one processor; wherein,

[0026] The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method described in any one of the present invention.

[0027] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the method described in any one of the present invention.

[0028] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any one of the present invention.

[0029] The advantages of this invention are as follows: Traditional energy tracing algorithms require the entire number of coupling steps to be calculated when generating the energy distribution matrix of the optical waveguide coupling region. However, this invention only requires the calculation of a portion of the energy distribution matrix. The filter is trained using this portion of the energy distribution matrix, and the complete energy distribution matrix of the target optical waveguide coupling region is interpolated and predicted using the filter. This eliminates the need to calculate the entire number of coupling steps, yet still generates the complete energy distribution matrix of the optical waveguide coupling region. This reduces computational complexity, saves computational resources, and improves the efficiency of energy distribution matrix generation.

[0030] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1A A flowchart of a filter training method provided in Embodiment 1 of the present invention;

[0033] Figure 1B This is a schematic diagram of an interpolation matrix region provided in Embodiment 1 of the present invention;

[0034] Figure 2 A flowchart illustrating a filter training method provided in Embodiment 2 of the present invention;

[0035] Figure 3 This is a flowchart of an energy distribution matrix generation method provided in Embodiment 3 of the present invention;

[0036] Figure 4 This is a schematic diagram of the structure of a filter training device provided in Embodiment 4 of the present invention;

[0037] Figure 5 This is a schematic diagram of an energy distribution matrix generation device provided in Embodiment 5 of the present invention;

[0038] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the filter training method and energy distribution matrix generation method of the embodiments of the present invention. Detailed Implementation

[0039] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 should fall within the scope of protection of the present invention.

[0040] It should be noted that the terms "first," "second," "third," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0041] The computational complexity of the energy tracing algorithm depends on the diffraction order and the number of coupling steps in the waveguide coupling region. Taking a two-dimensional grating pupil as an example, if the diffraction order includes N directions and the number of coupling steps is t, then the computational complexity of the energy tracing algorithm is approximately... Therefore, incorporating all the decoupling steps into the calculation would result in very high computational complexity.

[0042] Example 1

[0043] Figure 1A This is a flowchart of a filter training method provided in Embodiment 1 of the present invention. This embodiment is applicable to training a target image interpolation filter for interpolating and predicting the complete energy distribution matrix of the optical waveguide coupling region. This method can be executed by a filter training device, which can be implemented in hardware and / or software. Figure 1A As shown, the method includes:

[0044] S101. Determine the number of sub-coupling steps based on the total number of coupling steps of the light rays in the target optical waveguide coupling region, and perform energy tracing processing based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region.

[0045] The target waveguide coupling region refers to a specific area within the waveguide specifically designed to efficiently couple and output the internally transmitted light to the external environment. It is typically part of the waveguide surface and is responsible for converting guided light into free-space light for image display or signal detection.

[0046] Total outgoing steps refer to the total number of diffraction events that a light ray undergoes from entering the outgoing region of the target optical waveguide until it finally leaves. It reflects the overall behavior of light after multiple "bounces" inside the waveguide and is usually used to describe the global characteristics of energy distribution.

[0047] Sub-outgoing steps refer to a subset or lower-order part of the total outgoing steps, used to simplify the simulation process. The number of sub-outgoing steps is less than the total outgoing steps, which facilitates local energy analysis. For example, assuming the total outgoing steps are t, the number of sub-outgoing steps can be t / 2 or t / 3, etc. This embodiment does not limit the proportional relationship between the number of sub-outgoing steps and the total outgoing steps.

[0048] Energy tracing is a method for calculating optical energy by simulating the propagation path of light in a waveguide to track and calculate the energy distribution in the coupling region of a target optical waveguide. It is similar to ray tracing but focuses on the quantization of energy, generating a distribution matrix representing energy density, such as a partial energy distribution matrix.

[0049] The partial energy distribution matrix refers to a two-dimensional matrix generated based on the sub-coupling steps and energy tracing processing. It represents the energy distribution values ​​of a local region within the target optical waveguide coupling area. The matrix elements correspond to the energy intensity at spatial locations and are used as training samples for the interpolation filter of the subsequent image to be trained.

[0050] In one implementation, based on the design characteristics of the target waveguide coupling region (such as diffraction grating period, refractive index distribution, and surface morphology), and parameters such as incident light wavelength and incident angle range, the maximum number of diffractions occurring within the target waveguide is derived using an optical propagation model, and this number is taken as the total coupling steps. Further, based on the total coupling steps of the target waveguide coupling region, the number of sub-coupling steps is determined according to a preset rule. For example, the first k of the total coupling steps are selected as the number of sub-coupling steps, where k is less than the total coupling steps to reduce computational complexity; another example is determining the number of sub-coupling steps based on a preset ratio combined with the total coupling steps, where the preset ratio is less than 1, such as selecting 1 / 2 or 1 / 3 as the preset ratio.

[0051] Furthermore, a spatially discretized grid is established on the surface of the target waveguide coupling region. Initial parameters of the incident light field are set, including propagation direction, sub-coupling step number, and diffraction efficiency. The light path is iteratively simulated within the sub-coupling step number: at each step, the energy attenuation when the light interacts with the diffraction micro / nanostructure is calculated until the upper limit of the sub-coupling step number is reached. Finally, the cumulative energy received by the grid nodes within the sub-coupling step number is statistically analyzed to generate an energy distribution matrix covering a portion of the spatial domain of the target waveguide coupling region, which serves as the partial energy distribution matrix.

[0052] Optionally, after generating the partial energy distribution matrix, the following steps are also included:

[0053] The maximum energy value is determined based on the energy values ​​corresponding to each matrix element in the partial energy distribution matrix. Then, the energy values ​​corresponding to each matrix element in the partial energy distribution matrix are normalized based on the maximum energy value to obtain a normalized partial energy distribution matrix, thereby reducing the risk of numerical divergence during subsequent training.

[0054] S102. Determine the sample matrix region from the partial energy distribution matrix based on the filter size of the interpolation filter of the image to be trained, and determine the predicted energy value of the interpolation matrix region corresponding to the interpolation filter of the image to be trained in the partial energy distribution matrix based on the first actual energy value of the sample matrix region and the training weights of the interpolation filter of the image to be trained.

[0055] Among them, the image interpolation filter to be trained is a filter model that needs to be optimized to estimate the energy value of unknown points in the matrix. It is designed to predict the complete energy distribution matrix of the target optical waveguide coupling region by learning partial energy value data.

[0056] The filter size refers to the size of the region covered by the interpolation filter in the image to be trained during operation, usually expressed in terms of the number of rows and columns. It defines the neighborhood range considered by the interpolation filter when processing the input matrix. The filter size determines the size of the sample region selected from the partial energy distribution matrix, directly affecting the accuracy of training and prediction. In this embodiment, the number of rows in the filter size is set to be less than or equal to the number of rows in the partial energy distribution matrix, and the number of columns in the filter size is set to be less than or equal to the number of columns in the partial energy distribution matrix to ensure that there are usable energy values ​​in the sample matrix region.

[0057] The sample matrix region is a sub-region selected from the partial energy distribution matrix and used as input data to train the filter. It contains the first actual measured energy values, representing a local segment of the target waveguide coupling region. The selection of the sample matrix region is based on the filter size, with the aim of providing representative samples so that the interpolation filter of the image to be trained can learn the pattern of the energy distribution. For example, if the filter size is 3×3, the sample matrix region is a 3×3 matrix block.

[0058] The first actual energy value refers to the true measured energy value obtained through energy tracing processing in the sample matrix region. These values ​​represent the actual energy distribution of light rays in the target waveguide coupling region, serving as training sample data for the interpolation filter of the image to be trained.

[0059] The training weights are internal parameters of the image interpolation filter, initially unoptimized and requiring adjustment during training. They define how the filter weights the input data to generate the predicted output. These weights are variables, updated during training based on the prediction error, enabling the filter to more accurately estimate the energy distribution.

[0060] The interpolation matrix region refers to the local sub-region within the partial energy distribution matrix that the interpolation filter for the image to be trained needs to predict; it is a local sub-region spatially associated with the sample matrix region. During the training phase, its second actual energy value is pre-acquired through energy tracing and used to supervise the training of the interpolation filter for the image to be trained.

[0061] The predicted energy value is the estimated energy value generated by the interpolation filter of the image to be trained within the interpolation matrix region. It is calculated based on the first actual energy value of the sample matrix region and the weights to be trained, representing an initial prediction of the energy of the target waveguide coupling region. During training, these values ​​are compared with the second actual energy value of the interpolation matrix region to generate an error value, which is used to optimize the weights to be trained.

[0062] In one implementation, based on the propagation direction of the light rays in the optical waveguide, a fixed positional offset of the interpolation matrix region relative to the sample matrix region is predefined. For example, if the light rays in the optical waveguide propagate from left to right, the interpolation matrix region is located to the right of the sample matrix region; for instance, the interpolation matrix region may be adjacent to the right side of the sample matrix region. As another example, if the light rays in the optical waveguide propagate from top to bottom, the interpolation matrix region is located below the sample matrix region; for instance, the interpolation matrix region may be adjacent to the bottom side of the sample matrix region.

[0063] Furthermore, starting from the top-left corner (0,0) of the partial energy distribution matrix according to the filter size, the matrix slides within the row and column range of the partial energy distribution matrix at preset step sizes, such as 1 step, selecting a matrix region with the same size as the filter as the sample matrix region each time, until the entire matrix region of the partial energy distribution matrix has been traversed. The interpolation matrix region is always located at a preset relative position within the sample matrix region, such as the right neighbor, lower neighbor, or lower right diagonal.

[0064] For example, assuming the filter size is 2×2 and the sliding step size is 1, the partial energy distribution matrix is ​​as follows:

[0065] [0.8, 0.9, 0.7, 0.5, 0.6];

[0066] [1.0, 0.8, 0.6, 0.6, 0.5];

[0067] [0.6, 0.7, 0.5, 0.3, 0.6];

[0068] [0.9, 0.6, 0.6, 0.2, 0.3].

[0069] Then, sample matrix region 1 is selected as:

[0070] [0.8, 0.9];

[0071] [1.0, 0.8].

[0072] Select sample matrix region 2 as:

[0073] [0.9, 0.7];

[0074] [0.8, 0.6].

[0075] Select sample matrix region 3 as:

[0076] [0.7, 0.5];

[0077] [0.6, 0.6].

[0078] The energy distribution matrix is ​​traversed sequentially in the manner described above until all sample matrix regions are obtained.

[0079] The interpolation matrix region corresponding to the interpolation filter in this part of the energy distribution matrix of the image to be trained includes, but is not limited to:

[0080] The matrix region immediately to the right of sample matrix region 1 [0.7], the matrix region immediately to the right of sample matrix region 2 [0.5], the matrix region immediately to the right of sample matrix region 3 [0.6], and so on. It is understood that the above are merely illustrative examples of interpolation matrix regions and do not constitute any limitation on the interpolation matrix regions. In one implementation, the predicted energy value of the interpolation matrix region corresponding to the interpolation filter in the partial energy distribution matrix is ​​determined by weighted summation based on the first actual energy value of the sample matrix region and the training weights of the interpolation filter for the image to be trained.

[0081] For example, continuing with the above example, let's assume the first actual energy value of region 1 in the sample matrix is ​​represented as:

[0082] [0.8, 0.9];

[0083] [1.0, 0.8].

[0084] The training weights of the interpolation filter for the image to be trained are represented as follows:

[0085] [w11=0.1, w12=0.3];

[0086] [w13=0.2, w14=0.4].

[0087] The interpolation matrix region [0.7] associated with sample matrix region 1 is denoted as interpolation matrix region 1.

[0088] The predicted energy value for region 1 of the interpolation matrix is: (0.8×0.1)+(0.9×0.3)+(1.0×0.2)+(0.8×0.4)=0.87.

[0089] S103. Update the weights to be trained based on the predicted energy values ​​to generate the target image interpolation filter.

[0090] Updating the training weights refers to the iterative process of dynamically adjusting the weights using the error signal between the predicted and actual energy values. Essentially, it minimizes the difference between physical simulation and mathematical prediction, allowing the interpolation filter of the image to be trained to gradually approximate the true energy propagation law of the target waveguide coupling region.

[0091] The target image interpolation filter refers to the trained image interpolation filter with optimized and fixed weights, capable of predicting the energy distribution of unknown regions in the target waveguide coupling area based on locally known energy values. It is the final output of the training process, undertaking the task of mapping and reconstructing the partial energy distribution matrix to the complete energy distribution matrix. The target image interpolation filter is used to interpolate and predict the complete energy distribution matrix of the target waveguide coupling area.

[0092] In one implementation, a predicted energy value for the interpolation matrix region is determined, and a second actual energy value for the interpolation matrix region determined through energy tracing processing is also determined. The energy difference between the predicted and actual energy values ​​is then calculated, and a gradient value is calculated based on the square of the energy difference. The training weights are then updated based on the gradient value until the energy difference over N consecutive weight update rounds is less than a preset amount, at which point the training of the target image interpolation filter is terminated. Further, in the energy distribution matrix generation stage, interpolation prediction is performed using the target image interpolation filter and a portion of the energy distribution matrix to obtain the complete energy distribution matrix of the target waveguide coupling region.

[0093] For example, continuing with the above example, assuming the predicted energy value of interpolation matrix region 1 is "0.87" and the second actual energy value of interpolation matrix region 1 is "0.7", then the energy difference is determined to be 0.7-0.87=-0.17. Then, according to the calculation formula of energy difference and target gradient value, the weights to be trained are updated.

[0094] Optionally, if a normalization operation is performed on the partial energy distribution matrix after its generation, then after obtaining the complete energy distribution matrix of the target optical waveguide coupling region, the following steps are also included:

[0095] The maximum energy value is determined based on the energy values ​​corresponding to each matrix element in the partial energy distribution matrix. Then, the maximum energy value is multiplied by the energy values ​​corresponding to each matrix element in the complete energy distribution matrix to perform inverse normalization on the complete energy distribution matrix, resulting in the final complete energy distribution matrix. In this embodiment, the number of sub-coupling steps is determined based on the total number of coupling steps of the light rays in the target waveguide coupling region. Energy tracing processing is then performed based on the number of sub-coupling steps to generate a partial energy distribution matrix for the target waveguide coupling region; wherein the number of sub-coupling steps is less than the total number of coupling steps. A sample matrix region is determined from the partial energy distribution matrix based on the filter size of the interpolation filter to be trained. Based on the first actual energy value of the sample matrix region and the training weights of the interpolation filter to be trained, the predicted energy value of the interpolation matrix region corresponding to the interpolation filter in the partial energy distribution matrix is ​​determined. The training weights are updated based on the predicted energy value to generate the target image interpolation filter. The target image interpolation filter is used to interpolate and predict the complete energy distribution matrix of the target waveguide coupling region. The beneficial effects are:

[0096] This invention only requires calculating a portion of the energy distribution matrix, training a filter using the portion of the energy distribution matrix, and then interpolating and predicting the complete energy distribution matrix of the target optical waveguide coupling region using the filter. It does not require the introduction of all coupling steps for computation, yet it can still generate the complete energy distribution matrix of the optical waveguide coupling region, reducing computational complexity, saving computational resources, and improving the generation efficiency of the energy distribution matrix.

[0097] Figure 1B This is a schematic diagram of an interpolation matrix region provided in Embodiment 1 of the present invention, as shown below. Figure 1B As shown, 10 represents a partial energy distribution matrix, including interpolation filters 11, 12, and 13 of the image to be trained, all three being 3×3 interpolation filters of the image to be trained (e.g., ...). Figure 1B (As shown in the bolded black area).

[0098] In this diagram, the red matrix region 14 represents a specific interpolation matrix region corresponding to the interpolation filter 11 in the partial energy distribution matrix 10. The interpolation filter 11 can be used to predict energy values ​​in the matrix region of the first row of the partial energy distribution matrix 10.

[0099] The red matrix region 15 represents a specific interpolation matrix region in the partial energy distribution matrix 10 corresponding to the interpolation filter 12 for the image to be trained. The interpolation filter 12 for the image to be trained can be used to predict energy values ​​for the matrix regions in the remaining rows of the partial energy distribution matrix 10, excluding the first and last rows.

[0100] The red matrix region 16 represents a specific interpolation matrix region in the partial energy distribution matrix 10 corresponding to the interpolation filter 13 of the image to be trained. The interpolation filter 13 of the image to be trained can be used to predict the energy value of the matrix region in the last row of the partial energy distribution matrix 10.

[0101] It is understood that interpolation matrix regions 14, 15, and 16 are merely illustrative examples of the style, size, and position of interpolation matrix regions, and do not impose any limitations on the style, size, and position of interpolation matrix regions.

[0102] Example 2

[0103] Figure 2 This is a flowchart of a filter training method provided in Embodiment 2 of the present invention. This embodiment further optimizes and extends the above embodiments and can be combined with the various optional implementation methods described above. Figure 2 As shown, the method includes:

[0104] S201. Determine the number of sub-coupling steps based on the total number of coupling steps of the light rays in the target optical waveguide coupling region, and perform energy tracing processing based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region.

[0105] S202. Determine the sample matrix region from the partial energy distribution matrix based on the filter size of the interpolation filter of the image to be trained.

[0106] S203. Determine the actual energy value of each element in the sample matrix region, and determine the training sub-weights of the interpolation filter for the image to be trained in each sample matrix element; calculate the predicted energy value of the interpolation matrix region by weighted summation based on the actual energy value of each element and the training sub-weights.

[0107] Here, a sample matrix element refers to a basic spatial unit within the sample matrix region, i.e., a single cell in a grid divided according to the filter size, representing a miniature physical location within the target waveguide coupling region. The actual energy value of an element refers to the physical energy value measured at the sample matrix element location through sub-coupling step energy tracing, representing the true energy intensity of the light in that region. The sub-weights to be trained refer to the optimizable coefficients bound to a specific sample matrix element in the interpolation filter of the image to be trained, characterizing the contribution weight of the energy at that location to the interpolation prediction.

[0108] In one implementation, the predicted energy value is determined using the following formula:

[0109] ;

[0110] Where y represents the predicted energy value of the interpolation matrix region. Represents the sample matrix region The actual energy value of each element in the sample matrix at a given location. Indicates the interpolation filter of the image to be trained in The corresponding weights of the sub-weights to be trained at the given position.

[0111] For example, suppose the sample matrix region includes sample matrix element 1, sample matrix element 2, sample matrix element 3, and sample matrix element 4, with actual energy values ​​of 0.8, 0.9, 1.0, and 0.8 respectively. Assume the training sub-weights of the interpolation filter for the image to be trained at sample matrix elements 1, 2, 3, and 4 are 0.1, 0.3, 0.2, and 0.4 respectively. Then the predicted energy value of the interpolation matrix region is determined to be (0.8 × 0.1) + (0.9 × 0.3) + (1.0 × 0.2) + (0.8 × 0.4) = 0.87.

[0112] By determining the actual energy value of each element in the sample matrix region and the corresponding sub-weights of the interpolation filter for the image to be trained in each sample matrix region, and by performing a weighted summation calculation based on the actual energy value of each element and the sub-weights to be trained, the predicted energy value of the interpolation matrix region is determined. The beneficial effect is that the physical propagation law of the optical waveguide is encoded into the filter parameters through the dynamic optimization process of the sub-weights, ensuring that the prediction result conforms to the constraints of the optical equation and improving the accuracy of the energy distribution matrix prediction.

[0113] S204. Determine the second actual energy value of the interpolation matrix region in the partial energy distribution matrix, and determine the energy value difference based on the second actual energy value and the predicted energy value; update the weights to be trained based on the energy value difference to generate the target image interpolation filter.

[0114] The second actual energy value refers to the true physical energy density data obtained within the interpolation matrix region through energy tracing of sub-coupling steps, representing the measured energy distribution at the target location in the target waveguide coupling area. The energy value difference refers to the deviation between the predicted energy value and the second actual energy value.

[0115] In one implementation, the energy difference is determined using the following formula:

[0116] ;

[0117] in, Represents the interpolation matrix region The second actual energy value, Represents the interpolation matrix region The predicted energy value, Represents the interpolation matrix region The energy value difference.

[0118] Furthermore, the gradient value is calculated based on the energy difference, and then the weights to be trained are updated based on the gradient value to generate the target image interpolation filter.

[0119] By determining the second actual energy value in the interpolation matrix region within a portion of the energy distribution matrix, and determining the energy value difference based on the second actual energy value and the predicted energy value, the training weights are updated based on the energy value difference to generate a target image interpolation filter. The beneficial effect is that, using the second actual energy value generated by energy tracing the sub-coupling steps as the standard, the energy value difference quantifies the prediction deviation and propagates it back, enabling the training weights to dynamically learn the intrinsic optical laws of the target waveguide coupling region, thus ensuring the accuracy of subsequent complete energy distribution matrix interpolation prediction.

[0120] Optionally, the weights to be trained are updated based on the energy difference to generate a target image interpolation filter, including:

[0121] Gradient calculation is performed based on the squared value of the energy difference to determine the target gradient value corresponding to each sub-weight to be trained; each sub-weight to be trained is updated based on the update step size factor and each target gradient value to obtain the updated sub-weight corresponding to each sub-weight to be trained, and a target image interpolation filter is generated based on each updated sub-weight.

[0122] In this context, gradient operation refers to the mathematical process of calculating the partial derivative of the square of the energy difference with respect to each sub-weight to be trained. The target gradient value refers to the specific partial derivative value output by the gradient operation, representing the direction and magnitude of the adjustment to the sub-weights to be trained. The update step size factor, or learning rate, is used to control the magnitude of the adjustment to the sub-weights to be trained by the target gradient value. The updated sub-weights refer to the optimized weights obtained after updating with the target gradient value, and are the final computable parameters of the target image interpolation filter.

[0123] In one implementation, the target gradient value is determined using the following formula:

[0124] ;

[0125] in, Indicates the energy difference. This represents the target gradient value corresponding to the sub-weight to be trained. Represents the sample matrix region The actual energy value of each element in the sample matrix at a given location.

[0126] Furthermore, the weights of each sub-weight to be trained are updated according to the update step size factor and the gradient values ​​of each target, so as to obtain the updated sub-weights corresponding to each sub-weight to be trained, and the target image interpolation filter is generated according to each updated sub-weight.

[0127] By performing gradient calculations based on the squared difference in energy values, the target gradient values ​​corresponding to each sub-weight to be trained are determined. The sub-weights to be trained are then updated based on the update step size factor and the target gradient values, resulting in updated sub-weights for each sub-weight. Finally, a target image interpolation filter is generated based on these updated sub-weights. The beneficial effects are:

[0128] Firstly, by determining the target gradient values ​​corresponding to the sub-weights to be trained, the optical physical constraints are transformed into trainable mathematical signals, enabling the final trained target image interpolation filter to have the ability to predict energy values.

[0129] Secondly, by introducing an update step size factor to update the weights of each sub-sub to be trained, a balance can be struck between convergence speed and stability.

[0130] Optionally, each sub-weight to be trained is updated based on the update step size factor and the target gradient values ​​to obtain the updated sub-weights corresponding to each sub-weight to be trained, including:

[0131] A. The energy value difference determined in the previous weight update round is taken as the first energy value difference, and the energy value difference determined in the previous two weight update rounds is taken as the second energy value difference, and the absolute value difference between the second energy value difference and the first energy value difference is determined.

[0132] The preceding weight update round refers to the weight update process immediately preceding the current round, and the two preceding weight update rounds refer to the second-to-last weight update process before the current iteration round. The first energy value difference refers to the energy deviation between the predicted energy value and the actual energy value in the interpolation matrix region in the preceding weight update round, and the second energy value difference refers to the energy deviation between the predicted energy value and the actual energy value in the interpolation matrix region in the two preceding weight update rounds.

[0133] The absolute value difference refers to the difference between the absolute value of the second energy value difference and the absolute value of the first energy value difference.

[0134] B. When the absolute value difference is less than zero, determine the factor adjustment coefficient based on the absolute value difference, and determine the current update step size factor corresponding to the current weight update round based on the historical update step size factor and the factor adjustment coefficient.

[0135] The factor adjustment coefficient is a scaling factor calculated based on the absolute value difference, specifically generated when the absolute value difference is less than zero. It is used to dynamically scale the value of the update step size factor. It reflects the strength of the loss change trend, and its value is usually negatively correlated with the absolute value difference. In the algorithm, it acts as a pivot for adaptive parameter tuning, ensuring that the weight update step size matches the training state. The historical update step size factor is the update step size factor corresponding to the previous weight update round. It provides a benchmark reference for the current weight update round, continuing the memory of the training process. The current update step size factor refers to the update step size factor recalculated in the current weight update round, obtained by combining the historical update step size factor and the factor adjustment coefficient. It is used to directly control the update magnitude of the weights in this round.

[0136] In one implementation, when the absolute value difference is less than zero, a factor adjustment coefficient is determined based on the absolute values ​​of the absolute value difference, the second energy value difference, and the first energy value difference. Then, based on the historical update step size factor and the factor adjustment coefficient, the current update step size factor corresponding to the current weight update round is determined. When the absolute value difference is greater than or equal to zero, the current update step size factor corresponding to the current weight update round is set to the historical update step size factor.

[0137] Optionally, the factor adjustment coefficient can be determined based on the absolute value difference, including:

[0138] The factor adjustment coefficient is determined using the following formula:

[0139] ;

[0140] Where k represents the factor adjustment coefficient, The difference in absolute values. The absolute value of the difference between the second energy values. It is the absolute value of the difference between the first energy values.

[0141] Optionally, based on the historical update step size factor and factor adjustment coefficient, the current update step size factor corresponding to the current weight update round is determined, including:

[0142] ;

[0143] in, This represents the current update step size factor. represents the historical update step size factor, and k represents the factor adjustment coefficient.

[0144] C. Update each sub-weight to be trained based on the current update step size factor and each target gradient value to obtain the updated sub-weights corresponding to each sub-weight to be trained.

[0145] By using the energy value difference determined in the previous weight update round as the first energy value difference, and the energy value difference determined in the previous two weight update rounds as the second energy value difference, and determining the absolute value difference between the second energy value difference and the first energy value difference; when the absolute value difference is less than zero, determining the factor adjustment coefficient based on the absolute value difference, and determining the current update step size factor corresponding to the current weight update round based on the historical update step size factor and the factor adjustment coefficient; wherein, the historical update step size factor is the update step size factor corresponding to the previous weight update round; and updating each sub-weight to be trained based on the current update step size factor and each target gradient value, obtaining the updated sub-weights corresponding to each sub-weight to be trained, the beneficial effects are:

[0146] When the absolute difference is less than zero, it means that the historical update step size factor of the previous weight update round is too large and has a tendency to diverge. Therefore, a factor adjustment coefficient is introduced to adjust the historical update step size factor to obtain the current update step size factor, thereby appropriately reducing the update step size factor of the current weight update round and ensuring the training quality of the weights.

[0147] Optionally, based on the current update step size factor and each target gradient value, each sub-weight to be trained is updated to obtain the updated sub-weights corresponding to each sub-weight to be trained, including:

[0148] The updated sub-weight corresponding to the current sub-weight is determined using the following formula:

[0149] ;

[0150] in, Represents the weight of any sub-sub to be trained. This indicates the weights of the sub-sub-sub to be trained. The corresponding updated sub-weights, This indicates the weights of the sub-sub-sub to be trained. The corresponding target gradient value, This represents the energy value difference determined in the current weight update round. This indicates the weights of the sub-sub-sub to be trained. The actual energy value of the corresponding sample matrix element, where s represents the update step size factor.

[0151] Example 3

[0152] Figure 3 This is a flowchart of an energy distribution matrix generation method provided in Embodiment 3 of the present invention. This embodiment is applicable to the case of interpolating and predicting the complete energy distribution matrix of the optical waveguide coupling region using a trained target image interpolation filter. This method can be executed by an energy distribution matrix generation device, which can be implemented in hardware and / or software. Figure 3 As shown, the method includes:

[0153] S301. Determine the number of sub-coupling steps based on the total number of coupling steps of the light rays in the target optical waveguide coupling region, and perform energy tracing processing based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region.

[0154] Among them, the number of sub-outgoing steps is less than the total number of outgoing steps.

[0155] S302. Based on the matrix size of the complete energy distribution matrix of the target waveguide coupling region and the matrix size of the partial energy distribution matrix, generate a matrix to be filled, and determine the reference matrix region from the partial energy distribution matrix based on the filter size of the target image interpolation filter.

[0156] The matrix to be filled is a template matrix whose internal region has not yet been filled with energy values. It represents the blank parts of the complete energy distribution matrix that were not calculated through direct energy tracing and need to be filled using an interpolation algorithm. The reference matrix region is a local sub-region selected from the partial energy distribution matrix. It contains known actual energy values ​​(third actual energy values) and serves as a reference for interpolation calculations. The size of this region is determined by the filter size of the target image interpolation filter.

[0157] The target image interpolation filter is generated using any of the filter training methods provided in the embodiments of the present invention.

[0158] In one implementation, a new blank matrix is ​​initialized based on the matrix size of the complete energy distribution matrix of the target waveguide coupling region. This blank matrix has the exact same size and is uniformly filled with default values ​​(such as zero or null values) to indicate that all positions are in a state to be filled. Next, based on the matrix size of the partial energy distribution matrix, the actual energy values ​​of the partial energy distribution matrix are copied to the corresponding positions of this blank matrix according to their original row and column coordinates, thereby forming a sub-region with known energy values ​​in the blank matrix, while the remaining regions are retained as the initialized default values ​​as the matrix to be filled.

[0159] Furthermore, starting from the top left corner (0,0) of the partial energy distribution matrix according to the filter size, the system slides within the row and column range of the partial energy distribution matrix according to a preset step size, such as 1 step. Each time, a matrix region with the same size as the filter is selected as the reference matrix region until the entire matrix region of the partial energy distribution matrix is ​​traversed.

[0160] S303. Based on the third actual energy value of the reference matrix region and the trained weights of the target image interpolation filter, determine the energy value to be filled in the interpolation matrix region corresponding to the target image interpolation filter in the matrix to be filled, and fill the matrix to be filled with energy values ​​according to the energy value to be filled to generate the remaining energy distribution matrix.

[0161] The third actual energy value refers to the true energy value directly calculated within the reference matrix region through sub-coupling step energy tracing. The trained weights refer to the internal parameter matrix of the target image interpolation filter optimized using any of the filter training methods provided in this embodiment. The interpolation matrix region corresponding to the target image interpolation filter in the matrix to be filled refers to the target sub-region within the matrix to be filled that needs to generate energy through interpolation, and its position has a spatial mapping relationship with the reference matrix region. The energy value to be filled refers to the predicted energy value generated after processing the reference region data using the target image interpolation filter and to be written into the interpolation matrix region. The remaining energy distribution matrix refers to the energy distribution data generated after the matrix to be filled completes energy filling of all interpolation regions, covering the unknown part of the complete coupling region.

[0162] In one implementation, the reference actual energy value of each reference matrix element in the reference matrix region is determined, and the trained sub-weights of the target image interpolation filter corresponding to each reference matrix element are determined; the energy value to be filled in the interpolation matrix region is determined by weighted summation based on each reference actual energy value and each trained sub-weight.

[0163] Here, the reference actual energy value refers to the true physical energy value obtained by directly calculating the energy tracing of each grid cell within the reference matrix region through sub-coupling steps. The trained sub-weights refer to the specific weight parameters in the target image interpolation filter that are bound to a single reference matrix element, and are optimized using any of the filter training methods provided in this embodiment of the invention.

[0164] In one implementation, the energy value to be filled is determined using the following formula:

[0165] ;

[0166] in, This represents the energy value to be filled in the interpolation matrix region. Represents the reference matrix region The reference actual energy value of the reference matrix elements for the location. Indicates the target image interpolation filter in The corresponding trained sub-weights for each position.

[0167] For example, suppose the reference matrix region includes reference matrix element 1, reference matrix element 2, reference matrix element 3, and reference matrix element 4, with corresponding reference actual energy values ​​of 0.8, 0.9, 1.0, and 0.8, respectively. Assuming the trained sub-weights of the target image interpolation filter at reference matrix elements 1, 2, 3, and 4 are 0.1, 0.3, 0.2, and 0.4, respectively, then the energy value to be filled in the interpolation matrix region is determined to be (0.8 × 0.1) + (0.9 × 0.3) + (1.0 × 0.2) + (0.8 × 0.4) = 0.87.

[0168] Furthermore, each energy value to be filled is written to the corresponding position of the matrix to be filled according to the coordinate index of its interpolation matrix region, overwriting the original default value of that position. When the energy values ​​of all interpolation matrix regions are filled, the regions originally marked as unknown in the matrix to be filled are completely replaced with energy data generated by interpolation. At this time, the matrix is ​​transformed into the remaining energy distribution matrix.

[0169] S304. Generate the complete energy distribution matrix based on the remaining energy distribution matrix and the partial energy distribution matrix.

[0170] The complete energy distribution matrix refers to the comprehensive energy distribution matrix that covers all spatial locations and all coupling steps in the target optical waveguide coupling region.

[0171] In one implementation, all energy values ​​in the remaining energy distribution matrix are copied to the unfilled remaining positions in the base matrix. Since the partial energy distribution matrix and the remaining energy distribution matrix do not overlap spatially, this process will not result in data conflicts or overwriting errors. Finally, after the above two copying operations, all positions in the base matrix are filled with the actual or predicted energy values, thereby directly generating the complete energy distribution matrix of the target waveguide coupling region.

[0172] This invention, in its embodiments, determines the number of sub-coupling steps based on the total number of coupling steps of light rays in the target waveguide coupling region, and generates a partial energy distribution matrix of the target waveguide coupling region by performing energy tracing processing based on the number of sub-coupling steps; wherein the number of sub-coupling steps is less than the total number of coupling steps; a matrix to be filled is generated based on the matrix size of the complete energy distribution matrix of the target waveguide coupling region and the matrix size of the partial energy distribution matrix, and a reference matrix region is determined from the partial energy distribution matrix based on the filter size of the target image interpolation filter, wherein the target image interpolation filter is generated using the training method of any filter in Embodiment 1 and Embodiment 2; based on the third actual energy value of the reference matrix region and the trained weights of the target image interpolation filter, the energy value to be filled in the interpolation matrix region corresponding to the target image interpolation filter in the matrix to be filled is determined, and the matrix to be filled is filled with energy values ​​based on the energy values ​​to be filled to generate a remaining energy distribution matrix; a complete energy distribution matrix is ​​generated based on the remaining energy distribution matrix and the partial energy distribution matrix. The beneficial effects are:

[0173] This invention only requires calculating a portion of the energy distribution matrix, training a filter using the portion of the energy distribution matrix, and then interpolating and predicting the complete energy distribution matrix of the target optical waveguide coupling region using the filter. It does not require the introduction of all coupling steps for computation, yet it can still generate the complete energy distribution matrix of the optical waveguide coupling region, reducing computational complexity, saving computational resources, and improving the generation efficiency of the energy distribution matrix.

[0174] Example 4

[0175] Figure 4 This is a schematic diagram of a filter training device provided in Embodiment 4 of the present invention. It can be applied to training a target image interpolation filter, used for interpolating and predicting the complete energy distribution matrix of the optical waveguide coupling region, such as... Figure 4 As shown, the device includes:

[0176] The first energy distribution matrix generation module 41 is used to determine the number of sub-coupling steps based on the total number of coupling steps of light in the target optical waveguide coupling region, and to perform energy tracing processing based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region; wherein the number of sub-coupling steps is less than the total number of coupling steps.

[0177] The predicted energy value determination module 42 is used to determine a sample matrix region from the partial energy distribution matrix according to the filter size of the interpolation filter of the image to be trained, and to determine the predicted energy value of the interpolation matrix region corresponding to the interpolation filter of the image to be trained in the partial energy distribution matrix according to the first actual energy value of the sample matrix region and the training weight of the interpolation filter of the image to be trained.

[0178] The weight update module 43 is used to update the weights to be trained according to the predicted energy value to generate a target image interpolation filter; wherein, the target image interpolation filter is used to interpolate and predict the complete energy distribution matrix of the target optical waveguide coupling region.

[0179] Optionally, the predicted energy value determination module 42 is specifically used for:

[0180] Determine the actual energy value of each element of the sample matrix in the sample matrix region, and determine the training sub-weights of the image interpolation filter to be trained for each element of the sample matrix.

[0181] The predicted energy value of the interpolation matrix region is determined by weighted summation based on the actual energy value of each element and the weight of each sub-sub to be trained.

[0182] Optionally, the weight update module 43 is specifically used for:

[0183] Determine the second actual energy value of the interpolation matrix region in the partial energy distribution matrix, and determine the energy value difference based on the second actual energy value and the predicted energy value;

[0184] The training weights are updated based on the energy difference to generate a target image interpolation filter.

[0185] Optionally, the weight update module 43 is further used for:

[0186] Gradient calculation is performed based on the square of the energy value difference to determine the target gradient value corresponding to each of the sub-weights to be trained.

[0187] The training sub-weights are updated according to the update step size factor and the target gradient values ​​to obtain the updated sub-weights corresponding to each training sub-weight, and the target image interpolation filter is generated according to the updated sub-weights.

[0188] Optionally, the weight update module 43 is further used for:

[0189] The energy value difference determined in the previous weight update round is used as the first energy value difference, and the energy value difference determined in the previous two weight update rounds is used as the second energy value difference, and the absolute value difference between the second energy value difference and the first energy value difference is determined.

[0190] When the absolute value difference is less than zero, the factor adjustment coefficient is determined based on the absolute value difference, and the current update step size factor corresponding to the current weight update round is determined based on the historical update step size factor and the factor adjustment coefficient; wherein, the historical update step size factor is the update step size factor corresponding to the previous weight update round.

[0191] Based on the current update step size factor and each of the target gradient values, each of the sub-weights to be trained is updated to obtain the updated sub-weights corresponding to each of the sub-weights to be trained.

[0192] Optionally, the weight update module 43 is further used for:

[0193] The factor adjustment coefficient is determined using the following formula:

[0194] ;

[0195] Wherein, k represents the factor adjustment coefficient, and the The absolute value difference, the The absolute value of the difference between the second energy values, the It is the absolute value of the difference between the first energy values.

[0196] Optionally, the weight update module 43 is further used for:

[0197] The updated sub-weight corresponding to the current sub-weight is determined using the following formula:

[0198] ;

[0199] Among them, the Represents any of the aforementioned sub-weights to be trained. This indicates the weights of the sub-sub-sub to be trained. The corresponding updated sub-weights, This indicates the weights of the sub-sub-sub to be trained. The corresponding target gradient value, the This represents the energy value difference determined in the current weight update round. This indicates the weights of the sub-sub-sub to be trained. The actual energy value of the corresponding element of the sample matrix, where s represents the update step size factor.

[0200] The filter training device provided in the embodiments of the present invention can execute the filter training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0201] Example 5

[0202] Figure 5 This is a schematic diagram of an energy distribution matrix generation device provided in Embodiment 5 of the present invention. It is applicable to the case where a trained target image interpolation filter is used to interpolate and predict the complete energy distribution matrix of the optical waveguide coupling region. Figure 5 As shown, the device includes:

[0203] The second energy distribution matrix generation module 51 is used to determine the number of sub-coupling steps based on the total number of coupling steps of light in the target optical waveguide coupling region, and to perform energy tracing processing based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region; wherein the number of sub-coupling steps is less than the total number of coupling steps.

[0204] The reference matrix region determination module 52 is used to generate a matrix to be filled based on the matrix size of the complete energy distribution matrix of the target optical waveguide coupling region and the matrix size of the partial energy distribution matrix, and to determine the reference matrix region from the partial energy distribution matrix based on the filter size of the target image interpolation filter, wherein the target image interpolation filter is generated using any of the filter training methods described above.

[0205] The residual energy distribution matrix generation module 53 is used to determine the energy value to be filled in the interpolation matrix region corresponding to the target image interpolation filter in the matrix to be filled according to the third actual energy value of the reference matrix region and the trained weights of the target image interpolation filter, and to fill the matrix to be filled with energy value according to the energy value to be filled to generate the residual energy distribution matrix.

[0206] The complete energy distribution matrix generation module 54 is used to generate the complete energy distribution matrix based on the remaining energy distribution matrix and the partial energy distribution matrix.

[0207] The energy distribution matrix generation device provided in this embodiment of the invention can execute the energy distribution matrix generation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0208] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0209] Example 6

[0210] Figure 6A schematic diagram of an electronic device 60 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0211] like Figure 6 As shown, the electronic device 60 includes at least one processor 61 and a memory, such as a read-only memory (ROM) 62 and a random access memory (RAM) 63, communicatively connected to the at least one processor 61. The memory stores computer programs executable by the at least one processor. The processor 61 can perform various appropriate actions and processes based on the computer program stored in the ROM 62 or loaded from storage unit 68 into the RAM 63. The RAM 63 can also store various programs and data required for the operation of the electronic device 60. The processor 61, ROM 62, and RAM 63 are interconnected via a bus 64. An input / output (I / O) interface 65 is also connected to the bus 64.

[0212] Multiple components in electronic device 60 are connected to I / O interface 65, including: input unit 66, such as keyboard, mouse, etc.; output unit 67, such as various types of monitors, speakers, etc.; storage unit 68, such as disk, optical disk, etc.; and communication unit 69, such as network card, modem, wireless transceiver, etc. Communication unit 69 allows electronic device 60 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0213] Processor 61 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 61 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 61 performs the various methods and processes described above, such as filter training methods and energy distribution matrix generation methods.

[0214] In some embodiments, the filter training method and the energy distribution matrix generation method may be implemented as computer programs tangibly contained in a computer-readable storage medium, such as storage unit 68. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 60 via ROM 62 and / or communication unit 69. When the computer program is loaded into RAM 63 and executed by processor 61, one or more steps of the filter training method and energy distribution matrix generation method described above may be performed. Alternatively, in other embodiments, processor 61 may be configured to perform the filter training method and energy distribution matrix generation method by any other suitable means (e.g., by means of firmware).

[0215] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0216] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0217] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0218] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0219] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0220] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product within the cloud computing service system to address the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.

[0221] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0222] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for training a filter, characterized in that, The method includes: The number of sub-coupling steps is determined based on the total number of coupling steps of the light in the target optical waveguide coupling region, and energy tracing processing is performed based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region; wherein, the number of sub-coupling steps is less than the total number of coupling steps; Based on the filter size of the interpolation filter of the image to be trained, a sample matrix region is determined from the partial energy distribution matrix. Based on the first actual energy value of the sample matrix region and the training weights of the interpolation filter of the image to be trained, the predicted energy value of the interpolation matrix region corresponding to the interpolation filter of the image to be trained in the partial energy distribution matrix is ​​determined. The training weights are updated based on the predicted energy values ​​to generate a target image interpolation filter; wherein, the target image interpolation filter is used to interpolate and predict the complete energy distribution matrix of the target optical waveguide coupling region.

2. The method according to claim 1, characterized in that, The step of determining the predicted energy value of the interpolation matrix region corresponding to the interpolation filter in the partial energy distribution matrix based on the first actual energy value of the sample matrix region and the training weights of the interpolation filter to be trained includes: Determine the actual energy value of each element of the sample matrix in the sample matrix region, and determine the training sub-weights of the image interpolation filter to be trained for each element of the sample matrix. The predicted energy value of the interpolation matrix region is determined by weighted summation based on the actual energy value of each element and the weight of each sub-sub to be trained.

3. The method according to claim 2, characterized in that, The step of updating the training weights based on the predicted energy value to generate a target image interpolation filter includes: Determine the second actual energy value of the interpolation matrix region in the partial energy distribution matrix, and determine the energy value difference based on the second actual energy value and the predicted energy value; The training weights are updated based on the energy difference to generate a target image interpolation filter.

4. The method according to claim 3, characterized in that, The step of updating the training weights based on the energy value difference to generate a target image interpolation filter includes: Gradient calculation is performed based on the square of the energy value difference to determine the target gradient value corresponding to each of the sub-weights to be trained. The training sub-weights are updated according to the update step size factor and the target gradient values ​​to obtain the updated sub-weights corresponding to each training sub-weight, and the target image interpolation filter is generated according to the updated sub-weights.

5. The method according to claim 4, characterized in that, The step of updating each of the sub-weights to be trained according to the update step size factor and each of the target gradient values ​​to obtain the updated sub-weights corresponding to each of the sub-weights to be trained includes: The energy value difference determined in the previous weight update round is used as the first energy value difference, and the energy value difference determined in the previous two weight update rounds is used as the second energy value difference, and the absolute value difference between the second energy value difference and the first energy value difference is determined. When the absolute value difference is less than zero, the factor adjustment coefficient is determined based on the absolute value difference, and the current update step size factor corresponding to the current weight update round is determined based on the historical update step size factor and the factor adjustment coefficient; wherein, the historical update step size factor is the update step size factor corresponding to the previous weight update round. Based on the current update step size factor and each of the target gradient values, each of the sub-weights to be trained is updated to obtain the updated sub-weights corresponding to each of the sub-weights to be trained.

6. The method according to claim 5, characterized in that, The step of determining the factor adjustment coefficient based on the absolute value difference includes: The factor adjustment coefficient is determined using the following formula: ; Wherein, k represents the factor adjustment coefficient, and the The absolute value difference, the The absolute value of the difference between the second energy values, the It is the absolute value of the difference between the first energy values.

7. The method according to claim 5, characterized in that, The step of updating each of the sub-weights to be trained based on the current update step size factor and each of the target gradient values ​​to obtain the updated sub-weights corresponding to each of the sub-weights to be trained includes: The updated sub-weight corresponding to the current sub-weight is determined using the following formula: ; Among them, the Represents any of the aforementioned sub-weights to be trained. This indicates the weights of the sub-sub-sub to be trained. The corresponding updated sub-weights, This indicates the weights of the sub-sub-sub to be trained. The corresponding target gradient value, the This represents the energy value difference determined in the current weight update round. This indicates the weights of the sub-sub-sub to be trained. The actual energy value of the corresponding element of the sample matrix, where s represents the update step size factor.

8. A method for generating an energy distribution matrix, characterized in that, The method includes: The number of sub-coupling steps is determined based on the total number of coupling steps of the light in the target optical waveguide coupling region, and energy tracing processing is performed based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region; wherein, the number of sub-coupling steps is less than the total number of coupling steps; Based on the matrix size of the complete energy distribution matrix of the target waveguide coupling region and the matrix size of the partial energy distribution matrix, a matrix to be filled is generated, and a reference matrix region is determined from the partial energy distribution matrix based on the filter size of the target image interpolation filter, wherein the target image interpolation filter is generated using the filter training method described in any one of claims 1-7; Based on the third actual energy value of the reference matrix region and the trained weights of the target image interpolation filter, the energy value to be filled in the interpolation matrix region corresponding to the target image interpolation filter in the matrix to be filled is determined, and the matrix to be filled is filled with energy value according to the energy value to be filled to generate the remaining energy distribution matrix. The complete energy distribution matrix is ​​generated based on the remaining energy distribution matrix and the partial energy distribution matrix.

9. A training device for a filter, characterized in that, The device includes: The first energy distribution matrix generation module is used to determine the number of sub-coupling steps based on the total number of coupling steps of light rays in the target optical waveguide coupling region, and to perform energy tracing processing based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region; wherein, the number of sub-coupling steps is less than the total number of coupling steps; The predicted energy value determination module is used to determine a sample matrix region from the partial energy distribution matrix according to the filter size of the interpolation filter of the image to be trained, and to determine the predicted energy value of the interpolation matrix region corresponding to the interpolation filter of the image to be trained in the partial energy distribution matrix according to the first actual energy value of the sample matrix region and the training weights of the interpolation filter of the image to be trained. The weight update module is used to update the weights to be trained according to the predicted energy value to generate a target image interpolation filter; wherein, the target image interpolation filter is used to interpolate and predict the complete energy distribution matrix of the target optical waveguide coupling region.

10. An energy distribution matrix generation device, characterized in that, The device includes: The second energy distribution matrix generation module is used to determine the number of sub-coupling steps based on the total number of coupling steps of light in the target optical waveguide coupling region, and to perform energy tracing processing based on the number of sub-coupling steps to generate a partial energy distribution matrix of the target optical waveguide coupling region; wherein, the number of sub-coupling steps is less than the total number of coupling steps; The reference matrix region determination module is used to generate a matrix to be filled based on the matrix size of the complete energy distribution matrix of the target optical waveguide coupling region and the matrix size of the partial energy distribution matrix, and to determine the reference matrix region from the partial energy distribution matrix based on the filter size of the target image interpolation filter, wherein the target image interpolation filter is generated using the filter training method described in any one of claims 1-7; The residual energy distribution matrix generation module is used to determine the energy value to be filled in the interpolation matrix region corresponding to the target image interpolation filter in the matrix to be filled, based on the third actual energy value of the reference matrix region and the trained weights of the target image interpolation filter, and to fill the matrix to be filled with energy value according to the energy value to be filled, thereby generating the residual energy distribution matrix. The complete energy distribution matrix generation module is used to generate the complete energy distribution matrix based on the remaining energy distribution matrix and the partial energy distribution matrix.

11. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to perform the method of any one of claims 1-8.

13. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-8.