Optimal design method and apparatus for separable amplitude mask for lensless imaging
By optimizing the design of a separable amplitude mask for a lensless imaging system and using a genetic algorithm to encode and optimize the mask pattern, the limitations of long-distance imaging in existing technologies are overcome, achieving ideal imaging results at close range and improving the uniformity and signal-to-noise ratio of image reconstruction.
Patent Information
- Application Number
- PCT/CN2025/097011
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-27
- Filing Date
- 2025-05-23
- Publication Date
- 2025-12-04
AI Technical Summary
Existing separable amplitude masks are only suitable for long-distance imaging and cannot achieve ideal imaging results at close distances, especially when the distance between the scene under test and the system is smaller than the size of the image sensor, resulting in non-uniform intensity and reduced signal-to-noise ratio in the reconstructed scene image.
By acquiring the parameters of the lensless imaging system, the pattern design of the separable amplitude mask is optimized using a genetic algorithm. This includes encoding the mask pattern into genes and optimizing it using a genetic algorithm to obtain the optimal mask pattern, which is suitable for close-range imaging requirements.
Under environmental constraints, the lensless imaging system achieved ideal imaging results at both near and far distances, improving the uniformity of image reconstruction and the signal-to-noise ratio.
Smart Images

Figure CN2025097011_04122025_PF_FP_ABST
Abstract
Description
A method and apparatus for optimizing the design of lensless imaging separable amplitude masks Technical Field
[0001] This application relates to the field of optical sensor technology, and in particular to a method and apparatus for optimizing the design of a lensless imaging separable amplitude mask. Background Technology
[0002] Lensless imaging, a novel optical sensing technology, uses optical encoders to replace traditional lenses, encoding scene information into the sensor's observed image. This significantly reduces the size of the imaging system. Applications already implemented or with potential for application include microscopy, photography, in vivo imaging, wearable or implantable devices, and machine vision. In the context of tactile sensing, lensless imaging offers advantages such as reduced camera size and a larger field of view, as it breaks the constraints between working distance and field of view inherent in traditional lens-based imaging.
[0003] In existing lensless imaging systems based on separable amplitude masks, the masks are typically designed based on sequences with specific mathematical properties, most commonly the longest sequences. The advantage of these sequences is that the resulting mask's transition matrix will have large and slowly decaying singular values, which is beneficial for image reconstruction. However, these masks are only suitable for long-distance imaging (generally greater than 10 cm). When the distance between the scene to be reconstructed and the system is small, especially when the distance is smaller than the image sensor size, the system matrix begins to exhibit different characteristics. This is because the point spread function at each point on the scene only covers a small area. This change leads to non-uniform intensity in the reconstructed scene image, resulting in a reduced signal-to-noise ratio.
[0004] Existing separable amplitude masks have the problem that they are only suitable for long-distance imaging and cannot be used for short-distance imaging. Summary of the Invention
[0005] This application provides a method and apparatus for optimizing the design of a separable amplitude mask for lensless imaging, which can be applied to lensless imaging systems. These systems can be used in fields such as remote sensing, biomedical imaging, industrial inspection, and environmental monitoring. Through the optimized design of the separable amplitude mask, ideal imaging effects can still be obtained even under environmental constraints, making it suitable for both long-distance and short-distance imaging.
[0006] In a first aspect, embodiments of this application provide a method for optimizing the design of a lensless imaging separable amplitude mask, the method comprising:
[0007] Obtain the parameters of a lensless imaging system;
[0008] The pattern of the separable amplitude mask in the lensless imaging system is encoded as a gene. Based on the parameters of the lensless imaging system, the pattern of the separable amplitude mask is optimized using a genetic algorithm to obtain the optimized design result of the separable amplitude mask.
[0009] In this technical solution, parameters of the lensless imaging system are obtained; the pattern of the separable amplitude mask in the lensless imaging system is encoded as a gene; based on the parameters of the lensless imaging system, a genetic algorithm is used to optimize the pattern of the separable amplitude mask, resulting in an optimized design of the separable amplitude mask. This solves the problem that existing separable amplitude masks are only suitable for long-distance imaging and cannot be used for short-distance imaging; the lensless imaging system using the separable amplitude mask designed in this application can still achieve ideal imaging results even in environmentally limited conditions.
[0010] In one implementation, acquiring the parameters of the lensless imaging system includes:
[0011] Obtain the length l of the image sensor in a lensless imaging system sensor and high h sensor The observed image resolution S×R and the observed image equivalent pixel size δ sensor The reconstructed image resolution is M×N, and the reconstructed image pixel size is δ. scene Separable amplitude mask feature size δ mask Imaging distance z, distance d from the separable amplitude mask to the image sensor;
[0012] Perform a pre-calibration on the system matrix of the lensless imaging system to obtain a pre-calibrated system left-multiplication matrix containing the coded components. And right multiplication matrix
[0013] In one implementation, encoding the pattern of the separable amplitude mask in the lensless imaging system as a gene includes:
[0014] The expression for the pattern matrix of the separable amplitude mask is as follows:
[0015] Where D represents the mask pattern; It is a column vector containing K elements, each element being either 1 or -1;
[0016] column vector As genes, Each element in the expression represents a gene locus, and K is the length of the gene, where:
[0017] Kδ mask >max(l sensor ,hsensor ).
[0018] In one implementation, the method further includes:
[0019] 1) Let the initial iteration number t = 0, and randomly generate A column vectors of length K with elements of 1 or -1 as initial genes to form the initial population. A represents the gene with index i in the initial population, i.e., the 0th generation population Φ0, where A ≥ K / 5;
[0020] 2) Calculate the fitness of each gene in the current population;
[0021] 3) Determine the current iteration number t:
[0022] 3-1) When t ≤ the preset first upper limit a, the iteration termination condition is not met, and proceed to step 4); where 3 ≤ a ≤ 10;
[0023] 3-2) When b>t>a, for population Φ t-a+1 To Φ t There are a populations in total. Calculate the fitness of each gene in each population and take the maximum fitness of the population as the maximum fitness of the population.
[0024] After calculation, if the difference in maximum fitness between any two populations is less than or equal to a predetermined proportion c of the average maximum fitness of the a populations, then the iteration terminates, and population Φ is selected. t-a+1 To Φ t The gene with the highest fitness is selected as the optimal gene. Then proceed to step 6); if the difference in maximum fitness between two populations is greater than the set proportion c of the mean maximum fitness of the a populations, then proceed to step 4);
[0025] Where b is the preset second upper limit, 100a≤b; 1%≤c≤10%;
[0026] 3-3) When t≥b, the iteration terminates, and Φ is selected. b-a+1 To Φ b The gene with the highest fitness among a populations is selected as the optimal gene. Then proceed to step 6);
[0027] 4) For the current t-th generation population Φ t Crossover and mutation are used to obtain offspring, forming the next generation population Φ. t+1 ;
[0028] 5) Let t = t + 1, and convert the population Φ obtained in step 4) t+1 As the new current t-th generation population Φ t Then return to step 2);
[0029] 6) Using the optimal genes The optimal pattern D is calculated. best D best This is the final optimized result of the pattern design for the separable amplitude mask;
[0030] In one implementation, calculating the fitness of each gene in the current population includes:
[0031] 1) For the current t-th generation population Calculate each gene in the t-th generation population Corresponding system matrix and
[0032] in, Indicates gene The corresponding lensless imaging system contains the system left-multiplication matrix with coded components. Indicates gene The corresponding lensless imaging system contains a system right-multiplication matrix with coded components;
[0033] 2) Using the results of step 1), calculate the X image of the scene to be tested. GT Lower gene Corresponding simulated observation images
[0034] Where Σ represents pixel-by-pixel noise;
[0035] 3) Acquire the image X of the scene to be tested. GT Lower gene Corresponding reconstructed image
[0036] Where X is the parameter to be optimized, and τ is the regularization coefficient. Let Frobenius norm be the matrix.
[0037] 4) Calculate genes fitness
[0038] in,
[0039] in, Represents the reconstructed image With the image of the scene to be tested X GT Structural similarity index between them Represents the reconstructed image With the image of the scene to be tested X GT Peak signal-to-noise ratio between the two indicators;
[0040] G is a gradient-based evaluation metric for pure white images. u (·) and G v (·) denotes finding the gradient matrix in two directions, respectively. Let M be the 1-norm of the matrix, M and N be the width and height of the reconstructed image, and Xwhite be the pure white image.
[0041] In one implementation, the gene The corresponding lensless imaging system contains the system left-multiplication matrix of the coded component. The calculation method is as follows:
[0042] 1) Set the array W of possible repetition counts. L = [1,2,…,K] and the optional value array D of the left-multiplied matrix attenuation coefficients L = [1,2,…,N];
[0043] 2) From W L Select a repetition count W from the options. P From D L Choose a left-multiplied matrix attenuation coefficient d Pf ;
[0044] 3) Based on the results of step 2), the genes The corresponding column vector repeats W P Next, it forms K rows of W P Two-dimensional matrix of columns
[0045] 4) Based on the results of step 2), construct the attenuation matrix P. f Size is K rows W P Each column is identical to the next;
[0046] For a matrix element with column number x, its value y is:
[0047] 5) Convert the two-dimensional matrix With the attenuation matrix P f Dot product yields left multiplication of the source matrix
[0048] 6) Obtain the left multiplication matrix according to the following affine transformation relation.
[0049] Among them, for left-multiplied matrix The interior coordinates are (x tgt ,ytgt The value of ) is determined by left multiplying the source matrix. Coordinates are (x src ,y src The value of ) is obtained by interpolation:
[0050] Where, k center k is the slope of the center line of the matrix multiplied on the left. stripe The slope of the extension line of the left-multiplied matrix;
[0051] 7) Calculate the left multiplication matrix obtained in step 6). Left multiply matrix with precalibrated system Structural similarity;
[0052] Then return to step 2) and select the next W. P and d Pf The combinations are repeated until K×N groups of W are obtained. P and d Pf The combinations correspond to the left multiplication matrices respectively Left multiply matrix with precalibrated system Structural similarity;
[0053] 8) Select the structure with the highest structural similarity from all the structural similarities obtained in step 7). P and d Pf The combination, the corresponding combination As the final
[0054] In one implementation, the gene The corresponding lensless imaging system contains a system right-multiplication matrix with coded components. The calculation method is as follows:
[0055] 1) Set the array W of possible repetition counts. R = [1,2,…,K] and the array D of possible values for the right-multiplied matrix decay coefficients R = [1,2,…,M];
[0056] 2) From W R Select a number of repetitions and denote it as W. Q D R Choose a right-multiplied matrix and denote its attenuation coefficient as d. Qf ;
[0057] 3) Based on the results of step 2), the genes The corresponding column vector repeats W Q Next, it forms K rows of W Q Two-dimensional matrix of columns
[0058] 4) Based on the results of step 2), construct the attenuation matrix Q. f Size is K rows W Q Each column is identical to the next;
[0059] For a matrix element with column number x, its value y is:
[0060] 5) Convert the two-dimensional matrix With the attenuation matrix Q f Dot product yields right multiplication of the source matrix.
[0061] 6) Obtain the right-multiplication matrix according to the following affine transformation relation.
[0062] Among them, for right-multiplied matrices The interior coordinates are (x tgt ,y tgt The value of ) is determined by right multiplying the source matrix. Coordinates are (x src ,y src The value of ) is obtained by interpolation:
[0063] 7) Calculate the right multiplication matrix obtained in step 6). Right multiplication matrix with the precalibrated system Structural similarity;
[0064] Then return to step 2) and select the next W. Q and d Qf The combinations are repeated until a K×M group of W is obtained. Q and d Qf The combinations correspond to the right multiplication matrices respectively Right multiplication matrix with the precalibrated system Structural similarity;
[0065] 8) Select the structure with the highest structural similarity from all the structural similarities obtained in step 7). Q and d Qf The combination, the corresponding combination As the final
[0066] Secondly, embodiments of this application provide a lensless imaging separable amplitude mask optimization design device, the device comprising:
[0067] The parameter acquisition module is used to acquire parameters of the lensless imaging system.
[0068] An optimization design module is used to encode the pattern of the separable amplitude mask in the lensless imaging system into a gene, and optimize the pattern of the separable amplitude mask using a genetic algorithm based on the parameters of the lensless imaging system to obtain the optimized design result of the separable amplitude mask.
[0069] In this technical solution, parameters of the lensless imaging system are obtained; the pattern of the separable amplitude mask in the lensless imaging system is encoded as a gene; based on the parameters of the lensless imaging system, a genetic algorithm is used to optimize the pattern of the separable amplitude mask, resulting in an optimized design of the separable amplitude mask. This solves the problem that existing separable amplitude masks are only suitable for long-distance imaging and cannot be used for short-distance imaging; the lensless imaging system using the separable amplitude mask designed in this application can still achieve ideal imaging results even in environmentally limited conditions.
[0070] Thirdly, embodiments of this application provide an electronic device, which includes at least one processor; and a memory communicatively connected to the at least one processor.
[0071] The memory stores instructions executable by the at least one processor, the instructions being configured to perform the method described in the first aspect above.
[0072] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer instructions for causing the computer to perform the method described in the second aspect above. Attached Figure Description
[0073] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.
[0074] Figure 1 is an overall flowchart of a lensless imaging separable amplitude mask optimization design method provided in an embodiment of this application;
[0075] Figure 2 is a side view of a lensless imaging system to be optimized according to a specific embodiment of this application;
[0076] Figure 3 is an unoptimized separable amplitude mask pattern in a specific embodiment of this application;
[0077] Figure 4 is a USAF-1951 test diagram used in a specific embodiment of this application;
[0078] Figure 5 shows the optimized separable amplitude mask pattern in a specific embodiment of this application. Detailed Implementation
[0079] The following is a detailed description, with reference to the accompanying drawings, of a lensless imaging separable amplitude mask optimization design method and apparatus provided in this application.
[0080] Please refer to Figure 1, which is a flowchart illustrating a lensless imaging separable amplitude mask optimization design method provided in an embodiment of this application. As shown in Figure 1, the method may include, but is not limited to, the following steps:
[0081] 1) Obtain the parameters of the lensless imaging system.
[0082] In one implementation, a pre-built lensless imaging system to be optimized is shown in Figure 2 (side view). The system includes: an image sensor 1, a separable amplitude mask 2, and a support structure 3. The support structure 3 is used to fix the image sensor 1 and the separable amplitude mask 2 respectively. During imaging, light 5 emitted from the scene under test passes through the separable amplitude mask 2 and illuminates the image sensor 1. The image sensor 1 then outputs the corresponding observed image to reconstruct the image of the scene under test 4. In this embodiment, the imaging distance z refers to the distance from the scene under test 4 to the separable amplitude mask 2. When z is small (generally, z is smaller than the size of the image sensor), the existing separable amplitude mask design cannot achieve the ideal imaging effect and needs to be optimized.
[0083] For the lensless imaging system shown in Figure 2, the parameters that can be obtained include: the length l of the image sensor. sensor and high h sensor The observed image resolution S×R and the observed image equivalent pixel size δ sensor The reconstructed image resolution is M×N, and the reconstructed image pixel size is δ. scene Separable amplitude mask feature size δ mask The imaging distance z and the distance d from the separable amplitude mask to the image sensor are considered. A pre-calibration is performed on the system matrix of the lensless imaging system to obtain the pre-calibrated system left-multiplication matrix containing the coded components. And right multiplication matrix
[0084] In one implementation, the unoptimized separable amplitude mask pattern used, as shown in Figure 3, is a pattern designed based on the maximum length sequence. After identification, measurement, and pre-calibration of the remaining parameters, a pre-calibrated system left-multiplication matrix containing the coded components is obtained. And right multiplication matrix The specific parameters for the other types of parameters are shown in the table below:
[0085] Table 1 Key parameters of a lensless imaging system according to a specific embodiment of this application.
[0086] It should be noted that the method described in this embodiment requires an unoptimized pattern for pre-calibration. This pattern can be any type of separable amplitude mask and will not affect the subsequent results.
[0087] 2) Based on the results obtained in step 1), the pattern of the separable amplitude mask is optimized using a genetic algorithm; the specific steps are as follows:
[0088] 2-1) Encode the pattern of the separable amplitude mask as a gene.
[0089] In this embodiment, the pattern matrix of the separable amplitude mask can be expressed as follows:
[0090] Where D represents the mask pattern; Let K be a column vector containing K elements, each element being either 1 or -1. Therefore, the column vector can be directly... Genes required for genetic algorithms Each element in the expression represents a gene locus, and K is the gene length. The requirement is: Kδ mask >max(l sensor ,h sensor )
[0091] In one implementation, K is chosen to be 770.
[0092] 2-2) Randomly initialize genes to form the initial population.
[0093] In this embodiment, the initial iteration number t = 0 is set, and A column vectors of length K with elements of 1 or -1 are randomly generated as initial genes to form the initial population. A represents the gene with index i in the initial population, i.e., the 0th generation population Φ0, where A ≥ K / 5.
[0094] In one implementation, A is 200. Therefore, in this embodiment, 200 column vectors of length 770 are randomly generated, and each column vector has only 1 or -1 as its element. These column vectors are used as the initial population.
[0095] 2-3) Calculate the fitness of each gene in the current population.
[0096] In this embodiment, for the current t-th generation population Calculate each gene in the t-th generation population Corresponding system matrix and In one specific embodiment of this application, the fitness is calculated using the quality of simulated reconstructed images, and the specific steps are as follows:
[0097] 2-3-1) By genes Directly generate the corresponding system matrix and
[0098] If the lensless imaging system in step 1) uses genes The corresponding mask pattern is... and They represent genes respectively. The corresponding lensless imaging system includes the system left-multiplication matrix and right-multiplication matrix containing the coded component.
[0099] It should be noted that in traditional methods, the system matrix of a lensless imaging system requires the acquisition of hundreds to thousands of images for calibration, a process that is cumbersome and time-consuming. This embodiment, however, proposes a method based on genes... Directly generate left-multiplication matrix And right multiplication matrix The method.
[0100] Among them, calculation The specific steps are as follows:
[0101] a) Set the array W of possible repetition count values L = [1,2,…,K] and the optional value array D of the left-multiplied matrix attenuation coefficients L = [1,2,…,N].
[0102] b) From W L Select a repetition count W from the options. P From D L Choose a left-multiplied matrix attenuation coefficient d Pf .
[0103] In this embodiment, a value is selected from each of the two arrays each time, resulting in a total of K×N combinations.
[0104] c) Based on the results of step b), the genes The corresponding column vector repeats W P Next, it forms K rows of W P Two-dimensional matrix of columns
[0105] d) Based on the results of step b), construct the attenuation matrix P. f Size is K rows W P Each column is identical to the next. For a matrix element with x columns, its value y is:
[0106] e) Two-dimensional matrix With the attenuation matrix P f Dot product yields left multiplication of the source matrix
[0107] f) Obtain the left-multiplication matrix according to the following affine transformation relation.
[0108] Among them, for left-multiplied matrix The interior coordinates are (x tgt ,y tgt The value of ) is determined by left multiplying the source matrix. Coordinates are (x src ,y src The value of ) is obtained by interpolation:
[0109] Where, k center k is the slope of the center line of the matrix multiplied on the left. stripe The slope of the extension line of the left-multiplied matrix;
[0110] g) Calculate the left multiplication matrix obtained in step f) Left multiply matrix with precalibrated system Structural similarity.
[0111] Then return to step 2) and select the next W. P and d Pf The combinations are repeated until K×N groups of W are obtained. P and d Pf The combinations correspond to the left multiplication matrices respectively Left multiply matrix with precalibrated system Structural similarity.
[0112] h) Select the structure with the highest structural similarity from all the structural similarities obtained in step g). P and d Pf The combination, the corresponding combination As the final
[0113] calculate The specific steps are as follows:
[0114] a) Set the array W of possible repetition count values R = [1,2,…,K] and the array D of possible values for the right-multiplied matrix decay coefficients R = [1,2,…,M].
[0115] b) From W R Select a number of repetitions and denote it as W. Q D R Choose a right-multiplied matrix and denote its attenuation coefficient as d. Qf .
[0116] In this embodiment, a value is selected from each of the two arrays each time, resulting in a total of K×M combinations.
[0117] c) Based on the results of step b), the genes The corresponding column vector repeats W Q Next, it forms K rows of W Q Two-dimensional matrix of columns
[0118] d) Based on the results of step b), construct the attenuation matrix Q. f Size is K rows W Q Each column is identical to the next;
[0119] For a matrix element with column number x, its value y is:
[0120] e) Two-dimensional matrix With the attenuation matrix Q f Dot product yields right multiplication of the source matrix.
[0121] f) Obtain the right-multiplication matrix according to the following affine transformation relation.
[0122] Among them, for right-multiplied matrices The interior coordinates are (x tgt ,y tgt The value of ) is determined by right multiplying the source matrix. Coordinates are (x src ,y src The value of ) is obtained by interpolation:
[0123] g) Calculate the right-multiplication matrix obtained in step f) Right multiplication matrix with the precalibrated system Structural similarity;
[0124] Then return to step b) and select the next W. Q and d Qf The combinations are repeated until a K×M group of W is obtained. Q and d Qf The combinations correspond to the right multiplication matrices respectively Right multiplication matrix with the precalibrated system Structural similarity;
[0125] h) Select the structure with the highest structural similarity from all the structural similarities obtained in step g). Q and d Qf The combination, the corresponding combination As the final
[0126] 2-3-2) Using the results of step 2-3-1), calculate the image X of the scene to be tested. GT Lower gene Corresponding simulated observation images
[0127] In this embodiment, for the scene image X to be tested GT The simulated observation image is calculated according to the following formula.
[0128] Where Σ represents pixel-by-pixel noise. and It is obtained from step 2-3-1).
[0129] 2-3-3) Obtain the image X of the scene to be tested. GT Lower gene Corresponding reconstructed image
[0130] In this embodiment, the reconstructed image is obtained by solving the optimization problem shown below.
[0131] Where X is the parameter to be optimized, and τ is the regularization coefficient. Let f be the Frobenius norm of the matrix.
[0132] 2-3-4) Calculate genes fitness
[0133] In this embodiment, The fitness function is expressed as follows:
[0134] in,
[0135] in, Represents the reconstructed image With the image of the scene to be tested X GT Structural similarity index between them Represents the reconstructed image With the image of the scene to be tested X GT The peak signal-to-noise ratio (PSNR) and the peak signal-to-noise ratio (PSU) are both common quantitative evaluation metrics for images.
[0136] To avoid inhomogeneities in the reconstructed image, this embodiment additionally introduces a gradient-based evaluation metric for pure white images. G u (·) and G v(·) represents finding the gradient matrix of a matrix in two directions. Let M be the 1-norm of the matrix, M and N be the width and height of the reconstructed image, and Xwhite be the pure white image.
[0137] In one embodiment of this application, the selected scene image X to be tested GT Figure 4 shows the USAF-1951 resolution test image X. USAF This image serves as the standard image for testing resolution, providing a relatively intuitive representation of the image reconstruction effect. When executing step 2-3-2), the standard deviation of the generated noise Σ corresponds to the simulated observation image. and 0.5% of the maximum pixel value. In this embodiment, the Nesterov gradient method is selected as the optimization algorithm when performing step 2-3-3).
[0138] 2-4) Determine the current iteration number t:
[0139] 2-4-1) When t≤ the preset first upper limit a, the iteration termination condition is not met, and proceed to step 2-5). Wherein, 3≤a≤10, and in a specific embodiment of this application, the first upper limit of the number of iterations is 5.
[0140] 2-4-2) When b>t>a, for population Φ t-a+1 To Φ t There are a populations in total. Calculate the fitness of each gene in each population and take the maximum fitness of the population as the maximum fitness of the population.
[0141] After calculation, if the difference in maximum fitness between any two populations is less than or equal to a predetermined proportion c of the average maximum fitness of the a populations, then the iteration terminates, and population Φ is selected. t-a+1 To Φ t The gene with the highest fitness is selected as the optimal gene. Then proceed to steps 2-7); if the difference in maximum fitness between two populations is greater than a predetermined proportion c of the average maximum fitness of the a populations, then proceed to step 2-5). Here, b is a preset second upper limit, 100a≤b, and in one specific embodiment of this application, the second upper limit for the number of iterations is 2000. 1%≤c≤10%, and in one specific embodiment of this application, c = 3%.
[0142] 2-4-3) When t≥b, the iteration terminates, and Φ is selected. b-a+1 To Φ b The gene with the highest fitness among a populations is selected as the optimal gene. Then proceed to steps 2-7).
[0143] In one implementation, if the iteration count t = 3, then continue executing steps 2-5.
[0144] In one implementation, if the number of iterations t = 1573, and the population Φ is calculated... 1569 To Φ 1573 The maximum fitness of the five populations differs by 3% of the mean, thus satisfying the termination condition. The gene with the highest fitness is selected as the optimal solution. Continue with steps 2-7).
[0145] In one implementation, if the number of iterations t = 1501, and the population Φ is calculated... 1497 To Φ 1501 If the maximum fitness of the five populations differs by more than 3% of the mean, the termination condition is not met, and steps 2-5 are continued.
[0146] In one implementation, if the number of iterations t = 2000, calculate Φ. 1996 To Φ 2000 Among the five populations, the gene with the highest fitness is selected as the optimal solution. Continue with steps 2-7).
[0147] 2-5) For the current t-th generation population Φ t Crossover and mutation are used to obtain offspring, forming the next generation population Φ. t+1 The specific steps are as follows:
[0148] 2-5-1) The current population Φ t As the parent population, a roulette wheel selection algorithm is used to select two genes from the parent population according to probability. The roulette wheel selection algorithm ensures that the probability of a gene being selected is proportional to its fitness; therefore, genes with higher fitness are more likely to be selected. Let the selected genes be...
[0149] 2-5-2) For parents Perform a crossover operation to obtain crossover offspring. Multi-point crossover methods can be given priority, but other crossover algorithms can also be used.
[0150] 2-5-3) Crossover offspring Perform a mutation operation to obtain mutated offspring. The S-point mutation method is used to perform the inverse operation on s sites in the gene sequence.
[0151] 2-5-4) The mutated offspring Added to the initially empty next generation population Φ t+1 middle.
[0152] 2-5-5) Repeat steps 2-3-1) to 2-3-4) for a total number of repetitions equal to the population size A / 2, to obtain the next generation population Φ containing A / 2 mutant offspring. t+1 .
[0153] 2-5-6) Select the parent population Φ t The A / 2 genes with the highest fitness were added to the next generation population Φ. t+1 In the middle, at this time Φ t+1 The number of genes is A.
[0154] In one implementation, the crossover operation uses a two-point crossover method, randomly selecting two loci on the two parent genes and then exchanging the gene segments between the two loci. The mutation operation uses s=10, meaning that in each mutation operation, 10 random loci on the offspring genes are inverted. With a population size of 200, 100 crossover and mutation operations are needed to obtain 100 mutated offspring, which are then merged with the 100 genes with the highest fitness from the parent population to form the next generation.
[0155] 2-6) Let t = t + 1, and convert the population Φ obtained in step 2-5) t+1 As a new current population Φ t Then return to steps 2-3).
[0156] 2-7) Using the optimal genes The optimal pattern D is calculated. best D best This is the final optimized result of the pattern design of the separable amplitude mask.
[0157] In one implementation, the final optimized separable amplitude mask pattern is shown in Figure 5.
[0158] This application also provides a lensless imaging separable amplitude mask optimization design device, the device comprising:
[0159] The parameter acquisition module is used to acquire parameters of the lensless imaging system.
[0160] An optimization design module is used to encode the pattern of the separable amplitude mask in the lensless imaging system into a gene, and optimize the pattern of the separable amplitude mask using a genetic algorithm based on the parameters of the lensless imaging system to obtain the optimized design result of the separable amplitude mask.
[0161] It should be noted that the foregoing explanation of the embodiment of a lensless imaging separable amplitude mask optimization design method also applies to the lensless imaging separable amplitude mask optimization design device of this embodiment, and will not be repeated here.
[0162] In this technical solution, parameters of the lensless imaging system are obtained; the pattern of the separable amplitude mask in the lensless imaging system is encoded as a gene; based on the parameters of the lensless imaging system, a genetic algorithm is used to optimize the pattern of the separable amplitude mask, resulting in an optimized design of the separable amplitude mask. This solves the problem that existing separable amplitude masks are only suitable for long-distance imaging and cannot be used for short-distance imaging; the lensless imaging system using the separable amplitude mask designed in this application can still achieve ideal imaging results even in environmentally limited conditions.
[0163] This application also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform functions implementing any of the above method embodiments.
[0164] This application also provides a computer-readable storage medium having computer instructions stored thereon for causing the computer to perform the functions of any of the above method embodiments.
[0165] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer programs. When the computer program is loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer program can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0166] Those skilled in the art will understand that the various numerical designations such as "first," "second," etc., involved in this application are merely for the convenience of description and are not intended to limit the scope of the embodiments of this application, nor do they indicate the order of sequence.
[0167] At least one in this application can also be described as one or more, and multiple can be two, three, four or more, and this application does not impose any limitation. In the embodiments of this application, for a technical feature, the technical features in that technical feature are distinguished by "first", "second", "third", "A", "B", "C" and "D", and there is no order or size among the technical features described by "first", "second", "third", "A", "B", "C" and "D".
[0168] The correspondences shown in the tables of this application can be configured or predefined. The values of the information in each table are merely examples and can be configured to other values; this application is not limited to these values. When configuring the correspondences between information and parameters, it is not necessarily required to configure all the correspondences shown in each table. For example, the correspondences shown in some rows of the tables in this application may not be configured. Furthermore, appropriate modifications and adjustments can be made based on the above tables, such as splitting, merging, etc. The names of the parameters shown in the headings of the above tables can also use other names that the communication device can understand, and the values or representations of the parameters can also be other values or representations that the communication device can understand. In the implementation of the above tables, other data structures can also be used, such as arrays, queues, containers, stacks, linear lists, pointers, linked lists, trees, graphs, structures, classes, heaps, hash tables, or hash tables, etc.
[0169] The term "predefined" in this application can be understood as definition, pre-defined, stored, pre-stored, pre-negotiated, pre-configured, solidified, or pre-burned.
[0170] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0171] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0172] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for optimizing a design of a lensless imaging separable amplitude mask, characterized in that, The method comprises: obtaining parameters of the lensless imaging system; encoding a pattern of a separable amplitude mask in the lensless imaging system into a gene, and optimizing the pattern of the separable amplitude mask based on the parameters of the lensless imaging system by using a genetic algorithm to obtain an optimized design result of the separable amplitude mask.
2. The method of claim 1, wherein, The obtaining of the parameters of the lensless imaging system comprises: long l sensor and high h sensor , observed image resolution S x R, observed image equivalent pixel size δ sensor , reconstructed image resolution M x N, reconstructed image pixel size δ scene , separable amplitude mask feature size δ mask , imaging distance z, distance of separable amplitude mask to image sensor d; pre-calibrating a system matrix of the lensless imaging system to obtain a pre-calibrated system left multiplication matrix containing an encoding component and right multiplication matrix 3. The method of claim 2, wherein, The encoding of the pattern of the separable amplitude mask in the lensless imaging system into a gene comprises: The matrixed expression of the pattern of the separable amplitude mask is as follows: D is a mask pattern; for a column vector containing K elements, each element being 1 or -1; The column vector As genes, each element in the column vector is a locus of the gene, and K is the length of the gene, wherein: Kδ mask >max(l sensor ,h sensor ).
4. The method of claim 3, wherein, The method further comprises: 1) Let initial iteration number t = 0, randomly generate A column vectors of length K with elements of 1 or -1 as initial genes to form initial population denoting a gene with a serial number i in an initial population, i.e., a 0th generation population Φ0, A≥K / 5; 2) calculating the fitness of each gene in the current population; 3) determining the current iteration number t: 3-1) when t≤a, a first preset upper limit, the iteration termination condition is not met, and step 4) is entered; wherein, 3≤a≤10; 3-2) When b > t > a, for the population Φ t-a+1 to Φ t a total of a populations, the fitness of each gene in each population is calculated, and the maximum value of the fitness within the population is taken as the maximum fitness of the population; After the calculation, if the difference between the maximum fitness of any two populations is less than or equal to the set proportion c of the average of the maximum fitness of the a populations, the iteration is terminated, and the population Φ is selected t-a+1 to Φ t The gene with the maximum fitness in the population is selected as the optimal gene Then step 6) is entered; if the difference between the maximum fitness of the two populations is greater than the set proportion c of the average of the maximum fitness of the a populations, step 4) is entered; wherein b is a second preset upper limit, 100a≤b; 1%≤c≤10%; 3-3) When t≥b, iteration is terminated, and Φ is selected b-a+1 to Φ b The gene with the maximum fitness in the a populations is selected as the optimal gene Then step 6) is entered; 4) For the current generation t, Φt t Crossing and mutation are performed to obtain offspring, forming the next generation Φt+1 t+1 ; 5) Let t = t + 1, and replace the population Φ t+1 as the new current population Φ t and return to step 2). 6) with the optimal gene The optimal pattern D is calculated best , D best is the final optimization result of the pattern design of the separable amplitude mask; 5. The method of claim 4, wherein, The calculation of the fitness of each gene in the current population comprises: 1) for the current tth generation of the population Calculating each gene in the tth generation of the population corresponding system matrix and wherein, representation of a gene The corresponding lensless imaging system contains the system left-multiplication matrix with coded components. representing a gene the corresponding lensless imaging system contains a system right multiplication matrix of the encoding component; 2) using the result of step 1), calculate the image of the scene to be tested X GT lower gene Corresponding simulated observation images wherein Σ is the pixel-wise noise; 3) acquire the image X of the scene to be measured GT lower gene corresponding reconstructed image where X is the parameter to be optimized, and τ is a regularization coefficient, the Frobenius norm of the matrix; 4) computational gene fitness of the adaptation wherein wherein, representative reconstructed image a structure similarity index between the to-be-tested scene image X GT and the reference scene image Y, representative reconstructed image The peak signal-to-noise ratio between the to-be-tested scene image X GT and the reference image Y is taken as an index. For the gradient-based evaluation index of the pure white image, G u (·) and G v (·) respectively represent the gradient matrix in two directions of the matrix, is the 1-norm of the matrix, M and N are the width and height of the reconstructed image, X white is a pure white image.
6. The method of claim 5, wherein, The genes The corresponding lensless imaging system left multiplication matrix with encoding components The calculation is as follows: 1) Set the number of repetitions of the optional value array W L = [1, 2,..., K] and left multiplication matrix attenuation coefficient optional value array D L = [1, 2,..., N]; 2) from W L select a repetition number W P , from D L select a left multiplication matrix attenuation coefficient d Pf ; 3) based on the results of step 2), the genes The corresponding column vector repeats W P K rows of W P A two-dimensional matrix of K columns 4) Based on the results of step 2), construct the attenuation matrix P f of size K rows by W P columns, each row being identical; where, for a matrix element with column number x, the value y is: 5) the two-dimensional matrix is filled with the values of the function f(x,y) at the points of the matrix with the attenuation matrix P f pointwise multiplication with the left source matrix 6) The left multiplication matrix is obtained from the affine transformation relationship as follows where, for the left multiplication matrix The in coordinates are (x tgt ,y tgt ) values, according to left multiplication of the source matrix The values of the coordinates (x src ,y src ) are interpolated to obtain: where k center is the slope of the center line of the left multiplication matrix, k stripe is the slope of the extension line of the left multiplication matrix. 7) Compute the left multiplication matrix from step 6) Pre-multiplying the system by a left matrix the structural similarity of Then return to step 2) and select the next W P and d Pf of the combination until K x N groups of W P and d Pf of the combination respectively correspond to the left multiplication matrix Pre-multiplying the system by a left matrix the structural similarity of 8) selecting the W with the highest structural similarity from all structural similarities obtained in step 7) P and d Pf corresponding to the combination of as the final 7. The method of claim 6, wherein, The genes The corresponding lensless imaging system contains a system right multiplication matrix of encoding components The calculation is as follows: 1) Set the number of repetitions of the optional value array W R = [1, 2,..., K] and the right multiplication matrix attenuation coefficient optional value array D R = [1, 2,..., M]; 2) from W R , a repetition number is selected as W Q , D R , a right multiplication matrix attenuation coefficient is selected as d Qf ; 3) based on the results of step 2), the genes corresponding column vector repetition W Q K rows W Q two-dimensional matrix of K columns 4) Based on the results of step 2), construct the attenuation matrix Q f of size K rows by W Q columns, each row being identical; where, for a matrix element with column number x, the value y is: 5) the two-dimensional matrix is filled with the values of the function f(x,y) at the points of the matrix with the attenuation matrix Q f pointwise multiplication with the right-hand side matrix 6) The right multiplication matrix is obtained from the affine transformation relationship as follows where, for the right multiplication matrix The in coordinates are (x tgt ,y tgt ) values, according to right multiplication source matrix The values of the coordinates (x src ,y src ) are interpolated to obtain: 7) Compute the right multiplication matrix from step 6) Right multiplication with a pre-calibrated system matrix the structural similarity of Then return to step 2) and select the next W Q and d Qf , until K x M sets of W Q and d Qf are obtained, which correspond to the right multiplication matrix Right multiplication with a pre-calibrated system matrix the structural similarity of 8) selecting the W with the highest structural similarity from all the structural similarities obtained in step 7) Q and d Qf corresponding to the combination of as the final 8. A lensless imaging device with separable amplitude mask optimization design, characterized in that, comprises: a parameter acquisition module configured to obtain parameters of the lensless imaging system; an optimized design module configured to encode a pattern of a separable amplitude mask in the lensless imaging system into a gene, and optimize the pattern of the separable amplitude mask based on the parameters of the lensless imaging system by using a genetic algorithm to obtain an optimized design result of the separable amplitude mask.
9. An electronic device, comprising: comprises: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the computer to execute the method of any one of claims 1-7. The computer readable storage medium stores computer instructions for causing the computer to execute the method of any one of claims 1-7.
Citation Information
Patent Citations
Ultrathin lens-free separable compression imaging system and calibration and reconstruction method thereof
CN112802135A
Intelligent lens-free character recognition system
CN114596571A
Optical imaging system sensor optimal configuration method based on genetic algorithm
CN116029199A
Photoetching mask optimization method based on improved genetic algorithm
CN117406548A
Self-focusing lens-free compression imaging method and device based on non-iterative design
CN117692773A
Cited By
Matrix type optical absorption cell design method and system based on genetic algorithm
CN122133518A