In this paper, we elaborate the complete construction logic and mathematical derivation of the proposed SCGAN-MultiJNet-Based multi-modal MRI brain tumor image synthesis framework. We first unify the mathematical symbolic expressions of the generative network mapping relationship, model parameters and feature transformation operations, so as to provide a standardized mathematical basis for subsequent latent space disentanglement and network structure design. After clarifying the general model definition, we successively introduce the core latent space decoupling mechanism and the overall two-stage network architecture of SCGAN-MultiJNet, and detail the internal sub-module structure, loss function and end-to-end image generation pipeline of the model. All mathematical formulas, network layers involved in this chapter are derived and designed for the multi-modal missing and insufficient diversity problems of brain tumor MRI data.
3.2. Shape and Color Semantic Disentanglement Based on Latent Space Representations
Shape and color are two relatively core visual features in images. By separating the noise spaces that govern shape and color features, the entanglement between these characteristics can be reduced. This explicit disentanglement allows each subspace to focus on encoding variations in a specific dimension: shape features can be independently optimized to capture richer differences in contours and structures (e.g., morphological properties such as the area and roundness of brain structures), while color features can concentrate on multi-level combinations of grayscale values and signals (e.g., lesion brightness and grayscale distribution across brain regions). Independent variations in the two features can be combined to generate more diverse outputs, thereby directly enhancing the diversity of synthesized samples.
To achieve direct semantic disentanglement of shape and color features, we explicitly decompose the Gaussian noise space into two independent sub-spaces: the shape noise subspace
Zshape and the color noise subspace
Zcolour. Corresponding fully-connected modules
Fs and
Fc are designed for each subspace to perform disentangled mapping from the noise space to the latent space. Specifically, the shape noise vector
zshapeϵ
Zshape is mapped via
Fs into the shape latent vector
ϖshapeϵ
Wshape, which exclusively encodes geometric features such as brain tumor contours and topological structures. Similarly, the color noise vector
zcolourϵ
Zcolour is mapped via
Fc into the color latent vector
ϖcolourϵ
Wcolour, which exclusively represents color-related characteristics of MRI images, including pixel intensity and tone. The two independent fully-connected modules are designed without parameter sharing or feature interaction, enabling latent space to be decomposed as directsum
L=
Wshape⊕
Wcolour. This design guarantees the independent encoding of shape and color features at the mapping level, thereby achieving precise direct semantic disentanglement. The generative network model may be formulated as:
where
;
;
stands for the shape latent embedding layer, and
corresponds to the color latent embedding layer.
For the shape noise subspace
Zshape and color noise subspace
Zcolour, samples are drawn from Gaussian distributions. This design allows the brain tumor medical images generated by SCGAN-MultiJNet to maintain smooth transitions within shape or color modalities, while expanding diversity through cross-subspace combinations, thus balancing smoothness and diversity (See
Figure 2). The noise vectors corresponding to the shape and color semantics are denoted as:
.
Currently, most studies on semantic disentanglement mainly focus on qualitative analysis via visualizing latent representations. In the following, we derive metrics and methods for semantic disentanglement based on its fundamental principles.
Given a set of semantics
for an image
I, where each
si is a function of
I, i.e.,
si=
si(
I). According to Formula (3), the functional relationship between
si and the latent vector
can be obtained and expressed as Formula (4):
If the joint distribution of the semantics
satisfies the following condition:
then
are statistically independent.
Proposition 1.
(Sufficient Condition for Statistical Independence) Let denote a latent feature vector whose components are mutually independent. Let the set of semantic factors be, where each semantic component satisfies
=, i=1K. We define the difference set matrix as follows:
where
.
If each row ofcontains exactly K-1 sets equal to, and each column contains at least one set not equal to, thenare Statistical independent.
Proof. Introduce the notation,abbreviated as for . For any two latent vectors and satisfyingwhenever. we now prove that .
Let
denote the component indices where vectors
and
take unequal values, i.e.,
. Then we have:
Since, it follows that , i.e., . Thus:
Proceeding recursively, we obtain:
Similarly:
We can derive the following sequentially:
Consequently,and become equal component-wise, leading to.
It follows that the value of depends only on the components in and is independent of all components in. Thus, the functioncan be reduced towith, i.e.,.
Next,we prove that the Formula (5) holds:.
For any values
, we have
Since,andare pairwise disjoint, the variablesare independent. It follows that
Thus,holds, i.e., are statistically independent. □
As shown in Proposition 1, we have that may effectively explain. Its practical meaning is that adjusting the values of components incontrols the output ofwithout affecting the values of other functions in S, which achieves semantic disentanglement for S.
According to Proposition 1, we know that form a K-partition of the set . Therefore, we use the properties of the K-partition to characterize the degree of coupling among and perform semantic disentanglement. The two sets andmay be approximately described by the following Statement 1:
Statement
1. If for, the values inare far from zero, and conversely, for, the values inare nearly equal to zero, then the degree of coupling amongis low.
Next, to eliminate the influence of sign and magnitude, we define the relative change rate:.
The larger the expectation of, the stronger the explanatory power ofon; conversely, the weaker the explanatory power.
For a
K-partition
, we propose a disentanglement metric based on the relative change rate, denoted by Formula (6):
To find the optimal partition and thus achieve semantic disentanglement of S, We propose a latent disentanglement pipeline based on relative change rate, detailed as follows.
Step 1: Set initial conditions. Define the set of semantics ; the latent feature vector ; the latent vector partition ratio; the dimension n of the noise vector; the mapping network F; the generator network G; the smoothing constant; and the sample size N.
Step 2: Sample noise vectors. Independently sample N times from the -dimensional standard Gaussian distribution to obtain the noise vector samples.
Step 3: Compute latent vectors and semantic representations. Using the mapping network F, compute the latent vector samplescorresponding to the noise vector samples, where. Then compute the semantic representations corresponding to each latent vector as,for any.
Step 4: Perturb each component of the latent vector samples. For each component
of the latent vector samples
, perform random perturbation. The perturbed samples for component
are denoted as:
where
, and
is a
T-dimensional vector with the
j-th component equal to the
j-th component of
and all other components equal to 0.
Step 5: Compute perturbed semantic representations. Compute the semantic representations corresponding to the perturbed latent vectors:
Step 6: Compute the relative change rate.
Step 7: Normalize the relative change rate.
Step 8: Compute the sample mean of the relative change rate.
Step 9: Select explanatory latent vector components for each semantic. For each semantic, sort the sample mean valuesin descending order, and select the topcomponents to form the set.
Step 10: Compute the RRCI metric.
The above disentanglement algorithm based on the relative change rate achieves effective disentanglement of shape and color features in the latent space, addressing the insufficient diversity problem of medical images generated by conventional Gans. In this work, we select the circularity attribute (for foreground shape semantics) and the brightness attribute (for color semantics) as disentanglement targets, whose calculation methods are given by Formula (7) and Formula (8), respectively. Circularity reflects how close the foreground is to a perfect circle, while brightness measures the signal intensity of the foreground region.
where
represents the enclosed area, and
corresponds to the closed perimeter of the maximum-area external contour derived from input image
I. We acquire this contour via Gaussian blurring and subsequent Otsu threshold segmentation operations.
is the binary foreground mask generated by the identical preprocessing pipeline;
counts all pixels within the mask, and
refers to the normalized intensity of pixel at spatial coordinate
.
In the disentanglement experiments, we concatenate the 50-dimensional shape latent vector
ϖcolour and the 64-dimensional color latent vector
ϖcolour to form a 114-dimensional latent vector. The SCGAN (detailed in
Section 3.2.) is adopted as the generator network, with a sample size of 1024. The top 10 components, ranked by the sample mean of the relative change rate, are selected as the disentangled latent vector components for circularity and brightness.
Figure 3 and
Figure 4 plot the relative change rates of each component in the 114-dimensional latent feature vector with respect to circularity and brightness, constructing semantic index distribution maps to verify the disentanglement effect of circularity and brightness semantics in the latent feature space. The experimental results show that components with high impact on circularity semantics are concentrated in the first 50 dimensions, which dominate significant variations in the regularity of brain shape. In contrast, components with high impact on brightness semantics are distributed in the subsequent 64 dimensions. This distribution pattern demonstrates the effectiveness of decomposing the latent vector into shape and color vectors: the model successfully disentangles the shape semantics from color semantics in the latent space, and editing of both semantic attributes can be achieved by selecting the top 10 high-impact components for each. Furthermore, the
RRCI for circularity and brightness semantics are calculated to be 0.7564.
Figure 5 and
Figure 6 visualize the disentanglement effect of brain region circularity and brightness semantics in the latent feature space, achieved by independently editing the selected top 10 core latent components for circularity and brightness. In the circularity editing experiment, modifying the top 10 circularity-specific components increased the brain region circularity from 0.5815 to 0.7196, corresponding to a relative change rate of 23.75%, indicating a significant variation in the shape regularity of the brain region. Meanwhile, brightness only fluctuated slightly from 0.3882 to 0.3688, with a change rate of -4.99%, showing negligible variation. In the brightness editing experiment, modifying the top 10 brightness-specific components caused the brain region brightness to drop drastically from 0.6729 to 0.3453, with a relative change rate of -48.68%, reflecting a substantial reduction in signal intensity. In contrast, the brain region circularity only slightly changed from 0.8182 to 0.7859, with a change rate of -3.95%.These results directly demonstrate that the control of the two semantic attributes—brain region circularity and brightness—is relatively independent.