Gravity wave image anomaly detection method based on combination of student-teacher network and auto-encoder

By combining the student-teacher network and the autoencoder method, the contradiction between detection performance and computing efficiency in the abnormal detection of gravity wave spectral image is solved, and efficient and accurate abnormal detection is achieved, especially the recognition of local and global abnormalities.

CN120580558APending Publication Date: 2025-09-02NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510584548.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-09-02

AI Technical Summary

Technical Problem

The existing gravitational wave spectral image anomaly detection methods have contradictions between detection performance and computing efficiency. Multi-scale network training increases the complexity and cost of the model, and the information fusion is insufficient, making it difficult to effectively detect local and global anomalies in the image.

Method used

Using a method of combining student-teacher network with autoencoder, through preprocessing, dimensional compression and feature extraction, students' network is trained using hard feature loss, and comprehensive exception maps are generated in combination with local and global exception maps to improve detection accuracy.

Benefits of technology

It significantly improves the abnormal detection accuracy and efficiency of gravity wave spectral images, reduces noise interference, accurately recognizes local and global abnormalities in the image, and reduces calculation complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120580558A_ABST
    Figure CN120580558A_ABST
Patent Text Reader

Abstract

The invention particularly relates to a gravity wave spectral image anomaly detection method based on a student-teacher network in combination with an auto-encoder, and the method comprises the steps: collecting gravity wave spectral image data, and carrying out the preprocessing and dimension compression of a gravity wave spectral image; constructing a student-teacher network and auto-encoder combined anomaly detection model; training an anomaly detection model, and optimizing a student network by adopting a hard feature loss training method; and carrying out anomaly detection and positioning on the gravity wave spectral image by adopting the trained anomaly detection model, obtaining a local anomaly graph based on the output of the teacher network and the student network, obtaining a global anomaly graph based on the output of the auto-encoder and the student network, and generating a comprehensive anomaly graph by combining the local anomaly graph and the global anomaly graph. According to the method, the global features are trained in combination with the self-encoder, the global anomaly of the image is detected during testing, and the detection results of the self-encoder and the teacher-student model are calibrated before the results are merged, so that the anomaly detection performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of gravitational wave image detection, and in particular to a method for detecting anomalies in gravitational wave spectral images based on a student-teacher network combined with an autoencoder. Background Art

[0002] As an advanced scientific instrument, the gravity wave spectrometer captures images under different meteorological conditions by rotating optical filters, enabling multi-angle analysis of gravity wave-related meteorological phenomena. This process involves imaging gravity wave-related meteorological phenomena from different angles in order to reveal their inherent physical properties and dynamic patterns. Because gravity waves exhibit significant variations in their behavior under different meteorological conditions, meteorological images obtained in this manner exhibit significant heterogeneity in their characteristics. Specifically, images captured by the gravity wave spectrometer exhibit significant differences in spectral characteristics, texture structure, and spatial distribution. These characteristic differences not only reflect the unique behavior of gravity waves under different meteorological backgrounds but also provide important data support for a deeper understanding of their formation mechanisms and propagation characteristics. For example, the propagation of gravity waves in the atmosphere is influenced by multiple meteorological factors such as temperature, humidity, and wind speed. Changes in these factors can cause changes in characteristic parameters such as the amplitude, wavelength, and phase of gravity waves, resulting in recognizable characteristic differences in the images.

[0003] Over the past few years, deep learning techniques have made significant progress in improving the performance of various computer vision applications. Rapid progress has also been observed in the field of visual anomaly detection, particularly in benchmarks for industrial applications. Despite this, state-of-the-art anomaly detection methods often sacrifice computational efficiency for improved detection performance. Bergmann et al. proposed a student-teacher framework for unsupervised anomaly detection and segmentation. A student network regresses the output of a teacher network, which is pre-trained using natural image patches. Anomalies are detected when the student network output differs from the teacher network output, and the student network's uncertainty is used for scoring. However, to detect anomalies at different scales, this approach requires training student-teacher pairs with different receptive field sizes. This increases model complexity and training cost, and may also lead to insufficient information fusion between scales, affecting the final anomaly detection performance. Wang et al. used a multi-scale feature matching strategy to perform knowledge distillation at different feature levels, enabling the student model to detect anomalies of varying sizes and complexities. However, to achieve scale invariance, multiple student-teacher pairs must be trained, increasing computational complexity and training cost. Schneider et al. compared the performance of convolutional autoencoders (CAE), variational autoencoders (VAE), and adversarial autoencoders (AAE) in anomaly detection and found that CAE performed well on simple datasets.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention

[0005] The present invention provides a gravity wave spectral image anomaly detection method based on a student-teacher network combined with an autoencoder. The method uses a student-teacher network and an autoencoder for cross-anomaly detection, combining the advantages of the student-teacher network and the autoencoder to improve detection accuracy, thereby overcoming the defects of the existing technology to a certain extent.

[0006] Other features and advantages of the present invention will become apparent from the following detailed description, or may be learned in part by practice of the present invention.

[0007] According to a first aspect of the present invention, a method for detecting anomalies in gravity wave spectral images based on a student-teacher network combined with an autoencoder is provided, the method comprising:

[0008] Collect gravity wave spectrum image data and pre-process the gravity wave spectrum image;

[0009] Perform dimension compression on the pre-processed gravity wave spectrum image, mapping the 16-bit image to an 8-bit image;

[0010] Build an anomaly detection model that combines a student-teacher network with an autoencoder, where the autoencoder network is used to predict the output of the teacher network, and the student network is also used to predict the output of the autoencoder;

[0011] Train an anomaly detection model that combines a student-teacher network with an autoencoder, using a hard feature loss training method to optimize the student network;

[0012] The trained anomaly detection model is used to detect and locate anomalies in gravity wave spectral images. A local anomaly map is obtained based on the output of the teacher network and the student network. A global anomaly map is obtained based on the output of the autoencoder and the student network. A comprehensive anomaly map is generated by combining the local anomaly map and the global anomaly map.

[0013] In some exemplary embodiments, the pre-processing includes: dark noise removal, cosmic ray removal, and moonlight image removal.

[0014] In some exemplary embodiments, the student-teacher network includes a teacher network and a student network, both of which adopt a block feature extraction network. The block feature extraction network is a fully convolutional layer network, including six convolutional layers, and a strided average pooling layer is added after the first and second convolutional layers.

[0015] In some exemplary embodiments, the autoencoder includes an encoder and a decoder, wherein the encoder includes six layers of strided convolution, and the decoder includes seven upsampling layers and eight convolution layers, and a dropout layer is set after the first six convolution layers.

[0016] In some exemplary embodiments, the training of an anomaly detection model combining a student-teacher network and an autoencoder includes:

[0017] The training images are input into the teacher network and the student network respectively; the first square difference is calculated based on the output of the teacher network and the output of the first 384 channels of the student network, and the student loss is calculated based on the first square difference;

[0018] After data augmentation, the training images are input into the autoencoder, student network, and teacher network respectively. The second square difference is calculated based on the output of the autoencoder and the output of the teacher network, and the autoencoder loss is calculated based on the second square difference. The third square difference is calculated based on the output of the autoencoder and the output of the last 384 channels of the student network, and the student additional loss is calculated based on the third square difference.

[0019] The sum of student loss, autoencoder loss and student additional loss is used as the total loss function, and the network parameters are updated based on the total loss function until they are optimal.

[0020] In some exemplary embodiments, generating a comprehensive anomaly map by combining the local anomaly map and the global anomaly map includes:

[0021] Filling the local anomaly map and the global anomaly map;

[0022] Normalize the filled local anomaly map and global anomaly map;

[0023] The normalized local anomaly map and the global anomaly map are merged to generate a comprehensive anomaly map.

[0024] According to a second aspect of the present invention, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for detecting anomalies in gravity wave spectral images based on a student-teacher network combined with an autoencoder according to the first aspect is implemented.

[0025] According to a third aspect of the present invention, a computer program product is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for detecting anomalies in gravity wave spectral images based on a student-teacher network combined with an autoencoder according to the first aspect is implemented.

