CN115984546B - Sample base generation method for anomaly detection of fixed scene - Google Patents

Sample base generation method for anomaly detection of fixed scene Download PDF

Info

Publication number
CN115984546B
CN115984546B CN202211651505.5A CN202211651505A CN115984546B CN 115984546 B CN115984546 B CN 115984546B CN 202211651505 A CN202211651505 A CN 202211651505A CN 115984546 B CN115984546 B CN 115984546B
Authority
CN
China
Prior art keywords
abnormal
secondary screening
map
abnormal region
detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211651505.5A
Other languages
Chinese (zh)
Other versions
CN115984546A (en
Inventor
黄玲
顾华鑫
王哲
黄泉龙
肖云
练睿
盛启亮
谢康
彭建
邓强强
李擎宇
聂潇
廖强
王月超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Shuju Intelligent Manufacturing Technology Co ltd
Original Assignee
Sichuan Shuju Intelligent Manufacturing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Shuju Intelligent Manufacturing Technology Co ltd filed Critical Sichuan Shuju Intelligent Manufacturing Technology Co ltd
Priority to CN202211651505.5A priority Critical patent/CN115984546B/en
Publication of CN115984546A publication Critical patent/CN115984546A/en
Application granted granted Critical
Publication of CN115984546B publication Critical patent/CN115984546B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to the field of digital image processing, and provides a sample base generation method for anomaly detection of a fixed scene. The main scheme includes creating acquisition files, taking each detection scene as a detection point, acquiring picture data sets in various states, and storing the picture data sets of corresponding detected objects by taking the detection scenes as units; performing primary screening on the obtained picture data set, generating a primary bottom image set by adopting a Finch cluster, and establishing a secondary screening bottom image set; acquiring ROI configuration information of an object to be detected, and drawing an acquired ROI region on an acquired picture data set; and solving an abnormal region by sequentially comparing the pictures in the secondary screening bottom image set with the most similar pictures in the primary bottom image set, and adding the pictures in the current secondary screening bottom image set into the primary bottom image set when the abnormal region is larger than a set threshold value.

Description

Sample base generation method for anomaly detection of fixed scene
Technical Field
The invention relates to the field of digital image processing, and provides a sample base generation method for anomaly detection of a fixed scene.
Background
Under the condition that an abnormal sample is extremely missing in the existing marketized abnormal detection, the effective base is used as a data storage center of a normal sample, a comparison template can be provided for an abnormal detection system, a current image is compared with a base map set of a pre-stored current point position, and a difference region and characteristic information are found out. The anomaly detection system is based on a normal sample library, so the primary task for the anomaly detection system is to generate an effective normal sample background library map.
The quality of the base map data of the normal sample is closely related to the abnormal detection effect, but the problems in the traditional detection scheme are that:
1) High dependence on abnormal samples, and high recall rate is difficult to obtain without the occurrence of abnormalities;
2) The redundancy or low representativeness of the normal sample library, and the library entering rule does not achieve high customization aiming at various states of the detection scene;
3) The detection time is long, the resource utilization rate is low, and the precision is deficient.
Disclosure of Invention
The invention aims to establish a normal sample background library in multiple states aiming at abnormal defects which cannot be exhausted, customize a warehousing rule for a detection scene, improve the representativeness of a background library picture, effectively reduce the detection time, improve the detection efficiency and improve the resource utilization rate.
The invention adopts the following technical means to realize the purposes:
a sample base generation method for anomaly detection of a fixed scene comprises the following steps:
step 1, creating an acquisition file, acquiring picture data sets in various states by taking each detection scene as a detection point, and storing the picture data sets of the corresponding detected objects by taking the detection scenes as units;
step 2, performing primary screening on the picture data set obtained in the step 1, generating a primary edition bottom atlas by adopting a Finch cluster, and establishing a secondary screening bottom atlas;
step 3, acquiring ROI configuration information of the object to be detected, and drawing an acquired ROI region on the picture data set obtained in the step 1, wherein the corresponding sensitivities of the ROI region are classified into low sensitivity, medium high sensitivity and high sensitivity; the configuration of the ROI is to reduce the pixel value of the low sensitive area, so that the operation of the later area or the aspect ratio on the pixels is facilitated, and the reporting and filtering of the low sensitive area are reduced.
And 4, solving an abnormal region of the pictures in the secondary screening bottom image set and the pictures most similar to the primary bottom image set in sequence, and adding the pictures in the current secondary screening bottom image set into the primary bottom image set when the abnormal region is larger than a set threshold value.
In the above technical solution, step 2 specifically includes the following steps:
and carrying out fast Finch clustering by taking a detection point as a unit, and calculating each data point by converting each picture data under the point into a data point and using a random kd-Tree algorithm to obtain a first nearest neighbor. Calculating nearest neighbor to obtain an adjacent matrix, and connecting samples of the adjacent matrix according to the following formula:
the meaning of the above formula is: the data points converted from the picture data are hereinafter referred to as samples
a. Connecting nearest neighbors of sample i;
b. if the nearest neighbor of sample j is i, also making a connection;
c. if the nearest neighbors of sample i and sample j are consistent, the connection is also performed;
wherein K is i 1 A nearest neighbor index representing sample i;
wherein the sample points connected together are the same cluster, the Finch clusters M classes, the first picture of different classes is taken as a primary bottom atlas, namely M1 pictures, and all the other pictures are secondary screening bottom atlas
In the above technical solution, step 3 specifically includes the following steps:
step 3.1, acquiring an acquired picture data set of each detection scene of the multiple detection scenes;
step 3.2, marking a strong attention area and a weak attention area when carrying out inspection in the pictures in the picture data set;
and 3.3, drawing the ROI area of each detection scene according to the marks.
In the above technical solution, step 4 specifically includes the following steps:
step 4.1, taking the primary edition base diagram as a base, and taking pictures in the secondary screening base diagram as test pictures in sequence;
step 4.2, taking the pictures of the secondary screening base chart set and all the pictures in the primary edition base chart set as difference values one by one to obtain a set of difference chart of a single secondary screening base chart set and all the single Zhang Chuban base chart sets, traversing the set of difference chart sets to carry out addition summation on all the values of each difference chart set to obtain a difference value of each difference chart set, and obtaining Top1 and Top2 with the minimum difference value, wherein Top1 is a first-level picture which is the most similar to the single secondary screening base chart, and Top2 is a second-level picture which is the most similar to the single secondary screening base chart set;
and 4.3, firstly, obtaining characteristic points of a single secondary screening base map and Top1 by using a scale invariant characteristic Sift, namely respectively obtaining respective characteristic point sets, pairing the characteristic points of the single secondary screening base map and the characteristic points in Top1 one by using a KNN method, calculating a homography matrix H from the characteristic point set of the single secondary screening base map to the characteristic point set of Top1, and multiplying the single secondary screening base map and the H to obtain a picture aligned with Top 1.
Step 4.4, differentiating the single secondary screening base map aligned with the Top1 in the previous step with the Top1 to obtain a maximum channel difference map, multiplying the pixel values of different sensitivity areas of the secondary screening base map by the corresponding coefficients of the sensitivities described in the step 3, enlarging the pixel value of a high sensitivity area, reducing the pixel value of a low sensitivity area, outputting a maximum channel difference map after ROI matching, and obtaining the maximum channel difference map of the single secondary screening base map and the Top1 after ROI matching, wherein the maximum channel difference map is recorded as the Top maximum channel difference map;
step 4.5, processing the single secondary screening base map and the Top2 to obtain a maximum channel difference map of the single secondary screening base map and the Top2, and marking the maximum channel difference map as the Top2 maximum channel difference map;
and 4.5.1, firstly, obtaining a single secondary screening base map and characteristic points of Top2 by using a scale invariant feature Sift, namely respectively obtaining respective point sets, pairing the single secondary screening base map point set and the characteristic points in Top1 one by using a KNN method, calculating a homography matrix H from the single secondary screening base map point set to the Top2 point set, and multiplying the single secondary screening base map and the H to obtain a picture aligned with Top2.
Step 4.5.2, differentiating the single secondary screening base map aligned with the Top2 in the step 4.5.1 with the Top2 to obtain a maximum channel difference map, multiplying the pixel values of different sensitivity areas of the secondary screening base map by the corresponding coefficients of the sensitivity in the step 3, increasing the pixel value of a high sensitivity area, decreasing the pixel value of a low sensitivity area, outputting a maximum channel difference map after ROI matching, and obtaining the maximum channel difference map of the single secondary screening base map and the Top2 after ROI matching;
(the purpose of referring to top1 and top2 is to prevent the accidental occurrence of abnormal regions caused by non-human reasons or improper threshold settings of a single secondary screening base map and a normal sample base map, for example, illumination, taking the intersection of top1 and top2 abnormal regions would severely tighten the entering of normal samples into the base map, and preserve more normal samples in more states)
Step 4.6, respectively filtering the non-abnormal region of the Top1 maximum channel difference map and the Top2 maximum channel difference map to obtain a filtered abnormal region of the Top2 abnormal region;
and 4.7, taking the intersection of the Top2 abnormal region and the Topl abnormal region as a final abnormal region, and converting the test picture into a base picture when the final abnormal region is larger than a threshold value.
In the above technical solution, step 4.6 includes:
abnormal aspect ratio analysis: when the abnormal region is within the abnormal aspect ratio threshold range of the threshold, multiplying the pixel value of the abnormal region by 0.1, reducing the pixel value of the abnormal aspect ratio region, and outputting the abnormal region;
abnormal area filtering: when the area of the abnormal region is smaller than the threshold range of the abnormal area, filtering the abnormal region, and not identifying the abnormal region;
abnormal density filtration: the pixel value summation of the abnormal region is divided by the area of the abnormal region to obtain an abnormal region density value, and when the abnormal region density value is smaller than the threshold value range of the abnormal density, the abnormal region is filtered and is not considered as the abnormal region;
abnormal edge filtering: the image to be detected is not only a regular polygon, but also various curves, and the following filtering scheme is adopted for the area with the misaligned curves:
taking out the maximum channel difference image of the single secondary screening base image and the abnormal region of the image to be matched;
respectively taking out edge gradient graphs of the two abnormal areas through a Sobel operator, and differentiating the two graphs to obtain an edge abnormal graph of the abnormal area;
and (3) performing expansion processing communication on the edge anomaly graphs of the anomaly areas, obtaining a list of all the difference areas, obtaining areas of all the difference area lists, and filtering the anomaly areas when the largest difference in the list is smaller than the area where the threshold value is located, so that the anomaly areas are not considered as the anomaly areas.
Because the invention adopts the technical means, the invention has the following beneficial effects:
1. according to the method, rules of pictures are found through a multi-stage multi-scale normal sample background library clustering method aiming at detection scenes, different threshold conditions are set according to the detection scenes, so that the detection scene warehousing rules can be customized efficiently, a normal sample background library in multiple states is formed, redundant background library pictures are reduced, detection efficiency is improved, and resource utilization rate is improved.
2. The feature vectors stored in the bottom library are more stored as pictures in the prior art, the feature vectors are used for comparing the extracted feature vectors of the pictures to be detected with the feature vectors in the bottom library, the retrieval similarity reaches the extremely high similarity picture with the set threshold value, but when the abnormal area is smaller, the high recall rate is difficult to ensure, when the abnormal area is used for carrying out abnormal detection on the pictures to be detected and the normal sample background library, the normal sample background library is often redundant and is difficult to have the representativeness of the normal samples in various states, the input rule is automatically formulated through four stages written in the scheme, the scientificity and the representativeness of the bottom library pictures are effectively ensured, and the abnormal condition which does not appear can also show the high recall rate in the bottom library picture comparison.
3. The dynamic threshold condition is set in the warehousing rules according to the detection scene, so that the warehousing rules can be customized for the detection scene, more time is not needed for training the model in real time to obtain the result, and the adjustability and the interpretation are strong.
4. The stronger the data representative of the normal sample under the multiple states is, the less the data is, so that the detection time can be effectively reduced, the detection efficiency is improved, and the resource utilization rate is improved.
Drawings
FIG. 1 is a schematic of the general flow chart of the present invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described in detail. While the invention will be described and illustrated in conjunction with certain specific embodiments, it will be understood that it is not intended to limit the invention to these embodiments alone. On the contrary, the invention is intended to cover modifications and equivalent arrangements included within the scope of the appended claims.
In addition, numerous specific details are set forth in the following description in order to provide a better illustration of the invention. It will be understood by those skilled in the art that the present invention may be practiced without these specific details.
In the technical field of computer vision based on anomaly detection, a normal sample background library under multiple states is established aiming at anomaly defects which cannot be exhausted, a library rule is customized for a detection scene, and the representativeness of a library picture is improved. The general flow of automatically generating the bottom library diagram in the scheme is shown in figure 1.
The whole steps are as follows:
1. creating an acquisition file
And collecting picture data sets in various states under the detection scene, and storing corresponding detection object test patterns by taking the detection scene as a unit.
2. Generating a primary plate bottom atlas and establishing a secondary screening bottom atlas
A quick unsupervised clustering algorithm is used for converting each test chart under a detection object into data points, and connecting the data points through nearest neighbor elimination of the data points, so that data category division is obtained. The algorithm does not need a user to define any super parameters, is high in speed and low in calculation consumption, and generates a base map of the initial edition and a secondary screening library of other non-entered base maps.
1. Carrying out quick Finch clustering by taking a point position as a unit, converting each test chart under the point position into data points, obtaining a first nearest neighbor by using a random kd-Tree algorithm to calculate the nearest neighbor, and obtaining an adjacent matrix according to the following formula, wherein K is the following formula i 1 represents the nearest neighbor index of sample i, the meaning of the following formula: a. connecting nearest neighbors of sample i; b. if the nearest neighbor of sample j is i, also making a connection; b. if the nearest neighbors of sample i and sample j agree, a join is made as well.
2. Through the derivation of the above formula, a complete and sparse adjacency matrix can be obtained, wherein the sample points connected together are the same cluster, the first sheet of different categories M is taken as a primary plate bottom atlas, namely M1 sheet, and all the other pictures are secondary screening bottom atlas.
3. Configuration information acquisition of object to be detected
The customized warehousing rules are carried out on the detection scene, whether the detection scene is the equipment facility in close range or far range or the abnormal detection of the open scene, not all areas need to be subjected to high-sensitivity abnormal detection under the requirement of the current detection scene, such as multi-state display of the equipment facility, LED normally-on indicator light equipment, a non-working area of the area where the field of view of the camera is located, and the like.
Therefore, five corresponding polygonal region sensitivity configurations (hereinafter referred to as ROIs) are provided for each detection scene, wherein the five polygonal region sensitivity configurations comprise low sensitivity, middle high sensitivity and high sensitivity regions, different ROIs in each point location are provided with 0-1 ladder corresponding sensitivity indexes for local special treatment, the high sensitivity regions strengthen attention, and the low sensitivity regions reduce attention so as to reduce the number of false AI detection.
The procedure for acquiring the ROI area is as follows:
1. acquiring a set of each detection scene of the multiple detection scenes;
2. and communicating the strong attention area and the weak attention area when each worker using the multi-detection scene detects that the worker has carried out the inspection in the past;
3. drawing the ROI area of each detection scene to carry out local drawing;
4. TOP2 screening and establishing warehousing rules
The bottom library is used as a representative library of the template of the normal sample, and should cover imaging differences caused by various states of the normal sample under normal conditions, such as various weather conditions and photosensitive states, normal display of multiple states of equipment and facilities, and the like, instead of pictures in one or only a plurality of states which are identical. And solving an abnormal region of the test pictures in the secondary screening base picture and the most similar pictures of the primary base picture in sequence, and adding the pictures in the secondary screening base picture into the primary base picture when the abnormal region is larger than a certain set threshold value.
1. Taking the primary edition base picture as a base, and taking pictures in the secondary screening base as test pictures;
2. and (3) taking difference values of all pictures of the secondary screening base map and the primary base map, obtaining all abnormal pixel values, summing the abnormal pixel values, and taking out the abnormal pixel values and the minimum top1 and top2 in the secondary screening base map and the primary base map. (Top 1, top2 is considered to be the closest primary secondary picture to the test picture, hereinafter referred to as the image to be matched), and the reasons for selecting top1 and Top2 are explained at the following 6 th point;
3. the secondary screening base map needs to be subjected to Sift image alignment with the image to be matched obtained in the previous step.
4. The second screening base map is differentiated with the image to be matched to obtain a maximum channel difference map, different sensitivity areas of the image to be detected are multiplied by a coefficient corresponding to the sensitivity, the pixel value of a high sensitivity area is increased, the pixel value of a low sensitivity area is decreased, and the maximum channel difference map output after the ROI is matched is output;
5. the image environment transformation, the change of the photosensitive environment, the offset of the camera and the normal samples of the detection object in various states are all the reasons for generating abnormal pixel areas and are also the important reasons for causing redundancy of the normal samples of the bottom library, but what is needed is that the normal samples of the detection object in various states are the imaging environment transformation and the change of the photosensitive environment, which mainly cause the change of the density and the pixel value of the abnormal areas, the non-abnormal areas are filtered by checking the rules of the abnormal areas by human eyes, the false detection of the abnormal areas is reduced, and the various thresholds of the abnormal areas mentioned below are required to be customized and adjusted according to the actual scene abnormal detection requirements:
(1) Abnormal aspect ratio analysis: although the alignment treatment is performed in the earlier stage, the secondary screening base map and the picture to be matched cannot be subjected to complete 1:1, overlapping, when the abnormal region is in the abnormal aspect ratio threshold range of the threshold value, multiplying the pixel value of the abnormal region by 0.1, and outputting the abnormal region;
(2) Abnormal area filtering: when the area of the abnormal region is smaller than the threshold range of the abnormal area, filtering the abnormal region, and not identifying the abnormal region;
(3) Abnormal density filtration: the pixel value summation of the abnormal region is divided by the area of the abnormal region to obtain an abnormal region density value, and when the abnormal region density value is smaller than the threshold value range of the abnormal density, the abnormal region is filtered and is not considered as the abnormal region;
(4) Abnormal edge filtering: the image to be detected is not only a regular polygon, but also various curves, and the following filtering scheme is adopted for the area with the misaligned curves:
1) Taking out an abnormal region of the maximum channel difference image of the secondary screening image and the base image to be matched;
2) Respectively taking out edge gradient graphs of the two abnormal areas through a Sobel operator, and differentiating the two graphs to obtain an edge abnormal graph of the abnormal area;
3) Performing expansion processing communication on the edge anomaly graphs of the anomaly areas to obtain a list of all the difference areas, obtaining areas of all the difference area lists, and filtering the anomaly areas when the largest difference in the list is smaller than the area where the threshold value is located, so that the anomaly areas are not considered as the anomaly areas;
6. in order to ensure that the screened base pictures are more representative, a multi-base picture cross-validation mode is adopted, the finally screened abnormal region is the intersection of the secondary screened base pictures and top1 and top2 abnormal regions, and when the abnormal region is larger than a specific threshold value, the test picture is converted into a base picture.
Example 1
A sample base generation method for anomaly detection of a fixed scene comprises the following steps:
step 1, creating an acquisition file, acquiring picture data sets in various states by taking each detection scene as a detection point, and storing the picture data sets of the corresponding detected objects by taking the detection scenes as units;
step 2, performing primary screening on the picture data set obtained in the step 1, generating a primary edition bottom atlas by adopting a Finch cluster, and establishing a secondary screening bottom atlas;
step 3, acquiring ROI configuration information of the object to be detected, and drawing an acquired ROI region on the picture data set obtained in the step 1, wherein the corresponding sensitivities of the ROI region are classified into low sensitivity, medium high sensitivity and high sensitivity;
and 4, solving an abnormal region of the pictures in the secondary screening bottom image set and the pictures most similar to the primary bottom image set in sequence, and adding the pictures in the current secondary screening bottom image set into the primary bottom image set when the abnormal region is larger than a set threshold value.
In the above technical solution, step 2 specifically includes the following steps:
and carrying out fast Finch clustering by taking a detection point as a unit, and calculating each data point by converting each picture data under the point into a data point and using a random kd-Tree algorithm to obtain a first nearest neighbor. Calculating nearest neighbor to obtain an adjacent matrix, and connecting samples of the adjacent matrix according to the following formula:
the meaning of the above formula is: the data points converted from the picture data are hereinafter referred to as samples
a. Connecting nearest neighbors of sample i;
b. if the nearest neighbor of sample j is i, also making a connection;
c. if the nearest neighbors of sample i and sample j are consistent, the connection is also performed;
wherein K is i 1 A nearest neighbor index representing sample i;
wherein the sample points connected together are the same cluster, finnch clusters M classes, the first picture of different classes is taken as a primary base atlas, namely M1 pictures, and all the other pictures are secondary screening base atlas
In the above technical solution, step 3 specifically includes the following steps:
step 3.1, acquiring an acquired picture data set of each detection scene of the multiple detection scenes;
step 3.2, marking a strong attention area and a weak attention area when carrying out inspection in the pictures in the picture data set;
and 3.3, drawing the ROI area of each detection scene according to the marks.
In the above technical solution, step 4 specifically includes the following steps:
step 4.1, taking the primary edition base diagram as a base, and taking pictures in the secondary screening base diagram as test pictures in sequence;
step 4.2, taking the pictures of the secondary screening base chart set and all the pictures in the primary edition base chart set as difference values one by one to obtain a set of difference chart of a single secondary screening base chart set and all the single Zhang Chuban base chart sets, traversing the set of difference chart sets to carry out addition summation on all the values of each difference chart set to obtain a difference value of each difference chart set, and obtaining Top1 and Top2 with the minimum difference value, wherein Top1 is a first-level picture which is the most similar to the single secondary screening base chart, and Top2 is a second-level picture which is the most similar to the single secondary screening base chart set;
and 4.3, firstly obtaining characteristic points of a single secondary screening base map and Top1 by using a scale invariant feature Sift, respectively obtaining respective point sets, matching the single secondary screening base map point set with the characteristic points in Top1 one by using a KNN method, calculating a homography matrix H from the single secondary screening base map point set to the Top1 point set, and multiplying the single secondary screening base map by H to obtain a picture aligned with Top 1.
Step 4.4, differentiating the single secondary screening base map aligned with the Top1 in the previous step with the Top1 to obtain a maximum channel difference map, multiplying the pixel values of different sensitivity areas of the secondary screening base map by the corresponding coefficients of the sensitivities described in the step 3, enlarging the pixel value of a high sensitivity area, reducing the pixel value of a low sensitivity area, outputting a maximum channel difference map after ROI matching, and obtaining the maximum channel difference map of the single secondary screening base map and the Top1 after ROI matching, wherein the maximum channel difference map is recorded as the Top1 maximum channel difference map;
step 4.5, processing the single secondary screening base map and the Top2 to obtain a maximum channel difference map of the single secondary screening base map and the Top2, and marking the maximum channel difference map as the Top2 maximum channel difference map;
and 4.5.1, firstly, obtaining a single secondary screening base map and characteristic points of Top2 by using a scale invariant feature Sift, namely respectively obtaining respective point sets, pairing the single secondary screening base map point sets with the characteristic points in Top2 by using a KNN method, calculating a homography matrix H from the single secondary screening base map point sets to the Top2 point sets, and multiplying the single secondary screening base map and the H to obtain the picture aligned with Top2.
Step 4.5.2, differentiating the single secondary screening base map aligned with the Top2 in the step 4.5.1 with the Top2 to obtain a maximum channel difference map, multiplying the pixel values of different sensitivity areas of the secondary screening base map by the corresponding coefficients of the sensitivity in the step 3, increasing the pixel value of a high sensitivity area, decreasing the pixel value of a low sensitivity area, outputting a maximum channel difference map after ROI matching, and obtaining the maximum channel difference map of the single secondary screening base map and the Top2 after ROI matching;
(the purpose of referencing topl and top2 is to prevent single secondary screening bottom and normal sample bottom from accidental abnormal areas caused by non-human reasons or improper threshold settings, such as illumination transformation and daily changes of equipment and facilities, etc., taking intersection of topl and top2 abnormal areas then stricts the stringency of normal sample entering bottom, and retains more normal samples in more states)
Step 4.6, filtering the non-abnormal region of the Top1 maximum channel difference diagram and the Top2 maximum channel difference diagram respectively to obtain a filtered abnormal region of the Top1 and a filtered abnormal region of the Top 2;
and 4.7, taking the intersection of the Top2 abnormal region and the Topl abnormal region as a final abnormal region, and converting the test picture into a base picture when the final abnormal region is larger than a threshold value.
In the above technical solution, step 4.6 includes:
abnormal aspect ratio analysis: when the abnormal region is within the abnormal aspect ratio threshold range of the threshold, multiplying the pixel value of the abnormal region by 0.1, reducing the pixel value of the abnormal aspect ratio region, and outputting the abnormal region;
abnormal area filtering: when the area of the abnormal region is smaller than the threshold range of the abnormal area, filtering the abnormal region, and not identifying the abnormal region;
abnormal density filtration: the pixel value summation of the abnormal region is divided by the area of the abnormal region to obtain an abnormal region density value, and when the abnormal region density value is smaller than the threshold value range of the abnormal density, the abnormal region is filtered and is not considered as the abnormal region;
abnormal edge filtering: the image to be detected is not only a regular polygon, but also various curves, and the following filtering scheme is adopted for the area with the misaligned curves:
taking out the maximum channel difference image of the single secondary screening base image and the abnormal region of the image to be matched;
respectively taking out edge gradient graphs of the two abnormal areas through a Sobel operator, and differentiating the two graphs to obtain an edge abnormal graph of the abnormal area;
and (3) performing expansion processing communication on the edge anomaly graphs of the anomaly areas, obtaining a list of all the difference areas, obtaining areas of all the difference area lists, and filtering the anomaly areas when the largest difference in the list is smaller than the area where the threshold value is located, so that the anomaly areas are not considered as the anomaly areas.

