当前位置:网站首页>[2022 10th Teddy Cup Challenge] Title A: complete version of pest identification (general idea. Detailed process and code and results CSV in compressed package)
[2022 10th Teddy Cup Challenge] Title A: complete version of pest identification (general idea. Detailed process and code and results CSV in compressed package)
2022-07-19 05:06:00 【Big data Da Wenxi】
【2022 The 10th ‘ Teddy cup ’ challenge round 】A topic : Pest identification complete ( There are complete results )
2022 Teddy Cup Challenge A Title pest identification full version ( General train of thought , The detailed process and code are in the compressed package ):
Official data :
Extraction code : u54n
Write it at the front :
Download the full version :
Suggest Chrome Browser open
This set of compressed packages , Contains :
Data preprocessing code 、YOLO A complete set of codes for pest identification and positioning 、 Result processing code ( To normalize to pixel coordinates, etc. to csv file )、 Existing results result2,result3.csv( Due to the moving speed of Baidu online disk , Upload to Alibaba cloud disk , There are websites and extraction codes in the package )、 Additional gifts pycharm Professional software
There is a complete set of result data ( Detected pictures , The result of question 23 csv)
One 、 Data preprocessing :( In data preprocessing .ipynb in )
1、 Construct out YOLO Format label set :

2、 Preprocessing part of the code :


3、 Select the image set for training and the image set to be tested :




Two 、 adopt txt Documents and corresponding images Image files are converted to YOLO The required voc Dataset format :
3、 ... and 、 model training ( The full set of models and results are YOLO—hc In the compressed package )
1、 Set up the environment , Connect the server
2、 Set the data of the cost question :

3、 Use after training best.pt To verify ,val.py Parameter is :

4、 After verification , Carry out the final test ,detect.py, The parameter aspect is set to : Choose the best model , Select the data set to be tested :
5、 ... and 、 The result is processed into pixel coordinates and then written csv
runs\train\exp16:




confusion_matrix.png( Confusion matrix )
Confusion matrix can summarize the prediction results of classification problems , It shows which part of the classification model will be confused when making predictions .
F1_curve:
F1 The relationship between score and confidence .F1 fraction (F1-score) It's a measure of classification , It's accuracy precision And recall rate recall Harmonic mean of , The maximum is 1, The minimum is 0, 1 It's the best ,0 Is the worst
P_curve.png :
Accuracy rate precision And confidence confidence Diagram for
PR_curve.png:
PR In the curve P It stands for precision( Accuracy ),R It stands for recall( Recall rate ), It represents the relationship between accuracy and recall , In general , take recall Set to abscissa ,precision Set to ordinate .PR The area enclosed under the curve is AP, All categories AP The average value is Map. If PR One of the curves in Figure A Completely enclose the curve of another learner B, It can be asserted that A Better performance than B, When A and B When crossing occurs , It can be compared according to the area under the curve . General training results mainly observe the fluctuation of accuracy and recall rate ( If the fluctuation is not great, the training effect is better )Precision and Recall It is often a contradictory pair of performance metrics ; Improve Precision == Improve the threshold of positive case prediction by two classifiers == Make the positive example predicted by the two classifiers as real as possible ; Improve Recall == Reduce the threshold of positive case prediction by two classifiers == Make the two classifiers choose the real positive examples as much as possible
R_curve.png : The relationship between recall rate and confidence
results.png:
Box_loss: YOLO V5 Use GIOU Loss As bounding box The loss of ,Box Presumably GIoU The loss function means , The smaller the box, the more accurate ;
Objectness_loss: It's supposed to be target detection loss mean value , The smaller the target, the more accurate the detection ;
Classification_loss: It is presumed to be classified loss mean value , The smaller the size, the more accurate the classification ;
Precision: precision ( Find the right positive class / All positive classes found );
Recall: True for positive The accuracy of , That is, how many positive samples have been found ( How many recalls ).Recall From the perspective of real results , It describes how many real positive examples in the test set are selected by two classifiers , That is, how many real positive examples are recalled by the two classifiers .
val Box_loss: Verification set bounding box Loss ;
val Objectness_loss: Verification set target detection loss mean value ;
val classification_loss: Validation set classification loss mean value ;
C:\Users\X\Desktop\yolov5-hc\runs\val\exp3:

6、 ... and 、 result :
function detect.py:

Test pictures :

Convert to results and save to csv file :

result2.csv:

result3.csv:

Before optimization :

After optimization :

7、 ... and 、 At the end :
Due to the large amount of data, it cannot be uploaded at one time , So split some data and upload it to Alibaba cloud disk first , Specifically in the tutorial
There are detailed tutorials in the package , Pure hand code , It's not easy to create , Thank you for your support

边栏推荐
- 【2022第十届‘泰迪杯’挑战赛】A题:害虫识别完整版(大致思路。详细过程和代码以及结果csv在压缩包中)
- 02 Bar _ Recommandation de film (basée sur le contenu) Portrait de l'utilisateur
- 上传七牛云的方法
- Logic of image uploading
- Cve-2019-14234 Django jsonfield SQL injection vulnerability
- POC——DVWA‘s XSS Reflected
- 一个问题的探讨
- Yiwen takes you to know about haproxy
- 01_电影推荐(ContentBased)_物品画像
- CVE-2017-12635 Couchdb 垂直权限绕过漏洞复现
猜你喜欢
随机推荐
One article to understand Zipkin
Message converter (JSON)
Install MySQL
一文带你了解HAProxy
负载均衡添加ssl证书
Yiwen takes you to know about haproxy
DirectExchange交换机的简单使用。
Asynchronous data SMS verification code
浅聊链路追踪
微众对接机制备忘
redis 安装
MYSQL数据库表A数据同步到表B
User management - paging
ModerlArts第一次培训笔记
NoSQL overview
3.RestClient查询文档
Logic of image uploading
用户-注册/登录
银行联行号cnasp&查询(二)
Sleuth getting started