[0026] According to a fourth aspect of the present invention, there is provided an electronic device, comprising:

[0027] processor; and

[0028] a memory for storing executable instructions of the processor;

[0029] Wherein, the processor is configured to implement the gravity wave spectral image anomaly detection method based on a student-teacher network combined with an autoencoder described in the first aspect above by executing the executable instructions.

[0030] The embodiment of the present invention provides a method for detecting anomalies in gravitational wave spectral images based on a student-teacher network combined with an autoencoder. First, a student network is trained to predict the features calculated by a pre-trained teacher network on normal training images. Since the student network has not been trained on abnormal images, it is usually unable to imitate the performance of the teacher network on these images. Then, identifying the local features of the anomaly can detect anomalies that are structurally different from normal images, such as contamination or stains on products. However, violating logical constraints such as the position, size, and arrangement of normal objects is a challenging problem. To solve this problem, the gravitational wave spectral image anomaly detection algorithm based on cross-teacher-student autoencoder includes an autoencoder for learning the global features of the training images and detecting global anomalies of the images during testing. The autoencoder and teacher-student model detection results are calibrated before merging the results to improve the anomaly detection performance. It has the following advantages:

[0031] To overcome the lack of distinct image features and the severity of noise interference, this paper develops an image preprocessing method. This method significantly improves the visualization and recognition of key data in images through a series of filtering, enhancement, and feature extraction steps. This preprocessing not only provides more accurate and reliable input for subsequent processing steps but also significantly reduces the interference of noise on anomaly detection results.

[0032] 2. This paper proposes an anomaly detection method based on a student-teacher model architecture combined with an autoencoder. This method trains a student network to mimic the performance of a teacher network trained only on normal images, without training on anomalous images, thereby enabling anomaly detection during the testing phase. Secondly, an asymmetric strategy based on training loss is employed to enhance the model's ability to detect anomalous features in gravitational wave images. Then, an autoencoder is used to learn the global image of the training images and detect anomalies in these features during testing. Finally, the combined anomaly detection method of the autoencoder and the student-teacher model is optimized, further improving anomaly detection and localization performance.

[0033] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present invention, and together with the description, serve to explain the principles of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and it is clear that those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0035] Figure 1 This is a diagram of the structure of gravity wave image anomaly detection based on a student-teacher network combined with an autoencoder;

[0036] Figure 2 The structure diagram and simulation example of the forward model of the mesosphere airglow spectrophotometer;

[0037] Figure 3 This is a partial image display of the gravitational wave spectral image dataset;

[0038] Figure 4 This is the flow chart of gravity wave spectrum image preprocessing;

[0039] Figure 5 The architecture diagram of the block feature extraction network (left) and the autoencoder network (right);

[0040] Figure 6 Flowchart of the model training algorithm;

[0041] Figure 7 This is a flowchart of image anomaly detection and localization based on multi-dimensional detection. DETAILED DESCRIPTION

[0042] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0043] In addition, the accompanying drawings are merely schematic illustrations of the present invention and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0044] The gravitational wave image anomaly detection method based on a student-teacher network combined with an autoencoder proposed in the present invention is an efficient visual anomaly detection technology that focuses on the anomaly detection task of real-time calculation of gravitational wave spectral images. This method simultaneously detects global and local anomalies by combining a student-teacher network and an autoencoder. The core module of the present invention is the block feature extraction network, which is a lightweight convolutional neural network composed of six convolutional layers, specifically used to extract features from input images. Each output neuron of the block feature extraction network corresponds to a receptive field, each feature vector describes an image block, and the block feature extraction network is fully convolutional and can adapt to images of different sizes, generating all feature vectors in a single forward pass. In order to enhance the expressiveness of the features, the block feature extraction network extracts features from a deep pre-trained classification network through knowledge distillation. The structure of the gravitational wave image anomaly detection based on a student-teacher network combined with an autoencoder is as follows: Figure 1 shown.

[0045] Step 1: Gravitational wave spectral image data acquisition

