Giter Site home page Giter Site logo

medetection's Introduction

Adaptive Vision Detection of Industrial Product Defects

The code for the paper "Adaptive Vision Detection of Industrial Product Defects".

Requirements

python 3.8
pytorch 1.10.10
cuda 11.2
l2l 0.1.7

Dataset Preparation

  1. Our homemade dataset BC defetcs is placed in the dataset folder
  2. Our MAML dataset contains 30 different categories of industrial products, sourced from MVTec, DAGM and our own BC defects dataset. The remaining two datasets are available for download at MVTec AD:https://www.mvtec.com/company/research/datasets/mvtec-ad/๏ผŒ DAGM:https://hci.iwr.uni-heidelberg.de/content/weakly-supervised-learning-industrial-optical-inspection.
carpet
sidewalks
BC defects
pill
...

MAMl Train

  1. Run maml.python file for maml training First remove the target task from the dataset by the following code, then set the maml related parameters
    tasknames1=["cable"]
...
    argparser.add_argument('--epoch', type=int, help='epoch number', default=1000)
    argparser.add_argument('--meta_lr', type=float, help='meta-level outer learning rate', default=0.001)
    argparser.add_argument('--fast_lr', type=float, help='task-level inner update learning rate', default=1e-5)
    argparser.add_argument('--meta_bsz', type=int, help='task_batch', default=1)
    argparser.add_argument('--adaptation_steps', type=int, help='inner loop iter', default=1)
    argparser.add_argument('--task_num', type=int, help='meta batch size, namely task num', default=29)
    argparser.add_argument('--n_way', type=int, help='n way', default=2)

Train

1.After maml training, add in the weights for basic training to run basetrain.py, data loading and parameter settings are as follows:

   argparser.add_argument('--update_step_test', type=int, help='update steps for finetunning', default=2000)
  argparser.add_argument('--update_lr', type=float, help='task-level inner update learning rate', default=1e-5)
  argparser.add_argument('--n_way', type=int, help='n way', default=2)

Evaluate

Load the training results for evaluation and display the results as a pdf file

medetection's People

Contributors

jzbx123 avatar zhg-szpt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.