Claims (4)

1. The sample base generation method for anomaly detection of a fixed scene is characterized by comprising the following steps:
step 1, creating an acquisition file, acquiring picture data sets in various states by taking each detection scene as a detection point, and storing the picture data sets of the corresponding detected objects by taking the detection scenes as units;
step 2, performing primary screening on the picture data set obtained in the step 1, generating a primary edition bottom atlas by adopting a Finch cluster, and establishing a secondary screening bottom atlas;
step 3, acquiring ROI configuration information of the object to be detected, and drawing an acquired ROI region on the picture data set obtained in the step 1, wherein the corresponding sensitivities of the ROI region are classified into low sensitivity, medium high sensitivity and high sensitivity;
step 4, solving abnormal areas of the pictures in the secondary screening bottom image set and the pictures most similar to the primary bottom image set in sequence, and adding the pictures in the current secondary screening bottom image set into the primary bottom image set when the abnormal areas are larger than a set threshold value; the step 4 specifically comprises the following steps:
step 4.1, taking the primary edition base diagram as a base, and taking pictures in the secondary screening base diagram as test pictures in sequence;
step 4.2, taking the pictures of the secondary screening base chart set and all the pictures in the primary edition base chart set as difference values one by one to obtain a set of difference chart of a single secondary screening base chart set and all the single Zhang Chuban base chart sets, traversing the set of difference chart sets to carry out addition summation on all the values of each difference chart set to obtain a difference value of each difference chart set, and obtaining Top1 and Top2 with the minimum difference value, wherein Top1 is a first-level picture which is the most similar to the single secondary screening base chart, and Top2 is a second-level picture which is the most similar to the single secondary screening base chart set;
step 4.3, firstly, obtaining a single secondary screening base map and Top1 by using a scale invariant feature Sift, namely respectively obtaining respective feature point sets, matching the feature points of the single secondary screening base map with the feature points in Top1 one by using a KNN method, calculating a homography matrix H from the feature point set of the single secondary screening base map to the feature point set of Top1, and multiplying the single secondary screening base map by H to obtain a picture aligned with Top 1;
step 4.4, differentiating the single secondary screening base map aligned with Top1 in the step 4.3 with Top1 to obtain a maximum channel difference map, multiplying the pixel values of different sensitivity areas of the secondary screening base map by the corresponding coefficients of the sensitivities described in the step 3, increasing the pixel value of a high-sensitivity area, decreasing the pixel value of a low-sensitivity area, outputting a maximum channel difference map after ROI matching, and obtaining the maximum channel difference map of the single secondary screening base map and Top1 after ROI matching, and marking the maximum channel difference map as Top1 maximum channel difference map;
step 4.5, processing the single secondary screening base map and the Top2 to obtain a maximum channel difference map of the single secondary screening base map and the Top2, and marking the maximum channel difference map as the Top2 maximum channel difference map;
step 4.5.1, firstly, obtaining characteristic points of a single secondary screening base map and Top2 by using a scale invariant characteristic Sift, namely, the characteristic points can respectively obtain respective point sets, pairing the characteristic points of the single secondary screening base map with the characteristic points in Top1 one by using a KNN method, calculating a homography matrix H from the point set of the single secondary screening base map to the point set of Top2, and multiplying the single secondary screening base map by H to obtain a picture aligned with Top 2;
step 4.5.2, differentiating the single secondary screening base map aligned with Top2 in step 4.5.1 with Top2 to obtain a maximum channel difference map, multiplying the pixel values of different sensitivity areas of the secondary screening base map by the corresponding coefficients of the sensitivity in step 3, increasing the pixel value of a high sensitivity area, decreasing the pixel value of a low sensitivity area, outputting a maximum channel difference map after ROI matching, and obtaining a maximum channel difference map of the single secondary screening base map and Top2 after ROI matching;
step 4.6, filtering the non-abnormal region of the Top1 maximum channel difference diagram and the Top2 maximum channel difference diagram respectively to obtain a filtered abnormal region of the Top1 and a filtered abnormal region of the Top 2;
and 4.7, taking the intersection of the Top1 abnormal region and the Top2 abnormal region as a final abnormal region, and converting the test picture into a base picture when the final abnormal region is larger than a threshold value.
2. The method for generating a sample base for anomaly detection in a stationary scene according to claim 1, wherein the step 2 comprises the steps of:
carrying out quick Finch clustering by taking a detection point as a unit, converting each picture data under the detection point into data points, calculating each data point by using a random kd tree algorithm to obtain an adjacent matrix, and connecting samples of the adjacent matrix according to the following formula:
the meaning of the above formula is: the data points converted from the picture data are hereinafter referred to as samples
a. Connecting nearest neighbors of sample i; b. if the nearest neighbor of sample j is i, also making a connection;
c. if the nearest neighbors of sample i and sample j are consistent, the connection is also performed;
wherein K is i 1 A nearest neighbor index representing sample i;
the sample points connected together are the same cluster, the finch clusters out M classes, the first sheets of different classes are taken as primary plate bottom atlas, namely M1 sheets, and all other pictures are secondary screening bottom atlas.
3. The method for generating a sample base for anomaly detection in a stationary scene according to claim 1, wherein the step 3 comprises the steps of:
step 3.1, acquiring an acquired picture data set of each detection scene of the multiple detection scenes;
step 3.2, marking a strong attention area and a weak attention area when carrying out inspection in the pictures in the picture data set;
and 3.3, drawing the ROI area of each detection scene according to the marks.
4. The sample library generation method for anomaly detection for a fixed scene as claimed in claim 1, wherein step 4.6 comprises:
abnormal aspect ratio analysis: when the abnormal region is within the abnormal aspect ratio threshold range of the threshold, multiplying the pixel value of the abnormal region by 0.1, reducing the pixel value of the abnormal aspect ratio region, and outputting the abnormal region;
abnormal area filtering: when the area of the abnormal region is smaller than the threshold range of the abnormal area, filtering the abnormal region, and not identifying the abnormal region;
abnormal density filtration: the pixel value summation of the abnormal region is divided by the area of the abnormal region to obtain an abnormal region density value, and when the abnormal region density value is smaller than the threshold value range of the abnormal density, the abnormal region is filtered and is not considered as the abnormal region;
abnormal edge filtering: the image to be detected is not only a regular polygon, but also various curves, and the following filtering scheme is adopted for the area with the misaligned curves:
taking out the maximum channel difference image of the single secondary screening base image and the abnormal region of the image to be matched;
respectively taking out edge gradient graphs of the two abnormal areas through a Sobel operator, and differentiating the two graphs to obtain an edge abnormal graph of the abnormal area;
and (3) performing expansion processing communication on the edge anomaly graphs of the anomaly areas, obtaining a list of all the difference areas, obtaining areas of all the difference area lists, and filtering the anomaly areas when the largest difference in the list is smaller than the area where the threshold value is located, so that the anomaly areas are not considered as the anomaly areas.
CN202211651505.5A 2022-12-21 2022-12-21 Sample base generation method for anomaly detection of fixed scene Active CN115984546B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211651505.5A CN115984546B (en) 2022-12-21 2022-12-21 Sample base generation method for anomaly detection of fixed scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211651505.5A CN115984546B (en) 2022-12-21 2022-12-21 Sample base generation method for anomaly detection of fixed scene

