A method for detection of anomalies in an image and anomaly detection system
The method uses a pre-trained deep encoder and one-class models to efficiently detect anomalies in manufacturing environments with unknown textures, achieving high detection rates and low false positives without extensive training data.
Patent Information
- Application Number
- PCT/EP2024/055454
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2025-09-04
AI Technical Summary
Existing image anomaly detection methods require extensive training data and human supervision, making them unsuitable for manufacturing environments where surface textures frequently change and the nature of anomalies is unknown.
A method using a pre-trained deep encoder to extract one-dimensional features, combined with principal component analysis and one-class models, allows for rapid anomaly detection based solely on negative samples, reducing the need for extensive training data and enabling fully automated operation.
This approach achieves high detection rates with low false positives, suitable for manufacturing environments with changing designs, by leveraging pre-trained encoders and one-class classifiers to simplify the learning process and improve precision.
Smart Images

Figure EP2024055454_04092025_PF_FP_ABST
Abstract
Description
[0001] P2024,0232 WO E March 1,2024 -1 - DescriptionA METHOD FOR DETECTION OF ANOMALIES IN AN IMAGE AND ANOMALYDETECTION SYSTEMThe present disclosure relates to a method for dete ction ofanomalies in an image as well as a corresponding an omalydetection system.Computer-based, automated image analysis in general , and thedetection of anomalies in an image in particular, i s one keyaspect in many areas of technology. For example, inautonomous driving, detection of anomalies, i.e., u nknown orforeign objectson a driving surface,isimportant fortriggering warnings and / or initiating emergency act ions.Other examples that rely on automated anomaly detec tion aremedical diagnosis systems, for example the detectio n ofanomalies in tissue samples, as well as the detecti on offaults in manufactured goods, e.g., non-destructive testing.As a specific example, it is desirable to detect de fects inwood laminates, i.e., a top surface of a wood-based workpieceor a decorative strip of wood laminate to be applie d to anedge of a workpiece. Such laminates or other decora tivesurfaces may have a frequently changing design. Mor eover, dueto the large surface area produced,aswellasthe frequent changesin desired pattern,itmaynotbe feasible to manuallyinspecteach manufactured surface.So far, automatic detection of anomalies is usually based ontraditional image processing methods or highly spec ialistalgorithms. These approaches often require manual a daptationsand depend on the quality and quantity of available template P2024,0232 WO E March 1,2024 -2 -data. Less commonly, supervised AI-based learning m odels havebeen employed for anomaly detection. However, in th is caseextensive data sets of anomalies were required in o rder totrain the modelseffectively.One conventional approach is the use of image analy sisalgorithms that enable objects to be separated from theirbackground. One example is the so-called Otsu thres holding,which is contained in many image processing tools a ndlibraries by default. The method has been described in detailin the article “A Threshold Selection Method from G ray-LevelHistograms” in the IEEE Transactions on Systems, Ma n, andCybernetics. One specificexample ofan AI-based learning model isthe useof so-called support vector machines (SVM) and supe rvisedlearning for the detection of anomalies. The SVM is trainedusing both positive and negative sample images to d etectanomaliesin itsnormaloperation.Both of the above methods are unsuitable for use in amanufacturing environment, where the desired textur e of asurface often changes and, at the same time, the ex act natureand type of anomalies to be detected within the des iredsurfacesare partlyorentirelyunknown.The present disclosure aims at more solving the pro blem ofdetection of anomalies on surfaces more efficiently and / ormore precisely. Preferably, it should be suitable f orscenarios where only limited training data is avail able,and / or where the exact nature and type of anomalies to bedetected within the desired surfacesare partlyor entirely unknown. P2024,0232 WO E March 1,2024 -3 - Accordingly,itisa challenge to provide improved methodsand systems for detection of anomalies in images wh ich can berapidly deployed in a manufacturing environment, inparticular without the need to provide extensive tr ainingsets and / or adapt algorithms under human supervisio n.In this context, an improved method for detection o fanomalies is disclosed. The method comprises the st eps of:obtaining a setofnegative samples,each negative samplecomprising at least a part of an image comprising n o anomaly;training a processing chain using the set of negati vesamples;and processing an unknown image using the trainedprocessing chain to decide whether the unknown imag ecomprises an anomaly or not. Training the processin g chaincomprises: using a pre-trained deep encoder to obta in anarray of one-dimensional feature sets, each one-dim ensionalfeature setofthe arrayindicating featuresofacorresponding negative sample from the set of negat ivesamples; performing a reduction analysis, in partic ular aprincipal component analysis, on the array of one-d imensionalfeature sets to obtain a corresponding array of red uced setsof features; and training a one-class model based o n thearrayofreduced setsoffeatures. The disclosed method usesand combinesa numberof differenttechniques to greatly simplify the amount of learni ngrequired for training an AI-based detection of anom alies witha high detection rate and low false positive rate. Inparticular, the disclosed method allows the impleme ntation ofa fully automated, fast learning phase, based on th eprovision of only negative samples, i.e., the provi sion ofimagescomprising no anomaly. P2024,0232 WO E March 1,2024 -4 - Among others,the above advantagesare achieved by the use ofa pre-trained deep encoder to obtain an array of on e-dimensional features from a given sample. This esse ntiallyreduces the input value domain from a two-dimension al pixeldomain to a one-dimensional feature domain. Moreove r, in asubsequentreduction analysis,the one-dimensional featuredomain can be further reduced to a reduced set of f eatures,which are particularly relevant to a given target d omain,i.e., patterns comprised in images to be supervised . Such areduction analysis, in particular a principal compo nentanalysis, can be performed based on a relatively sm alltraining set and greatly increases the significance of theextracted,reduced setoffeaturesdescribing each image.Based on this reduced set of features, it is possib le totrain one ormore one-classmodelssuccessfullyin arelatively short time, which can then be used to di scriminatebetween images comprising an anomaly and images com prising noanomaly. Attention isdrawn to the factthatthe processing chain used during processing ofunknown imagesisessentially the sameas the processing chain used during a training. The keydifference between the two operating phases is ther efore thesamples provided to the processing chain as well as the factthat the weights and other initialization parameter s computedduring the training phase are fixed during the subs equentimage classification.Optionally, each negative sample corresponds to a t rainingpatch with a predefined target size, wherein the pr edefinedtarget size corresponds to a size of training image s usedduring pre-training of the deep encoder. The step o f P2024,0232 WO E March 1,2024 -5 -obtaining the set of negative samples comprises: ob tainingsample images comprising no anomaly; dividing the s ampleimagesinto a pluralityoftraining patchesofthe predefinedtarget size; and selecting at least some of the tra iningpatches as negative samples. The step of processing theunknown image comprises: dividing the unknown image into aplurality of target patches with the predefined tar get size;processing each target patch using the trained proc essingchain to determine whether the target patch compris es ananomaly or not; and deciding that the unknown image comprisesno anomaly only if it is determined that none of th e targetpatchescomprisesan anomaly.The separation of images into patches with a predef inedtarget size used during pre-training of the deep en codersignificantly reduces the processing power required toimplement the deep encoder. Moreover, it allows a r elativelylarge number of negative samples to be generated fr om alimited numberoftraining images.Optionally, the step of obtaining a set of negative samplescomprises: providing a pool of negative samples, inparticular the plurality of training patches as det ailedabove; selecting an initial subset, in particular a randomsubset, from the pool of negative samples; pre-trai ning theprocessing chain using the initial subset to obtain a pre-trained processing chain;processing the remaining samplesfrom the pool of negative samples not included in t he initialsubset using the pre-trained processing chain to de cidewhether each of the remaining samples is classified as ananomaly or not; and selecting all samples classifie d by thepre-trained processing chain as containing an anoma ly as part P2024,0232 WO E March 1,2024 -6 -of the set of negative samples for training the pro cessingchain.The above two-stage selection of negative samples g reatlyimproves the detection rate of the trained processi ng chain.In particular, in a first training stage, a relativ ely smallnumber of negative samples selected at random can b e used toquickly obtain a pre-trained processing chain. This pre-trained processing chain can then be used to quickl y verifythe precision of the pre-trained processing chain f or thespecific application domain by classifying the rema iningsamples. Any false positives, i.e., samples conside red tocontain an anomalywhile theyare derived from the imagescontaining no anomalies, can be used to retrain theprocessing chain, thereby greatly improving its acc uracy forthe specific problem domain. Note that no human int eractionis required in either training stage, as it is clea r from theoutset that each patch provided to the processing c hainduring training representsa negative sample.Optionally, the selected set of negative samples fo r trainingthe processing chain furthercomprisesthe initial subset.The additional inclusion of the random set of negat ivesamples avoids an overly high bias of the trained p rocessingchain on problematicimage fragments.Optionally, training the processing chain further c omprises:generating a set of pseudo-positive samples based o n the setof negative samples, each pseudo-positive sample be inggenerated by modifying at least one of the negative samples;and fine-tuning the pre-trained deep encoderusing the setof negative sampleslabelled asnegativesand the set ofpseudo- positive sampleslabelled aspositives. P2024,0232 WO E March 1,2024 -7 -While the use of a pre-trained deep encoder greatly speeds upthe extraction of potentially relevant features fro m ageneric image serving as input to the processing ch ain, itmay not be tuned to the specific application area o r problemdomain. Accordingly, by the above automatic generat ion ofpseudo-positive samples using deliberately modified , i.e.,disturbed, versions of the samples, e.g., images or imagepatches,comprising no anomalies,the deep encoder can befine-tuned to select a feature set that is specific to agiven problem domain. Asan example,noise maybe added to each negative sample toobtain a corresponding pseudo-positive sample. This can befacilitated easily, for example using a correspondi ng filterofan image processing library. Optionally,in the step oftraining the processing chain,aplurality of one-class models is trained, each one- classmodel being trained independently based on the redu ced set offeatures. The step of processing an unknown image c omprises:obtaining a reduced feature set corresponding to th e unknownimage; separately processing the reduced feature se t using atleast a subset of the plurality of one-class models ; anddeciding whether the unknown image comprises an ano maly ornot based on outputs provided by the used one-class models.The use of more than one one-class model further im proves thedetection accuracy of the disclosed processing chai n. Inparticular, not every type of one-class model may b e suitableto detect all kinds of possible anomalies in a prob lemdomain. By combining the output of multiple one-cla ss models,the overall detection accuracy may be further reduc ed. P2024,0232 WO E March 1,2024 -8 -Optionally, each one-class model of the plurality o f one-class models is configured to output a binary valueindicating whether the unknown image comprises an a nomaly ornot. The outputted binary values of the used one-cl ass modelsare combined, in particular using a majority, minor ity orconsensus decision, to detect whether an unknown im agecomprisesan anomalyornot.Depending on the specific application domain, one o f theabove decision criteria maybe used to combine the outputofmultiple one-class models in a suitable manner. For example,in the most restrictive consensus or hard voting de cision,only when all used one-class models agree on a part iculardetection outcome the output is considered to be cl ear. Thismay mean thata sample isconsidered to contain no anomalyonly if all used one-class models indicate the abse nce of ananomaly. Inversely, if at least one one-class model indicatesthe presence of an anomaly, the sample is considere d tocontain an anomaly, irrespective of the classificat ion resultof all other one-class models. In less critical app lications,it may be sufficient to use a less restrictive majo rity orminority voting decision to either sort out samplespotentially comprising an anomaly and / or samples mo st likelynot comprising an anomaly. For example, a single mo delindicating an anomaly may be overruled by several o thermodelsindicating the absence ofanomalies. Optionally,a decision ismade indicating thatthe unknownimage comprises an anomaly if one-class model of th eplurality of one-class models indicates that the un knownimage comprises an anomaly, and processing the redu ced P2024,0232 WO E March 1,2024 -9 -feature set using any of the remaining one-class mo dels isstopped oromitted afterthe decision istaken.The above implementation may be particularly suitab le in afastmanufacturing orotherdetection environment, wheresamples are checked based on a live video stream ta ken, forexample, of a production output. In this situation, it may beeasier to discard or sort out any samples, e.g., pr oducts,considered to be potentially comprising an anomaly, ratherthan perform an extensive and thus potentially leng thyanalysisofeach sample.Alternatively, the reduced feature set is separatel yprocessed using each one-class model of the plurali ty of one-class models. Each one-class model of the plurality of one-classmodelsoutputsa likelihood thatthe unknown image comprisesan anomaly.The outputted likelihoodsof allone-class models are combined, in particular by computi ng anaverage likelihood, to decide whether an unknown im agecomprisesan anomalyornot.The above alternative allows to quantitatively dete rmine thelikelihood of whether a processed image comprises a n anomalyby considering the output of each used one-class mo del. Inthis way, one or more application domain specific c ut-offpoints or threshold values for detecting positives, negativesand, potentially, samples lying between clear posit ives andclearnegatives,maybe configured.Optionally, the plurality of one-class models compr ises atleast one of a one-class vector support machine (OC -SVM) andan isolation forest.An OC-SVM estimatesa support ofa high-dimensional distribution for unsupervised outlier d etection. P2024,0232 WO E March 1,2024 -10 -An isolation forest is an ensemble of “Isolation Tr ees” that“isolate” observations by recursive random partitio ning,which can be represented by a tree structure. The n umber ofsplittings required to isolate a sample is lower fo r outliersand higher for inliers. The above-mentioned AI-base d one-class (classification) models are particularly suit able fordetection of anomalies in images by identifying out liers withrespectto a known setofnegative sample images.The present disclosure further comprises an anomaly detectionsystem comprising a deep encoding subsystem, a redu ctionsubsystem, a classification subsystem, and a traini ngsubsystem. The deep encoding subsystem is configure d toextract a one-dimensional feature set from at least a part ofan image. The reduction system is configured to obt ain areduced set of features based on a reduction analys is, inparticular a principal component analysis, of multi ple one-dimensional feature sets. The classification system isconfigured to implement at least one one-class mode l, whichprocesses the reduced set of features to output a v alueindicative of whether an unknown image processed by the deepencoding subsystem and the reduction subsystem comp rises ananomaly or not. The training subsystem is configure d toinitialize the reduction subsystem and train the at least oneone-classmodelbased on a setofnegative samples encoded bythe deep encoding subsystem, each negative sample c omprisingatleasta partofan image comprising no anomaly. The above anomalydetection system issuitable forimplementing the previously used method for detecti on ofanomalies in an image. In particular, the deep enco dingsubsystem, the reduction subsystem and the classifi cationsubsystem can be used to implement the processing c hain as P2024,0232 WO E March 1,2024 -11 -described above. Note that the training subsystem m akes useof the other subsystems to initialize and train the m duringthe training phase.Optionally, the deep encoding subsystem comprises a neuronalnetwork, which has been pre-trained using a trainin g setcomprising a plurality of different training images labelledselectively with a plurality of different classific ationterms. Such pre-trained neural networks are suitabl e forextracting relevantfeaturesfrom arbitraryimages inputintothe deep encoding subsystem. Moreover, such pre-tra inedneuralnetworksare readilyavailable,forexample based onnetworks trained with pre-tagged selection of image s used forperformance benchmarks in automatic object detectio n.Optionally,the training subsystem isspecifically configured to extracta one-dimensionalfeature setfrom each negative sample ofthe setofnegative samplesto obtain an arrayof one-dimensionalfeature sets,each one-dimensional featureset of the array corresponding to one of the negati ve samplesof the set of negative samples; and perform the red uctionanalysis, in particular the principal component ana lysis, onthe array of one-dimensional feature sets to config ure atransformer, in particular, a translation matrix, o f thereduction subsystem for transforming the one-dimens ionalfeature sets to corresponding reduced sets of featu res.Note thata principalcomponentanalysis(PCA)and similarstatistical methods for reduction analysis essentia llyperform compute a translation matrix, e.g., based o n anEigenvector analysis of an input matrix. The comput edtranslation matrix for translating the (input) arra y of one-dimensional feature sets into a corresponding (outp ut) array P2024,0232 WO E March 1,2024 -12 -of reduced feature sets may be later used during no rmaloperation of the anomaly detection system to transf orm theoutputofthe deep encoderinto the expected input forthe classification subsystem.Optionally, the training subsystem is further confi gured to:use the reduction subsystem configured with the tra nslationmatrix to compute a reduced feature set for each of the one-dimensional feature set of the array to obtain a pl urality ofreduced feature sets; and train the at least one on e-classmodel based on the plurality of reduced feature set s servingasnegative samplesforthe training.Note that the negative samples used during training can beused twice. Firstly, they are used to compute the t ranslationmatrix as described above, to select the most relev antfeatures of a potentially large set of features ext racted bythe deep encoding subsystem.Secondly,the reduced featureset corresponding to each sample used during traini ng is alsoused to train the respective one-class model. Accor dingly,both the number of required training samples as wel l as theprocessing effort during training are limited in th edisclosed anomaly detection system. Moreover, no po sitivesamplesare required forthe training. According to a differentaspectofthe disclosure, anothermethod for training a one-class model for detection ofanomalies in an image is provided. The method compr ises:providing a pool of negative samples, each negative samplecomprising pixel data of an image comprising no ano maly;performing an initial training phase; and performin g at leastone furthertraining phase.Performing the initial trainingphase comprises: selecting a first subset of negati ve samples P2024,0232 WO E March 1,2024 -13 -from the pool of negative samples, the first subset ofnegative samples being smaller than the pool of neg ativesamples; transforming the pixel data of each negati ve sampleof the first subset into a corresponding first subs et offirst one-dimensional data structures forming a fir sttraining set; and pre-training a one-class model us ing onlythe first training set as negative samples. Perform ing the atleast one further training phase comprises: selecti ng asecond subsetofnegative samplesfrom the poolof negativesamples, the second subset of negative samples comp rising atleast one negative sample not comprised in the firs t subset;transforming the pixel data of each negative sample of thesecond subset into a corresponding second one-dimen sionaldata structure;processing the obtained second one-dimensional data structures using the pre-trained o ne-classmodel to determine whether the respective sample isclassified as an anomaly or not; including respecti ve samplesand / or the corresponding second one-dimensional dat astructures classified as an anomaly into a second t rainingset; and training the one-class model using the sec ondtraining setasfalse positive samples.The above steps implement a two-stage training meth od oralgorithm, wherein, in a first stage, the one-class model istrained based on a relatively small set of negative samplesselected, for example, at random. In a second stage , the one-class model is re-trained using a more sophisticate d orchallenging training set of negative samples, inclu ding falsepositivesincorrectlyidentified based on onlythe initialtraining in the first stage. Accordingly, a hard-mi ning ofhighly relevant training samples may be implemented . P2024,0232 WO E March 1,2024 -14 -Optionally, transforming the pixel data of a negati ve sampleinto a corresponding one-dimensional data structurecomprises: using an encoder on the pixel data to ob tain aone-dimensional feature set, each one-dimensional f eature setindicating features of a corresponding negative sam ple; andreducing the one-dimensional feature set using a re ductionsubsystem or a transformer, in particular a reducti on ortranslation matrix, to obtain the one-dimensional d atastructure, the one-dimensional data structure being smallerthan the one-dimensionalfeature set.Optionally, the initial training phase comprises: o btainingan array of first one-dimensional feature sets usin g theencoder,each firstone-dimensionalfeature setof the arrayindicating features of a corresponding negative sam ple fromthe first subset of negative samples; and performin g areduction analysis, in particular a principal compo nentanalysis, on the array of one-dimensional feature s ets toinitialize the reduction subsystem or the transform er.Optionally, the at least one further training phasecomprises: obtaining a second array of second one-d imensionalfeature sets using the encoder, each second one-dim ensionalfeature set of the second array indicating features of acorresponding negative sample from the second subse t ofnegative samples; and performing a reduction analys is, inparticular a principal component analysis, on the s econdarray of one-dimensional feature sets to re-initial ize thereduction subsystem orthe transformer.The above method for training a one-class model for detectionof anomalies in an image may be used in combination with themethod for detection of anomalies in an image as we ll as the P2024,0232 WO E March 1,2024 -15 - corresponding anomalydetection system,and maybe implemented therein.In the following, different aspects and implementat ions ofthe above anomaly detection methods and systems are describedwith respectto the attached setoffigures,which arehelpful for better understanding the invention. Whi le severalspecific embodiments of the disclosed method and sy stem arepresented,attention isdrawn to the factthatthe presentdisclosure is not limited to the described embodime nt.Instead, the present invention is defined by the at tached setofclaims. Briefdescription offigures Figure 1 showsa method fordetection ofanomalies in an image.Figure 2 shows an anomaly detection system comprisi ng aprocessing chain and a training subsystem.Figure 3 shows different phases of training an anom alydetection system.Figure 4 shows method steps for obtaining a pre-tra ined deepencoder.Figures 5A and 5B shows method steps and training p hases fora mining ofrelevanttraining samples. Figures6A and 6B showsmethod stepsand resulting data setsfor training a processing chain an anomaly detectio n system. P2024,0232 WO E March 1,2024 -16 - Figure 7 showsa solution architecture ofa system fordetecting anomalies in a livestream of images obtai ned in amanufacturing environment.Figure 8 shows a reduction of data within a process ing chainofan anomalydetection system.Figure 1 shows, in a schematic manner, a flow diagr am of amethod fordetection ofanomaliesin an image.The method isbased on deep learning and therefore comprises a le arningstage comprising steps S11 and S12, as well as a re gularoperating stage comprising stepsS13 to S15.As shown in Figure 1, a number of training images i s obtainedin step S11 during the learning ortraining phase.As discussed in the outset, in a manufacturing envi ronment,typically only a limited set of images showing no a nomaly,and no or only very few images showing an anomaly a reavailable. Thus, according to the present disclosur e, thetraining images obtained in step S11 do not contain anyanomalies. For example, in a manufacturing environm ent, onlypictures of a desired product surface may be provid ed whichdo not have any defects or variations from the expe cteddesign. Note thatin termsofmachine learning in general, andanomaly detection in particular, such a training sa mple notcontaining a feature to be identified, i.e., an ano maly, isdescribed as a “negative sample” as the trained ano malydetection system is not meant to indicate any warni ng in casesuch an image is processed. Inversely, training sam plesshowing an anomaly are described as “positive sampl es”. P2024,0232 WO E March 1,2024 -17 -Attention is drawn to the fact that most known AI-b asedclassification systems require the provision of bot h positiveand negative samples. The disclosed approach addres ses thischallenge based on a combination of modern deep lea rningmethods, in particular so-called one-class models ( OCM) whichare combined with more traditional machine learning methods.This approach enables it to automatically and relia bly detectanomalies or inconsistencies of surfaces without th e need forextensive training data,in particularwithoutthe need for provision ofpositive samplesofanomalies.Atthe same time,the disclosed method works reliably and very effici ently asit harnesses the efficiency of pre-trained encoders and makesuse of the flexibility of so-called one-class class ifiermethods. Among others, this enables the classificat ion systemto be trained in a very brief time, i.e., in severa l minutesor at most a few hours, and is therefore suitable f orapplication in a manufacturing environment with fre quentlychanging designs.Accordingly, in step S12, a processing chain compri sing acombination of deep learning methods and traditiona l machinelearning methods are trained using the negative sam plesobtained in step S11. That is to say, the processin g chain istrained solely using images comprising no anomalies asfurtherdetailed below with regard to Figures2 to 6.In the specific example of a manufacturing environm ent, themachine maysimplybe trained based on a sample of a productto be manufactured, or the output of a manufacturin g processat its initial stage of operation, where it is unli kely thatdeviations from the intended design are included in the P2024,0232 WO E March 1,2024 -18 -production output. Accordingly, the training perfor med instep S12 may be performed unsupervised in the sense of theterm as used in machine learning and requires no ad ditionaleffortin the intended application domain.Once the anomaly detection system and its processin g chainhave been trained in step S12, the anomaly detectio n systemmay be switched into a normal operating mode, where in itcontinuously monitors the output of a stream of ima ges. Forexample, it may capture and supervise a stream of d igitalimages obtained by a camera in the same manufacturi ngenvironment,in which the training wasperformed.Accordingly, in step S13, one or more target images areobtained.The obtained targetimagesare processed in step S14 using the previouslytrained processing chain. Processing in thiscontextmeans,thatthe one ormore target imagesor partsthereofare feed into the previouslytrained processing chain,and corresponding outputsofthe processing chain are,if necessary, combined. As a result, for each image fed intothe anomaly detection system, a classification resu lt isoutput in step S15, indicating if the image obtaine d in stepS13 isconsidered to comprise an anomalyornot. Figure 2 schematicallyshowsa detection system 20 accordingto an example of the present disclosure in more det ail. Thedetection system 20 comprises a processing chain 21 and atraining subsystem 22.The processing chain 21 comprises a deep encoding s ubsystem23,a reduction subsystem 24,and a classification subsystem25. Note that the processing chain 21 comprises dif ferentapproaches taken from the field of artificial intel ligence as P2024,0232 WO E March 1,2024 -19 -well as statistics. In particular, the deep encodin gsubsystem 23 is based on well-established, highly e fficientencoder-decoder networks known from the field of ob jectdetection. The reduction subsystem 24 may be implem ented as asystem for performing a principal component analysi s (PCA),which is a well-known statistical method for data r eductionin multidimensional data sets. Lastly, the classifi cationsubsystem 25 maybe based on one ormore so-called one-classclassifiers, which are highly flexible and can be t rainedbased on negative training samplesonly.All components of the processing chain 21 can be co ntrolledand adjusted by the training subsystem 22. In parti cular, thetraining subsystem 22 makes use of the deep encodin gsubsystem 23 to provide sufficient data for perform ing areduction analysis, whose outcome is used to config ure thereduction subsystem 24 for performing the reduction offeatures corresponding to target images during norm aloperation of the detection system 20. Moreover, the output ofthe reduction subsystem 24 during training is furth er used totrain the classification subsystem 24. Accordingly, thetraining subsystem 22 may not require any additiona lprocessing components in addition to the processingcomponents of the processing chain 21 used during n ormaloperation ofthe anomalydetection system 20.During both training and regular operation, the pro cessingchain 21 receives image samples on its input 26 and providesclassification results on its output 27. As detaile d below,the image samples provided at the input 26 may be c omplete,high-resolution images, e.g., of a camera, or may b e smallerpatches of one or more larger images. Moreover, theclassification result provided on the output 27 may be a P2024,0232 WO E March 1,2024 -20 -binary value, indicating whether or not the image s ample islikely to contain an anomaly, or may be another val ue, suchasa probabilityvalue indicating how likelyitis thatthe received image sample containsan anomaly.Figure 3 shows different phases of the training sta ge. In thedescribed embodiment, the training stage may be fur thersubdivided into three stages 31 to 33. However, att ention isdrawn to the fact that at least the two first parts of thetraining are optional. In the first,optionaltraining stage 31,the deep encodingsubsystem 23 is pre-trained. Further details of thi s stageare provided below with respect to Figure 4. Pre-tr aining ofthe deep encoding subsystem 23 ensures that the dee p encodingsubsystem 23 extracts relevant features from the in putsamples provided at the input 26 for subsequent sta ges of theprocessing chain 21.In the second, optional training stage 32, a set of suitabletraining samples is selected. This step is optional at leastin cases where only a very limited number of sample s isavailable,which maybe used in theirentiretyfor training.However, as further detailed below with regard to F igures 5Aand 5B, a special mining process may be employed to selectthe particularly relevant subset of a larger set of trainingsamples available, which improves the efficiency of both thetraining phase and the precision of the trained ano malydetection system 20.In the last stage 33 of the training phase, at leas t some ofthe components of the processing chain 21 are train ed usingthe previously selected training samples. In partic ular, one P2024,0232 WO E March 1,2024 -21 - ormore OCM ofthe classification subsystem 25 may be trainedbased on the encoded image samples. Moreover, at le ast insome embodiments,the reduction system 24 mayalso be configured based on a reduction analysisperformed forthe setoftraining samplesselected in stage 32.This isdescribed in more detail below with regard to Figur es 6A and6B.Figure 4 shows, in a schematic manner, a method for obtaininga pre-trained deep encoder. In particular, Figure 4 disclosesa possible implementation of the first training sta ge 31 ofFigure 3 in detail.For efficiency reasons, in a step S41, a pre-traine d encodernetwork is obtained. Such encoder-based networks ar e based oncomputer-implemented, neuronal networks. Pre-traine d networksof this type are available, or can be automatically trained,using tagged image libraries comprising pictures fr omdifferent, typically a large number of domains tagg ed withrespective keywords. This ensures that the correspo nding deepencoder network is adapted to extract features from inputimages,which are sufficientto regenerate mostof the information contentcomprised in an image.In mathematical terms, such an encoder network will reduce atwo-dimensionalarrayorgrid ofpixelsinto a one-dimensional vector of features describing the image . Suchencoder networks are known from the field of automa tic objectdetection and therefore not described in greater de tail here.However, attention is drawn to the fact that such a pre-trained deep encodernetworkisnotspecificfora given application domain.Thus,veryreasonable,results can be P2024,0232 WO E March 1,2024 -22 -obtained for images taken from a variety of domains usingsuch a generic,pre-trained deep encodernetwork.In the described embodiment, in an optional step S4 2, thedeep encoder network obtained in step S41 is fine-t uned witha number of positive and negative sample images. No te thatthe terms “positive” and “negative” here refer to a specificapplication, i.e., samples taken or derived in a gi venapplication domain. Thisensuresthatthe encoder network,after fine-tuning, extracts those features that areparticularly relevant to the given application doma in.As far as the negative image samples are concerned, these canbe obtained, in a step S43, directly from the input 26 duringthe training stage ofthe anomalydetection system 20.However, as detailed above, no positive samples are availableto the anomaly detection system 20 in the envisione dapplication domain. Accordingly, in step S44 one or more ofthe available negative samples obtained in step S43 ismodified to obtain corresponding artificial, positi vesamples, in step S44. Such a modification may compr ise, amongothers, the addition of noise, or deliberate manipu lation,exclusion, or replacement of segments within a give n,negative sample image.Figure 5A shows, in a schematic manner, a method fo rperforming mining of training samples. In particula r, Figure5A discloses a possible implementation of the secon d trainingstage 32 of Figure 3 in detail. Moreover, Figure 5B shows acorresponding example ofmining training samples. P2024,0232 WO E March 1,2024 -23 -Figures 5A and 5B disclose a mining technique for s electing aset of training samples for quickly and efficiently trainingthe classification subsystem 25. While the describe d miningtechnique is particularly useful for the anomaly de tectionsystem 20 shown in Figure 2,attention isdrawn to the factthat the described mining technique may also be app lied indifferentclassification systemsand methods.In a first, optional step S51, high-resolution trai ningimages obtained at the input 26 may be divided into a numberof smaller image patches. In this disclosure, the t erm patchor image patch refers to a subsection of a larger i mage,which essentiallycorrespondsin resolution to the resolution oftraining imagesused during initialtraining of a deep encodernetworkofthe deep encoding subsystem.For example, publicly available encoder networks ma y havebeen trained with sample picture libraries containi ng imageswith resolutions of 256x256 pixel or 224x224 pixel. However,live camera data obtained atthe input26 mayhave aconsiderably higher resolution, such as a 4K resolu tion,i.e., 3840 x 2160 pixel, QHD resolution, i.e., 2560 x 1440pixel,orHD resolution,i.e.,1920 x1080 pixels. Thus,to simplifythe computation and,atthe same time,enlarge the number of training samples available, t he high-resolution input images of a first resolution may b esegmented in the first step S51 into a number of pa tcheshaving a lower resolution. Preferably, the lower re solutioncorresponds to the resolution used during initial t raining orfine-tuning ofthe deep encodernetwork. P2024,0232 WO E March 1,2024 -24 -Accordingly, a relatively large set of patches 50 s erving asnegative training samples, for example a 100,000 ne gativesamples as shown in Figure 5B, may be obtained from arelativelysmallnumberofinputimages.In a step S52, this initial set of training samples may bedivided into subsets two or more subsets. Specifica lly, arelatively small first subset 53 of negative sample s may beselected atrandom.Forexample,an image sequence comprising k=200 framesmaybe selected to provide the setof negativetraining samples. Each frame may be divided, for ex ample,into n=138 patches, from which l=10 are selected at random.Accordingly, m=k*l=200*10=2000 negative training sa mples areselected as first subset 53 of negative samples. Th e may bestored in a single location, e.g., a folder labelle d asnegative samples, for processing. The remaining neg ativesamples, i.e., the set complement of the first subs et 53 maybe selected as a second subset 54 and may be stored in adifferentlocation.The first subset 53 of negative samples is used for pre-training of the processing chain 21 in step S55. Pr e-trainingthe processing chain is performed in essentially th e same wayas the final training of the processing chain 21 an d isdescribed in more detail below with respect to Figu res 6A and6B. In short,in step S55,the reduction system 24 and theclassification subsystem 25 are initialized so that theyprovide a detection resulton the output27 ofthe processingchain 21 for an image patch provided to the encodin g system23. For this purpose, the first subset 53 of negati ve samplesis encoded using the encoding system 23, then a PCA analysis P2024,0232 WO E March 1,2024 -25 -is performed on an array comprising corresponding f eaturevectors to configure the reduction subsystem 24 wit h atranslation matrix, and the encoded and reduced fea tures ofeach negative sample from the first subset 53 is fu rther usedfortraining the classification system 25.Atthis stage,the processing chain 21 isreadyforoperation.Accordingly, in step S56, samples from the second s ubset 54or the entire set of patches 50 of negative samples can beclassified using the pre-trained processing chain 2 1. Foreach sample of the second subset 54, the processing chain 21will output a value indicative of whether the respe ctivesample isconsidered to contain an anomaly. Note thatatthisstage allpatchesare considered to benegative samples. Accordingly, any sample indicated tocontain an anomaly represents a so-called false pos itive ofthe classification subsystem 25. Accordingly, a set of falsepositives 57 is collected, which includes all sampl es fromthe second subset 54 of negative samples classified in stepS56 aslikelyto contain an anomaly.Note further that the set of false positives 57 ide ntified instep S56 corresponds to patches from the relatively large setof training samples which are particularly challeng ing toidentify. Accordingly, to improve the overall perfo rmance ofthe anomaly detection system 20, in a step S58, the firstsubset53 with negative samplesselected atrandom iscombined with the set of false positive samples 57.Based on the merged set of step S58, the training o f theprocessing chain 21 is repeated in step S59 to retr ain theclassification subsystem 25 and, optionally, the re duction P2024,0232 WO E March 1,2024 -26 - subsystem 24,using a particularlychallenging and domain-specific subset of the initial set of training samp les. As aresult, the anomaly detection system 20 should corr ectlyidentify all available training samples correctly a snegativesafterthe training ofstep S59.Note that according to Figure 5A, the above process ing stepsare performed only once, i.e., only one iteration o f thealgorithm isperformed to obtain a firstorderset offalse positives57.However,asfurtherindicated bythe dashed arrow ofFigure 5B,the above negative hard mining process can be iterated to obtain a second orhigherorder setofsetof false positives, which can then be reused for fu rthertraining phasesto furtherimprove the used OCM.Figure 6A shows, in a schematic manner, a method fo r traininga processing chain, such as the processing chain 21 of Figure2 comprising the pre-trained deep encoding subsyste m 23, thereduction subsystem 24 and the classification subsy stem 25.In particular,Figure 6A showsan example oftheimplementation of the third training stage 33 of Fi gure 3 inmore detail. Note that the steps shown in Figure 6A may beemployed during both pre-training of the processing chain 21in step S55 as well as during final training of theprocessing chain in step S59 of Figure 5. Figure 6B shows theresulting data sets during the training and later u se of theprocessing chain 21 during prediction of anomalies.In a firststep S61,a training sample isobtained from arespective set of training samples, e.g., the first set 53 ofnegatives samples or the set with false positive sa mples 57ora combination ofboth. P2024,0232 WO E March 1,2024 -27 -The obtained negative training sample is then encod ed in stepS62 by the pre-trained deep encoding subsystem 23 t o obtain afull set of features describing the respective trai ningsample. In the following, the output of the deep en codingsubsystem 23 is described as a first or full featur e vector.Insofar, the terms “feature vector” and “feature se t” areused interchangeably. Thus, in step S62, a two-dime nsionalpixel bitmap is converted into a one-dimensional fi rstfeature vector.Steps S61 and S62 are repeated as long as further t rainingsamplesare available.Accordingly,in a step S63, the methodchecks for the availability of further samples. For example,in the pre-training of the processing chain 21 in s tep S55,steps S61 and S62 may be repeated for all 2,000 sam ples ofthe first subset 53 of negative samples selected at random.Accordingly, an array may be filled, wherein each e ntry ofthe array comprises a first feature vector correspo nding toone of the training samples from a respective set o f trainingdata.Note that this array essentially represents a matri xstructure on which conventional, statistical method s for datareduction can be applied. Accordingly, in a step S6 4, aprincipal component analysis (PCA) algorithm may be appliedto the array of feature vectors to analyze the prin cipalcomponents corresponding to the Eigenvectors of the matrixstructure. Other known algorithms for data reductio n may alsobe applied to reduce the relatively large number of featuresofthe firstvectorsto a reduced setoffeatures representing second feature vectors. P2024,0232 WO E March 1,2024 -28 -While this leads to a reduction of the data conside red atlater stages of the processing chain 21, experiment al resultsbased on real-world data have shown that the inclus ion of thereduction step S64 leads to an improvement of the p recisionofthe detection output.Thismaybe caused,among others,byimplementing a clustering of relevant features and / oravoiding overfitting with respect to the set of rel ativelylarge first feature vectors. Put differently, the s econd orreduced feature vectors appear to be particularly r elevantfor the detection of anomalies. At the same time, t hereduction of the amount of data to be considered by the OCMofthe classification subsystem 25 during training andclassification results in a considerable improvemen t of theperformance of the anomaly detection system 20. Non etheless,step S64 should be considered to be optional and ma y beomitted in case the used OCM can process the full s et offeaturesdirectly. Asshown in Figure 6B,the deep encoding subsystem 23 mayoutput first feature vectors comprising 1280 featur es foreach of the m=2,000 input samples. Accordingly, a f irstmatrix 68 fed into the PCA algorithm in step S64 ma y comprise2000×1280 values. These can be analyzed, for exampl e usingPCA, to generate a second matrix 69, comprising 200 0 entriesof only 256 features, i.e., a matrix of 2000×256. N ote thatthe remaining 256 features are mathematically large lyindependent of each other and should describe featu res, whichare particularly relevant for the application domai n fromwhich the training sampleswere selected.Further note that, depending on the implementation, step S64may comprise two distinct sub-steps, i.e., the comp utation orfitting of a transformation matrix based on a stati stical P2024,0232 WO E March 1,2024 -29 -analysis of the first matrix 68 as well as the comp utation ofthe second matrix 69 based on the first matrix 68 a nd thetransformation matrix, i.e., the actual transformat ion of thefirst matrix 68 into the second matrix 69. In pract ice,however, both steps may be performed by a single al gorithm ormodule, storing the transformation internally for l ater useand directlyoutputting the second matrix69.In a subsequent step S65, the resulting set of feat ures foreach of the training samples, i.e., the full sets o f featuresobtained in step S62 or the reduced sets of feature s obtainedin step S64, may be used to train one or more one-c lassmodels(OCM).Note thatduring thistraining,each sample isindicated as a negative sample, as it is known that therespective training sample did not contain any anom aly.Accordingly, corresponding classification models oralgorithms, such as one-class support vector machin es (OC-SVM) or isolation forest, may be trained based on t he reducedsets of features for the used set of negative sampl es.Accordingly, the respective OCM should be capable o fprecisely identifying samples from the desired appl icationdomain comprising no anomaly. Inversely, everything else thatdoes not fall into this data range will be identifi ed by theOCMs as a sample comprising an anomaly. In Figure 6 B, thissituation is depicted as a larger input space 90 of the OCMs,comprising a smaller sub-space 91 representing an a rea, intowhich the second training vectors are mapped by the OCMs.As indicated in step S66, the above step S65 may be repeatedfor a plurality of models. This has the advantage t hatweaknesses of a single OCM may be compensated by co mparingits output with the output of another OCM. In the s pecific P2024,0232 WO E March 1,2024 -30 - embodimentshown in Figure 6B and the architecture describedlater with respect to Figure 7, the output of an OC -SVM iscombined with the output of an isolation forest bas ed OCM forobtaining the final decision on whether or not an i nputsample isconsidered to contain an anomaly.As further indicated in the right-hand side of Figu re 6B, theprocessing chain 21 isoperated in a corresponding mannerduring normal operation, i.e., for prediction or de tectinganomalies in a target image. As shown, the target i mage orframe is decomposed into n0138 target sample 92, wh ich areencoded to corresponding setoffirstvectors.The firstvectors are then transformed using a transformation module ora transformation matrixobtained during the PCA of step S64 to obtain corresponding second vectors.The second vectorsare then fed, one-by-one into each one of the previ ouslytrained OCMs, to obtain corresponding classificatio n results93 foreach targetsample 92 and / orOCM.Figure 7 shows a specific architecture 70 of an ano malydetection system, e.g., the anomaly detection syste m 20 ofFigure 2,employed in a production environment.As indicated on the left-hand side of Figure 7, a n umber ofnormalimages71 isinitiallyprovided asinputto a trainingmodule 72. The training module 72 then modifies the set ofnormal images 71 into a corresponding set of modifi ed images73. Each modified image 73 corresponds to one of th e normalimages 71 and is generated by adding noise to the r espectivenormal image 71. For the purpose of the training, t he normalimages 71 are considered to represent negative samp les,whereas the modified images 73 are considered to re presentpseudo-positives as indicated. The respective image s are P2024,0232 WO E March 1,2024 -31 -accordingly labelled as negatives and positives res pectivelyand then fed to a pre-trained encodernetwork74.In the specific solution, the so-called ResNet-18 e ncodernetworkisused.Foreach ofthe normalimagesand themodified images 73, the pre-trained encoder network 74 willgenerate a corresponding feature vector 75 which al lows todistinguish between the normal images 71 and the mo difiedimages 73 by means of a respective first tags 76 (“ bad”)corresponding to a positive sample and an alternati ve secondtag 77 (“good”) corresponding to a normal image 71.At this stage, the pre-trained encoder network 74 h as beenfine-tuned to distinguish between positive and nega tivesamples provided at its input can be used in a proc essingchain 21 of the solution architecture 70. For a bet terunderstanding,the fine-tuned encodernetworkis identified with reference numeral 78 in the foll owing.The fine-tuned encoder network 78 is used to encode thenormal images 71 used as negative samples to genera tecorresponding full feature vectors 79. For each nor mal image71,a corresponding fullfeature vectors79 maybe generated.Full feature vectors for all of the normal images 7 1 may becombined to form a matrix or array (not shown in Fi gure 7) offull feature vectors 79 as described before. Accord ingly, PCAmay be applied to the array or matrix of full featu re vectors79 to generate a corresponding matrix or array of r educedfeature vectors80.The reduced feature vectors 80 may be fed into an e nsemble 81of OCMs. In the given example, the ensemble 81 comp rises anOC-SVM 82 and an isolation forest 83. Each OCM outp uts a P2024,0232 WO E March 1,2024 -32 -classification result 93 as detailed above with res pect toFigure 6B.In the specific embodiment shown in Figure 7, a so- calledhard voting consensus 84 is applied to the ensemble 81 toproduce the final detection output 85. This means t hat animage sample fed into the processing chain 21 will beconsidered to comprise an anomaly and hence indicat e a badsample aslong asone ofthe OCM from the ensemble 81indicates the presence of an anomaly. Of course, ot her waysof combining the output of the OCMs of the ensemble 81 arealso possible.Note that Figure 7 essentially shows the processing chain 21asoperated during the pre-training step described above withregard to step S55 or the (re-)training with regard to stepS59. The difference between the two stages is the s et oftraining data provided asnormalimages71.A difference between operating the processing chain 21 duringtraining and during normal operation of the anomaly detectionsystem 20 lies in the fact that the PCA is no longe rperformed. Instead, the transformation matrix compu ted duringcomputation ofthe PCA isused to transform a full feature vector79 corresponding to a targetsample into a corresponding reduced feature vector80.Moreover, the samples fed into the ensemble 81 of O CMs 82 and83 are no longerlabelled.Accordingly,the OC-SVM 82 andisolation forest 83 simply output a detection outpu t 85without modifying their internal configuration such as theweightsofthe OC-SVM 82. P2024,0232 WO E March 1,2024 -33 -Corresponding data structures and algorithms for im plementingindividual parts of the anomaly detection system 20 , inparticular the encoder networks 74 and / or 78 of the deepencoding subsystem 23,the reduction subsystem 24, and theOC-SVM 82, the isolation forest 83, and the ensembl e 81 ofthe classification subsystem 25 are provided, for e xample, inscikit-learn (https: / / scikit-learn.org / ), providing a Pythonlibraryforvariousmachine learning algorithms.The described solution architecture 70 combines theadvantages of several approaches known from artific ialintelligence and statisticalprocessing in a novel mannerto obtain a high precision fordetection ofanomalies on images,such as surfaces of a finished good, without the ne ed for anextensive orhuman supervised learning phase.Among others, flexibility of the solution architect ure 70 isderived from the fact that the OCMs of the ensemble 71 can betrained using negative samples, i.e., normal patter ns only,and do not require any training samples or the info rmationabout potential anomalies. This makes them particul arlyuseful for situations in which it is difficult to o btainextensive data about anomalies or in situations whe reanomalies are variable by their very nature. Moreov er, sinceonly normal, i.e., good, data is processed, the eff ort forcollection and labelling of the negative samples is verylimited. In fact, during the training phase, all in put datainputinto the OCM issimplyindicated orlabelled as negative samples.OCMs are particularly robust against new, previousl y unknownanomaliesin thattheyare nottrained to detecta specificanomaly, but rather to detect the presence of a nor mal, i.e., P2024,0232 WO E March 1,2024 -34 -good, pattern. Accordingly, OCMs can also detect ne w orpreviously unknown anomalies, which were not availa ble orthoughtofduring the training phase. Moreover,the use ofa pre-trained encodernetwork harnessesthe power of established object recognition technol ogiesknown from other fields of artificial intelligence. Suchencoders are already trained using voluminous and d iversifieddata sets, such as ImageNet (https: / / www.image-net. org).Using them enables transfer learning by using gener alfeatures learned based on the image collection of p ubliclyavailable data sets to a specific application domai n, such assurfaces of a laminate. This greatly accelerates an dstabilizes the learning phase of the disclosed arch itecture70 and enables an efficient extraction of feature v ectors 75or 79, which enable the OCM(s) to detect anomalies.The additional fine-tuning of the generic encoder n etwork 74to produce a fine-tuned encodernetwork78 further improves the relevance ofthe extracted feature vectors79. Themodification of normal images 71 to generate modifi ed images73 is sufficient to train the encoder network 74 to selectfeatures that have particular relevance for the dec ision ofthe ensemble 81 to detect anomalies with the modifi ed images.For this purpose, it is sufficient to generate arti ficialnoise in normal images 71, thus obliviating the nee d toprovide true positive samples.Lastly, the specific processing chain 21 comprising the deepencoding subsystem 23 with the encodernetwork78, and the reduction subsystem 24 aswellasone ormore OCMs oftheclassification subsystem 24, successively reduces t he amountofdata being processed.In particular,firstdata isreduced P2024,0232 WO E March 1,2024 -35 -from two-dimensional pixel data to a one-dimensiona l featurevector (or set). Then the one-dimensional feature v ector isfurther reduced using a PCA to a reduced feature ve ctor (orset). Accordingly, the relatively complex OCM(s) on ly need tooperate on a limited data set which enables anomaly detectionto be performed in real-time of a production enviro nment.
[0002] P2024,0232 WO E March 1,2024 -36 - Listofreferences 20 anomalydetection system 21 processing chain 22 training subsystem 23 deep encoding subsystem 24 reduction subsystem 25 classification subsystem 26 input 27 output 30 firsttraining phase 32 second training phase 33 third training phase 50 setofpatches 53 firstsubsetofnegative samples 54 second subsetofnegative samples 57 setoffalse positive samples 68 firstmatrix(offullfeature vectors) 69 second matrix(ofreduced feature vectors) 70 architecture 71 normalimage 72 training module 73 modified image 74 pre-trained encodernetwork 75 feature vector 76 tag “bad” 77 tag “good” 78 fine-tuned encodernetwork 79 fullfeature vector P2024,0232 WO E March 1,2024 -37 - 80 reduced feature vector 81 ensemble ofOCM 82 OC-SVM 83 isolation forest 84 hard voting consensus 85 detection output 90 inputspace 91 sub-space 92 targetsample 93 classification result
Claims
P2024,0232 WO E March 1,2024 -38 - Claims1. A method for detection of anomalies in an image, themethod comprising:- obtaining a set of negative samples, each negative samplecomprising at least a part of an image (71) compris ing noanomaly;- training (S12) a processing chain (21) using the se t ofnegative samples;and- processing (S14) an unknown image using the trainedprocessing chain (21) to decide whether the unknown imagecomprisesan anomalyornot;characterized in that training (S12) the processing chain(21)comprises:- using a pre-trained deep encoder to obtain an array ofone-dimensionalfeature sets,each one-dimensional feature set of the array indicating features of a correspon dingnegative sample from the setofnegative samples;- performing (S64) a reduction analysis, in particula r aprincipalcomponentanalysis,on the arrayofone- dimensionalfeature setsto obtain a corresponding array ofreduced setsoffeatures;and- training (S65) a one-class model based on the array ofreduced setsoffeatures.
2. The method ofclaim 1,wherein- each negative sample corresponds to a training patc h witha predefined target size, wherein the predefined ta rgetsize corresponding to a size of training images use dduring pre-training ofthe deep encoder(74);- the step of obtaining the set of negative samplescomprises: −obtaining sample images (S11) comprising no anomaly ;P2024,0232 WO E March 1,2024 -39 - −dividing (S51) the sample images into a plurality o ftraining patches of the predefined target size; and− selecting atleastsome ofthe training patchesas negative samples;and- the step of processing the unknown image comprises:− dividing the unknown image into a plurality of targ etpatcheswith the predefined targetsize; − processing each targetpatch using the trained processing chain (21) to determine whether the targ etpatch comprisesan anomalyornot;and −deciding that the unknown image comprises no anomal yonly if it is determined that none of the target pa tchescomprisesan anomaly.
3. The method ofclaim 1 or2,wherein the step of obtaining a setofnegative samplescomprises:- providing a pool of negative samples, in particular thepluralityoftraining patchesofclaim 2;- selecting an initial subset (53), in particular a r andomsubset,from the poolofnegative samples;- pre-training (S55) the processing chain (21) using theinitial subset (53) to obtain a pre-trained process ingchain (21);- processing (S56) remaining samples (54) from the po ol ofnegative samples not included in the initial subset (53)using the pre-trained processing chain (21) to deci dewhether each of the remaining samples (54) is class ifiedasan anomalyornot;and- selecting all samples classified by the pre-trainedprocessing chain (21) as containing an anomaly (57) aspart of the set of negative samples for training (S 59) theprocessing chain (21).P2024,0232 WO E March 1,2024 -40 - 4. The method ofclaim 3,wherein the selected set of negative samplesfortraining the processing chain (21) furthercomprisesthe initialsubset(53). 5.The method ofanyone ofclaims1 to 4,wherein training the processing chain (21)furthercomprises:- generating (S44) a set of pseudo-positive samples b ased onthe set of negative samples, each pseudo-positive s amplebeing generated by modifying at least one of the ne gativesamples;and- fine-tuning (S42) the pre-trained deep encoder (74) usingthe set of negative samples labelled as negatives a nd theset of pseudo-positive samples labelled as positive s.
6. The method of claim 5, wherein noise is added to eachnegative sample to obtain a corresponding pseudo-po sitivesample.
7. The method of any one of claims 1 to 6, wherein,- in the step of training the processing chain (21), aplurality of one-class models is trained, each one- classmodel being trained independently based on the redu cedsetsoffeatures;and- the step of processing (S14) an unknown image compr ises:− obtaining a reduced feature set corresponding to th eunknown image; −separately processing the reduced feature set using atleast a subset of the plurality of one-class models ; and− deciding whether the unknown image comprises an ano malyor not based on the outputs provided by the used on e-classmodels.P2024,0232 WO E March 1,2024 -41 - 8.The method ofclaim 7,wherein:- each one-class model of the plurality of one-class modelsis configured to output a binary value indicating w hetherthe unknown image comprisesan anomalyornot;and- the outputted binary values of the used one-class m odelsare combined, in particular using a majority, minor ity orconsensus decision, to decide whether the unknown i magecomprisesan anomalyornot. 9.The method ofclaim 8,wherein:- a decision is made indicating that the unknown imag ecomprisesan anomalyifanyone-classmodelofthe plurality of one-class models indicates that the un knownimage comprisesan anomaly;and- processing the reduced feature set using any of theremaining one-class models is stopped or omitted af ter thedecision istaken. 10.The method ofclaim 7,wherein:- the reduced feature set is separately processed usi ng eachone-class model of the plurality of one-class model s;- each one-class model of the plurality of one-class modelsoutputs a likelihood that the unknown image compris es ananomaly;and- the outputted likelihoods of all one-class models a recombined,in particularbycomputing an average likelihood, to decide whether the unknown image com prisesan anomalyornot.
11. The method of any one of claims 7 to 10, wherei n theplurality of one-class models comprises at least on e of aone-class vector support machine (82) and an isolat ion forestP2024,0232 WO E March 1,2024 -42 - 12. An anomalydetection system (20)comprising:- a deep encoding subsystem (23), configured to extra ct aone-dimensional feature set (79) from at least a pa rt ofan image (71,73);- a reduction subsystem (24), configured to obtain a reducedset of features (80) based on a reduction analysis, inparticular a principal component analysis, of multi pleone-dimensionalfeature sets(79);- a classification subsystem (25), configured to impl ementat least one one-class model, which processes the r educedset of features (80) to output a value indicative o fwhether an unknown image processed by the deep enco dingsubsystem (23) and the reduction subsystem (24) com prisesan anomalyornot;and- a training subsystem (22) configured to initialize thereduction subsystem (24) and train the at least one one-class model based on a set of negative samples (53, 54)encoded by the deep encoding subsystem (23), each n egativesample comprising at least a part of an image compr isingno anomaly. 13.The anomalydetection system (20)ofclaim 12, whereinthe deep encoding subsystem (23) comprises a neuron al network(74), which has been pre-trained using a training s etcomprising a plurality of different training images labelledselectively with a plurality of different classific ationterms.
14. The anomaly detection system (20) of claim 12 o r 13,wherein the training subsystem (22) is specificallyconfigured to:P2024,0232 WO E March 1,2024 -43 -- extract a one-dimensional feature set (79) for eachnegative sample of the set of negative samples to o btainan arrayofone-dimensionalfeature sets,each one- dimensional feature set (79) of the array correspon ding toone ofthe negative samplesofthe setofnegative samples;and- perform the reduction analysis, in particular theprincipalcomponentanalysis,on the arrayofone- dimensional feature sets (79) to configure a transf ormer,in particular, a translation matrix, of the reducti onsubsystem (24) for transforming the one-dimensionalfeature sets to corresponding reduced sets of featu res(80).
15. The anomalydetection system (20)ofclaim 14, wherein the training subsystem isfurtherconfigured to:- use the reduction subsystem (24) configured with th etranslation matrix to compute a reduced feature set (80)for each of the one-dimensional feature sets (79) o f thearray to obtain a plurality of reduced feature sets (80) ;and- train the at least one one-class model based on theplurality of reduced feature sets (80) serving as n egativesamplesforthe training.
Citation Information
Cited By
Abnormal day production data determination method and device and storage medium
CN115840918A
A method, apparatus and storage medium for identifying abnormal daily production data
CN115840918B