A random pattern training set, hologram generation method and system

By generating random graphic training sets, including gradient fill and translation transformations, the problem of insufficient existing training set data is solved, the model training effect and image information richness are improved, and it is applicable to a variety of research directions.

CN115311517BActive Publication Date: 2026-01-09ARMOR ACADEMY OF CHINESE PEOPLES LIBERATION ARMY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210953313.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-10
Publication Date
2026-01-09
Estimated Expiration
2042-08-10

AI Technical Summary

Technical Problem

The limited availability of image training data results in poor holographic performance of trained network models, failing to provide sufficient training data.

Method used

A random graphic training set is generated, including random squares, circles, and equilateral triangles. Through gradient fill and translation transformations, a gradient graphic set and a random graphic training set are formed for training a convolutional neural network.

Benefits of technology

It provides more comprehensive training data, improves the training effect of the model, has richer image information, and a more balanced spectral distribution, making it suitable for a variety of research directions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115311517B_ABST
    Figure CN115311517B_ABST
Patent Text Reader

Abstract

The application relates to a random pattern training set, a hologram generation method and system, and particularly relates to the technical field of image processing. The random pattern training set generation method comprises the following steps: randomly generating a plurality of pattern sets, each of the pattern sets comprising a square, a circle and an equilateral triangle; performing gradient filling on each pattern in the pattern set to obtain a gradient pattern set; performing a preset number of translation transformations on each pattern in the gradient pattern set to obtain a random pattern corresponding to the pattern set; and determining the random patterns corresponding to all the pattern sets as a random pattern training set. The application can provide more comprehensive training data and improve the training effect of a model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to a random pattern training set, a hologram generation method and system. BACKGROUND

[0002] In recent years, the research and application in the field of image have been widely concerned by people, such as realizing the commonly used functions of face payment, clocking in and out and commodity classification by researching image recognition; improving the diagnosis efficiency of medical diseases and promoting the development of driverless vehicles by researching semantic segmentation; realizing naked eye true 3D stereoscopic display effect by researching computational holography.

[0003] With the progress of hardware technology and the substantial improvement of computing platform computing power, researchers are more and more inclined to use neural networks to solve the above problems commonly seen in the field of image. A large amount of data set is needed as input when training a neural network model, and a suitable training set is extremely important for the training of network model. In order to approach the limit performance of network model and achieve better training effect, the training set used for model training should be as rich and comprehensive as possible. Common image training sets include ImageNet, CIFAR, AFLW and INRIAPerson Dataset. However, the data in these training sets is limited, and it is impossible to provide all possible training data, which leads to the fact that the hologram effect obtained by the trained network model is not good, so it is extremely important to create a training set that can provide more comprehensive training data for the training of neural network. SUMMARY

[0004] The purpose of the present application is to provide a random pattern training set, a hologram generation method and system, which can provide more comprehensive training data and improve the training effect of the model.

[0005] To achieve the above purpose, the present application provides the following scheme:

[0006] A random pattern training set generation method, comprising:

[0007] randomly generating a plurality of pattern sets, each of the pattern sets comprising a square, a circle and an equilateral triangle;

[0008] For any one pattern set, each pattern in the pattern set is subjected to gradient filling to obtain a gradient pattern set;

[0009] Each pattern in the gradient pattern set is subjected to a set number of translation transformations to obtain a random pattern corresponding to the pattern set, and the random patterns corresponding to all pattern sets are determined as a random pattern training set.

[0010] Optionally, the step of performing gradient filling on each of the graphics in the graphics set to obtain a gradient graphics set comprises:

[0011] For any one of the graphics in the graphics set, a gradient graphic corresponding to the graphic is obtained according to a pixel value to be filled in each point inside the graphic according to a distance of each point inside the graphic to a center of the graphic;

[0012] A gradient graphics set is formed by determining the gradient graphics corresponding to each of the graphics in the graphics set.

