# Research on Identification Technology of Field Pests with Protective Color Characteristics
## 3 Results and Discussions
### Model Training and Performance Evaluation  
The operating system is Windows 10, the CPU (Center Processing Unit) is Intel (R) Xeon (R) CPU e5-2623 V3 \(\times\) 2, the GPU (Graphic Process Unit) is NVIDIA geforce rtx2080 with 32 GB video memory, and the framework is pytoch. After the training, we can get curves of loss value of bounding box, objectness and classification. Classification loss inspires how well the algorithm can predict the correct class of a given object [48]. Given only one identification target (_Pieris rapae_) in this paper and no classification of multiple objects, there is no curve of classification loss. As demonstrated in Figure 9, it represents curve of loss value of bounding box. The graph on the left shows the bounding box loss of the training set. The graph on the right shows the bounding box loss of the verification set. Box loss indicates the extent to which the algorithm can position the center of the target and the extent to which the predicted bounding box covers the target. The abscissa of the curve is the epoches of the algorithm, and the ordinate represents the value of box loss. The smaller the value of box loss, the more accurate the predicted bounding box is. As demonstrated in Figure 10, it represents curve of the value of objectness loss. The graph on the left shows the objectness loss of the training set. The graph on the right shows the objectness loss of the verification set. Objectness loss measures the probability that an object exists in a proposed region of interest. If the objectivity is high, the bounding box is likely to contain an object. The abscissa of the curve is the epochs of the algorithm, and the ordinate represents the value of objectness loss. The smaller the value of objectness loss, the more accurate the target detection is. Figure 10: Curve of objectness loss. Figure 9: Curve of loss value of bounding box. The accuracy evaluation of the identification model mainly consists of visual comparison and performance evaluation index. The visual comparison is to obtain the missing detection and wrong detection of pests through comparison [49]. The performance evaluation index contains identification accuracy and identification speed. The speed index refers to the average time required to identify a pest image. The basic indicators of identification accuracy are precision (\(P\)) and recall (\(R\)). Precision indicates the proportion of the actual positive samples in the forecast samples to all positive samples. Recall indicates the proportion of actual positive samples in all predicted samples. The classification problem of _Pieris rapae_ can be considered as a binary classification problem. In the classification problem, _Pieris rapae_ is a positive sample and all types of background are negative samples. Assuming that the positive sample is expressed as \(T\) and the negative sample is expressed as \(P\), the calculation formulas of precision and recall is as follows:  
\[P=\frac{TP}{TP+FP} \tag{1}\]  
\[R=\frac{TP}{TP+FN} \tag{2}\]  
where \(TP\) represents the number of positive samples correctly predicted as positive samples, \(TN\) denotes the number of negative samples correctly predicted as negative samples, \(FP\) indicates the number of negative samples predicted as positive samples, and \(FN\) suggests the number of positive samples predicted as negative samples [50,51]. The curve of precision and recall are shown in Figure 11. The graph on the left shows the curve of precision. The graph on the right shows the curve of recall. The model improved swiftly in terms of precision and recall before plateauing after about 20 epochs. P-R curve is a graph showing the relationship between precision and recall. The abscissa is recall and the ordinate is precision. The area enclosed by P-R curve and coordinate axis is the AP (Average Precision) of the model. The larger the area between the curve and the coordinate axis, the better its recognition effect. Figure 12 shows the P-R curve with a threshold of 0.5 generated in the training process.