# A Method for Enhancing the Accuracy of Pet Breeds Identification Model in Complex Environments
## 3 Materials and Methods  
### CPI Dataset  
As previously stated, the primary objective of this study is to enhance the recognition accuracy of the model on complex images using transfer learning. To achieve this, we developed a 37-category dataset for pet cat and dog breeds classification, referred to as the CPI dataset. The categories and their corresponding number of images are shown in Table 1, where Name stands for the name of the category and N stands for the number of images. The CPI dataset comprises 5550 real-world images, all sourced from the Oxford-IIIT Pet dataset [15].  
Oxford-IIIT Pet is a public dataset with 37 categories and a total of 7349 pet images. It includes 12 different breeds of pet cats and 25 different breeds of pet dogs, with each category containing approximately 200 images. The majority of the image data in the Oxford-IIIT Pet dataset are annotated images posted by enthusiasts on social networking sites dedicated to sharing photos of cats and dogs, including indoor and outdoor shots, as well as images with simpler or solid-colored backgrounds [15].  
Utilizing a model trained solely on the Oxford-IIIT Pet dataset for identifying breeds in real-world cat and dog images is prone to errors. As previously highlighted, this issue arises from the model's inadequate generalization capacity and the low signal-to-noise ratio of the training set feature maps. Consequently, we refined the Oxford-IIIT Pet dataset by discarding all overly simplistic images within each category, retaining only the more intricate images. Images in the Oxford-IIIT Pet dataset were removed if any of the following conditions were met:  
(1) The image background is a solid color.  
(2) The background has few features due to dim light (such as pictures taken in a dark room).  
(3) The background features are too simple due to an environment with fewer characteristics such as grass, blue sky, sofa and bedspread.  
In this manner, we obtained 5247 images. To enhance the selection of images to create a migration learning dataset suitable for practical applications, we applied rotations, brightness adjustments, noise filtering, and horizontal and vertical mirroring on categories with fewer images. The processed data served as an augmentation. Consequently, we were able to produce a pet cat and dog breed classification dataset--the CPI dataset (see Figure 1)--evenly distributed across 37 categories.  
The CPI dataset is tailored for identifying pet cat and dog breeds in challenging environments. The dataset includes 5550 images of 37 pet categories, comprising 12 cat breeds and 25 dog breeds. As shown in Figure 1, these images are captured from diverse perspectives, settings, and lighting conditions, presenting a complex background. The backgrounds of these images include plants and various common indoor and outdoor objects. In some images, there may be people present, which can make the pets not the most salient objects (i.e., not the most noticeable). These factors are designed to reduce the signal-to-noise ratio of the image features observed during model training, increase the difficulty of identifying pets, and push the feature extraction capabilities of the model to the theoretical limits of its architectural design.