[0046] The top region of the mesosphere, as an important energy coupling zone in the Earth's atmosphere, hosts a variety of active dynamic processes, including the phenomenon of gravity waves. Temperature, as an effective tracer of these dynamic activities, plays a key role in revealing the complex physical processes occurring in this region. In view of this, in order to further explore this important scientific field, a new type of efficient gravity wave spectrometer has been designed and implemented for tasks such as gravity wave image capture and temperature monitoring. The gravity wave spectral image dataset used in the present invention is derived from the forward image generated by the mesosphere airglow spectrophotometer, an important optical device in the instrument. The forward model structure of the mesosphere airglow spectrophotometer and the gravity wave spectral image example are as follows: Figure 2 shown.

[0047] like Figure 2 As shown in Figure (a), the forward model of the airglow spectrophotometer consists of four key submodules: the airglow spectral radiation module, the atmospheric radiation transmission module, the optical system module, and the CCD (charge-coupled device) detector module. This forward model simulates how the CCD detector converts atmospheric optical radiation signals into electronic signals, providing theoretical support and practical guidance for instrument design, field observations, and the development of inversion algorithms.

[0048] Airglow Spectral Radiation Module: This module, based on the HITRAN08 molecular spectral database, provides detailed emission intensity data for the vibrational-rotational spectrum of the O2(0-1) band, emitted from multiple energy levels during electronic transitions of oxygen molecules (O2). The data covers the temperature range of 110 to 280 K, with temperature intervals as fine as 0.1 K, ensuring simulation accuracy.

[0049] Atmospheric Radiative Transfer Module: During the radiative transfer simulation process, this paper focuses on the atmospheric transmission of airglow radiation and its intensity attenuation. To this end, the Atmospheric Radiative Transfer Simulator (ARTS) software, jointly developed by the University of Hamburg and Chalmers University, was introduced. The ARTS software is designed to accurately simulate the airglow extinction process along the MASP observation path under clear sky conditions.

[0050] Optical System Module: This module comprehensively considers key factors such as the optical system's overall transmittance, filter characteristics, optical distortion, the flat field coefficient caused by varying light flux, and the modulation transfer function (MTF) within the field of view. These parameters are precisely measured through an in-lab calibration process, ensuring the reliability of the Optical System Module simulation.

[0051] CCD Detector Module: This module focuses on simulating the conversion process from photon signals to electron signals. In the forward model, key performance parameters of the CCD detector, such as responsivity, dark noise, readout noise, and shot noise, are carefully integrated to ensure that the model accurately reflects the actual detection process.

[0052] Based on the above-mentioned structure of the intermediate layer airglow spectrophotometer, the forward simulation diagram is as follows: Figure 2 (b) shows that, except Figure 2 (b), the images taken with different filters are quite different, so two of them are used as the baseline dataset for the three algorithms mentioned in this invention, and the training, testing, and reasoning of the model are all based on this dataset. Figure 3 As shown, the upper part is the large aperture image of gravitational waves, and the lower part is the small aperture image of gravitational waves.

[0053] Step 2: Gravitational wave spectral image preprocessing

[0054] The dataset used in this paper is data collected by the gravity wave instrument during its operation. The dataset was captured continuously for one month starting in September 2018 at the Nanjing University of Information Science and Technology Meteorological Comprehensive Base Platform. In October 2018, the mesosphere airglow spectrophotometer successfully obtained 13 sets of high-quality observation data, with observation time ranging from 7 to 10 hours. These data included 16 dark noise images and 3209 high-quality hyperspectral observation images, each of which was 256×256 in size.

[0055] like Figure 4 As shown in FIG, the gravity wave spectral image preprocessing proposed in the present invention is mainly divided into the following three process modules:

[0056] (1) Dark noise elimination: Dark noise is a form of noise inherent in image sensors under no-light conditions and is an important part of image preprocessing that cannot be ignored. During the experiment, the shutter was closed periodically (e.g., every 30 minutes) and dark shots were taken under the same exposure conditions to obtain dark noise images. These dark noise images actually contain the dark noise and bias of the sensor itself. The superposition effect of the two makes the pixel values ​​fall within the range of 1000 to 3000. These dark noise images are recorded and used for accurate subtraction from the observed image in subsequent image processing, thereby effectively eliminating dark noise and improving the purity and signal-to-noise ratio of the image.

