IP Library Granted Patent US 12,020,425
Granted Patent B2
US 12,020,425 · App. 18/356,229 · Granted Jun 25, 2024

Fast anomaly detection method and system based on contrastive representation distillation

Inventors: Annan Shu (Ningde, CN); Can Chen (Ningde, CN); Jv Huang (Ningde, CN)
Assignee: CONTEMPORARY AMPEREX TECHNOLOGY CO., LIMITED
G06T7/001G06T2207/20084G06T2207/20224
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,020,425
App. No.
18/356,229
Granted
Jun 25, 2024
Kind
B2
Abstract

Provided are a method and system for anomaly detection. The method includes: acquiring a picture of an object to be detected; inputting the acquired picture to each of a trained teacher network and a student network distilled from the teacher network, to obtain a feature map output by the teacher network and a feature map output by the student network, where the teacher network is trained by constructing a defective sample to learn feature distribution of normal samples from a pre-trained expert network; and determining a greatest anomalous pixel in a difference map between the feature map output by the teacher network and the feature map output by the student network as an anomaly value of the acquired picture, to output an anomaly detection result.

Claims (37)

1. A method for anomaly detection, the method comprising:

acquiring a picture of an object to be detected;

inputting the acquired picture to each of a trained teacher network and a student network distilled from the teacher network, to obtain a feature map output by the teacher network and a feature map output by the student network, wherein the teacher network is trained by constructing a defective sample to learn feature distribution of normal samples from a pre-trained expert network; and

determining a pixel based on a difference map between the feature map output by the teacher network and the feature map output by the student network as an anomaly detection indicator for the acquired picture and for outputting an anomaly detection result, wherein the determination comprises identifying the pixel by virtue of the pixel having a greatest difference value in layers of the feature map output by the teacher network and in the corresponding layers of the feature map output by the student network.

2. The method of claim 1 , wherein the determining the pixel in the difference map between the feature map output by the teacher network and the feature map output by the student network as an anomaly indicator for the acquired picture further comprises:

determining the pixel in a total difference map between feature maps of layers with different resolutions that are output by the teacher network and feature maps of corresponding layers that are output by the student network as an anomaly value of the acquired picture, to output the anomaly detection result.

3. The method of claim 1 , characterized in that the defective sample is constructed through data augmentation.

4. The method of claim 1 , characterized in that training of the teacher network comprises the following steps, wherein a training data set comprises a normal non-defective sample and a defective sample:

inputting the normal non-defective sample to the pre-trained expert network and the teacher network, and minimizing, in a contrastive loss function, a distance between a feature vector of a last layer that is output by the expert network and a feature vector of a last layer that is output by the teacher network;

inputting the normal non-defective sample to the pre-trained expert network and inputting the defective sample to the teacher network, and maximizing, in the contrastive loss function, a distance between a feature vector of a last layer that is output by the expert network and a feature vector of a last layer that is output by the teacher network; and

updating a parameter of the teacher network based on loss calculation results.

5. The method of claim 1 , characterized in that training of the student network comprises the following steps, wherein a training data set comprises a normal sample:

inputting the normal sample to the trained teacher network and the student network to obtain a feature map of each layer that is output by the teacher network and a feature map of each corresponding layer that is output by the student network;

minimizing, in a distillation loss function, a distance between the feature map of each layer that is output by the teacher network and the feature map of each corresponding layer that is output by the student network; and

updating a parameter of the student network based on loss calculation results.

6. The method of claim 1 , characterized in that the outputting an anomaly detection result further comprises:

locating an anomalous region in the acquired picture based on the determined anomaly value to obtain a segmented anomalous region mask.

7. A system for anomaly detection, the system comprising a processor configured to implement computer software modules comprising:

an image acquisition module configured to acquire a picture of an object to be detected;

a feature extraction module configured to input the acquired picture to each of a trained teacher network and a student network distilled from the teacher network, to obtain a feature map output by the teacher network and a feature map output by the student network, wherein the teacher network is trained by constructing a defective sample to learn feature distribution of normal samples from a pre-trained expert network; and

an anomaly detection module configured to determine a pixel based on a difference map between the feature map output by the teacher network and the feature map output by the student network as an anomaly detection indicator for the acquired picture the acquired picture and for outputting an anomaly detection result, wherein the determination comprises identifying the pixel by virtue of the pixel having a greatest difference value in layers of the feature map output by the teacher network and in corresponding layers of the feature map output by the student network.

8. The system of claim 7 , wherein the anomaly detection module is further configured to:

determine the pixel in a total difference map between feature maps of layers with different resolutions that are output by the teacher network and feature maps of corresponding layers that are output by the student network as an anomaly value of the acquired picture, to output the anomaly detection result.

9. The system of claim 7 , characterized in that the defective sample is constructed through data augmentation.

10. The system of claim 7 , characterized in that training of the teacher network comprises the following steps, wherein a training data set comprises a normal non-defective sample and a defective sample:

inputting the normal non-defective sample to the pre-trained expert network and the teacher network, and minimizing, in a contrastive loss function, a distance between a feature vector of a last layer that is output by the expert network and a feature vector of a last layer that is output by the teacher network;

inputting the normal non-defective sample to the pre-trained expert network and inputting the defective sample to the teacher network, and maximizing, in the contrastive loss function, a distance between a feature vector of a last layer that is output by the expert network and a feature vector of a last layer that is output by the teacher network; and

updating a parameter of the teacher network based on loss calculation results.

11. The system of claim 7 , characterized in that training of the student network comprises the following steps, wherein a training data set comprises a normal sample:

inputting the normal sample to the trained teacher network and the student network to obtain a feature map of each layer that is output by the teacher network and a feature map of each corresponding layer that is output by the student network;

minimizing, in a distillation loss function, a distance between the feature map of each layer that is output by the teacher network and the feature map of each corresponding layer that is output by the student network; and

updating a parameter of the student network based on loss calculation results.

12. The system of claim 7 , characterized in that the anomaly detection module is further configured to:

locate an anomalous region in the acquired picture based on the determined anomaly value to obtain a segmented anomalous region mask.

13. An apparatus for anomaly detection, the apparatus comprising:

a memory storing computer-executable instructions; and

at least one processor, wherein the computer-executable instructions, when executed by the at least one processor, cause the apparatus to implement a method of claim 1 .

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 6, 2024
From: CONTEMPORARY AMPEREX TECHNOLOGY CO., LIMITED
To: CONTEMPORARY AMPEREX TECHNOLOGY (HONG KONG) LIMITED
Reel/Frame 068338/0723 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 21, 2023
From: SHU, ANNAN; CHEN, CAN; HUANG, JV
To: CONTEMPORARY AMPEREX TECHNOLOGY CO., LIMITED
Reel/Frame 064357/0825 →
Continuity (2)
Continuation PCTCN2021135278 · Dec 3, 2021
Related Publication 20230368372A1 · Nov 16, 2023