Publications (2)

Publication Number Publication Date
CN115984546A CN115984546A (en) 2023-04-18
CN115984546B true CN115984546B (en) 2023-08-08

Family

ID=85957523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211651505.5A Active CN115984546B (en) 2022-12-21 2022-12-21 Sample base generation method for anomaly detection of fixed scene

Country Status (1)

Country Link
CN (1) CN115984546B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101957325A (en) * 2010-10-14 2011-01-26 山东鲁能智能技术有限公司 Substation equipment appearance abnormality recognition method based on substation inspection robot
CN110136083A (en) * 2019-05-14 2019-08-16 深圳大学 A kind of the base map update method and device of combination interactive mode
CN110298837A (en) * 2019-07-08 2019-10-01 上海天诚比集科技有限公司 Fire-fighting road occupying exception object detecting method based on frame differential method
CN113554645A (en) * 2021-09-17 2021-10-26 常州微亿智造科技有限公司 Industrial anomaly detection method and device based on WGAN

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11900679B2 (en) * 2019-11-26 2024-02-13 Objectvideo Labs, Llc Image-based abnormal event detection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101957325A (en) * 2010-10-14 2011-01-26 山东鲁能智能技术有限公司 Substation equipment appearance abnormality recognition method based on substation inspection robot
CN110136083A (en) * 2019-05-14 2019-08-16 深圳大学 A kind of the base map update method and device of combination interactive mode
CN110298837A (en) * 2019-07-08 2019-10-01 上海天诚比集科技有限公司 Fire-fighting road occupying exception object detecting method based on frame differential method
CN113554645A (en) * 2021-09-17 2021-10-26 常州微亿智造科技有限公司 Industrial anomaly detection method and device based on WGAN