[0057] (2) Elimination of cosmic rays: The impact of cosmic rays and high-energy particles on the observed image is mainly manifested as local overexposed bright spots, which will seriously interfere with the accuracy of the data and subsequent analysis. In order to remove these abnormal bright spots, it is first necessary to subtract the previously obtained dark noise image from the observed image. After that, the threshold setting is used to identify and eliminate these high-brightness pixels. In order to ensure a smooth transition of the image after elimination, for these eliminated points, the pixel values ​​of the surrounding 3x3 pixel matrix are used for median filtering, and the entire image is subjected to an adaptive median filtering method to remove the salt and pepper noise in the image. This process is called adaptive smoothing, which effectively reduces the visual interference and data errors caused by cosmic rays.

[0058] (3) Elimination of moonlight images: In astronomical observations, moonlight not only illuminates the observation target, but also may bring significant background pollution, affecting the purity of the observation data. The degree of moonlight pollution depends on the phase of the moon (full moon, new moon, etc.) and the zenith angle of the moon relative to the observation point. Therefore, for the acquired observation images, it is necessary to evaluate the degree of moonlight influence based on the intensity change of the observed spectral line. If the influence of moonlight is significant, resulting in a significant decrease in the quality of the observation data, these affected images should be screened and eliminated to ensure that the data used in subsequent analysis has a high signal-to-noise ratio and accuracy.

[0059] Step 3: Dimensional compression of gravitational wave spectral images

[0060] Gravity wave spectral images are typically stored at a 16-bit bit depth. This high bit depth captures and records richer grayscale information, providing greater precision and detail in meteorological observations and analysis. However, when these high-resolution 16-bit images are used to train machine learning models, they inevitably impose significant computational burdens and memory requirements. To mitigate this burden without sacrificing excessive image information, a common processing method is to employ a max-min normalization technique to efficiently map 16-bit images to 8 bits.

[0061]

[0062] In formula (1-1), X is the pixel value of each pixel in the image, X max and X min are the maximum and minimum values ​​of the image pixels, respectively, norm The pixel values ​​are normalized. This step not only reduces the image's bit depth, thereby reducing computational resources, but also maintains the relative integrity and recognizability of key information within the image. Max-min normalization is a linear transformation method that first converts pixel values ​​in an image to between 0 and 1, then further maps this range to the desired bit representation as needed.

[0063] Step 4: Gravity wave spectral image feature extraction based on block feature network

[0064] In the latest anomaly detection technology, the features of deep pre-trained networks are widely used. This paper proposes a framework combining a student-teacher network and an autoencoder as a feature extractor for feature extraction and anomaly detection of gravitational wave spectral images. The framework consists of two main components: a block feature extraction network and an autoencoder. The architecture of the block feature extraction network model and the autoencoder network model is shown in the figure. Figure 5 shown.

[0065] like Figure 5 As shown in the figure (left), the block feature extraction network is a simple fully convolutional network consisting of only six convolutional layers. Each output neuron corresponds to a 33×33 pixel receptive field, so each output feature vector represents a 33×33 pixel image patch. The block feature extraction network is a fully convolutional network that can adapt to images of varying sizes and calculates all feature vectors in a single forward pass. The parameters of each layer of the block feature extraction network are shown in Table 1.

[0066] Table 1. Block feature extraction network parameters

[0067]

[0068] Similar to the ST method, the present invention also uses networks with only a few convolutional layers to extract features. However, due to the lack of downsampling operations in the convolution and pooling layers, these networks have relatively high computational costs. This phenomenon shows that the number of parameters is not a reliable indicator of the latency, throughput and memory usage of the method. Modern classification architectures often perform downsampling early to reduce the size of the feature map, thereby reducing running time and memory requirements. The present invention achieves this by adding a strided average pooling layer after the first and second convolutional layers in the block feature extraction network.

[0069] In order to enhance the feature expression capability, the block feature extraction network utilizes the features of a deep pre-trained classification network. The present invention trains the block feature extraction network on images from the ImageNet dataset, with the goal of minimizing the mean squared error between its output and the features extracted by the pre-trained network. In addition to being more efficient, the block feature extraction network has another advantage over the deep networks used in recent methods. By design, the feature vector generated by the block feature extraction network depends only on the 33×33 pixel region to which it corresponds. In contrast, the feature vector of the pre-trained classifier shows long-range dependencies on other parts of the image. The clearly defined receptive field of the block feature extraction network ensures that anomalies in one area of ​​the image will not lead to abnormal feature vectors in other distant areas, which helps to improve the accuracy of anomaly localization.

[0070] Step 5: Gravitational wave spectral image feature extraction based on autoencoder network

[0071] The autoencoder is used as an auxiliary tool to learn local features in the training images and identify these abnormal situations. It consists of an encoder and a decoder. The parameters of each layer of the autoencoder network are shown in Table 2.

[0072] Table 2 Autoencoder network parameters

[0073]

[0074] The autoencoder architecture is Figure 3 , as shown in Table 2, the encoder uses six layers of strided convolution to compress the input image into a 64-dimensional latent space, while the decoder restores the original size through bilinear upsampling. It includes 8 convolutional layers and 7 upsampling layers, and a dropout layer is set after the first six convolutional layers to reduce the risk of model overfitting, prevent the network from over-relying on specific neurons, and enable the network to learn more robust features. The task of the autoencoder is to predict the output of the teacher network, thereby helping to identify structural and logical anomalies. In addition, the student network is also extended to predict the output of the autoencoder, which allows the student to learn the systematic reconstruction error on normal images without learning the error of abnormal images, thereby improving the accuracy of anomaly detection.

[0075] Step 6: Training the Gravitational Wave Spectral Image Anomaly Detection Model

[0076] In order to detect abnormal feature vectors, the present invention uses a student-teacher network combined with an autoencoder multi-dimensional detection model, in which a fully trained and well-performing teacher network is used to guide a student network. The teacher network imparts knowledge through its output or the activation of its intermediate layers, helping the student network learn more effective feature representations, thereby reducing the complexity of the model while maintaining or approaching the performance of the teacher network as much as possible. The autoencoder compares the feature representations output by the student network and performs detection from a global perspective. Before detection, the student-teacher network and the autoencoder need to be trained. The present invention adopts two different strategies to optimize performance and computing requirements.

[0077] In the standard student-teacher framework, increasing the number of training images can improve the student's ability to imitate the teacher on anomalous images. This can degrade anomaly detection performance. At the same time, deliberately reducing the number of training images may suppress important information about normal images. The goal of this paper is to present the student with enough data so that it can adequately imitate the teacher on normal images while avoiding generalization to anomalous images. Inspired by Abhinav Shrivastava et al., our student-teacher network adopts a hard feature loss training method that restricts the loss backpropagation to those patches where the student least imitates the teacher.

[0078] Formally, the present invention applies teacher T and student S to the training image I and obtains and The present invention calculates the square difference of each tuple (c, w, h) as

[0079] D c,w,h =(T(I) c,w,h -S(I) c,w,h ) 2 (1-2)

[0080] Based on the mining factor p h ∈[0,1], the present invention calculates the p of the elements of D h Quantile. Given p h Quantile d hard , the present invention calculates the training loss L hard For all D c,w,h ≥d hard The average value of p h Setting it to zero will get the original student-teacher loss. In our experiments, we set p h Set to 0.999, which corresponds to using an average of ten percent of the values ​​in each of the three dimensions of D for backpropagation.

[0081] M w,h =C -1∑ c D c,w,h (1-3)

