# A Size-Controlled AFGAN Model for Ship Acoustic Fault Expansion
## 3 The Size-Controlled AFGAN
### The Information Entropy Equivalence Principle  
The GAN model generates expanded samples by capturing the potential distribution of real samples. From the point of information theory, the information contained in the expanded samples should be equal to the information provided by the real samples. The \"information hedge\" problem  
Figure 1: The Acoustic Fault Generative Adversarial Network (AFGAN) architecture.  
during the acoustic fault sample expansion process can be explained as an issue that the amount of the information of the expanded samples is more or less than that of the real samples, which leads to the distortion of expanded samples. Therefore, to avoid the \"information hedge\", it is necessary to ensure that the same amount of information is contained in both two sample sets, and thus the size of the expanded samples can be optimized.  
Information entropy is employed to measure the amount of information contained in the fault samples. Assume the real sample set and the generated sample set are \(X=x_{1},x_{2},...,x_{M}\) and \(gX=G(z_{1}),G(z_{2}),...,G(z_{N})\), respectively, where \(x_{i}\in\mathbb{R}^{p}\), \(z_{i}\in\mathbb{R}^{Q}\). The discriminator outputs the probabilities of the input samples belonging to the real samples. For sets \(X\) and \(gX\), their outputs after the discriminator are \(D(x_{i})\) and \(D(G(z_{j}))\), respectively.  
For the real samples, the information entropy [21] of the sample \(x_{i}\) can be calculated with  
\[Hx_{i}=-D(x_{i})logD(x_{i})-(1-D(x_{i}))log(1-D(x_{i})). \tag{1}\]  
Thus, the amount of information of the real samples set \(X\) is  
\[HX =\frac{1}{N}\sum_{i=1}^{M}Hx_{i} \tag{2}\] \[=-\frac{1}{M}\sum_{i=1}^{M}[D(x_{i})logD(x_{i})+(1-D(x_{i}))log(1- D(x_{i}))].\]  
Equation (2) denotes the average information entropy of the real sample set.  
For the expanded sample set, the samples are rearranged in descending order of \(D(G(z_{j}))\), and the rearranged samples are \(gX_{sort}=G(z_{i1}),G(z_{i2}),\ldots,G(z_{iN})\), where \(1\geq D(G(z_{i1}))\geq D(G(z_{i2}))\geq...\geq D(G(z_{iN}))\geq 0\). The average information entropy of the first \(K\) expanded samples can be calculated with  
\[H(gX(K)) =H(gX_{sort}(K)) \tag{3}\] \[=-\frac{1}{K}\sum_{i=1}^{K}[D(G(z_{i_{k}}))logD(G(z_{i_{k}}))+(1- D(G(z_{i_{k}})))log(1-D(G(z_{i_{k}})))].\]  
According to the principle of information entropy equivalence, we need to find an expansion subset with size \(K^{*}\), so that the information entropy difference between the subset and real sample set reaches the minimum, which is  
\[K^{*} =argminL_{SIZE}(G) \tag{4}\] \[=\underset{K=1,...,N}{argmin}|H(X)-H(gX(K))|\] \[=\underset{K=1,...,N}{argmin}|-\frac{1}{M}\sum_{i=1}^{M}[D(x_{i} )logD(x_{i})+(1-D(x_{i}))log(1-D(x_{i}))]+\] \[\frac{1}{K}\sum_{i=1}^{K}[D(G(z_{i_{k}}))logD(G(z_{i_{k}}))+(1- D(G(z_{i_{k}})))log(1-D(G(z_{i_{k}})))].\]  
Equation (4) shows that a smaller \(L_{SIZE}(G)\) implies that the two information entropy is more likely to be equivalent. In other words, the smaller the \(L_{SIZE}(G)\), the more equal the information amount of the subset and real sample set, which is useful for the sample size control.