Feasibility study of unsupervised anomaly detection using Wasserstein GAN in SPECT image Authors: Ryosuke Kasai, Hideki Otsuka Published: 2025 ABSTRACT AbstractPurposeIn this study, we constructed an anomaly detection system based on the Wasserstein generative model in brain single-photon emission computed tomography (SPECT) images, and conducted a basic study on the feasibility of the system.MethodsThe proposed method used a Wasserstein generative adversarial network approach based on optimal transport theory. Anomaly detection was performed using only healthy images, and based on the anomaly score calculated from the loss function. Theoretical validation was performed using a numerical phantom which simulated medical image with varying image noise and signal levels. The results were evaluated with receiver operating characteristic curves and area under the curve (AUC). Brain SPECT images from clinical scenarios were used to investigate the feasibility of this system through subtraction images and various quantitative evaluations.ResultsThe numerical phantom showed the relationship between the noise and signal values of the system, and the anomaly detection ability based on the anomaly score value indicated an AUC of 0.9994. The correlation between the anomaly score and the anomaly image was confirmed in the brain SPECT image, and the detection region was clearly observed in the difference image.ConclusionWe proposed and investigated the feasibility of an anomaly detection system based on the Wasserstein generative model. Its effectiveness is expected to reduce the workload of human operators.Keywords: Anomaly detection, Wasserstein generative adversarial networks, Wasserstein distance, Machine learning, Single photon emission computed tomography Introduction Anomaly detection plays a vital role in diagnostic imaging and the evaluation of pathological conditions in medical imaging [1]. Rule-based processes are often insufficient for accurately identifying disease or anomalous regions in target images; in contrast, machine learning can assist radiologists with diagnosis [2]. However, the application of machine learning to anomaly detection presents several challenges. In nuclear medicine examinations, accumulation patterns are highly complex and vary across different disease. Therefore, collecting the same number of uniformly defined anomaly images as healthy images (images with no accumulation) is not an easy task [3, 4]. Anomaly detection for differentiating healthy images from anomaly images cannot be achieved successfully if a sufficient number of anomaly healthy images cannot be obtained as training images for machine learning. Moreover, supervised machine learning approaches requires adding labels to all images even if the same number of anomalous and healthy images are obtained. Most of this complex and extremely time-consuming task is performed by human operators [5–7]. In this study, the anomaly class is defined as images presenting radiotracer accumulation in regions where accumulation is not expected (healthy classes). However, patient variations and image noise can make distinguishing between these the two classes challenging [8]. The classification problem in anomaly detection can be approached using two models: discriminative models, which search for linear or nonlinear boundaries between classes, and generative models, which aim to characterize the distribution of each class. Discriminative models struggle to define boundaries effectively when the amount of training data is limited, and they often fail to classify unseen data correctly. Conversely, generative models may fail to capture the full diversity of class distributions, particularly when the generated image quality is insufficient [9, 10]. Constructing a model that can generate high-quality images is expected to overcome the above limitations and enable effective anomaly detection in nuclear medicine images. In addition, only few experiments have focused on anomaly detection using nuclear medicine imaging. Therefore, in this study, we constructed an anomaly detection system based on the Wasserstein generation model for brain single-photon emission computed tomography (SPECT) images among nuclear medicine images. We aimed at a basic study of the feasibility of the proposed system. This study employed anomaly detection based on the generative adversarial network AnoGAN [11]. AnoGAN, a widely used method for anomaly image detection, was the first approach to apply generative models for anomaly detection. AnoGAN detects anomalies using a generator trained to produce only healthy images. In addition, AnoGAN introduces a loss function capable of computing anomaly scores by quantifying the differences between the input and generated images. Anomalous regions can also be visualized by highlighting the differences between the generated healthy images and the input anomalous images. Providing a basis for judgment is vital in diagnostic imaging. However, the GAN used in AnoGAN has several limitations, including unstable training, which can hinder its ability to represent small structures in brain SPECT images [12–17]. To address these issues, the present study employed Wasserstein GAN (WGAN), which incorporates the Wasserstein distance based on the optimal transport theory, for anomaly detection. The Wasserstein distance serves as a measure of dissimilarity between images and improves the training stability and performance of the original GAN [18]. We hypothesized that this approach would enable the high-quality nuclear medicine images and facilitate more accurate detection. Several methods have been proposed to improve the computational efficiency and image quality of GAN-based approaches following the introduction of AnoGAN [19–23]. However to our knowledge, no studies have applied these approaches to detect anomalies in nuclear medicine images using both numerical phantoms and clinical data. Moreover, the relationship between noise specific to nuclear medicine images and signal values in abnormal regions remains unclear in the context of anomaly detection, particularly given the various factors introduced by differences in scanning conditions. Therefore, in this study, we employed WGAN for anomaly detection and conducted a basic feasibility study to evaluate its performance across various noise and signal levels. Numerical phantoms were used to focus solely on noise and signal characteristics, without the confounding effects of body motion or imaging artifacts. The results obtained from the numerical phantoms provide a theoretical foundation for applying anomaly detection in brain SPECT imaging. To assess whether these findings generalize to real-world nuclear medicine images, we further applied the method to clinical SPECT data. The results demonstrated consistency between the numerical phantom experiments and the theoretical predictions, and the approach also performed successfully with clinical data. Methods This section presents the system used for anomaly detection in brain SPECT images. The system consisted of two parts. An overview of the study is illustrated in Fig. 1. The system consists of two components: one that learns only healthy images (blue block) and another that detects anomalous images (red block). Each input is a 2D slice image. The performance of the system was first validated using numerical phantoms with varying noise and signal levels and subsequently evaluated using SPECT images acquired from clinical data The primary objective of this study was to generate high-quality images using the generative model system WGAN-GP (blue block shown in Fig. 1). The images to undergo anomaly detection were input (red block Fig. 1), and their detectability was evaluated. WGAN In the true dataset and the generated dataset , we considered equating to . We first need to quantitatively measure the distance between datasets to equate two datasets and . In the adversarial model approach, the concept of measuring distance is to prepare a classification model that determines whether the data is an element of or . f is optimized to produce a high value for points in and a low value for points in . If the discriminant f leads to a low-value result, it indicates that the data points are close to . In contrast, If a function cannot discriminate between points in and , then the two-point groups are indistinguishable, and we can conclude that the distances are equal. Samples with a probability distribution p(z) defined in some space that are true data are transformed using model in the framework of generative models to obtain the true data. The problem can be summarized by designing a model that outputs the likelihood data from noise , where the input z is noise. However, calculating the likelihood of this model is extremely difficult owing to the presence of unknown functions within the model. Therefore, a training framework minimizes distance estimation (MDE) between the generated model and the true data distribution [24, 25]. MDE is a framework that uses the distance d of a probability distribution to estimate the parameter , which is the closest to the true data distribution. This approach has been used in medical image reconstruction and denoising procedures with satisfactory results [26, 27]. In addition to a generator g that generates data from noise, GAN employs a discriminator to determine whether a given sample is generated by the generator or drawn from the true data distribution. The MDE used in GAN is expressed as: where denotes expected value [12]. Equation (1) is equivalent to the Jensen–Shannon (JS) divergence, which serves as the loss function in GAN. Consequently, GAN can be interpreted as performing MDE using JS divergence. However, the discriminator in GAN is a piecewise constant function, resulting in zero gradients at most points. This causes the well-known problem of gradient vanishing, which hinders generator training. Moreover, mode collapse may occur, where the discriminator becomes overfitted and the generator repeatedly produces the same limited set of outputs [18, 28]. In contrast, WGAN addresses these stability issues by replacing the JS divergence with the Wasserstein distance in the MDE framework. The Wasserstein distance, particularly in its dual form, is derived using the following equation: The Wasserstein distance ensures that the distance between distributions remains well-defined even when their supports are disjoint, thereby mitigating issues such as gradient vanishing and mode collapse. Arjovsky et al. [18] proposed weight clipping to enforce the 1-Lipschitz constraint on the discriminator. However, Gulrajani et al. [28] demonstrated that weight clipping can lead to gradient vanishing and may restrict the discriminator to learning overly simplistic functions. To address these limitations, the present study employed WGAN with gradient penalty (WGAN-GP), which replaces weight clipping with a gradient penalty as an alternative means of maintaining the 1-Lipschitz property. WGAN-GP is derived using the following equation: where denotes the weight applied to the gradient penalty [28]. In Equation (3), the first two terms estimate the Wasserstein distance between the true and generated data distributions, while the last term enforces the 1-Lipschitz constraint via a gradient penalty. This formulation allows the critic f to output unbounded real values rather than probabilities. Consequently, f provides meaningful gradients for updating the generator, even when the distributions have little or no overlap, which prevents the incidence of gradient vanishing. Several reports have demonstrated that WGAN-GP produces higher-quality images than the original GAN [18, 28]. AnoGAN This section provides an overview of AnoGAN, based on the fundamental concept of anomaly detection using generative models. The AnoGAN procedure consists of the following steps: Random noise is input to the generator to produce an image. The discriminator then distinguishes between real and generated images. At this stage, a GAN model is trained using only healthy images. Random noise is input to the generator to produce an image. The discriminator then distinguishes between real and generated images. At this stage, a GAN model is trained using only healthy images. An anomalous image is input into the trained GAN model. Since the generator has learned only healthy images, it attempts to approximate the anomalous image but fails to reproduce its abnormal features. An anomalous image is input into the trained GAN model. Since the generator has learned only healthy images, it attempts to approximate the anomalous image but fails to reproduce its abnormal features. If a healthy image is input to the model, the trained GAN model can successfully generate a similar image. If a healthy image is input to the model, the trained GAN model can successfully generate a similar image. AnoGAN detects anomalies by evaluating the similarity between the input image and the generated image. AnoGAN detects anomalies by evaluating the similarity between the input image and the generated image. By training a GAN exclusively on healthy images, the model acquires the ability to represent healthy image features without explicitly defining them. The trained model can generate realistic healthy images, but fails to reproduce abnormal images due to its limited training scope. This discrepancy enables AnoGAN to discriminate between healthy and anomalous images based on the quality of the generated outputs. As high-quality image generation is critical for improving AnoGAN’s anomaly detection performance, WGAN-GP was adopted as the generative model in this study. Furthermore, AnoGAN incorporates a loss function to guide the learning process for distinguishing between healthy and anomalous images. The loss function of AnoGAN is defined as follows: where Here, is a parameter controlling the balance between the residual loss and discrimination loss; in this study, we used values of 0.1 and those reported by Schlegl et al. [11]. AnoGAN uses the loss defined in Eq. (4) as the anomaly score for all generated images. A larger anomaly score indicates a greater deviation from the training images (defined as healthy), meaning the image is more likely to be anomalous. Conversely, a smaller anomaly score suggests the image is very similar to healthy data. AnoGAN also allows users to set a threshold for the anomaly score, classifying images with scores above the threshold as anomalies and those below as healthy. Experiments Computer simulation using numerical phantom Experiments using a numerical phantom confirmed that anomaly detection in brain SPECT images produced the expected results. In medical imaging, obtaining a true distribution image is challenging due to variations in imaging conditions, equipment, and patient-specific factors. Machine learning models, on the other hand, evaluate their performance based on differences from the training data; however, it is often difficult to exclude the influence of factors unrelated to the target anomalies in patient data. As a result, accurately assessing the performance of anomaly detection methods on clinical images becomes problematic. Anomaly detection performance is affected by noise in medical images and signal intensity in anomalous regions. Therefore, the present study focused on numerical phantom experiments, which allowed us to control and isolate the effects of noise and signal values. A numerical phantom image comprising with pixels, as shown in Fig. 2, was used in this study. The Shepp–Logan phantom [29], a widely used model for evaluating image reconstruction and image quality [30, 31], was chosen because its shape resembles the human brain. a shows an image of the numerical phantom, and b shows each pixel value composing the numerical phantom The training data for WGAN-GP requires images depicting various shapes rather than identical ones. To simulate inter-patient variability, the elliptical shape of the Shepp–Logan phantom was randomly modified. An example of a shape-varied Shepp–Logan phantom is shown in Fig. 3a, which was used as a healthy image in this study. To simulate anomalous images, an additional randomly shaped ellipse was inserted into the phantom, as illustrated in Fig. 3b, c. Representative images of a numerical phantom. a shows a healthy image wherein the ellipse shape of the Shepp–Logan phantom is randomly changed. b shows an anomaly image wherein the low signal of the anomalous region is added to the healthy image. c shows an anomalous image wherein the high signal of the anomalous region is added to the healthy image An ellipse region representing an anomaly was added to the lower-left corner of the phantom. The other ellipses in the anomalous images were randomly varied, similar to those in the healthy image, and the shape of the anomalous region itself was also randomly modified. In this study, we focused on noise and signal levels within the anomalous regions; therefore, the location of the anomalies was fixed. These added elliptical regions simulate areas of abnormal radiotracer accumulation in the nuclear medicine images. To investigate the impact of signal intensity on detectability, we considered two levels of accumulation in the anomalous region: low (= 0.6) and high (= 0.8). As illustrated in Fig. 3b, c, experiments were conducted using phantoms with low and high signal values, respectively. Here, the high and low signal levels were defined relative to the maximum (= 0.8) and minimum (= 0.6) signal intensities within the Shepp–Logan phantom. Subsequently, noise was added to the images in Fig. 3 to better simulate clinical conditions. In SPECT imaging, pixel values are theoretically proportional to the radioactivity of the organ; however, statistical variability from the randomness of radioactive decay introduces noise. Image noise in nuclear medicine is known to follow a Poisson distribution [32–34]. Therefore, numerical noise phantoms with Poisson-distributed noise were applied to simulate this characteristic. The Poisson distribution is defined as: where n is the expected value and p(k; n) represents the probability of observing k events. The mean and variance of the Poisson distribution are both equal to n. In the present experiments, two levels of Poisson noise were applied to the numerical phantom images, yielding total counts of and [35]. A higher total count corresponds to a lower relative noise level, allowing the signal component to be more clearly observed. The numerical phantom images for each total counts are shown in Fig. 4. The anomalous image, with low and high signal values in the anomalous regions, simulate situations where it is challenging to identify the anomalies due to noise effects. Healthy and anomalous images with Poisson noise added to the numerical phantom. The upper panel shows total counts in the image , whereas the lower panel shows total counts in the image For implementation, 1000 images were used for both training and testing. WGAN-GP was trained using RMSprop with a learning rate of 0.00019, as it is a widely used optimization method [36]. The gradient penalty parameter in WGAN-GP was set to in Equation (3) [28]. AnoGAN was trained using the Adam optimizer with a learning rate of 0.001 [37]. The anomaly detection system developed in this study was implemented in Python 3.11.5. The accuracy of anomaly detection was evaluated using receiver operating characteristic (ROC) curves, quantified by the corresponding area under the ROC curve (AUC) values. Clinical SPECT data Clinical SPECT images were used as validation targets to assess whether the findings from numerical phantoms could be applied to real-world data. In this study, we utilized 201Tl brain SPECT images, which are commonly used to diagnose brain tumors and other neurological conditions. Computed tomography (CT), magnetic resonance imaging (MRI), and positron emission tomography (PET) are widely used to evaluate malignant tumors. CT and MRI yield superior performance for morphological evaluation; however, qualitative evaluation of tumors using these modalities is challenging. The detection rate of brain tumors using 18F–fluorodeoxyglucose (FDG) PET is low owing to the physiological accumulation of 18F–FDG in healthy brain cells [38]. In contrast, 201Tl does not cross the blood-brain barrier and is not taken up by healthy brain tissue; making 201Tl SPECT particularly valuable for brain tumor detection. 201Tl accumulation is primarily observed in the skull with minimal uptake in the brain parenchyma. Regions exhibiting higher accumulation than the background in the brain parenchyma were visually identified as areas of abnormal uptake. Patient population Brain SPECT images from 100 patients with a final clinical diagnosis of no brain accumulation who underwent 201Tl brain scans between 2020 and 2022, were used in this study. SPECT images of 10 patients with anomalous accumulation in the brain were acquired for evaluation images. Anomalous images were used to confirm the diagnosis of brain accumulation and validate anomaly detection. All images were acquired during the early phase and images with artifacts and body movements were excluded. This retrospective study was approved by the Ethics Committee of Tokushima University Hospital (approval number: 4295-1). The requirement for informed consent was waived by the Ethics Committee of Tokushima University Hospital due to the retrospective nature of the study. Imaging protocol Following the intravenous infusion of 201TlCl (111 MBq), early-phase SPECT images were acquired after 10 min, and late-phase SPECT images were acquired after 180 min. An e.cam (Canon Medical Systems Co., Tochigi, Japan) with a high-resolution, low-energy collimator (LEHR) was used in this study. Images were acquired for 28 min (circular orbit; angle of rotation, 180°; 45 views). Two energy windows of 166 keV ± 7.5% and 70 keV ± 10% were used, and the image matrix size was set as 128 128 pixels. The reconstruction method is the FBP method using the Butterworth filter without scatter correction and attenuation correction. We performed the reconstruction by summing the projection data from two energy windows, 166 keV and 70 keV. The early and late phases are reconstructed using their respective projection data. This study investigate the feasibility of anomaly detection using WGAN, and the early and late phase images were mixed and used for training data. An example of an acquired 201Tl brain SPECT image is shown in Fig. 5. Images without accumulation were defined as healthy, whereas images with intracranial accumulation were defined as anomalous. The unit of the image was the counts, and all images were normalized in the range [0, 1] for data preprocessing [39]. Representative image of 201Tl brain SPECT images. a shows a healthy image without accumulation. b shows an anomaly image with accumulation Image analysis For the quantitative evaluation of images generated by WGAN-GP, we calculated the structural similarity index [40] (SSIM) between the generated and patient images. SSIM quantifies the similarity between two images within the range , where values closer to 0 indicate lower similarity and values closer to 1 indicate higher similarity. We further analyzed the anomaly scores of 10 patients exhibiting abnormal brain accumulation. The anomaly scores, computed using Eq. (4), were obtained for both the early and late phase images of each patient. To examine whether the anomaly score reflects the degree of radiotracer uptake, we calculated the mean counts from a circular ROI manually placed on the abnormal region in accordance with clinical practice. Subsequently, we assessed the relationship between the anomaly score ratio (early/late) and the Retention Index (RI), a widely used quantitative metric in 201Tl brain SPECT [41–43]. The RI was computed as where each ratio was obtained from the mean counts (counts/pixel) within a pair of circular ROIs. In accordance with clinical practice, a circular ROI was manually placed on the abnormal region, centered on the area showing the highest radiotracer uptake, and a corresponding ROI was positioned in the contralateral normal background. The early and delayed ratios were calculated using the mean counts within these ROIs. Although the size and shape of the ROIs were principally kept identical between the lesion and contralateral side, the mean count was used even in cases where strictly identical ROIs could not be applied because of differences in lesion size or location. The Pearson correlation coefficient between the anomaly score ratio and the RI was then calculated using Python 3.11.5. Results This section presents the experimental results of anomaly detection using WGAN-GP and AnoGAN. Numerical phantom and 201Tl brain SPECT image results of the system are also presented. Results of numerical phantom Histograms of the anomaly scores were created for both healthy and anomalous image. Figure 6 and 7 show the results for low and high signal values in the anomalous regions, respectively. In each figure, (a) shows noise of , and (b) shows a noise of . The results of all histograms show that the figures in blue represent healthy images, whereas the figures in orange represent anomalous images. The anomaly scores for anomalous images were higher than those for healthy images. Histogram of the anomaly scores with low signal values in the anomalous regions. a shows total counts in the image , and b shows total counts in the image . The figures in blue represent the distribution of healthy images, whereas the figures in orange represent the distribution of anomalous images Histogram of the anomaly scores with high signal values in the anomalous regions. a shows total counts in the image , and b shows total counts in the image . The figures in blue represent the distribution of healthy images, whereas the figures in orange represent the distribution of anomalous images In anomaly detection, the anomaly scores of the healthy and anomalous images should ideally be well separated. A clear distinction between the two histograms represents the optimal result. However, concerning the low signal level shown in Fig. 6, comparing (a) and (b), (b) shows that the anomaly scores are very similar for healthy and anomalous images owing to the noise effect. In contrast, as shown in Fig. 7b, the histogram can be separated relatively well despite the same amount of noise . Figure 7a, which has low noise and a high signal value, shows a good separation between the anomaly score values of healthy and anomalous images. The ROC curves are presented in Fig. 8. Figure 8a compares the results for the two noise levels with low signal values in the anomalous region, whereas Fig. 8b presents the results for high signal values. The red and green curves represent Poisson noise levels of and , respectively. The AUC values are summarized in Table 1. Anomaly detection accuracy based on the receiver operating characteristic (ROC) curves compared under different noise levels and signal levels. a Comparison of the noise levels with low signal values in the anomalous region. b Comparison of the noise levels with high signal values in the anomalous region. The red curve represents noise levels of total counts in the image , and the green curve represents noise levels of total counts in the image Table 1Area under the curve (AUC) values for anomaly detection accuracy in numerical phantomsAUC valuesSignal of anomaly regionTotal counts in the image Total counts in the image Low0.82490.6715High0.99940.9926Each value represents different signal values and different noise levels Area under the curve (AUC) values for anomaly detection accuracy in numerical phantoms Each value represents different signal values and different noise levels The AUC value was the lowest at 0.6715 when the signal intensity in the anomalous region was low and the Poisson noise was high. The AUC improved to 0.8249 under low noise conditions. In contrast, when the signal intensity in the anomalous region was high, the ROC curve demonstrated excellent performance, with an AUC of 0.9926 even at low noise levels. The system’s performance was further confirmed both quantitatively and qualitatively by subtracting the generated images from the anomalous images. In this process, the generated images were reconstructed from the original images and their corresponding latent variables. A key advantage of AnoGAN is its ability to provide visual evidence for anomaly detection, presenting the anomaly as a localized change in signal intensity within the image. The results are presented in Fig. 9. The upper panels display the results for total counts of and when the signal intensity in the anomalous region was low, while, the lower panels show the results for high signal intensity. For clarity, the subtracted images are presented using a blue colormap. When the signal intensity in the anomalous region was high, the subtraction images clearly delineate the abnormal region at both total counts ( and ). In contrast, when the signal intensity was low, the abnormal region is obscured by noise in the total count images, making it difficult to identify. Results of subtraction between the image reconstructed from the WGAN-GP and the target anomalous image. The upper panel shows the results for total counts in the image and when the signal in the anomalous region is low. In contrast, the lower panel shows the results when the signal in the anomalous region is high. The color has been changed to blue to enable clear image visualization. Signal values with high anomaly scores are shown as high values in the images Results of the clinical 201Tl brain SPECT images The results obtained were validated using numerical phantoms with clinical images. All conditions, including the optimization method and other parameters, of the experiment using 201Tl brain SPECT were the same as those of the numerical phantom. A comparison of the image quality of the patient image and image generated by the WGAN-GP is shown in Fig. 10. The unit of the images were the counts, and all images were normalized in the range [0, 1]. Representative examples of patient images acquired using the SPECT scanner and a generated image. a shows a healthy image without 201Tl accumulation and b shows an example image generated using WGAN-GP with a healthy image as the training image Figure 10a shows the actual patient image, whereas (b) presents the corresponding generated image. The generated image exhibits high fidelity, making it visually indistinguishable from the original patient image. The SSIM calculated between Fig. 10a, b was 0.8306. These results confirm that anomaly detection using AnoGAN can achieve high accuracy for images with abnormal accumulation that deviate from the manifold distribution of healthy images. The 201Tl brain SPECT accumulation and subtraction images are shown in Figs. 11 and 12, respectively, illustrating six cases of anomalous images analyzed in this study. Visualization of images to evaluate qualitative results. The upper panel shows the anomalous image and the lower panel shows the subtraction image between the image reconstructed using the WGAN-GP and the anomaly image. The unit of the image was the counts, and all images were normalized in the range [0, 1]. In addition, values of the anomaly score calculated from Eq. (4) are shown below the image Visualization of images to evaluate qualitative results. The upper panel shows the anomalous image and the lower panel shows the subtraction image between the image reconstructed using the WGAN-GP and the anomaly image. The unit of the image was the counts, and all images were normalized in the range [0, 1]. In addition, values of the anomaly score calculated from Eq. (4) are shown below the image The upper panel shows the accumulated image, and the lower panel shows the subtraction image. In the subtraction images, the contours of the head bones appear with lower signal intensity, while the areas of radiotracer accumulation are enhanced. This observation indicates that the magnitude of the anomaly score calculated using Eq. (4) is correlated with the signal intensity of the anomalous regions. The anomaly scores calculated using Eq. (4) are shown in Figs. 11 and 12. Figure 13 shows a scatter plot of the anomaly scores and the mean counts in the anomaly regions for 10 patients diagnosed with abnormal brain accumulation. The blue and red dots indicate the value of the anomaly score in the early and late phases, respectively. The higher the counts by uptake, the higher the anomaly score. In the subtraction image, the signal values of the background and cranium are removed and suppressed, and displayed only the abnormal region with a high signal value. Correlation plots between the anomaly scores of 10 patients diagnosed with abnormal accumulation in the brain and the mean counts of anomaly regions. Blue dots indicate the anomaly score in the early phase and red dots indicate the anomaly score in the late phase Table 2 shows the anomaly score ratios and RI for the 10 patients with abnormal brain accumulation. In the experiment, the maximum difference between the ratio of anomaly scores and the Retention Index was 0.15, with a minimum difference of 0.01 and a mean error of 0.069. Furthermore, the Pearson correlation coefficient between the anomaly score ratios and the Retention Index was 0.941, showing a very strong positive correlation. Table 2Ratio of anomaly scores between early and late phases and Retention Index for 10 patients with anomaly accumulationPatient12345678910Anomaly score ratio0.580.780.850.950.970.971.081.081.111.55Retention Index0.630.860.880.941.040.990.931.121.261.46 Ratio of anomaly scores between early and late phases and Retention Index for 10 patients with anomaly accumulation Discussion This study developed a system for detecting anomalous images, focusing on brain SPECT among nuclear medicine images. By incorporating WGAN-GP, which generates high-quality images, into AnoGAN, we conducted a basic feasibility study of anomaly detection in brain SPECT using numerical phantoms with varying noise and signal levels. The proposed system requires only healthy images for training, thereby addressing the challenge of collecting sufficient anomalous images in nuclear medicine. Moreover, as the system does not require manual labeling of healthy and abnormal images, it significantly reduces time and labor costs. The Lack of basic research on noise and signal levels in nuclear medicine images using numerical phantoms has created uncertainty about their applicability to clinical imaging. In this study, the Shepp–Logan phantom (Fig. 2) was used as a numerical phantom to investigate these factors. Varying the noise and signal levels and combining the generative models WGAN-GP and AnoGAN, we demonstrated that anomaly detection can be achieved with high accuracy. While several previous studies have used additive white Gaussian noise (AWGN) as image noise, statistical variations in nuclear medicine imaging are often dominated by Poisson processes. As AWGN does not accurately reflect these variations, numerical phantoms are advantageous because they allow the addition of Poisson noise at any count level while excluding other confounding factors. In this study, we simulated two noise levels: the total counts of the images and . The results showed that anomaly detection accuracy decreased in noisier images with lower counts. In particular, detection was impaired when the anomalous region’s signal intensity approached that of the surrounding tissue, potentially leading to false negatives. The shape of the numerical phantom was also varied randomly to simulate inter-patient anatomical differences. The findings revealed that noise and signal levels are dominant factors influencing anomaly detection performance. As shown in Table 1, the AUC values differed substantially (0.6715 vs. 0.8249) between noise levels, even for the same signal intensity. Notably, a very high AUC was achieved even in noisy images when the signal intensity of the anomalous region was high. These results, validated experimentally using both numerical phantoms and clinical 201Tl brain SPECT images, underscore the critical role of noise and signal levels in reliable anomaly detection. The results of the anomaly detection experiment were evaluated based on anomaly scores. The parameter in Eq. (4) was set to 0.1, following the study by Schlegl et al. [11]. Although other values were tested, the best performance was achieved with . This setting places greater weight on the residual loss than on the discrimination loss, emphasizing reconstruction quality. Consequently, AnoGAN’s anomaly detection performance is highly dependent on the quality of the generated images. WGAN-GP, incorporating the Wasserstein distance based on optimal transport theory [44], provides improved training stability and enables the generation of high-quality images. This advantage underscores the significance of the results obtained in the present study. Anomalous images in the clinical 201Tl SPECT data were characterized by abnormal radiotracer accumulation in the brain. As shown in Fig. 10, the proposed system successfully generated high-quality images that were visually indistinguishable from actual patient images. The SSIM between the generated and patient images reached 0.8306, demonstrating excellent reconstruction performance. Quantitative measures such as AUC values, along with visual and qualitative comparisons, are essential in nuclear medicine imaging. In particular, Figs. 11 and 12 show that subtraction images effectively highlight areas of abnormal accumulation, isolating the regions of interest as theoretically expected. Notably, the signal intensity in the anomalous regions varied from faint to strong, closely reflecting real-world patterns of radiotracer uptake and underscoring the method’s utility for diagnostic imaging. Furthermore, as illustrated in Fig. 13, anomaly scores exhibited a strong correlation with radiotracer counts in the anomaly regions. Higher anomaly scores corresponded to higher uptake counts when defining healthy and anomalous images based on the presence of accumulation. This trend was observed consistently across both early and late imaging phases. Table 2 summarizes the Retention Index, a recognized indicator for differentiating intracranial tumors, alongside the anomaly scores. The mean difference between the anomaly score ratios and the RI was 0.069, and the Pearson correlation coefficient was 0.941, indicating a strong positive correlation. This finding highlights the potential of anomaly scores as a novel quantitative metric for assessing tumor characteristics, including their benign or malignant nature and tissue type. This experiment investigated the feasibility of anomaly detection in brain SPECT images using a generative model. The study has several limitations: the use of a simplified numerical phantom for noise and shape variation, basic reconstruction techniques without scattering or attenuation correction, and anomaly detection based solely on the presence of radiotracer accumulation. Additionally, it should be noted that the anomaly score depends on the quality of the training model and represents a relative, not absolute, measure between healthy and anomalous images. Despite these limitations, this study clarified the relationship between noise and signal levels in a simplified model and demonstrated a correlation between anomaly scores and radiotracer counts, supporting the effectiveness of WGAN-based anomaly detection. These findings suggest the potential for extending the approach to more complex phantoms, reconstructed images with greater anatomical detail, and other medical imaging modalities beyond brain SPECT. This work provides a foundational basis for future applications of generative models in anomaly detection. Conclusion The present study demonstrates that noise and signal values within anomalous regions significantly affect the accuracy of anomaly detection in medical imaging, including nuclear medicine. These findings, obtained through numerical experiments with simulated medical images, emphasize key considerations for implementing anomaly detection in nuclear medicine for diagnostic and pathological applications. Furthermore, we found that applying anomaly detection to 201Tl brain SPECT images is effective for supporting diagnostic imaging. The use of a high-quality generative model enables accurate visualization of anomalous regions. The calculated anomaly scores and subtraction images provide a novel quantitative index for SPECT images, facilitating the differentiation of benign and malignant tumors. Additionally, these metrics may help establish relationships with tumor tissue classifications, which will be explored in future studies. Author contributions All authors contributed to the study conception and design. Material preparation, data collection and analysis were performed by Ryosuke Kasai. The first draft of the manuscript was written by Ryosuke Kasai and Hideki Otsuka commented on previous versions of the manuscript. All authors read and approved the final manuscript. Funding The authors declare that no funds, grants, or other support were received during the preparation of this manuscript. Data availability The datasets generated during and/or analyzed during the current study are available within the article. Declarations Ethics approval and consent to participate This retrospective study was approved by the Ethics Committee of Tokushima University Hospital (approval number: 4295-1). The requirement for informed consent was waived by the Ethics Committee of Tokushima University Hospital due to the retrospective nature of the study. Conflict of interest The authors have no relevant financial or non-financial interests to disclose. Footnotes Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Ryosuke Kasai and Hideki Otsuka contributed equally to this work. References Associated Data Data Availability Statement The datasets generated during and/or analyzed during the current study are available within the article.