Image Hiding in Stochastic Geometric Moiré Gratings

: An image hiding scheme based on stochastic moiré gratings is proposed, discussed, and illustrated in this paper. The proposed scheme is based on a counter-intuitive optical feature of specially designed stochastic moiré gratings when similar images in the static mode become very different in the time-averaged mode. A soft computing PSO algorithm was used for the construction of stochastic gratings. Complex computational algorithms were required to construct the cover image; however, the decryption process was completely visual. The cover image must oscillate in a predeﬁned direction and at a predeﬁned amplitude (the amplitude of the harmonic oscillation is one of the parameters of the proposed image hiding scheme). Computational experiments were used to demonstrate the efﬁcacy of this optical image hiding scheme based on the stochastic moiré gratings.


Introduction
Geometric moiré is a classical optical experimental technique used for the experimental identification of displacements, strains, etc., from the patterns of moiré fringes [1][2][3][4].Geometric moiré is classified into double exposure geometric moiré and time-averaged geometric moiré [1,2].Both optical techniques require the formation of moiré gratings on the surface of a deformable object.Double exposure geometric moiré uses the superposition of two images.The first image of the moiré grating is taken in the state of equilibrium.The second image of the grating is taken in a deformed state.Two static moiré gratings yield a two-dimensional pattern of fringes used to describe the spatial field of in-plane deformations.
Time-averaged geometric moiré techniques use exposure times such that many oscillation periods fit into the averaging interval.Naturally, time-averaged geometric moiré techniques are commonly used for vibrating deformable bodies [2].
Two main goals exist in the analysis of moiré patterns (generated by double exposure or time-averaged techniques).The first goal deals with the interpretation of experimentally obtained patterns of moiré fringes.Those patterns are used to reconstruct the field of displacements, strains, etc., at the centerlines of moiré fringes [2][3][4].The other goal is associated with the synthesis of a predefined target pattern of moiré fringes [5,6].Note that there is a tight link between both tasks as one task gives insight into the other.
Recently, moiré techniques have been successfully exploited in different image hiding applications.For example, an image encryption technique based on embedding the secret image into the geometric moiré pattern is discussed in [7].Unfortunately, with this method, rough details of the secret image may still be visible in the deformed pattern of moiré grating lines, even to the naked eye.To address this issue, an improved algorithm for image encryption and decryption that uses stochastic moiré grating manipulations is presented in [8].In this approach, the secret information is hidden by deforming a stochastic moiré grating according to the grayscale intensities of the secret image.Decryption is performed by correlating the pixel intensities in the encrypted image and the original stochastic moiré grating [8].
The relationship between the pitch of the moiré grating, the order of the time-averaged fringe, and the amplitude of the harmonic oscillations forms the basis for the dynamic visual cryptography (DVC) image hiding technique [9].This term (DVC) originates from the concept of visual cryptography (VC), which was introduced in 1995 [10].VC can be characterized by two basic features.Complex computational algorithms are required to encode the secret image.However, a computer is not required to decode the image; the secret is revealed and can be interpreted by the naked eye [10].VC algorithms are used to split the secret image into two (or more) separate shares (usually printed on transparencies).The secret image emerges when those transparencies are aligned and stacked together [10].
DVC is not based on image sharing [9].The secret dichotomous image is embedded into the moiré grating in such a way that the stationary cover image does not reveal any hidden information, but the secret can be decoded as a pattern of time-averaged moiré fringes when the cover image oscillates harmonically with a predefined amplitude a, and time-averaging techniques are used to register the time-averaged image [9].The secret can be directly visually decoded by observing the oscillating cover image.The naked human eye is capable of integrating oscillating images over time and perceiving embedded secret information only if the minimum frequency of oscillations exceeds 25-28 Hz [11].
The main objective of this paper is to introduce stochastic moiré gratings into DVC schemes, which enables an increase in the security of the cover image.The main advantage of the proposed DVC scheme is based on the fact that the stochastic structure of the cover image ensures robustness to statistical algorithms.In other words, statistical analysis of the stationary cover image cannot reveal the encoded visual information.
This paper is structured as follows.Section 2 discusses the one-dimensional Wada index, governing equations of time-averaged geometric moiré, and the scheme for image hiding in harmonic gratings.The construction of the dynamic visual cryptography scheme based on near-optimal stochastic gratings is introduced in Section 3. Concluding remarks are presented in the last section.

The Wada Index for the Evaluation of the Grating Complexity
It is common to evaluate the randomness of digital grayscale images using the Shannon entropy [12,13].In [14], the Wada index, based on weighted and truncated Shannon entropy, was proposed for detecting Wada boundaries in phase plots of nonlinear dynamical systems.Moreover, the Wada index provides a numerical estimate of the number of different colors and their proportions in a two-dimensional phase space diagram, making it applicable not only in nonlinear dynamics but also in image processing in general [14].In this study, the Wada index is used to estimate the number of different grayscale levels and their distribution in stationary and time-averaged moiré gratings.
Let us list the notations required for the introduction of the one-dimensional (1D) Wada index, which is used to evaluate the complexity of the 1D digital image: 2 is equal to 1 if the number of grayscale levels in the 1D observation window is greater than or equal to 2:

•
The indicator function 1 (s) 3 is equal to 1 if the number of grayscale levels in the 1D observation window is greater than or equal to 3: 1 The Shannon entropy of different grayscale levels in the 1D observation window: The Wada index ω (s) 1 in the 1D observation window of length s reads [14]: ( Let us denote the number of 1D observation windows covering the whole 1D digital image as N.Then, the Wada index W (s) 1 for the whole 1D digital image can be formulated in accordance with [14]: where ω (s) 1,k and 1 1 (Equation ( 2)) and the indicator function in the k-th observation window.

Time-Averaged Geometric Moiré: Harmonic Grating
The one-dimensional harmonic moiré grating M(x) in the state of equilibrium reads: where x is the one-dimensional spatial coordinate; λ is the pitch of the grating, indicating the distance between the centers of two adjacent white (or black) grating lines.Values of M(x) vary from 0 (which corresponds to the black color) to 1 (the white color); values from the interval [0, 1] represent different grayscale levels.Let us suppose that the moiré grating M(x) (Equation ( 4)) oscillates in time according to the harmonic function a sin(ωt + ϕ) in the direction perpendicular to the grating lines (a, ω and ϕ stand for the amplitude, frequency, and phase of harmonic oscillations, respectively).The brightness of the gray color at point x at time moment t 0 reads: If time-averaging techniques are used to register the image in Equation ( 5) for a sufficiently long exposure time T, the grayscale time-averaged image reads [2]: where J 0 is the zero-order Bessel function of the first kind: It is clear that the brightness of the grayscale color in the time-averaged geometric moiré depends only on the amplitude of the harmonic oscillations.The oscillation frequency ω and the phase ϕ have no influence on the time-averaged M(x, a) (when T → ∞).
The computational representation of M(x, a) (Equation ( 6)) can be implemented by computing the arithmetic average of M(x)| t=t k (k = 1, 2, 3, . ..) over one period of harmonic oscillations (0 ≤ t k < 2π) [9]: The accuracy of a numerical reconstruction of the time-averaged image is determined by the number of discrete time steps n used in one period of oscillations (Equation ( 8)).The relationship between n and the number of reconstructed time-averaged moiré fringes with a predefined accuracy is given in [9].
Time-averaged moiré fringes become fully developed when The relationship between the sequential number of time-averaged fringes, the amplitude of harmonic oscillations, and the pitch of the moiré grating reads: 2π where r i denotes the i-th root of J 0 (Equation ( 7)); a i is the amplitude of oscillations at the center of the i-th time-averaged fringe.
The graphical interpretation of Equation ( 10) is presented in Figure 1.One-dimensional time-averaged moiré gratings M(x, a) at increasing amplitudes of harmonic oscillations a are depicted in the left panel of Figure 1.Note that the top row of this image (at a = 0) coincides with the stationary moiré grating M(x).The stationary moiré grating M(x), its optical representation, and the Wada index W (s) 1 are depicted in Figure 1a.Note that 0 ≤ M(x) ≤ 1, but the brightness of pixels in the optical representation varies from 0 to 255.The panels representing Wada indexes in Figure 1 are constructed in such a way that the horizontal axis represents the length of the 1D observation window s.In other words, Figure 1 represents the variation of the Wada index W (s) 1 is depicted at a = 0 (Figure 1a), the middle of the first time-averaged moiré fringe (a = λr 1 2π ≈ 0.1914, Figure 1b), and the zone between the first and the second time-averaged fringes (a = 0.3, Figure 1c).
Note that W (s) 1 is a monotonous function with respect to s.The wider the observation window, the larger the number of pixels with different brightness.The maximum value of W (s) 1 is produced at the largest s.However, periodic moiré gratings (Figure 1a,c) yield maximum values of W (s) 1 even when the width of the observation window is equal to one period of the grating.

Image Hiding in Harmonic Gratings
Let us suppose that two moiré gratings M 1 (x) and M 2 (x) are given with two different pitches λ 1 = 0.5 and λ 2 = 0.57.Static moiré gratings M 1 (x) and M 2 (x) are depicted in Figure 2a,c.Optical representations of the static moiré gratings M 1 (x) and M 2 (x) are depicted in Figure 2b,d.
Both moiré gratings are oscillated harmonically with the same amplitude of oscillations a = 0.19 (Figure 2).Time-averaged moiré gratings M 1 (x, 0.19) and M 2 (x, 0.19) are shown in Figure 2a,c; their optical representations are shown in Figure 2b,d.
The amplitude of harmonic oscillations a = 0.19 is preselected in such a way that the pitch λ 1 = 0.5 satisfies Equation (10).The time-averaged image M 1 (x, 0.19) becomes plain gray and the time-averaged fringe becomes fully developed (Figure 2b).
However, amplitude a = 0.19 and the pitch λ 2 = 0.57 do not satisfy the relationship given by Equation (10).The time-averaged moiré fringe is not fully developed, and the blurred original moiré grating is still visible in the resulting time-averaged image (Figure 2d).
The DVC encoding scheme is illustrated by a simple computational example when a plain circle is embedded into the surrounding background (Figure 2e).The stochastic initial moiré phase algorithm and the algorithm for the regularization of moiré phases on the boundary lines between the secret and the background [9] are used to hide the "secret" circle in the background (Figure 2e).The naked eye cannot interpret the secret image in the stationary encoded image.
However, the secret image is leaked when the amplitude of harmonic oscillations is preselected in such a way that a fully developed moiré fringe is formed either in the background or in the area occupied by the secret image.The Moiré grating M 1 (x) is used to cover the background; the moiré grating M 2 (x) is the area occupied by the circle.Therefore, the background becomes plain gray, and the circle appears in the form of notfully developed moiré fringe in the time-averaged image in Figure 2e.
The image hiding scheme in harmonic gratings (the DVC scheme based on harmonic moiré gratings) can be characterized by the two essential features.The secret image should be unrecognizable to the naked eye from the stationary cover image.The secret image should be interpretable to the naked eye when the cover image oscillates, and the amplitude of harmonic oscillations is set to a given value (the amplitude of harmonic oscillations is one of the keys used for decoding the secret) [9].

Time-Averaged Random Moiré Grating
Two moiré gratings (M 1 (x) and M 2 (x)) used to construct the DVC scheme in Figure 2 are harmonic functions.Moreover, although the naked eye cannot interpret the embedded secret in the static cover image, advanced statistical algorithms could be exploited to check the variations in the period of the pixel brightness in each row of the digital cover image.The robustness of the DVC scheme to statistical algorithms can be enhanced by using non-harmonic oscillations [15], near-optimal periodic gratings [16], chaotic oscillations [17], and deformable periodic gratings [18].
Nevertheless, the periodicity of the moiré grating in DVC schemes is a drawback from the point of view of the robustness of steganalysis algorithms.Note that VC schemes are completely robust to steganalysis [10,19].However, VC schemes are required to split the secret image into shares.The fact that the secret image is split into separate shares also raises serious security issues.VC schemes suffer from the possibility of cheating when the eavesdropper obtains information about one of the shares and can generate another/other share/shares in order to produce fake secret images [19].Special advancements in VC schemes help to lower the cheating probability, but it remains an issue related to the security of those schemes [20,21].
Therefore, the ability to exploit random non-periodic moiré gratings in DVC schemes remains an attractive objective, which could raise the security of those schemes to another level.
Time-averaged patterns produced by random moiré gratings are discussed in [22].Time-averaging effects produced by random moiré gratings are illustrated in Figure 3. One-dimensional time-averaged random moiré gratings M(x, a) at increasing amplitudes of harmonic oscillations a are depicted in the left panel of Figure 3.Note that the top row of this image (at a = 0) coincides with the stationary random moiré grating M(x).The stationary random moiré grating M(x), its optical representation, and the Wada index W

Dynamic Visual Cryptography Based on Stochastic Gratings 3.1. One-Dimensional Stochastic Gratings for Image Hiding Applications
As mentioned previously, all available DVC schemes exploit the relationship between the pitch of the periodic moiré grating, the parameters of oscillations, and the order of the time-averaged fringe to hide the secret in a single cover image.Such DVC schemes are based on the phase regularization and random initial phase shifting algorithms [9].The secret information is leaked as a pattern of time-averaged moiré fringes when the cover image oscillates at a predefined amplitude, and time-averaging techniques (or the naked eye) are used to register the time-averaged image [11].
The main objective of this paper is to introduce stochastic moiré gratings into DVC schemes.The apparent simplicity of the problem is truly misleading.The stationary cover image must remain uninterpretable (the secret image should not be directly leaked from the stationary image).The secret image should be leaked in the time-averaged image when the cover image oscillates according to a pre-set amplitude of harmonic oscillations.Clearly, phase regularization and random initial phase shifting algorithms are not applicable for stochastic moiré gratings (the concept of the phase is lost in the set of pixels with random brightness).Moreover, changes in the contrast of stochastic images affected by motion blur are completely different from the mathematical point of view.As discussed in the previous section, DVC schemes with harmonic gratings are based on Bessel functions and the interplay of their roots.A completely new nomenclature has to be introduced in order to describe (and control) motion-induced blur for stochastic gratings.
Recently, the Wada index was introduced to measure the randomness of digital images that are more complex than fractal dichotomous basin boundaries of nonlinear dynamical systems [14].Since the stochastic DVC scheme is based on manipulation with pixels in separate rows (columns) of the cover image, the concept of the Wada index needs to be adapted to one-dimensional sets of pixels (Section 2.1).
The proposed DVC scheme based on stochastic moiré gratings is also based on the interplay between two gratings, where one grating is used to encode the background and the other grating is used to encode the secret.Unfortunately, as mentioned previously, the concept of the phase and the pitch is lost in stochastic moiré gratings.A completely new strategy is required to design those two stochastic gratings.
The basic principle of the DVC scheme must hold true.The first requirement is that the naked eye should not be able to interpret a secret embedded in the cover image.The second requirement is that the secret should be optically leaked from the time-averaged image when the cover image oscillates at a predefined amplitude of harmonic oscillations.
We will use the Wada index W 1 and the size of the one-dimensional observation window s helps reveal the complexity of the stochastic grating throughout multiple scales.This is absolutely necessary for the successful implementation of the two DVC requirements since the pitch of the stochastic grating is not defined.
In fact, it would be easy to construct stochastic moiré gratings if both DVC requirements would be constructed in an alternative (opposite) way.It is easy to construct such stochastic gratings where the secret is leaked in the stationary cover image.Then, the motion-induced optical blur in the time-averaged images would equalize both gratings, and the secret would not be recognizable in the time-averaged mode.
However, the formulated DVC requirements pose a serious challenge from both theoretical and computational perspectives.The Wada indexes for the two stochastic gratings should be almost identical in the static mode, while being as different as possible for the same stochastic gratings in the time-averaged mode.
Clearly, manual manipulations with the brightness of pixels cannot be expected to produce stochastic gratings that satisfy both DVC requirements simultaneously.Highend machine learning algorithms should be employed for this purpose.Moreover, the application of machine learning algorithms, including the cost functions and system of constraints, is highly nontrivial.Special additional requirements for the stochastic gratings should be formulated and efficiently implemented.

Requirements for Stochastic Gratings
Requirements for two stochastic gratings M 1 (x) and M 2 (x) are formulated in this section.Grating M 1 (x) will be used for the background; grating M 2 (x) will be used in the areas occupied by the secret information.

Requirements for
The standard deviation of the stationary grating M 1 (x) is as high as possible.This requirement is necessary to ensure that the brightness range of pixels used to construct the grating is as large as possible.

2.
The mean and standard deviation are approximately the same in any segment of the stationary grating M 1 (x).This requirement is necessary to ensure the consistency of the grating.

3.
The difference between the brightness of each pixel of the time-averaged grating M 1 (x, a) and the value 127.5 is as small as possible.This requirement ensures that the time-averaged image of the stochastic grating closely resembles a plain gray image.

Requirements for M 2 (x)
As mentioned previously, the static stochastic image represented by M 2 (x) should be as close as possible to the image represented by M 1 (x).On the other hand, the time- averaged image of M 2 (x) must be as different as possible from the time-averaged image of M 1 (x).

1.
The stationary grating M 2 (x) should be as similar as possible to M 1 (x).

2.
The mean of the stationary grating M 2 (x) is approximately the same as the mean of M 1 (x).Otherwise, the secret will be clearly visible in the static cover image.

3.
The standard deviation of the stationary grating M 2 (x) is approximately the same as the standard deviation of M 1 (x).This requirement is also crucial for hiding the secret in the cover image.4.
The Wada index of the stationary grating M 2 (x) is approximately the same as the Wada index of M 1 (x).This requirement defines the similarity of the secret and the background in multiple scales of the observation window.5.
The standard deviation of the time-averaged grating M 2 (x, a) is as high as possible.This requirement ensures that the area occupied by M 2 (x) is not transformed into a plain gray image in the time-averaged mode.6.
The mean, the standard deviation, and the Wada index are approximately the same in any segment of the time-averaged grating M 2 (x, a).This requirement ensures the consistency of the secret image in the time-averaged mode.

The Formulation of the Cost Functions
Let us consider that the spatial coordinate x is bounded by the limits of the onedimensional observation interval 0 ≤ x ≤ L.Moreover, let us assume that this observation interval comprises n grayscale pixels, and that coordinate x i , 1 ≤ i ≤ n is the center point of the i-th pixel.
Let us divide the observation interval into such q segments that each segment comprises exactly ν pixels (qν = n).

Notations of Statistical Characteristics
The following notations of statistical characteristics used in the construction of the cost functions are introduced:

•
The average brightness of the moiré grating M 1 (x) over the entire observation interval:

•
The average brightness of M 1 (x) in the k-th segment: • The standard deviation of the brightness of M 1 (x) over the entire observation interval: • The standard deviation of the brightness of M 1 (x) in the k-th segment:

•
The average brightness of M 1 (x, a) over the entire observation interval: • The average brightness of M 1 (x, a) in the k-th segment: • The standard deviation of the brightness of M 1 (x, a) over the entire observation interval: • The standard deviation of the brightness of M 1 (x, a) in the k-th segment: • The fourth central moment of the brightness of M 1 (x, a) over the entire observation interval:

The Formulation of the Cost Function F 1
The formulation of the cost function F 1 (M 1 ) (to be minimized) for the stochastic moiré grating M 1 (x) follows the set of requirements defined in Section 3.2.1: where k 1 , k 2 , k 3 are real positive weighting coefficients.
The larger the standard deviation of the 1D image M 1 (x) in the state of equilibrium, the smaller the term 127.5  σ (1) − 1.Note that the highest possible standard deviation of a digital image is equal to 127.5.Such a situation is possible when half of all pixels in the observation interval are black, and the other half are white.
2 tend to zero when the mean brightness and the standard deviation in all segments become approximately the same.The term µ (1) 4 is close to zero when the time-averaged grating M 1 (x) is continuously gray (the brightness of all pixels is close to 127.5).The power of 4 in Equation ( 19) prevents large fluctuations around 127.5.

The Formulation of the Cost Function F 2
According to the requirements listed in Section 3.2.2, the stationary stochastic grating M 2 (x) should not differ substantially from M 1 (x) (otherwise the secret would leak in the cover image).Therefore, M 2 (x) is constructed as the perturbation of M 1 (x).The perturbation is implemented in the form of additive noise: where ε is the array of integer corrections, ε ∈ [−C, C], where C defines the magnitude of the perturbation.The vector of corrections ε is constructed in such a way that the second cost function where k 1 , k 2 , k 3 , and k 4 are real positive weighting coefficients.The proportional weights of terms at k 2 , k 3 , and k 4 are similar.Therefore, the constraint k 2 = k 3 = k 4 is set in further computations (which also helps to reduce the computational complexity of the optimization process).The corrections ε are minimized because the stationary stochastic grating M 2 (x) should not be very different from M 1 (x).
It is clear that lower values of the correction vector ε result in a lower value of the term 1 n ∑ n i=1 ε i in the cost function F 2 (M 1 , ε).The terms m (1) − m (2) , σ (1) − σ (2) , and max tend to zero when the means, standard deviations, and maximal Wada indexes of the gratings M 1 (x) and M 2 (x) become similar.
Analogously, the higher the standard deviation σ (2) , the smaller the value of the term 1 σ (2) .Note that a higher value of σ (2) is required to ensure that the area occupied by M 2 (x) is not transformed into a plain gray image in the time-averaged mode. The (2,j) max 2 tend to zero when the mean brightness, the standard deviation, and the maximal Wada index in all segments of the time-averaged image M 2 (x, a) become similar.

Evolutionary Algorithms for the Optimization of Stochastic Gratings for Image Hiding Applications
It is clear that the complexity of the cost functions (Equations ( 20) and ( 22)) is so high that deterministic optimization algorithms should be replaced by evolutionary optimization algorithms.Since the particle swarm optimization (PSO) algorithm is widely considered to be a robust optimization algorithm with good properties of convergence [23], further construction of stochastic gratings is performed by means of PSO (though other soft computing algorithms are also used in image steganography [24]).PSO is an algorithm inspired by the social behaviors of animal groups [23,25].The initial version of the algorithm was proposed by J. Kennedy and R. Eberhart in 1995 [26].Since then, different modifications and new versions of the PSO algorithm were introduced [27].
A new parameter, called an inertia weight, incorporated into the original particle swarm optimizer, improved the performance of the original technique [28].The constriction coefficient introduced into the PSO algorithm enhance the convergence speed and improves the balance between global exploration and local exploitation [29].The sinecosine acceleration coefficients are introduced into the particle swarm optimizer in [30].A proportional factor based on the Nash equilibrium is incorporated in the PSO in [31].
Numerous new learning and searching strategies for different applications were incorporated into the PSO optimizer as well.The authors of [32] propose selectively informed PSO, in which the particles choose different learning strategies based on their connections.A new version of PSO based on several initializations in different zones of the search space (using charged particles) is presented in [33].A level-based multi-strategy learning swarm optimizer for large-scale multi-objective optimization is introduced in [34].A multi-swarm particle swarm optimization algorithm using an adaptive factor selection strategy is described in [35].
The constricted PSO algorithm was employed in further investigations.Note that the constricted PSO enables the avoidance of early convergence and swarm explosion [23,25].Information about each particle i is stored in n-dimensional vectors P i , Q i , and V i , representing the current location, the previous best position, and the current velocity of the particle, respectively.Vector Gb denotes the position of the best particle.In each j-th iteration, particle i updates its position and velocity according to the following iterative equations [25,27,29]: where ϕ 1j and ϕ 2j are random numbers uniformly distributed in (0, 1); coefficient c 1 pulls the particle towards the position where it has the best fitness, while c 2 propels the particle towards the current best particle; χ is the constriction coefficient Parameter κ controls the exploitation and exploration abilities of the swarm.If κ is close to 0, then the convergence is faster with local exploitation, and if κ approaches 1, then the convergence is slow with a higher degree of exploration [27].
We set c = 4.1 as the convergence is quick and guaranteed at c > 4 [23,27].The parameters c 1 and c 2 are set to be equal (c 1 = c 2 = 2.05) [27,36].We use κ = 0.7 in our computations.Thus, the value of the constriction coefficient is set to χ ≈ 0.5109.
Let us consider the stochastic grating consisting of 100 pixels.Then, the computational optimization of the cost function F 1 (M 1 ) in Equation ( 20) yields the near-optimal stochastic moiré grating M 1 (x) (Figure 4a).Unsurprisingly, the time-averaged image M 1 (x, 5) is almost a plain image (Figure 4a).Note that the scale of x and the amplitude of oscillations in M 1 (x, 5) are defined in terms of discrete pixels (the amplitude is set to cover the distance equal to five adjacent pixels).

The variation of W (s)
1 for the static stochastic grating M 1 (x) is almost linear with respect to s and reaches 77.11 at s = 100 (Figure 4c).However, the variation of the Wada index W (s) 1 for the time-averaged grating M 1 (x, 5) only reaches 4.94 (Figure 4c).Such an effect is caused by the blur induced by the harmonic oscillations of the time-averaged image.
The optimization of the cost function F 2 (M 1 , ε) in Equation ( 22) yields the near-optimal perturbed stochastic moiré grating M 2 (x) (Figure 4d).However, M 2 (x) is not transformed into a plain image in the time-averaged mode (Figure 4d).This is predetermined by the structure of the cost function F 2 (M 1 , ε), where (M 2 (x) is similar to M 1 (x), but time- averaged effects produced by M 2 (x) and M 1 (x) are substantially different).
Note that W (s) 1 for M 2 (x) is almost identical to M 1 (x) in the static mode (Figure 4c,f).However, W (s) 1 for M 1 (x, 5) and M 2 (x, 5) are very different (panels (c) and (f) in Figure 4).Such optical effects build the foundation for the construction of the dynamic visual cryptography scheme based on stochastic moiré gratings.The optical representations of M 1 (x) and M 1 (x, 5) are depicted in panel (b).Wada indexes W (s) (1) max = 5.1).The optimal grating M 2 (x) is shown in panel (d); µ 2 = 127.9,σ 2 = 66.2.The statistical characteristics of the time-averaged grating M 2 (x, 5) read as follows: µ 2 = 127.9,σ 2 = 8.6.The optical representations of M 2 (x) and M 2 (x, 5) are depicted in panel (e).Wada indexes W (s) In general, the optical effects illustrated in Figure 4 are strongly counterintuitive.The motion-induced blur makes the time-averaged images more similar, not vice versa.This fact is illustrated in Figure 5.Note that the DVC scheme developed in this paper is based on completely different optical effects than demonstrated in Figure 5.
(Baboon) max = 57.1,ω (Baboon) max = 37.1).Note that one-dimensional images are very different in the static mode, but become similar in the time-averaged mode.The DVC scheme developed in this paper is based on a completely different optical effect.

The DVC Scheme Based on Stochastic Moiré Gratings
Let us consider a two-dimensional dichotomous secret image of size n y × n x (with n y rows, each containing n x pixels).The main steps of the proposed scheme are shown in Figure 6.In the preprocessing step (STEP 1), two near-optimal stochastic gratings (M 1 and M 2 ) must be generated.Both gratings M 1 and M 2 are computed using the PSO algorithm (the detailed pseudo-code and flowchart of the PSO algorithm are described in [23]).Note that both near-optimal stochastic gratings M 1 and M 2 are constructed only once and can be reused to encode any secret dichotomous image.
The encoding of the two-dimensional secret dichotomous image (STEP 2) is implemented by a straightforward combination of two-dimensional stochastic gratings M 1 and M 2 .The pixels containing the secret information are covered by M 2 (the background is covered by M 1 ).
The decoding of the secret information (STEP 3) can be performed visually [9,11] or by using computational simulation [9].Visual decoding lies in the essence of DVC; complex algorithms are required to encode the secret, but the decoding of the secret does not require a computer.In our case, the cover image should oscillate in a given direction with a given amplitude; the naked eye is sufficient to interpret the secret image [11].However, computational simulations could also be used to decode the secret.The additive superposition of a sufficient number of identical copies of the cover image deflected from the state of equilibrium according to the harmonic motion law with a given amplitude results in the interpretable secret image [9].Note that all illustrations of the decoded secret images in this paper are constructed using computational decoding algorithms.
The preprocessing step appears to be the most computationally intensive stage of the encoding process.Let us suppose that the swarm size used in the PSO algorithm is preset to N particles.A comprehensive discussion about the swarm size can be found in [39] (we used N = 1000 in our computations).Five multiplications and four additions per particle per dimension are required for one iteration of the PSO algorithm to update the particle's velocity [40].One "addition" operation per particle per dimension is also required to update the particle's position (Equation ( 23)) [40].Overall, 10Nn x arithmetic operations are required for the whole swarm of N particles with dimension n x for one iteration of the PSO algorithm (for the one-dimensional grating).This number of operations results in an algorithmic complexity of O(n x ) per iteration for the one-dimensional stochastic grating.The computational complexity of one evaluation of the cost-functions F 1 (M 1 ) and x per iteration of the PSO algorithm (for the one-dimensional grating).Although the computations described in STEP 1 are time-consuming, two-dimensional stochastic gratings are constructed only once and can then be reused for encoding any secret dichotomous image of size n y × n x .Computational decoding requires the arithmetic superposition of the encoded image per one period of harmonic oscillations, resulting in a complexity estimate of O(n x ).
The DVC scheme based on the stochastic moiré gratings is illustrated in Figure 7.The resolution of the cover image is set to 300 × 180 pixels.Moreover, 180 copies of nonidentical near-optimal one-dimensional moiré gratings M 1 (x) constitute the static image in panel (a) of Figure 7.The time-averaged image M 1 (x, 5) yields an almost plain gray image (Figure 7a).Moreover, 180 copies of non-identical near-optimal one-dimensional moiré gratings M 2 (x) constitute the static image in Figure 7b.The time-averaged image M 2 (x, 5) in panel (b) is very different from M 1 (x, 5) in panel (a).
The dichotomous secret image is depicted in panel (c).The static digital image in Figure 7a is used for the construction of the background of the cover image; the static digital image in Figure 7b is used to fill the regions occupied by the secret.The resulting static cover image is depicted in Figure 7d.Note that the secret is uninterpretable to the naked human eye (due to the optimization of M 1 (x) and M 2 (x)).However, the time-averaged cover image yields the secret (Figure 7d).

The Comparison between the Proposed Technique and Classical DVC Schemes
The proposed DVC technique based on stochastic gratings is compared with two classical DVC schemes.The static cover image produced by the DVC scheme based on the harmonic moiré gratings [9] is depicted in Figure 8a.The static cover image produced by the DVC scheme based on the dichotomous black and white gratings is shown in Figure 8b.Note that the embedded secret information is exactly the same as in Figure 7.
Harmonic oscillations with amplitude a = 5 are used to decode the secret for both schemes (Figure 8a,b).The same pitches λ 1 = 2πa r 1 = 13.06 (Equation ( 10)) and λ 2 = 0.9 • λ 1 = 11.75 are used for the harmonic and dichotomous gratings.Pitch λ 1 is used for the background image; pitch λ 2 is used for the areas occupied by the secret image.One of the main features used to characterize the quality of the decoded image in visual cryptography is the difference between the standard deviation of the pixels in the background of the decoded image and the standard deviation of the pixels in the areas of the secret image [41].This difference in standard deviations defines the contrast and visual interpretability of the decoded secret.The corresponding calculations are presented in Table 1.The contrast of the decoded image produced by the proposed scheme is lower compared to the classical DVC scheme based on the harmonic moiré grating.On the other hand, the major advantage of the proposed scheme is its robustness to statistical analysis algorithms (Table 1).

Concluding Remarks
A novel DVC scheme based on the stochastic moiré gratings is proposed, discussed, and illustrated in this paper.The proposed scheme is based on a counter-intuitive optical feature of time-averaged moiré gratings, when similar images in the static mode become very different in the time-averaged mode.
Special cost functions and a complex system of constraints were developed for the computation of the moiré gratings used for the background and the representation of the secret.The defined optimization problem is very complicated, and near-optimal soft computing algorithms are used for the construction of two planar images.
The proposed DVC scheme is a typical VC scheme.Complex computational algorithms are required for the construction of the cover image.However, a computer is not required to decrypt the embedded image.The decryption process is completely visual.The cover image must oscillate in a predefined direction and at a predefined amplitude (the amplitude of harmonic oscillations is one of the parameters of the proposed image's hiding scheme).Computational experiments were used to demonstrate the efficacy of the proposed optical DVC scheme based on the stochastic moiré gratings.
As mentioned in the introduction, classical DVC schemes are based on harmonic moiré gratings with slightly different pitches.The proposed DVC scheme based on the stochastic moiré gratings provides a serious advantage compared to DVC schemes based on harmonic gratings.It is interesting to observe that this advantage in the security of the scheme is achieved without compromising the quality of the decrypted secret in the timeaveraged cover image.Moreover, the developed DVC scheme based on the stochastic moiré gratings provides a foundation for different extensions and a large variety of experimental applications.DVC schemes based on the stochastic moiré gratings and chaotic oscillations, as well as building experimental prototypes for testing the human visual system, will remain definite objectives of future research.

• s -
The length of the 1D observation window measured in the number of pixels; s ≥ 2. • c-The number of different grayscale levels in the 1D observation window; c ≥ 1. • ν k , k = 1, 2, . . ., c-The number of k-th color pixels in the 1D observation window.• p k = ν k s 2 , k = 1, 2, . . ., c-The discrete probability of the k-th color in the 1D observation window.• The indicator function 1 (s)

Figure 1 .
Figure 1.Optical time-averaging effects induced by harmonic oscillations on a periodic moiré grating (λ = 0.5).Time-averaged moiré gratings are depicted in the left panel at increasing values of amplitude a (the numbering on the right boundary of the panel corresponds to the consecutive order of the time-averaged fringe).Time-averaged moiré gratings, their optical representations, and their Wada indexes W (s) 1 are shown at a = 0 (panel (a)), a = λr i 2π (panel (b)), and a = 0.3 (panel (c)).

Figure 2 .
Figure 2. A schematic illustration of the DVC scheme based on two harmonic moiré gratings.Two moiré gratings (M 1 (x) and M 2 (x)) with slightly different pitches (depicted in panels (a,c)) are used to represent the background and the secret (the circle); their optical representations are shown in panels (b,d).The static and time-averaged cover image is shown in panel (e).The amplitude of harmonic oscillation a is chosen in such a way that the time-averaged moiré fringe is not fully developed in the area occupied by the secret image.
depicted in Figure 3a.The time-averaged random moiré grating M(x, a) at a = 0.4, its optical representation, and the Wada index W (s) 1 are depicted in Figure 3b.The higher the value of the amplitude of harmonic oscillations, the larger the motion-induced optical blur, and the lower the maximum value of the Wada index W (s) 1 in the time-averaged image (Figure 3b,c).

Figure 3 .
Figure 3. Harmonic oscillations of a random moiré grating produce optical motion-induced blur in the time-averaged image.Time-averaged random moiré gratings are depicted in the left panel at increasing values of amplitude a. Time-averaged random moiré gratings, their optical representations, and their Wada indexes W (s) 1 are shown at a = 0 (panel (a)), a = 0.4 (panel (b)), and a = 0.8 (panel (c)).
the randomness of the stochastic moiré gratings.The relationship between W (s)

STEP 1 :STEP 2 :Figure 6 .
Figure 6.The main steps of the proposed scheme.

Figure 7 .
Figure 7.The DVC scheme based on the stochastic moiré gratings.The resolution of the cover image is set to 300 × 180 pixels; 180 copies of non-identical near-optimal one-dimensional moiré gratings M 1 (x) constitute the static image in panel (a).The time-averaged image M 1 (x, 5) yields an almost plain gray image (panel (a)); 180 copies of non-identical near-optimal one-dimensional moiré gratings M 2 (x) constitute the static image in panel (b).The time-averaged image M 2 (x, 5) in panel (b) is very different from M 1 (x, 5) in panel (a).The dichotomous secret image is depicted in panel (c).The static cover image containing the embedded secret is shown in panel (d).The time-averaged image of the cover image yields the secret.

Figure 8 .
Figure 8.The stationary cover image and the decoded secret image produced by the different DVC schemes.The DVC scheme based on the harmonic moiré gratings is used to encode and decode the secret information in panel (a).The DVC scheme based on the dichotomous moiré gratings is depicted in panel (b).

Table 1 .
The comparison of the proposed scheme with classical DVC schemes (the DVC scheme based on harmonic moiré gratings (Scheme A), and the DVC scheme based on dichotomous moiré gratings (Scheme B)).