A noise training set generation method and system
By generating a noise training set to replace the real image and optimizing the cluster center using grayscale distribution and probability mass function, the problem of insufficient clarity of the existing training set is solved, and high-definition detail reproduction of the hologram is achieved.
Patent Information
- Application Number
- CN202210848100.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-19
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-07-19
AI Technical Summary
The existing training sets have poor clarity and detail information, resulting in the generated holograms not being clear enough. Existing training sets such as DIV2K and Flickr2K cannot meet the training requirements of neural networks.
By obtaining the grayscale distribution of the test set, randomly generating the initial cluster center point, optimizing the cluster center, generating a noise training set, and using the probability mass function of the optimal cluster distribution and grayscale value to generate multiple noise training sets to replace the real image for training.
The clarity and detail information of the generated hologram are improved, the generation process is flexible and controllable, there are many high-frequency components, and the training effect is significantly improved.
Smart Images

Figure CN115082687B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method and system for generating a noise training set. Background Art
[0002] Computational holography can generate pure phase holograms more flexibly, which, combined with spatial light modulators, can reproduce the light field of any object, even those that do not exist.
[0003] The primary challenge facing computer-generated holography is converting an object's complex amplitude information into pure phase information. Traditional approaches to this problem include the GS algorithm and dual-phase encoding. While the former produces holograms with good reproduction quality, its iterative approach makes the generation process too slow to achieve real-time display. The latter, by encoding light field information, can generate holograms in a single step, but the reproduction quality is suboptimal.
[0004] In recent years, with advances in computer hardware, researchers have begun using neural networks to generate holograms. Through the computation of numerous nodes in a multi-layer neural network, complex amplitude information can be converted into corresponding pure phase information. The quality of holographic reconstruction is influenced by many factors, including the type, structure, and depth of the neural network, as well as the size and quality of the training set. A well-trained neural network can stably and quickly generate pure phase holograms with excellent reproduction quality.
[0005] Traditionally, neural networks have been used to generate holograms using training sets such as DIV2K and Flickr2K. The type and quantity of training sets are crucial for neural network training and significantly impact the quality of hologram reproduction. Existing training sets suffer from poor clarity and detail, resulting in unclear holograms. Therefore, a method for generating training sets that can produce clear holograms is needed. Summary of the Invention
[0006] The purpose of the present invention is to provide a method and system for generating a noise training set, which uses the generated noise training set to replace the real image and improve the clarity of the generated hologram.
[0007] To achieve the above object, the present invention provides the following solutions:
[0008] A method for generating a noise training set, comprising:
[0009] Obtaining a test image of a test set and determining a grayscale distribution of the test image;
[0010] Randomly generate multiple initial cluster center points;
[0011] Optimizing the initial cluster center points according to the grayscale distribution of the test image to obtain the optimal cluster distribution;
[0012] A plurality of noise training sets are generated according to the probability mass function of the optimal distribution of the cluster and the grayscale value.
[0013] Optionally, the performing cluster center optimization on the initial cluster center points according to the grayscale distribution of the test image to obtain the optimal cluster distribution specifically includes:
[0014] Calculating the Euclidean distance between the grayscale distribution of each test image in the test set and the center point of each initial cluster;
[0015] Clustering the test image according to the Euclidean distance to obtain clusters after the division and calculating new cluster centers of the clusters after the division;
[0016] The optimal cluster distribution is determined according to the new cluster center point and the divided clusters.
[0017] Optionally, determining the optimal cluster distribution according to the new cluster center point and the divided clusters specifically includes:
[0018] Determine whether the center point of the new cluster meets the optimal conditions. If so, determine that the cluster formed by the center point of the new cluster is the optimal cluster distribution; if not, return to the step of "calculating the Euclidean distance from the grayscale distribution of each test image in the test set to each of the initial cluster centers". The optimal condition is that the center point of the new cluster does not change or the Euclidean distance from any test image in the cluster corresponding to the center point of the new cluster to the center point of the new cluster is the shortest.
[0019] Optionally, generating multiple noise training sets according to the probability mass function of the cluster optimal distribution and grayscale value specifically includes:
[0020] Determining a grayscale value distribution of a probability mass function of grayscale values according to the resolution of the test image and the optimal distribution of the clusters;
[0021] Determining a grayscale value cumulative distribution of a probability mass function of grayscale values according to the grayscale value distribution;
[0022] A plurality of noise training sets are generated according to the grayscale value distribution and the grayscale value cumulative distribution.
[0023] A noise training set generation system, comprising:
[0024] An acquisition module, configured to acquire a test image of a test set and determine a grayscale distribution of the test image;
[0025] Random generation module, used to randomly generate multiple initial cluster center points;
[0026] An optimization module, configured to optimize the initial cluster center points according to the grayscale distribution of the test image to obtain an optimal cluster distribution;
[0027] The noise training set generation module is used to generate multiple noise training sets according to the probability mass function of the optimal distribution of the cluster and the gray value.
[0028] Optionally, the optimization module specifically includes:
[0029] a Euclidean distance determination unit, configured to calculate the Euclidean distance between the grayscale distribution of each test image in the test set and the center point of each initial cluster;
[0030] a clustering unit, configured to cluster the test image according to the Euclidean distance to obtain clusters after division and calculate new cluster centers of the clusters after division;
[0031] The cluster optimal distribution determining unit is used to determine the cluster optimal distribution according to the new cluster center point and the divided clusters.
[0032] Optionally, the cluster optimal distribution determining unit specifically includes:
[0033] The judgment subunit is used to judge whether the center point of the new cluster meets the optimal conditions. If so, it is determined that the cluster formed by the center point of the new cluster is the optimal cluster distribution; if not, it returns to the Euclidean distance determination unit; the optimal condition is that the center point of the new cluster does not change or the Euclidean distance from any test image in the cluster corresponding to the center point of the new cluster to the center point of the new cluster is the shortest.
[0034] Optionally, the noise training set generation module specifically includes:
[0035] a grayscale value distribution determining unit, configured to determine a grayscale value distribution of a probability mass function of grayscale values according to the resolution of the test image and the optimal distribution of the cluster;
[0036] a grayscale value cumulative distribution determining unit, configured to determine a grayscale value cumulative distribution of a probability mass function of grayscale values according to the grayscale value distribution;
[0037] The noise training set generating unit is used to generate multiple noise training sets according to the gray value distribution and the gray value cumulative distribution.
[0038] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0039] The present invention obtains test images from a test set and determines their grayscale distribution; randomly generates multiple initial cluster centers; optimizes the initial cluster centers based on the grayscale distribution of the test images to obtain an optimal cluster distribution; and generates multiple noise training sets based on the optimal cluster distribution and a probability mass function of grayscale values. The present invention uses the generated noise training sets to replace real images, thereby improving the clarity of the generated holograms. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] Figure 1 This is a flow chart of the noise training set generation method provided by the present invention. DETAILED DESCRIPTION
[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0043] The purpose of the present invention is to provide a method and system for generating a noise training set, which uses the generated noise training set to replace the real image and improve the clarity of the generated hologram.
[0044] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0045] like Figure 1 As shown, the present invention provides a method for generating a noise training set, comprising:
[0046] Step 101: Obtain a test image of a test set and determine the grayscale distribution of the test image.
[0047] Calculate the grayscale distribution of the test set. According to the formula Gray = R × 0.299 + G × 0.587 + B × 0.114, the color images in the given test set are converted into 256-level grayscale images. R, G, and B are the pixel values corresponding to the three channels, and Gray is the grayscale. If there are M test images in the given test set, the grayscale distribution of the i-th image is
[0048]
[0049] Where t is the 256-level grayscale value, t=0,1,2,…,255, S i is the total number of pixels in the i-th picture, p n is the grayscale value of the nth pixel in the i-th picture, η(p n ) is a counting function.
[0050]
[0051] When the grayscale value of the nth point is equal to t, this point is counted; if they are not equal, this point is skipped and not counted.
[0052] Step 102: Randomly generate multiple initial cluster center points.
[0053] Initialize the cluster center. Assume that the test set images can be divided into k clusters (k is any positive integer, k is generally selected from 3 to 8), and randomly generate k different grayscale histogram distributions as the initial cluster center points. The jth cluster center F j (t) The initial value generation process is as follows:
[0054] First generate the sequence R(d)
[0055] R(d)=rand(0,1),d=1,2,3,…,255 (3)
[0056] In the formula, rand(0,1) refers to a random number in the interval (0,1). After sorting the sequence R(d) from small to large using the bubble method, insert R(0)=0, R(256)=1
[0057] F j (t)=R(t+1)-R(t),t=0,1,2,…,255 (4)
[0058] Step 103: Optimize the initial cluster center points according to the grayscale distribution of the test image to obtain the optimal cluster distribution. Step 103 specifically includes:
[0059] Calculate the Euclidean distance between the grayscale distribution of each test image in the test set and the center point of each initial cluster.
[0060] Calculate the distance from the cluster to the center. Calculate the Euclidean distance from the grayscale distribution of each image in the test set to each cluster center.
[0061]
[0062] The test image is clustered according to the Euclidean distance to obtain clusters after the division, and new cluster centers of the clusters after the division are calculated.
[0063] Update cluster centers. Classify the images in the test set into the cluster with the shortest Euclidean distance to its cluster center, thereby generating new clusters. Based on the distribution of the new clusters, calculate the cluster center of each cluster.
[0064]
[0065] Where W j represents the jth cluster, |W j | represents the number of images in the jth cluster.
[0066] Determine the optimal distribution of clusters based on the new cluster center point and the divided clusters. Specifically, determining the optimal distribution of clusters based on the new cluster center point and the divided clusters includes: judging whether the new cluster center point meets the optimal condition; if so, determining that the cluster formed by the new cluster center point is the optimal distribution of clusters; if not, returning to the step of "calculating the Euclidean distance from the grayscale distribution of each test image in the test set to each of the initial cluster center points"; the optimal condition is that the new cluster center point does not change or the Euclidean distance from any test image in the cluster corresponding to the new cluster center point to the new cluster center point is the shortest.
[0067] Optimize the cluster distribution through iteration. After updating the cluster center, repeat the steps of calculating the distance from the cluster to the center and updating the cluster center. Update the cluster center by calculating the Euclidean distance from the image to the cluster center. Repeat this process repeatedly, using an iterative approach, until the cluster center no longer changes or the Euclidean distance from any image in each cluster to the cluster center is the shortest. This is the optimal cluster distribution.
[0068] Step 104: Generate multiple noise training sets based on the probability mass function of the optimal distribution of the cluster and the grayscale value. Step 104 specifically includes:
[0069] The grayscale value distribution of the probability mass function of the grayscale value is determined according to the resolution of the test image and the optimal distribution of the cluster.
[0070] A grayscale value cumulative distribution of a probability mass function of grayscale values is determined according to the grayscale value distribution.
[0071] A plurality of noise training sets are generated according to the grayscale value distribution and the grayscale value cumulative distribution.
[0072] Generate a specific noise training set based on the cluster center. The k clusters correspond to k different noise training sets, and the standard of each noise training set - the probability mass function of the gray value can be respectively obtained by the corresponding cluster center F j (t) represents. Assuming that the resolution of the generated training set image is L = m × n, m is the resolution in the horizontal direction, and n is the resolution in the vertical direction, then the distribution of the grayscale value t in the noise image belonging to the jth noise training set is
[0073] H j (t) = F j (t)·L (7)
[0074] The cumulative distribution of gray value t is
[0075]
[0076] The noise image generation process in the noise training set corresponding to the j-th cluster is as follows: For any pixel point in the interval [1,G j (255)] randomly select a positive integer E, if G j (y-1)<E≤G j (y)(G j (-1)=0), then the gray value of the pixel is set to y, and then H j (y)=H j (y)-1, the distribution of the remaining gray values remains unchanged, and a new gray value cumulative distribution G is generated again j (t). Repeat the above process until a noise image is generated.
[0077] Assuming the required image resolution is L = 100 * 100 = 10,000, the first pixel is randomly assigned a grayscale value between 0 and 255, and the probability of this selected grayscale value being selected next time is reduced. Then, the second pixel is randomly assigned a grayscale value between 0 and 255, and the probability of this selected grayscale value being selected next time is reduced again. Repeat this process 10,000 times to obtain a noise image that conforms to the probability mass function. This noise image generated by this method can be used as a training set for a neural network, replacing real images. Compared to traditional training sets, the neural network trained using this noise training set produces holograms with higher quality, superior detail and clarity.
[0078] The present invention proposes an image generation method that is not limited by traditional training sets and can produce a corresponding noise training set based on a given test image. It can be used in the training process of a fully convolutional neural network to achieve the purpose of quickly generating a computer-generated hologram. Based on the analysis of the histogram distribution of the given test image, the test image can be divided into different clusters, and the center of each cluster and the Euclidean distance of the image in each cluster to the center of all clusters are calculated respectively. The image is then assigned to the cluster with the shortest distance to its cluster center and the cluster center is updated. Through continuous iteration, the cluster center eventually stops changing, and the distance from the image in each cluster to the cluster center is the shortest. The cluster center at this time is the probability mass function of the grayscale value of the corresponding noise training set. According to this function, combined with the given image resolution, the distribution and cumulative distribution of the grayscale value can be obtained, thereby generating a specific noise image for neural network training.
[0079] The present invention also provides a noise training set generation system, comprising:
[0080] The acquisition module is used to acquire a test image of a test set and determine the grayscale distribution of the test image.
[0081] Random generation module, used to randomly generate multiple initial cluster center points.
[0082] The optimization module is used to optimize the cluster center of the initial cluster according to the grayscale distribution of the test image to obtain the optimal cluster distribution.
[0083] The noise training set generation module is used to generate multiple noise training sets according to the probability mass function of the optimal distribution of the cluster and the gray value.
[0084] As an optional implementation, the optimization module specifically includes:
[0085] The Euclidean distance determining unit is used to calculate the Euclidean distance from the grayscale distribution of each test image in the test set to the center point of each initial cluster.
[0086] The cluster division unit is configured to divide the test image into clusters according to the Euclidean distance to obtain divided clusters and calculate new cluster centers of the divided clusters.
[0087] The cluster optimal distribution determining unit is used to determine the cluster optimal distribution according to the new cluster center point and the divided clusters.
[0088] As an optional implementation manner, the cluster optimal distribution determination unit specifically includes:
[0089] The judgment subunit is used to judge whether the center point of the new cluster meets the optimal conditions. If so, it is determined that the cluster formed by the center point of the new cluster is the optimal cluster distribution; if not, it returns to the Euclidean distance determination unit; the optimal condition is that the center point of the new cluster does not change or the Euclidean distance from any test image in the cluster corresponding to the center point of the new cluster to the center point of the new cluster is the shortest.
[0090] As an optional implementation, the noise training set generation module specifically includes:
[0091] A grayscale value distribution determining unit is configured to determine the grayscale value distribution of the probability mass function of the grayscale value according to the resolution of the test image and the optimal distribution of the cluster.
[0092] The grayscale value cumulative distribution determining unit is configured to determine the grayscale value cumulative distribution of the probability mass function of the grayscale value according to the grayscale value distribution.
[0093] The noise training set generating unit is used to generate multiple noise training sets according to the gray value distribution and the gray value cumulative distribution.
[0094] The noise training set generated by the present invention has the following advantages as a training set for a neural network:
[0095] (1) Highly targeted. This method extracts and summarizes the features of the image based on the histogram distribution of the test image, generates a corresponding noise training set based on the features, and then puts it into different neural networks for training. For test images with different features, input them into the corresponding neural network to obtain the corresponding pure phase hologram.
[0096] (2) The generation process is more flexible and controllable. The noise training set is generated based on the probability mass function of the grayscale value. The entire generation process is completed by numerical calculation software inside the computer. During the generation process, the size of the training set and the resolution of the training images can be easily controlled by modifying the parameters.
[0097] (3) Many high-frequency components. Since the grayscale values of pixels in the noise training set are randomly assigned, the content of the generated noise training images varies dramatically compared to the real images, and there are more high-frequency components. Therefore, the neural network trained with this as the training set will generate holograms with higher clarity and richer details when reproduced.
[0098] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0099] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.
Claims
1. A method for generating a noise training set, characterized in that: include: Obtaining a test image of a test set and determining a grayscale distribution of the test image; Randomly generate multiple initial cluster center points; Optimizing the initial cluster center points according to the grayscale distribution of the test image to obtain the optimal cluster distribution; generating a plurality of noise training sets according to the probability mass function of the optimal distribution of the cluster and the grayscale value; Generating multiple noise training sets according to the probability mass function of the optimal distribution of the cluster and the grayscale value specifically includes: Determining a grayscale value distribution of a probability mass function of grayscale values according to the resolution of the test image and the optimal distribution of the clusters; Determining a grayscale value cumulative distribution of a probability mass function of grayscale values according to the grayscale value distribution; A plurality of noise training sets are generated according to the grayscale value distribution and the grayscale value cumulative distribution.
2. The noise training set generation method according to claim 1, characterized in that: The step of optimizing the initial cluster center points according to the grayscale distribution of the test image to obtain the optimal cluster distribution specifically includes: Calculating the Euclidean distance between the grayscale distribution of each test image in the test set and the center point of each initial cluster; Clustering the test image according to the Euclidean distance to obtain clusters after the division and calculating new cluster centers of the clusters after the division; The optimal cluster distribution is determined according to the new cluster center point and the divided clusters.
3. The noise training set generation method according to claim 2, characterized in that: The determining of the optimal cluster distribution according to the new cluster center point and the divided clusters specifically includes: Determine whether the center point of the new cluster meets the optimal conditions. If so, determine that the cluster formed by the center point of the new cluster is the optimal cluster distribution; if not, return to the step of "calculating the Euclidean distance from the grayscale distribution of each test image in the test set to each of the initial cluster centers". The optimal conditions are that the center point of the new cluster does not change or the Euclidean distance from any test image in the cluster corresponding to the center point of the new cluster to the center point of the new cluster is the shortest.
4. A noise training set generation system, characterized in that: include: An acquisition module, configured to acquire a test image of a test set and determine a grayscale distribution of the test image; Random generation module, used to randomly generate multiple initial cluster center points; An optimization module, configured to optimize the initial cluster center points according to the grayscale distribution of the test image to obtain an optimal cluster distribution; A noise training set generation module is used to generate multiple noise training sets according to the probability mass function of the optimal distribution of the cluster and the gray value; The noise training set generation module specifically includes: a grayscale value distribution determining unit, configured to determine a grayscale value distribution of a probability mass function of grayscale values according to the resolution of the test image and the optimal distribution of the cluster; a grayscale value cumulative distribution determining unit, configured to determine a grayscale value cumulative distribution of a probability mass function of grayscale values according to the grayscale value distribution; The noise training set generating unit is used to generate multiple noise training sets according to the gray value distribution and the gray value cumulative distribution.
5. The noise training set generation system according to claim 4, characterized in that: The optimization module specifically includes: a Euclidean distance determination unit, configured to calculate the Euclidean distance between the grayscale distribution of each test image in the test set and the center point of each initial cluster; a clustering unit, configured to cluster the test image according to the Euclidean distance to obtain clusters after division and calculate new cluster centers of the clusters after division; The cluster optimal distribution determining unit is used to determine the cluster optimal distribution according to the new cluster center point and the divided clusters.
6. The noise training set generation system according to claim 5, characterized in that: The cluster optimal distribution determination unit specifically includes: The judgment subunit is used to judge whether the center point of the new cluster meets the optimal conditions. If so, it is determined that the cluster formed by the center point of the new cluster is the optimal cluster distribution; if not, it returns to the Euclidean distance determination unit; the optimal condition is that the center point of the new cluster does not change or the Euclidean distance from any test image in the cluster corresponding to the center point of the new cluster to the center point of the new cluster is the shortest.
Citation Information
Patent Citations
Method and device for document picture identification, computer equipment and storage medium
CN111191651A
Method and device for processing deep learning task in big data cluster
CN112257677A