[0013] Optionally, the step of obtaining the gradient graphic corresponding to the graphic according to the pixel value to be filled in each point inside the graphic according to the distance of each point inside the graphic to the center of the graphic comprises:

[0014] For any one of the points inside the graphic, a pixel value to be filled in the point is calculated according to a formula , wherein p is the pixel value to be filled in the point, L OU is the distance of the point to the center of the graphic, max(L OU ) is a maximum value of distances of all points inside the graphic to the center of the graphic, and δ is a gray value gradient index.

[0015] A system for generating a random graphics training set comprises:

[0016] A graphics set generation module is configured to randomly generate a plurality of graphics sets, each of the graphics sets comprising a square, a circle and an equilateral triangle;

[0017] A gradient module is configured to perform gradient filling on each of the graphics in any one of the graphics sets to obtain a gradient graphics set.

[0018] A random graphics training set generation module is configured to perform a translation transformation on each of the graphics in the gradient graphics set for a set number of times to obtain a random graphic corresponding to the graphics set, and determine the random graphics corresponding to all the graphics sets as a random graphics training set.

[0019] Optionally, the gradient module comprises:

[0020] A gradient graphic generation unit is configured to obtain a gradient graphic corresponding to any one of the graphics in the graphics set according to a pixel value to be filled in each point inside the graphic according to a distance of each point inside the graphic to a center of the graphic.

[0021] A gradient graphics set generation unit is configured to determine the gradient graphics corresponding to each of the graphics in the graphics set to form a gradient graphics set.

[0022] Optionally, the gradient graphic generation unit comprises:

[0023] a gradual change pattern generating sub-unit, configured to, for any point in the pattern, calculate a pixel value to be filled for the point according to a formula p = L + (L - L) * (r / r) ^ δ, wherein p is the pixel value to be filled for the point, L is a distance from the point to the center of the pattern, OU r is a distance from the point to the center of the pattern, max(L OU ) is a maximum value among distances from all points in the pattern to the center of the pattern, and δ is a gray value gradual change index.

[0024] A hologram generation method, comprising:

[0025] calculating a diffraction field of a random pattern training set; the random pattern training set is generated according to the random pattern training set generation method described above;

[0026] generating a pure phase hologram of the random pattern training set;

[0027] training a convolutional neural network with the diffraction field as input and the pure phase hologram as output to obtain a trained convolutional neural network;

[0028] obtaining a preprocessed image;

[0029] calculating a diffraction field of the preprocessed image;

[0030] inputting the diffraction field of the preprocessed image into the trained convolutional neural network to obtain a hologram of the preprocessed image.

[0031] A hologram generation system, comprising:

[0032] a training diffraction field calculation module, configured to calculate a diffraction field of a random pattern training set; the random pattern training set is generated according to the random pattern training set generation method described above;

[0033] a pure phase hologram generation module, configured to generate a pure phase hologram of the random pattern training set;

[0034] a training module, configured to train a convolutional neural network with the diffraction field of the random pattern training set as input and the pure phase hologram as output to obtain a trained convolutional neural network;

[0035] an acquisition module, configured to acquire a preprocessed image;

[0036] a diffraction field calculation module, configured to calculate a diffraction field of the preprocessed image;

[0037] inputting the diffraction field of the preprocessed image into the trained convolutional neural network to obtain a hologram of the preprocessed image.

[0038] According to the specific embodiments of the present application, the following technical effects are disclosed: according to the present application, the pixel value of a point is calculated according to the distance from the point to the center of the figure, so that the gradient effect of the figure is realized, and then a required random figure training set is obtained through translation transformation, the random figure training set has more angle, edge and other detail information and pixel value gradient background information, compared with the traditional training set, the image information contained is more abundant, the distribution of high frequency components and low frequency components in the frequency spectrum is more balanced, more comprehensive training data can be provided, and the training effect of the model is improved. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description only constitute some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0040] Figure 1 A flowchart of a random figure training set generation method provided by the embodiments of the present application is shown in the figure.