Also Published As

Publication number Publication date
CN115984546A (en) 2023-04-18

Similar Documents

Publication Publication Date Title
US10579669B2 (en) System, apparatus, method, program and recording medium for processing image
US8135239B2 (en) Display control apparatus, display control method, computer program, and recording medium
CN111784633B (en) Insulator defect automatic detection algorithm for electric power inspection video
US10902563B2 (en) Moran's / for impulse noise detection and removal in color images
CN111368690B (en) Deep learning-based video image ship detection method and system under influence of sea waves
US20070195344A1 (en) System, apparatus, method, program and recording medium for processing image
KR20160143494A (en) Saliency information acquisition apparatus and saliency information acquisition method
US20050141766A1 (en) Method, system and program for searching area considered to be face image
CN112633382A (en) Mutual-neighbor-based few-sample image classification method and system
Agrawal et al. Survey on image segmentation techniques and color models
CN115984546B (en) Sample base generation method for anomaly detection of fixed scene
CN116912184A (en) Weak supervision depth restoration image tampering positioning method and system based on tampering area separation and area constraint loss
JP3962517B2 (en) Face detection method and apparatus, and computer-readable medium
CN105023001B (en) A kind of more pedestrian detection methods and system based on selective area
Busin et al. Colour space selection for unsupervised colour image segmentation by analysis of connectedness properties
Pan et al. TV logo classification based on convolutional neural network
CN112560929A (en) Oil spilling area determining method and device and storage medium
Liu et al. Splicing forgery localization via noise fingerprint incorporated with CFA configuration
CN113158838B (en) Full-size depth map supervision-based face representation attack detection method
Soobhany et al. On the performance of Li’s unsupervised image classifier and the optimal cropping position of images for Forensic Investigations
CN117372732A (en) Image target detection method based on deep learning
CN115272249A (en) Defect detection method and device, computer equipment and storage medium
CN114708662A (en) Behavior characteristic detection system based on big data
CN115205579A (en) Image color cast detection method, device and computer readable storage medium
CN117474918A (en) Abnormality detection method and device, electronic device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant