Unsupervised Anomaly Detection in Images2019 Community Moderator Electionanomaly detection alert systemDetecting anomalies with neural networkH2o autoencoder anomaly detection for multivariate time series dataAutoencoder for anomaly detection from feature vectorsMachine learning anomaly detection for continues dataEncoder Decoder networks with varying image sizesAnomaly Detection: Model Creation & ImplementationComparison between approaches for timeseries anomaly detectionUnsupervised Anomaly Detection on system metrics like memory, cpu, io, net, etc

Typesetting a double Over Dot on top of a symbol

How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?

If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?

How to deal with fear of taking dependencies

Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?

COUNT(*) or MAX(id) - which is faster?

Prime joint compound before latex paint?

Is there a familial term for apples and pears?

Is domain driven design an anti-SQL pattern?

Patience, young "Padovan"

extract characters between two commas?

Is there a way to make member function NOT callable from constructor?

What does it exactly mean if a random variable follows a distribution

What to wear for invited talk in Canada

How would photo IDs work for shapeshifters?

Domain expired, GoDaddy holds it and is asking more money

What are the advantages and disadvantages of running one shots compared to campaigns?

What is the command to reset a PC without deleting any files

Email Account under attack (really) - anything I can do?

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

Is "plugging out" electronic devices an American expression?

How can I fix this gap between bookcases I made?

Was there ever an axiom rendered a theorem?

Does bootstrapped regression allow for inference?



Unsupervised Anomaly Detection in Images



2019 Community Moderator Electionanomaly detection alert systemDetecting anomalies with neural networkH2o autoencoder anomaly detection for multivariate time series dataAutoencoder for anomaly detection from feature vectorsMachine learning anomaly detection for continues dataEncoder Decoder networks with varying image sizesAnomaly Detection: Model Creation & ImplementationComparison between approaches for timeseries anomaly detectionUnsupervised Anomaly Detection on system metrics like memory, cpu, io, net, etc










4












$begingroup$


I would like to detect defects/anomalies in images. Due to the lack of images with anomalies, I try to solve the problem in an unsupervised manner. Until now, I trained a variational autoencoder together with an generative adversarial network with “good” images. Now, I have an encoder/decoder network which is able to produce images without anomalies. Here are two examples:



original image | cropped image & input of the encoder | output of the decoder



enter image description here



enter image description here



In those images, if the object is rotated (not vertical), then it is an anomaly (like the second image). To measure the difference between the input/output of the encoder/decoder network, I tried the structural similarity metric SSIM. However, the result is not satisfying enough as many images without an anomaly also have a low similarity value. Also the pixel-wise MAE or MSE metrics are not good as they do not look specifically on the structure and are very sensitive to the brightness. Here is the result with the SSIM metric (green are the good examples, red are the anomalies):



enter image description here



What I want to avoid is to add specific rules for the detection, in this example to detect vertical lines because there are many other objects with different anomalies which I would like to detect.



Do you have a suggestion for another image similarity metric? Am I on the right path or are there other/better methods to do unsupervised anomaly detection?



PS: There are only a few images with anomalies (<10 images), but many without an anomaly..










share|improve this question











$endgroup$




bumped to the homepage by Community 13 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • $begingroup$
    Do you use pooling?
    $endgroup$
    – Lau
    Nov 24 '18 at 11:02










  • $begingroup$
    I would love to have the dataset you are working on. Thanks :)
    $endgroup$
    – Ali Fessi
    Mar 9 at 14:20















4












$begingroup$


I would like to detect defects/anomalies in images. Due to the lack of images with anomalies, I try to solve the problem in an unsupervised manner. Until now, I trained a variational autoencoder together with an generative adversarial network with “good” images. Now, I have an encoder/decoder network which is able to produce images without anomalies. Here are two examples:



original image | cropped image & input of the encoder | output of the decoder



enter image description here



enter image description here



In those images, if the object is rotated (not vertical), then it is an anomaly (like the second image). To measure the difference between the input/output of the encoder/decoder network, I tried the structural similarity metric SSIM. However, the result is not satisfying enough as many images without an anomaly also have a low similarity value. Also the pixel-wise MAE or MSE metrics are not good as they do not look specifically on the structure and are very sensitive to the brightness. Here is the result with the SSIM metric (green are the good examples, red are the anomalies):



enter image description here