[0041] Figure 2 A schematic diagram of a random figure is shown in the figure.

[0042] Figure 3 A schematic diagram of a randomly generated square is shown in the figure.

[0043] Figure 4 A schematic diagram of a randomly generated circle is shown in the figure.

[0044] Figure 5 A schematic diagram of a randomly generated equilateral triangle is shown in the figure.

[0045] Figure 6 A schematic diagram of a gradient figure set is shown in the figure.

[0046] Figure 7 A schematic diagram of a Backward Diffraction process is shown in the figure.

[0047] Figure 8 A hologram generation process schematic diagram is shown in the figure. DETAILED DESCRIPTION

[0048] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0049] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0050] This invention provides a method for generating a random graph training set, such as... Figure 1 As shown, the method includes:

[0051] Step 101: Randomly generate multiple graphic sets, each graphic set including a square, a circle and an equilateral triangle.

[0052] Step 102: For any set of graphics, perform gradient fill on each graphic in the set to obtain a gradient graphic set.

[0053] Step 103: Perform a set number of translation transformations on each graphic in the gradient graphic set to obtain a random graphic corresponding to the graphic set, and determine the random graphics corresponding to all graphic sets as the random graphic training set, such as... Figure 2 As shown, specifically, by randomly selecting different coordinate points as centers, random graphics can be generated through translation transformation.

[0054] In practical applications, step 101 specifically includes:

[0055] Step 1: Generate a square with random position, random size, and random tilt angle.

[0056] like Figure 3 As shown, with the center O of the square sq Establish a Cartesian coordinate system with R as the origin, and randomly select R. sq and θ sq These are respectively the distance between the vertex and the center of the square, and the distance from the center to vertex A. sq The angle between the line segment and the positive x-axis of the coordinate system.

[0057] Coordinates of the four vertices of the square They can be represented as follows:

[0058]

[0059] From formula (1), we can know the distance from any point S(x,y) in the plane of the coordinate system to the lines containing the four sides of the square. They are respectively:

[0060]

[0061] The distance from a point inside a square to any of its four sides must be less than or equal to the side length of the square. Therefore, the condition for "any point S(x,y) lies inside the square" is:

[0062]

[0063] Filter out the pixel points that do not meet the condition in formula (3), and the shape composed of the remaining pixel points is a square with random position, random size and random inclination.

[0064] Second step: generate a circle with random position and random size.

[0065] As shown in the figure, the origin of the rectangular coordinate system is the center O of the circle, and R is randomly taken as the radius of the circle. ro ro Figure 4

[0066] The distance from any point Q(x, y) in the plane of the coordinate system to the center of the circle is

[0067]

[0068] The distance from any point Q(x, y) in the plane of the coordinate system to the center of the circle is

[0069] Filter out the pixel points that do not meet the condition in formula (5), and the shape composed of the remaining pixel points is a circle with random position and random size.

[0070] Third step: generate a right triangle with random position, random size and random inclination.

[0071] As shown in the figure, the origin of the rectangular coordinate system is the center of the right triangle, and R and θ are randomly taken as the distance from the vertex to the center, and the angle between the line segment from the center to the vertex A and the positive direction of the x-axis of the coordinate system. tr tr tr Figure 5

[0072] The coordinates of the three vertices of the right triangle can be expressed as:

[0073] The vectors from any point W(x, y) in the plane of the coordinate system to the three vertices of the right triangle are:

[0074]

[0075] Therefore, the vector product of the three vectors is:

[0076]

[0077] ​​​​​​​​​

[0078] According to the direction of the vector product, when the following conditions are met simultaneously:

[0079] W(x, y) is located in the equilateral triangle.

[0080] Filtering out the pixel points that do not meet the conditions in formula (9), the shape composed of the remaining pixel points is an equilateral triangle with random position, random size and random inclination.

