跳到主要內容

以AI深度模型檢測NB D件螺絲孔

Purpose:
To check if screw exists in each screw hole on D piece of notebook by Machine Learning.

Field test of MI4FA project : labeling 3 vacant holes and 1 hole with screw accurately; right pane indicated results of 4 holes with probabilities


Pictures of Field Test





Training:
Step:
Construct framework to take picture of piece D with conditioned ambient light spotted on
1.Collect pictures of screw hole with and without screw on notebook D piece in every project as many as possible.
2.Auto crop circular region of screw hole in pictures by OpenCV program

3.Train CNN model

training dataset:

























Inference:
1.Crop loosely









2.Inverse








3.Threshold






4.pyr
pyrUp
pyrDown



5.can algorithm




6.hough






7.square cropping



8.circle cropping with black padding




9.predict and labeling on picture directly





Result:








留言

這個網誌中的熱門文章

A3C in ATARI Pong-V0

ATARI PONG 對戰模式,左邊為遊戲程式,右邊為訓練中的A3C模型。一局以21分決勝負,對手MISS 一球得一分。從LOG可以看出,A3C模型從最初全敗的輸21分,經過2小時左右的TRAINING,已經逆轉至幾乎每局都勝利,偶爾甚至勝出高達13分。 底下為TRAINING A3C MODEL過程的LOG, (base) frank@viper1:~/a3c$ python main.py --env-name "Pong-v0" --num-processes 8 Time 00h 00m 10s, episode reward -21.0, episode length 1026 Time 00h 01m 18s, episode reward -21.0, episode length 1020 Time 00h 02m 26s, episode reward -21.0, episode length 1029 Time 00h 03m 35s, episode reward -21.0, episode length 1023 Time 00h 04m 42s, episode reward -21.0, episode length 1014 Time 00h 05m 50s, episode reward -21.0, episode length 1087 Time 00h 07m 00s, episode reward -21.0, episode length 1359 Time 00h 08m 14s, episode reward -16.0, episode length 1922 Time 00h 09m 30s, episode reward -14.0, episode length 2220 Time 00h 10m 48s, episode reward -15.0, episode length 2431 Time 00h 12m 04s, episode reward -15.0, episode length 2211 Time 00h 13m 23s, episode reward -8.0, episode length 2600 Time 00h 14m 38s, episod...

DDPG in Torcs within Docker Container

Dockerfile: FROM tensorflow/tensorflow:0.10.0-gpu WORKDIR /home/frank/old_gym_torcs ADD . /home/old_gym_torcs  RUN apt update RUN apt install -y vim xautomation torcs RUN apt-get install -y libjpeg-dev cmake swig python-pyglet python3-opengl libboost-all-dev \         libsdl2-2.0.0 libsdl2-dev libglu1-mesa libglu1-mesa-dev libgles2-mesa-dev \         freeglut3 xvfb libav-tools RUN pip install gym RUN pip install keras==1.1.0 ENV PATH="/usr/games:${PATH}" CMD ["/bin/bash"] viper1 $ docker run --runtime=nvidia -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/frank/old_gym_torcs:/home/old_gym_torcs -v /var/run/docker.sock:/var/run/docker.sock -v /home/frank/gym_torcs:/home/gym_torcs -v /home/frank/gym:/home/gym -p 3101:3101 --workdir /home/old_gym_torcs -p 8888:8888 ddpgfrk:tf0.10 /bin/bash (grey part is not necessary) After  $ docker commit id ddpg:tf0.10.0-gpu viper1 $ docker r...

Loss function

why cross entroy is more suitable for categorical classcification? ref: https://www.youtube.com/watch?v=Li5sVEXTIJw