What I want to avoid is to add specific rules for the detection, in this example to detect vertical lines because there are many other objects with different anomalies which I would like to detect.



Do you have a suggestion for another image similarity metric? Am I on the right path or are there other/better methods to do unsupervised anomaly detection?



PS: There are only a few images with anomalies (<10 images), but many without an anomaly..










share|improve this question











$endgroup$




bumped to the homepage by Community 13 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • $begingroup$
    Do you use pooling?
    $endgroup$
    – Lau
    Nov 24 '18 at 11:02










  • $begingroup$
    I would love to have the dataset you are working on. Thanks :)
    $endgroup$
    – Ali Fessi
    Mar 9 at 14:20













4












4








4


1



$begingroup$


I would like to detect defects/anomalies in images. Due to the lack of images with anomalies, I try to solve the problem in an unsupervised manner. Until now, I trained a variational autoencoder together with an generative adversarial network with “good” images. Now, I have an encoder/decoder network which is able to produce images without anomalies. Here are two examples:



original image | cropped image & input of the encoder | output of the decoder



enter image description here



enter image description here



In those images, if the object is rotated (not vertical), then it is an anomaly (like the second image). To measure the difference between the input/output of the encoder/decoder network, I tried the structural similarity metric SSIM. However, the result is not satisfying enough as many images without an anomaly also have a low similarity value. Also the pixel-wise MAE or MSE metrics are not good as they do not look specifically on the structure and are very sensitive to the brightness. Here is the result with the SSIM metric (green are the good examples, red are the anomalies):



enter image description here



What I want to avoid is to add specific rules for the detection, in this example to detect vertical lines because there are many other objects with different anomalies which I would like to detect.



Do you have a suggestion for another image similarity metric? Am I on the right path or are there other/better methods to do unsupervised anomaly detection?



PS: There are only a few images with anomalies (<10 images), but many without an anomaly..










share|improve this question











$endgroup$




I would like to detect defects/anomalies in images. Due to the lack of images with anomalies, I try to solve the problem in an unsupervised manner. Until now, I trained a variational autoencoder together with an generative adversarial network with “good” images. Now, I have an encoder/decoder network which is able to produce images without anomalies. Here are two examples:



original image | cropped image & input of the encoder | output of the decoder



enter image description here



enter image description here



In those images, if the object is rotated (not vertical), then it is an anomaly (like the second image). To measure the difference between the input/output of the encoder/decoder network, I tried the structural similarity metric SSIM. However, the result is not satisfying enough as many images without an anomaly also have a low similarity value. Also the pixel-wise MAE or MSE metrics are not good as they do not look specifically on the structure and are very sensitive to the brightness. Here is the result with the SSIM metric (green are the good examples, red are the anomalies):



enter image description here



What I want to avoid is to add specific rules for the detection, in this example to detect vertical lines because there are many other objects with different anomalies which I would like to detect.



Do you have a suggestion for another image similarity metric? Am I on the right path or are there other/better methods to do unsupervised anomaly detection?



PS: There are only a few images with anomalies (<10 images), but many without an anomaly..







machine-learning neural-network deep-learning similarity anomaly-detection






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 '18 at 22:22







schieGG

















asked Mar 21 '18 at 18:17









schieGGschieGG

213




213





bumped to the homepage by Community 13 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 13 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.













  • $begingroup$
    Do you use pooling?
    $endgroup$
    – Lau
    Nov 24 '18 at 11:02










  • $begingroup$
    I would love to have the dataset you are working on. Thanks :)
    $endgroup$
    – Ali Fessi
    Mar 9 at 14:20
















  • $begingroup$
    Do you use pooling?
    $endgroup$
    – Lau
    Nov 24 '18 at 11:02










  • $begingroup$
    I would love to have the dataset you are working on. Thanks :)
    $endgroup$
    – Ali Fessi
    Mar 9 at 14:20















$begingroup$
Do you use pooling?
$endgroup$
– Lau
Nov 24 '18 at 11:02




$begingroup$
Do you use pooling?
$endgroup$
– Lau
Nov 24 '18 at 11:02












$begingroup$
I would love to have the dataset you are working on. Thanks :)
$endgroup$
– Ali Fessi
Mar 9 at 14:20




$begingroup$
I would love to have the dataset you are working on. Thanks :)
$endgroup$
– Ali Fessi
Mar 9 at 14:20










2 Answers
2






active

oldest

votes


















2