[0081] In practical applications, step 102 specifically includes:

[0082] For any one figure in the figure set, the pixel value to be filled in each point inside the figure is determined according to the distance from the point to the center of the figure, and the corresponding gradient figure of the figure is obtained.

[0083] The gradient figures corresponding to each figure in the figure set are determined to form a gradient figure set.

[0084] In practical applications, the pixel value to be filled in each point inside the figure is determined according to the distance from the point to the center of the figure, and the corresponding gradient figure of the figure is obtained, specifically including:

[0085] For any one point inside the figure, the pixel value to be filled in the point is calculated according to the formula , wherein p is the pixel value to be filled in the point, L OU is the distance from the point to the center of the figure, max(L OU ) is the maximum value of the distances from all points inside the figure to the center of the figure, and δ is a gray value gradient index. The pixel value of the point is calculated according to the ratio of the distance from the point to the center of the figure to the distance from the farthest point inside the figure to the center of the figure. By changing the parameter δ (δ>0), the shape of the curve can be adjusted to control the overall gradient effect of the figure, as shown in Figure 6 , wherein Figure 6 The gradient effect of (b) is annular, and L OU is set as the distance from the point inside to the nearest edge, and the parallel gradient effect can be achieved, as shown in Figure 6 (a) and Figure 6 (b).

[0086] In practical applications, the distance from a certain point U(x, y) inside the random figure to the center of the figure is

[0087]

[0088] A random figure training set generation system, comprising:

[0089] A graphics set generation module is configured to randomly generate a plurality of graphics sets, each of which includes a square, a circle and an equilateral triangle.

[0090] A gradient module is configured to, for any one of the graphics sets, perform gradient filling on each graphics in the graphics set to obtain a gradient graphics set.

[0091] A random graphics training set generation module is configured to perform a preset number of translation transformations on each graphics in the gradient graphics set to obtain a random graphics corresponding to the graphics set, and determine random graphics corresponding to all graphics sets as a random graphics training set.

[0092] In actual application, the gradient module specifically includes:

[0093] A gradient graphics generation unit is configured to, for any one of the graphics in the graphics set, determine a pixel value to be filled for each point inside the graphics according to a distance from the point to a center of the graphics to obtain a gradient graphics corresponding to the graphics.

[0094] A gradient graphics set generation unit is configured to determine the gradient graphics corresponding to each graphics in the graphics set to obtain a gradient graphics set.

[0095] In actual application, the gradient graphics generation unit specifically includes:

[0096] A gradient graphics generation subunit is configured to, for any one of the points inside the graphics, calculate a pixel value to be filled for the point according to formula (10).

[0097] A hologram generation method includes:

[0098] A diffraction field of a random graphics training set is calculated, and the result is as shown in Figure 7 The random graphics training set is generated according to the random graphics training set generation method described above.

[0099] A pure-phase hologram of the random graphics training set is generated.

[0100] A convolutional neural network is trained with the diffraction field as input and the pure-phase hologram as output to obtain a trained convolutional neural network.

[0101] A preprocessed image is obtained.

[0102] A diffraction field of the preprocessed image is calculated.

[0103] The diffraction field of the preprocessed image is input into the trained convolutional neural network to obtain a hologram of the preprocessed image.

[0104] The convolutional neural network is as shown in Figure 8As shown, the U-net architecture is selected, which is set to 1 input layer (Input layer), 5 down sampling layers (Downsampling layer), 1 convolutional layer (Convolutional layer), 5 up sampling layers (Upsampling layer) and 1 output layer (Output layer), the feature is 32, the loss function uses the perception loss and L1 (mean absolute error), and the model trained by using the random pattern training set can quickly generate high-quality holograms.

[0105] In practical applications, the diffraction field of the random pattern training set is specifically:

[0106] The diffraction field of the random pattern training set back propagation distance z on the diffraction surface is

