Computer vision (3): retraining one’s own data model with induction-v3 model

Time:2020-9-21

Retraining your data model with inception-v3

Background:

Modern image recognition models have millions of parameters. Training from scratch requires a large number of sample data and consumes huge computing resources (hundreds of GPUs). Therefore, the cost of retrain a model by transfer learning is low,Using concept-v3 as a trained model to achieve their own image classification and recognition
 
 

Introduction to the directory of inception model file:

Data directory: the data to be trained is placed in this directory: induction_ Model: put the download inception model in this directory:

  

 

test_ Images: after the training is completed, test the directory of pictures

 

After the data preparation is completed, perform the following steps:

Step 1:

windows:

Run batch file retrain.bat

 

python retrain.py ^
--bottleneck_ Dir bottleneck ^ ා generate the data of each training picture
--how_ many_ training_ Steps 200
--model_ dir inception_ Model
--output_ graph output_ graph.pb  ^Output model after training
--output_ labels output_ labels.txt  ^Output label after training
--image_dir data
pause

 

Ubuntu:

Run batch file retrain.sh

 

Step 2:

After training, the test is as follows

 

 

Python  predict.py

The test results are as follows:

 

 

 

 

Conclusion: if the test objects are not similar, the recognition rate is very high, but if the objects are similar in shape, the recognition rate is not high

Source code: https://pan.baidu.com/s/1qdRmnQsRv5k3QesZxRC9QA Extraction code: JIT