$begingroup$

There seems to be a clear line between samples with anomalies and those without. Label them and run a classifier? e.g SVM. One shouldn't use more complex models than needed.



Also, be a bit careful with trying to detect all kind of anomalies. It's not always realistic and might lead you away from more straightforward, and perhaps better solutions.



You could also try something as simple as a histogram from one part of the image. Looks like it should be able to find the anomalies.






share|improve this answer









$endgroup$




















    0












    $begingroup$

    One thing you could try, would be to add a second loss term that uses also the latent representation of the VAE. The idea being that anomalies should also be outliers in latent space. That way you would have another channel that provides information about your outliers. There was a paper by Zong et al., DEEP AUTOENCODING GAUSSIAN MIXTURE MODEL FOR UNSUPERVISED ANOMALY DETECTION from the NEC labs at ICLR 2018 that used this approach. Please see
    https://openreview.net/forum?id=BJJLHbb0-



    I have no idea how good that would work for your images. In the paper they used very small datasets.






    share|improve this answer









    $endgroup$













      Your Answer





      StackExchange.ifUsing("editor", function ()
      return StackExchange.using("mathjaxEditing", function ()
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      );
      );
      , "mathjax-editing");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "557"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f29391%2funsupervised-anomaly-detection-in-images%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2












      $begingroup$

      There seems to be a clear line between samples with anomalies and those without. Label them and run a classifier? e.g SVM. One shouldn't use more complex models than needed.



      Also, be a bit careful with trying to detect all kind of anomalies. It's not always realistic and might lead you away from more straightforward, and perhaps better solutions.



      You could also try something as simple as a histogram from one part of the image. Looks like it should be able to find the anomalies.






      share|improve this answer









      $endgroup$

















        2












        $begingroup$

        There seems to be a clear line between samples with anomalies and those without. Label them and run a classifier? e.g SVM. One shouldn't use more complex models than needed.



        Also, be a bit careful with trying to detect all kind of anomalies. It's not always realistic and might lead you away from more straightforward, and perhaps better solutions.



        You could also try something as simple as a histogram from one part of the image. Looks like it should be able to find the anomalies.






        share|improve this answer









        $endgroup$















          2












          2








          2





          $begingroup$

          There seems to be a clear line between samples with anomalies and those without. Label them and run a classifier? e.g SVM. One shouldn't use more complex models than needed.



          Also, be a bit careful with trying to detect all kind of anomalies. It's not always realistic and might lead you away from more straightforward, and perhaps better solutions.



          You could also try something as simple as a histogram from one part of the image. Looks like it should be able to find the anomalies.






          share|improve this answer









          $endgroup$



          There seems to be a clear line between samples with anomalies and those without. Label them and run a classifier? e.g SVM. One shouldn't use more complex models than needed.



          Also, be a bit careful with trying to detect all kind of anomalies. It's not always realistic and might lead you away from more straightforward, and perhaps better solutions.



          You could also try something as simple as a histogram from one part of the image. Looks like it should be able to find the anomalies.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Oct 7 '18 at 9:56









          Carl RynegardhCarl Rynegardh

          321112




          321112





















              0












              $begingroup$

              One thing you could try, would be to add a second loss term that uses also the latent representation of the VAE. The idea being that anomalies should also be outliers in latent space. That way you would have another channel that provides information about your outliers. There was a paper by Zong et al., DEEP AUTOENCODING GAUSSIAN MIXTURE MODEL FOR UNSUPERVISED ANOMALY DETECTION from the NEC labs at ICLR 2018 that used this approach. Please see
              https://openreview.net/forum?id=BJJLHbb0-



              I have no idea how good that would work for your images. In the paper they used very small datasets.






              share|improve this answer









              $endgroup$

















                0












                $begingroup$

                One thing you could try, would be to add a second loss term that uses also the latent representation of the VAE. The idea being that anomalies should also be outliers in latent space. That way you would have another channel that provides information about your outliers. There was a paper by Zong et al., DEEP AUTOENCODING GAUSSIAN MIXTURE MODEL FOR UNSUPERVISED ANOMALY DETECTION from the NEC labs at ICLR 2018 that used this approach. Please see
                https://openreview.net/forum?id=BJJLHbb0-



                I have no idea how good that would work for your images. In the paper they used very small datasets.






                share|improve this answer









                $endgroup$















                  0












                  0








                  0





                  $begingroup$

                  One thing you could try, would be to add a second loss term that uses also the latent representation of the VAE. The idea being that anomalies should also be outliers in latent space. That way you would have another channel that provides information about your outliers. There was a paper by Zong et al., DEEP AUTOENCODING GAUSSIAN MIXTURE MODEL FOR UNSUPERVISED ANOMALY DETECTION from the NEC labs at ICLR 2018 that used this approach. Please see
                  https://openreview.net/forum?id=BJJLHbb0-



                  I have no idea how good that would work for your images. In the paper they used very small datasets.






                  share|improve this answer









                  $endgroup$



                  One thing you could try, would be to add a second loss term that uses also the latent representation of the VAE. The idea being that anomalies should also be outliers in latent space. That way you would have another channel that provides information about your outliers. There was a paper by Zong et al., DEEP AUTOENCODING GAUSSIAN MIXTURE MODEL FOR UNSUPERVISED ANOMALY DETECTION from the NEC labs at ICLR 2018 that used this approach. Please see
                  https://openreview.net/forum?id=BJJLHbb0-



                  I have no idea how good that would work for your images. In the paper they used very small datasets.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 8 '18 at 21:07









                  jkdsjkds

                  11




                  11



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Data Science Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f29391%2funsupervised-anomaly-detection-in-images%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Францішак Багушэвіч Змест Сям'я | Біяграфія | Творчасць | Мова Багушэвіча | Ацэнкі дзейнасці | Цікавыя факты | Спадчына | Выбраная бібліяграфія | Ушанаванне памяці | У філатэліі | Зноскі | Літаратура | Спасылкі | НавігацыяЛяхоўскі У. Рупіўся дзеля Бога і людзей: Жыццёвы шлях Лявона Вітан-Дубейкаўскага // Вольскі і Памідораў з песняй пра немца Адвакат, паэт, народны заступнік Ашмянскі веснікВ Минске появится площадь Богушевича и улица Сырокомли, Белорусская деловая газета, 19 июля 2001 г.Айцец беларускай нацыянальнай ідэі паўстаў у бронзе Сяргей Аляксандравіч Адашкевіч (1918, Мінск). 80-я гады. Бюст «Францішак Багушэвіч».Яўген Мікалаевіч Ціхановіч. «Партрэт Францішка Багушэвіча»Мікола Мікалаевіч Купава. «Партрэт зачынальніка новай беларускай літаратуры Францішка Багушэвіча»Уладзімір Іванавіч Мелехаў. На помніку «Змагарам за родную мову» Барэльеф «Францішак Багушэвіч»Памяць пра Багушэвіча на Віленшчыне Страчаная сталіца. Беларускія шыльды на вуліцах Вільні«Krynica». Ideologia i przywódcy białoruskiego katolicyzmuФранцішак БагушэвічТворы на knihi.comТворы Францішка Багушэвіча на bellib.byСодаль Уладзімір. Францішак Багушэвіч на Лідчыне;Луцкевіч Антон. Жыцьцё і творчасьць Фр. Багушэвіча ў успамінах ягоных сучасьнікаў // Запісы Беларускага Навуковага таварыства. Вільня, 1938. Сшытак 1. С. 16-34.Большая российская1188761710000 0000 5537 633Xn9209310021619551927869394п

                      Partai Komunis Tiongkok Daftar isi Kepemimpinan | Pranala luar | Referensi | Menu navigasidiperiksa1 perubahan tertundacpc.people.com.cnSitus resmiSurat kabar resmi"Why the Communist Party is alive, well and flourishing in China"0307-1235"Full text of Constitution of Communist Party of China"smengembangkannyas

                      ValueError: Expected n_neighbors <= n_samples, but n_samples = 1, n_neighbors = 6 (SMOTE) The 2019 Stack Overflow Developer Survey Results Are InCan SMOTE be applied over sequence of words (sentences)?ValueError when doing validation with random forestsSMOTE and multi class oversamplingLogic behind SMOTE-NC?ValueError: Error when checking target: expected dense_1 to have shape (7,) but got array with shape (1,)SmoteBoost: Should SMOTE be ran individually for each iteration/tree in the boosting?solving multi-class imbalance classification using smote and OSSUsing SMOTE for Synthetic Data generation to improve performance on unbalanced dataproblem of entry format for a simple model in KerasSVM SMOTE fit_resample() function runs forever with no result