[0107] U(x,y)=F -1 {F{U0(x,y)}·H(f x ,f y )} (12)

[0108] In the formula, F{·} is a two-dimensional Fourier transform, F -1 {·} is a two-dimensional inverse Fourier transform, U0(x,y) is the complex amplitude of the training set in the monochromatic light field, H(f x ,f y ) is an optical transfer function,

[0109]

[0110] Where, exp is the exponential function with the natural constant e as the base, j is an imaginary number, and lambda is the wavelength of the monochromatic light, f x , f y are the spatial frequencies of the diffraction field in the x-axis and y-axis directions, respectively.

[0111] A hologram generation system comprises:

[0112] A training diffraction field calculation module is configured to calculate the diffraction field of a random pattern training set.

[0113] A pure phase hologram generation module is configured to generate a pure phase hologram of the random pattern training set.

[0114] A training module is configured to train a convolutional neural network with the diffraction field of the random pattern training set as input and the pure phase hologram as output to obtain a trained convolutional neural network.

[0115] An acquisition module is configured to acquire a preprocessed image.

[0116] a diffraction field calculation module configured to calculate a diffraction field of the preprocessed image.

[0117] inputting the diffraction field of the preprocessed image into the trained convolutional neural network to obtain a hologram of the preprocessed image.

[0118] The present application has the following advantages:

[0119] 1. The present application proposes a method for generating a random pattern training set composed of basic random patterns (random squares, random circles and random equilateral triangles). First, according to the mathematical properties of the three basic random patterns and the decision theorem, the generated basic patterns have random positions, sizes and inclination angles through numerical calculation software. Then, the pixel value of the point is calculated according to the distance from the point inside the pattern to the center of the pattern, so as to realize the gradual change effect of the pattern. Finally, by setting the number of basic patterns, the required random pattern training set can be obtained through translation transformation. The random pattern training set is close to the spectrum of real pictures, and can replace real images for image recognition, semantic segmentation, calculation of holograms and other research directions based on neural network models that have great demand for image data sets.

[0120] 2. Convenient generation: Common data sets (such as DIV2K, Flickr2K, etc.) are large in volume, and errors may occur during network transmission, resulting in damaged transmission files. Using 3DS MAX, Blender and other software for sampling requires a large number of 3D models to be prepared in advance, and the operation process is complex, requiring researchers to have high software usage skills. Compared with the above traditional methods of obtaining data sets, the method of generating random pattern training sets proposed in the present application can quickly generate a large number of different training pictures in a short time using numerical calculation software, with extremely high efficiency.

[0121] 3. Suitable for multiple directions: When the research direction changes, a new training set is often needed. In the method proposed in the present application, the position, size and inclination angle of the basic random pattern are controllable, so different random pattern training sets can be generated according to different research needs. Compared with traditional methods, the method proposed in the present application is highly adaptable and can be used for a variety of different research directions.

[0122] 4. Rich image information: Random pattern training sets have a large number of angle, edge and other detail information and pixel value gradient background information, and compared with traditional training sets, they contain more image information, and the distribution of high frequency components and low frequency components in the spectrum is more balanced.

[0123] The various embodiments described in this specification are presented for the purpose of illustrating the principles of the present application and its best mode of operation. Each of the embodiments described in this specification has been provided for the purpose of illustration only and the various embodiments are not intended to limit the present application in any way unless otherwise specifically indicated. The same parts and / or features of the various embodiments described in this specification can be referenced using the same reference numerals for the ease of understanding of the present application.