[0082] During inference, the plane anomaly score map It is given by the formula, i.e., D is averaged over the channels. It assigns an anomaly score to each feature vector. By using hard feature loss, the present invention avoids outliers in anomaly scores on normal images, i.e., false positive detections. In addition to hard feature loss, the present invention also uses loss penalties during training to further prevent students from imitating images that do not belong to normal training images. In the standard student-teacher framework, the teacher is pre-trained on an image classification dataset, or it is a refined version of such a pre-trained network. The student is not trained on that pre-training dataset, but only on normal images of the application. The present invention proposes to use the teacher's pre-training images in the training of the student. Specifically, in each training step, the present invention randomly samples an image P from the pre-training dataset and calculates the student loss as

[0083]

[0084] Prevent the student from overfitting to out-of-distribution images. The total loss L ST A combination of hard feature loss and penalization of the student's output on pre-training images ensures that the student can focus on imitating normal images without generalizing to abnormal images.

[0085] The goal of autoencoder training is to make the autoencoder A reconstruct the output of the teacher network T as closely as possible, while the student network S' is also trained to predict the output of the autoencoder. Formally, the present invention applies the autoencoder A to the training image I and obtains And calculate the loss as

[0086]

[0087] let represents the additional output channel of the student. The additional loss of the student is

[0088]

[0089] The total training loss is L AE , L ST and L STAE The sum of:

[0090] Loss = L AE +L ST +L STAE (1-7)

[0091] Compared to image patch-based students, autoencoders must encode and decode the full image through a bottleneck of 64 latent dimensions. For images with logical anomalies, the autoencoder often fails to generate the correct latent code and thus cannot reconstruct the image in the teacher's feature space. However, on normal images, the autoencoder's reconstruction is also flawed because the autoencoder often has difficulty reconstructing fine-grained patterns. In this case, using the difference between the teacher output and the autoencoder reconstruction as the anomaly map can lead to false positive detections. In contrast, the present invention doubles the number of output channels of the student network and trains it to predict the output of the autoencoder in addition to the teacher's output.

[0092] Step 7: Anomaly detection and positioning of gravity wave spectral images based on multi-dimensionality

[0093] The core of anomaly detection and location in gravity wave spectral images lies in obtaining anomaly scores for each pixel in the test sample and for the entire image. Anomaly scores indicate the likelihood of an anomaly at the detected pixel and typically range from [0, 1], with larger values ​​indicating a greater probability of anomaly. Once pixel- and image-level anomaly scores are obtained, thresholding can be used to determine image anomalies and locate abnormal regions.

[0094] The student can learn the systematic reconstruction errors of the autoencoder on normal images, such as blurred reconstruction. At the same time, it will not learn the reconstruction errors of abnormal images because these errors are not part of the training set. This makes the difference between the output of the autoencoder and the output of the student very suitable for calculating the anomaly map. Similar to the student-teacher pairing, the anomaly map is the squared difference between the two outputs, averaged across channels. The present invention refers to this anomaly map as the global anomaly map, and the anomaly map generated by the student-teacher pairing as the local anomaly map. The present invention averages these two anomaly maps to calculate the combined anomaly map, and takes its maximum value as the image-level anomaly score. Therefore, the combined anomaly map contains the detection results of the student-teacher pairing and the detection results of the autoencoder-student pairing. Sharing the hidden layer of the student when calculating these detection results enables the method of the present invention to maintain low computational requirements while being able to detect structural and logical anomalies.

[0095] To ensure fair fusion of local and global outlier maps, they must first be normalized to a similar scale. This step is particularly important for cases where anomalies are detected in only one map. If this step is omitted, noise in one map may mask accurate anomaly detections in the other, resulting in misleading representations in the final combined outlier map.

[0096] To evaluate the noise level in normal images, we calculated the anomaly scores of all pixels in the validation set for both local and global anomaly maps, and determined two quantiles q for each score set.a and q b , corresponding to the positions of parameters p=a and p=b respectively. Based on these quantile values, the present invention defines a linear transformation that converts q a is mapped to an anomaly score of 0, while q b 0.1. During testing, this linear transformation is applied to both the local and global anomaly maps to achieve normalization. Using quantile normalization makes our method robust to variations in the distribution of anomaly scores in normal images. This normalization is unaffected by whether these scores follow a normal distribution, a Gaussian mixture distribution, or any other distribution.

[0097] The choice of setting the mapping target values ​​to 0 and 0.1 was made for practical reasons, rather than having a substantial impact on anomaly detection performance. This is because evaluation metrics like AUROC rely on the relative ranking of anomaly scores, rather than their absolute magnitude. We chose these values ​​because they produce normalized anomaly maps that fit well on the commonly used 0 to 1 color scale, making them easier to visualize and interpret. This ensures that the anomaly detection model works reliably across diverse scenarios, and that the resulting comprehensive anomaly map is both intuitive and reliable.

[0098] Other embodiments of the present invention will readily occur to those skilled in the art after considering the specification and practicing the invention herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the invention being indicated by the claims.

[0099] It should be understood that the present invention is not limited to the exact construction described above and shown in the drawings and that various modifications and variations can be made without departing from the scope thereof, which is limited only by the appended claims.

Claims

1. A method for detecting anomalies in gravity wave spectral images based on a student-teacher network combined with an autoencoder, characterized in that: The method comprises: Collect gravity wave spectrum image data and pre-process the gravity wave spectrum image; Perform dimension compression on the pre-processed gravity wave spectrum image, mapping the 16-bit image to an 8-bit image; Build an anomaly detection model that combines a student-teacher network with an autoencoder, where the autoencoder network is used to predict the output of the teacher network, and the student network is also used to predict the output of the autoencoder; Train an anomaly detection model that combines a student-teacher network with an autoencoder, using a hard feature loss training method to optimize the student network; The trained anomaly detection model is used to detect and locate anomalies in gravity wave spectral images. A local anomaly map is obtained based on the output of the teacher network and the student network. A global anomaly map is obtained based on the output of the autoencoder and the student network. A comprehensive anomaly map is generated by combining the local anomaly map and the global anomaly map.

2. The method according to claim 1, characterized in that The preprocessing includes: dark noise removal, cosmic ray removal and moonlight image removal.

3. The method according to claim 1, characterized in that The student-teacher network includes a teacher network and a student network, both of which adopt a block feature extraction network. The block feature extraction network is a fully convolutional layer network, which includes six convolutional layers, and a strided average pooling layer is added after the first and second convolutional layers.

4. The method according to claim 1, wherein The autoencoder includes an encoder and a decoder, wherein the encoder includes six layers of strided convolution, the decoder includes seven upsampling layers and eight convolution layers, and a dropout layer is set after the first six convolution layers.

5. The method according to claim 1, characterized in that The anomaly detection model combining the training student-teacher network and the autoencoder includes: The training images are input into the teacher network and the student network respectively; the first square difference is calculated based on the output of the teacher network and the output of the first 384 channels of the student network, and the student loss is calculated based on the first square difference; After data augmentation, the training images are input into the autoencoder, student network, and teacher network respectively. The second square difference is calculated based on the output of the autoencoder and the output of the teacher network, and the autoencoder loss is calculated based on the second square difference. The third square difference is calculated based on the output of the autoencoder and the output of the last 384 channels of the student network, and the student additional loss is calculated based on the third square difference. The sum of student loss, autoencoder loss and student additional loss is used as the total loss function, and the network parameters are updated based on the total loss function until they are optimal.

6. The method according to claim 1, characterized in that The generating of a comprehensive anomaly map by combining the local anomaly map and the global anomaly map includes: Filling the local anomaly map and the global anomaly map; Normalize the filled local anomaly map and global anomaly map; The normalized local anomaly map and the global anomaly map are merged to generate a comprehensive anomaly map.

7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting anomalies in gravity wave spectral images based on a student-teacher network combined with an autoencoder according to any one of claims 1 to 6 is implemented.

8. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for detecting anomalies in gravity wave spectral images based on a student-teacher network combined with an autoencoder according to any one of claims 1 to 6 is implemented.

9. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the method for detecting anomalies in a gravity wave spectral image based on a student-teacher network combined with an autoencoder according to any one of claims 1 to 6 by executing the executable instructions.