[0124] The principles and implementations of the present application have been described in the above embodiments, which are only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, the specific implementation and application range of the present application can be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A method for generating a random set of training patterns, characterized in that, The method comprises the steps of: randomly generating a plurality of pattern sets, each of the pattern sets comprising a square, a circle and an equilateral triangle; for any one of the pattern sets, performing gradient filling on each pattern in the pattern set to obtain a gradient pattern set; performing a preset number of translation transformations on each pattern in the gradient pattern set to obtain a random pattern corresponding to the pattern set, and determining random patterns corresponding to all the pattern sets as a random pattern training set; the gradient filling on each pattern in the pattern set to obtain a gradient pattern set comprises the steps of: for any one of the patterns in the pattern set, determining pixel values to be filled for each point inside the pattern according to distances from the points to a center of the pattern to obtain a gradient pattern corresponding to the pattern; determining gradient patterns corresponding to each pattern in the pattern set to obtain a gradient pattern set; determining pixel values to be filled for each point inside the pattern according to distances from the points to a center of the pattern to obtain a gradient pattern corresponding to the pattern, and the gradient pattern set comprises the steps of: For any point inside the figure, the pixel value to be filled for the point is calculated according to the formula p = L + δ (max(L) - L) OU where p is the pixel value to be filled for the point, L is the distance from the point to the center of the figure, OU max(L) is the maximum value among the distances from all points inside the figure to the center of the figure, and δ is the gray value gradient index.

2. A system for generating a random set of training patterns, characterized in that The method comprises the steps of: a pattern set generation module configured to randomly generate a plurality of pattern sets, each of the pattern sets comprising a square, a circle and an equilateral triangle; a gradient module configured to, for any one of the pattern sets, perform gradient filling on each pattern in the pattern set to obtain a gradient pattern set; a random pattern training set generation module configured to perform a preset number of translation transformations on each pattern in the gradient pattern set to obtain a random pattern corresponding to the pattern set, and determine random patterns corresponding to all the pattern sets as a random pattern training set; the gradient module comprises: a gradient pattern generation unit configured to, for any one of the patterns in the pattern set, determine pixel values to be filled for each point inside the pattern according to distances from the points to a center of the pattern to obtain a gradient pattern corresponding to the pattern; a gradient pattern set generation unit configured to determine gradient patterns corresponding to each pattern in the pattern set to obtain a gradient pattern set; the gradient pattern generation unit comprises: A gradual change pattern generating sub-unit is configured to, for any one point inside the pattern, calculate a pixel value to be filled for the point according to a formula p = L + δ (L - L OU ) / max(L OU ), wherein p is the pixel value to be filled for the point, L OU is a distance from the point to a center of the pattern, max(L OU ) is a maximum value among distances from all points inside the pattern to the center of the pattern, and δ is a gray value gradual change index.

3. A method of generating a hologram, characterized by, The method comprises the steps of: calculating a diffraction field of a random pattern training set; the random pattern training set is generated according to the method for generating a random pattern training set in claim 1; generating a pure-phase hologram of the random pattern training set; training a convolutional neural network with the diffraction field as input and the pure-phase hologram as output to obtain a trained convolutional neural network; obtaining a preprocessed image; calculating a diffraction field of the preprocessed image; 4. A hologram generating system characterized by comprising: inputting the diffraction field of the preprocessed image into the trained convolutional neural network to obtain a hologram of the preprocessed image. The method comprises the steps of: a training diffraction field calculation module configured to calculate a diffraction field of a random pattern training set; the random pattern training set is generated according to the method for generating a random pattern training set in claim 1; a pure-phase hologram generation module configured to generate a pure-phase hologram of the random pattern training set; a training module configured to train a convolutional neural network with the diffraction field of the random pattern training set as input and the pure-phase hologram as output to obtain a trained convolutional neural network; an acquisition module configured to obtain a preprocessed image; a diffraction field calculation module configured to calculate a diffraction field of the preprocessed image; inputting the diffraction field of the preprocessed image into the trained convolutional neural network to obtain a hologram of the preprocessed image.

Citation Information

Patent Citations

  • Image generating device, image generating method and printing device

    CN101551912A

  • Image completion model initialization method, training method and image completion method

    CN112102200A