Causal inspiration-based unbiased pest identification method, terminal and storage medium
Through the causal inspiration learning framework, the reconstruction images of various backgrounds are generated and unbiased constraints are implemented, which solves the problem of external generalization in pest recognition, improves the recognition accuracy and generalization ability, and is suitable for pest recognition under different background conditions.
Patent Information
- Application Number
- CN202510415407.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-11
AI Technical Summary
The existing technology has the problem of external distribution generalization in pest recognition, which leads to low recognition accuracy. The reason is that the deep learning model uses background factors as the core feature of discriminating pest categories and cannot effectively generalize to different background conditions.
The causal and inspiring learning framework is adopted to generate reconstructed images of diverse backgrounds through the causal feature separation module and the causal and inspiring data reconstruction module, and filter and train images through the unbiased constraint module to build a convolutional neural network model for identification.
It improves the accuracy and generalization ability of pest recognition, and can achieve unbiased pest recognition under different background conditions, which is suitable for environments where training data scene distribution is inconsistent.
Smart Images

Figure CN120299065A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural crop pest identification, and particularly to an unbiased pest identification method, a terminal and a storage medium based on causal inspiration. Background Art
[0002] In recent years, with the rapid development of computer vision technology, great progress has been made in pest identification from manual identification to automatic identification. In particular, deep learning technology has achieved remarkable results in the field of pest identification. However, the deep learning technology, which is essentially inductive learning, often relies on independently and identically distributed data. In the face of the complex field environment in the wild, affected by pest habits, most of the collected data is captured in the same background, while the immediate identification task will be in different background conditions. This phenomenon is summarized as the out-of-distribution generalization problem. In this case, although multi-scale feature extraction is used to capture deep features, irrelevant factors such as the background will still be regarded as the core features for discriminating pest categories during the training stage, resulting in poor generalization ability and low identification accuracy of the pest identification method. Therefore, it is urgent to solve. Summary of the Invention
[0003] To solve the technical problems existing in the prior art, the present invention provides an unbiased pest identification method, a terminal and a storage medium based on causal inspiration. Based on the causal theory, the present invention systematically analyzes the essence of the out-of-distribution generalization problem and proposes a comprehensive solution that takes into account core feature extraction and data diversity enhancement, which can achieve accurate pest identification in out-of-distribution scenarios.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] The present invention discloses an unbiased pest identification method based on causal inspiration, including the following steps:
[0006] S1. Collect pest images containing distribution bias from a multi-source pest dataset and perform preprocessing to obtain original images;
[0007] S2. Construct a causal inspiration learning framework, which includes a causal feature separation module and a causal inspiration data reconstruction module; the causal feature separation module is used to generate a pest region mask, and use the mask to extract the low-dimensional causal features of the pest object in the original image to complete the separation of causal factors; the causal inspiration data reconstruction module is used to combine the low-dimensional causal features and text prompts to generate reconstructed images with diverse backgrounds;
[0008] S3. Construct an unbiased constraint module, which uses a scene discriminator and an object discriminator to calculate the scene scores and object scores of the original image and the reconstructed image respectively, and extracts the scene score difference and object score difference between the reconstructed image and the original image through an object-scene distance metric strategy, and filters out the constrained reconstructed image based on the relative metric constraint score and threshold;
[0009] S4. Input the original image and the constrained reconstructed image into a classification model based on a convolutional neural network for training to optimize the network weights;
[0010] S5. Input the pest image to be recognized into the trained qualified classification model for prediction to obtain the evaluation indexes of the corresponding pest category and the corresponding confidence level.
[0011] As a further improvement of the above solution, in the unbiased constraint module, the original image I and the reconstructed image I′ are respectively obtained by the scene discriminator F scene and the object discriminator F object to obtain their corresponding scores, and the score formula is expressed as:
[0012] (S, S ′ ) = F scene (I, I ′ )
[0013] (O, O ′ ) = F object (I, I ′ )
[0014] In the formula, S and S′ respectively represent the scene scores of the original image and the reconstructed image, and O and O ′ respectively represent the object scores of the original image and the reconstructed image;
[0015] Calculate the object and scene differences between each reconstructed image and the original image through the Euclidean distance, and then calculate the relative metric constraint score. The expression formula is:
[0016]
[0017] In the formula, Dis(·,·) represents the Euclidean distance; A represents the relative metric constraint score, that is, the set of constraint scores of all reconstructed images;
[0018] Judge the data reliability through the threshold, and the expression formula is as follows:
[0019] I″ = I′(a i > α)
[0020] In the formula, I″ represents the constrained reconstructed image; a i represents the constraint score of a single reconstructed image; α represents the threshold of the constraint score.
[0021] As a further improvement of the above solution, the classification model uses ResNet-50, DenseNet-201 or ConvNeXt-B.
[0022] As a further improvement of the above solution, the YOLOv11 detector is used to combine the original pest data to obtain training weights and save the parameters as the object discriminator; the YOLOv11 classifier is used to combine the place365 dataset to obtain training weights and save the parameters as the scene discriminator.
[0023] As a further improvement of the above solution, in step S1, the preprocessing includes: in the collected data, removing duplicate, blurred and image with interfering watermarks; then using a web crawler to crawl image data on the network to supplement the dataset.
[0024] As a further improvement of the above solution, in step S1, the collected data is also divided. The pest images with the same background are used as the training set, and the pest images with multiple backgrounds are used as the test set to simulate the out-of-distribution generalization problem in the field of pest recognition.
[0025] As a further improvement of the above solution, in step S2, the causal feature separation module uses a pre-trained image segmentation model to generate a pest region mask and extract low-dimensional causal features; the causally inspired data reconstruction module uses a pre-trained image diffusion model to combine the low-dimensional causal features and text prompts to generate a reconstructed image.
[0026] As a further improvement of the above solution, the image segmentation model uses SAM, and the image diffusion model uses LDMs.
[0027] The present invention also discloses a computer terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the unbiased pest recognition method based on causal inspiration as described above are implemented.
[0028] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the unbiased pest recognition method based on causal inspiration as described above are implemented.
[0029] Compared with the prior art, the beneficial effects of the present invention are:
[0030] 1. The present invention uses a causal heuristic learning framework to generate reconstructed images of multiple scenario variants, and also retains object information related to labels. The reconstructed images are constrained by an unbiased data constraint module to ensure data reliability. The causal feature classification module can separate low-dimensional causal features to ensure the extraction of causal factors, and then the global background information of the low-dimensional causal features is complemented by a causal heuristic data reconstruction module to generate reconstructed images as new extended data samples. Through the original images and the reconstructed images, causal intervention on the model can be achieved, improving the generalization ability of the model.
[0031] 2. The present invention uses an object discriminator and a scene discriminator to obtain the scores of the reconstructed images, and designs an object-scene distance metric strategy. The closer the object distance and the larger the scene distance, the better the reconstructed image is represented. By obtaining unbiased reconstructed images of pests, the classification accuracy can be improved.
[0032] 3. The present invention is based on the pest extended data generated by causal heuristic learning, and through the constraint on the reconstructed images, unbiased pest extended data is obtained. Through this method, unbiased pest recognition can be achieved in out-of-distribution scenarios.
[0033] 4. The present invention is applicable to the out-of-distribution generalization problem where most of the training data is composed of the same scene distribution, and the test data comes from various different distribution scenarios. In addition, the present invention is also applicable when the training data is affected by distribution bias. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is the overall flowchart of the unbiased pest recognition method based on causal heuristic in Embodiment 1 of the present invention.
[0035] Figure 2 is the flowchart of the causal heuristic learning framework in Embodiment 1 of the present invention.
[0036] Figure 3 is the flowchart of the unbiased data constraint module in Embodiment 1 of the present invention.
[0037] Figure 4 is the structural schematic diagram of the computer terminal in Embodiment 2 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0039] Embodiment 1
[0040] See also Figure 1 ,This embodiment provides an unbiased pest identification method based on causal inspiration, including the following steps, namely S1 to S5.
[0041] S1. Collect pest images containing distribution deviations from multi-source pest datasets and preprocess them to obtain original images.
[0042] In this embodiment, pest data is collected using multi-source data and preprocessed in various aspects to ensure the quality and reliability of the data. First, multiple types of pest data with heavy distribution deviations are obtained from multiple pest data sets. Second, duplicate, blurred, and interference watermarked images are removed from the collected data. Then, a web crawler is used to crawl image data on the Internet to supplement some data sets.
[0043] In order to simulate the data distribution problem in agricultural pest sample collection, the collected data is divided, and pests with the same background are used as the training set, while pests with multiple backgrounds are used as the test set, so as to simulate the out-of-distribution generalization problem in the field of pest identification. Through these innovative data collection and preprocessing work, the present invention can obtain high-quality out-of-distribution pest data and lay a solid foundation for subsequent research.
[0044] S2. Construct a causal-inspired learning framework.
[0045] The causal-inspired learning framework includes a causal feature separation module and a causal-inspired data reconstruction module.
[0046] Causal factors represent the core features of the class related to the label, which are difficult to obtain by traditional technical means in the out-of-distribution generalization problem. Based on causal theory, causal intervention helps the model ignore non-causal factors and focus on causal factors to achieve accurate identification, but traditional methods are difficult to directly meet this technical means. Therefore, a causal feature separation module and a causal-inspired data reconstruction module are used to construct a causal-inspired learning framework to achieve data diversification and promote the model to complete causal intervention.
[0047] See also Figure 2 The causal feature separation module separates the causal factors by generating an object mask and then retaining the object information to separate the background area. This embodiment uses the pre-trained Segment Anything Model (SAM) to locate the pest area through the prompt point, generate a high-precision mask, and use the mask to extract the low-dimensional causal features of the pest object to complete the task of separating the causal factors. Of course, in other embodiments, SAM can also be replaced with other image segmentation models.
[0048] The causality-inspired data reconstruction module preserves low-dimensional causal features and complements background information to generate reconstructed images. The reconstructed images contain diverse background information, which can significantly enhance the generalization ability of the model and improve the recognition performance in out-of-distribution scenarios. In this study, pre-trained Latent Diffusion Models (LDMs) are adopted to generate reconstructed images by combining low-dimensional causal features with text prompts. The diversity of the background can be enhanced by manually adjusting language expressions based on domain knowledge, generating extended data with multiple scene variants. In other embodiments, LDMs can also be replaced with other image diffusion models.
[0049] The causality-inspired data reconstruction module is used to generate reconstructed images with diverse backgrounds by combining low-dimensional causal features and text prompts.
[0050] The data reconstruction framework based on causality-inspired learning combines two major modules to generate reconstructed images. The reconstructed images carry information about the objects related to their labels in the original image and diverse background information. The causal feature classification module can separate low-dimensional causal features, ensuring the extraction of causal factors. Then, the causality-inspired data reconstruction module complements the global background information of the low-dimensional causal features to generate reconstructed images as new extended data samples. Through the original image and the reconstructed image, causal intervention on the model can be achieved, enhancing the generalization ability of the model.
[0051] S3. Construct an unbiased constraint module.
[0052] Reconstructed images with diverse backgrounds show excellent performance in solving out-of-distribution generalization problems by promoting the model to achieve causal intervention. However, when the object information in the reconstructed image is incomplete or the background is similar to the original image, it will conversely affect the recognition accuracy and generalization ability of the model. Although methods such as point prompts and manually adjusting language expressions based on domain knowledge are used to adjust the prompt information, the reliability of the generated reconstructed data is still difficult to guarantee. Therefore, by imposing constraint conditions on the reconstructed images, the reliability of the reconstructed images is ensured.
[0053] Specifically, please refer to Figure 3 , the unbiased data constraint module obtains the scene score and the object score through the scene discriminator and the object discriminator, and proposes an object-scene distance metric strategy. Through this strategy, the differences in scene scores and object scores are extracted, and the relative metric scores between the differences are calculated. The reliability of the reconstructed image is judged through a threshold.
[0054] Among them, for the object-scene distance metric strategy, the object and the scene are the pest object and the pest background information of the original pest image and the reconstructed image, respectively.
[0055] The original image I and the reconstructed image I′ are respectively processed by the scene discriminator F scene and the object discriminator Fobject Obtain its corresponding score, and the score formula is expressed as:
[0056] (S, S ′ ) = F scene (I, I ′ )
[0057] (O, O ′ ) = F object (I, I ′ )
[0058] Wherein, S and S' respectively represent the scene scores of the original image and the reconstructed image, and O and O ′ respectively represent the object scores of the original image and the reconstructed image;
[0059] Optimize the reconstructed image through the object-scene distance metric strategy, calculate the object and scene differences between each reconstructed image and the original image through the Euclidean distance, and then obtain the constraint score through the relative metric. The formula for the constraint score is as follows:
[0060]
[0061] Wherein, Dis(·,·) represents the Euclidean distance; A represents the constraint score of the relative metric, that is, the set of constraint scores of all reconstructed images;
[0062] Judge the data reliability through the threshold. If the constraint score of the relative metric of the reconstructed image is greater than the threshold, then the reconstructed image is a constrained reconstructed image, and the expression formula is as follows:
[0063] I″ = I′(a i > α)
[0064] Wherein, I″ represents the constrained reconstructed image; a i represents the constraint score of a single reconstructed image; α represents the threshold of the constraint score.
[0065] Obtain high-quality reconstructed images using the constraint conditions. The unbiased data constraint module uses the object attributes and background information of the reconstructed images for relative metrics, promoting the generated reconstructed images to effectively promote the model to achieve causal intervention and enhancing the recognition accuracy and generalization ability of the model in out-of-distribution scenarios.
[0066] Use the object discriminator and the scene discriminator to obtain the reconstructed image scores, and design the object-scene distance metric strategy, so that the closer the object distance and the larger the scene distance, the better the reconstructed image is represented. By obtaining unbiased pest reconstructed images, the classification accuracy is improved.
[0067] In addition, to effectively improve the performance of the discriminator, this study plans to use the YOLOv11 detector to combine with the original pest data to obtain training weights and save the parameters as the object discriminator, and use the YOLOv11 classifier to combine with the place365 dataset to obtain training weights and save the parameters as the scene discriminator.
[0068] S4. Input the original image and the reconstructed image with constraints into a convolutional neural network-based classification model for training to optimize the network weights.
[0069] By using the original image and the reconstructed image as training samples, optimize the network weights according to the loss function of the training set and the gradient descent algorithm, and use the best model weights to predict the out-of-distribution data categories in scenarios with different distributions from the training set. The various convolutional neural network-based classification models proposed in this study, such as: ResNet-50, DenseNet-201, ConvNeXt-B, are all supported by the MMLab toolbox.
[0070] S5. Input the pest image to be recognized into the trained classification model for prediction to obtain the evaluation indicators of the corresponding pest category and the corresponding confidence level.
[0071] Verify through the test data in the original image in the classification model that has obtained the best model weights. Input the given test data into the classification model for evaluation to obtain the accuracy, precision, recall rate, and F1-score. Input a single piece of data into the classification model for prediction, and the evaluation indicators of the corresponding pest category and the corresponding confidence level can be obtained.
[0072] In this embodiment, 13 pest species that are prone to out-of-distribution generalization problems are collected and preprocessed as the experimental dataset in the data collection and preprocessing steps, constructing an out-of-distribution generalization dataset. The training set is single-background data, and the test set is multi-class background data. In addition, the training set and the test set of the out-of-distribution generalization dataset are mixed and randomly distributed to construct a dataset with distribution bias.
[0073] To verify the feasibility of the present invention, it is verified through three convolutional neural networks proposed. For comparative analysis, the experimental parameters are uniformly set. The image input size is 224*224, and the data augmentation uses random cropping and random horizontal flipping with the parameter set to 0.5. The optimizer uses the SGD algorithm, the initial learning rate is set to 0.01, the momentum is 0.9, and the weight decay coefficient is 0.0001. The batch size is 16. To improve the model convergence speed, a linear learning rate warm-up + cosine annealing learning rate scheduling strategy is adopted. From the experimental data in Table 1 and Table 2, it can be seen that the present invention (Ours) has significantly improved the performance in both the out-of-distribution generalization problem and the dataset with distribution bias.
[0074] Table 1. Experimental results in out-of-distribution generalization scenarios
[0075] Accuracy (%) Precision (%) Recall (%) F1 Score (%) ResNet-50 47.43 57.18 45.79 48.53 DenseNet-201 51.93 62.86 47.42 51.52 ConvNeXt-B 50.30 68.56 46.03 51.14 Ours (ResNet-50) 65.70 71.06 63.02 65.35 Ours (DenseNet-201) 69.38 73.70 66.81 68.96 Ours (DenseNet-201) 78.09 84.76 76.70 78.36
[0076] Table 2. Experimental results in distribution bias scenarios
[0077]
[0078]
[0079] Example 2
[0080] This example provides a computer terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the unbiased pest recognition method based on causal inspiration described in Example 1 are implemented.
[0081] As Figure 4 shown, the computer terminal provided in this example includes: at least one processor 101, and a memory 102 connected to at least one processor 101. In this example, the specific connection medium between the processor 101 and the memory 102 is not limited. Figure 4 Here, it is taken as an example that the processor 101 and the memory 102 are connected through a bus 100. The bus 100 is represented by a thick line in Figure 4 Here. The connection manners between other components are only illustrative and not restrictive. The bus 100 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 4 here it is only represented by a thick line, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 101 can also be called a controller, and the name is not limited.
[0082] In this example, the memory 102 stores instructions executable by at least one processor 101. By executing the instructions stored in the memory 102, at least one processor 101 can execute the foregoing method.
[0083] Among them, the processor 101 is the control center of the device, and can connect various parts of the entire control device through various interfaces and lines. By running or executing the instructions stored in the memory 102 and calling the data stored in the memory 102, various functions of the device and process data, so as to monitor the device as a whole.
[0084] In a possible design, the processor 101 may include one or more processing units. The processor 101 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 101 either. In some embodiments, the processor 101 and the memory 102 may be implemented on the same chip, and in some embodiments, they may also be separately implemented on independent chips.
[0085] The processor 101 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the unbiased pest identification method based on causal inspiration disclosed in conjunction with Embodiment 1 can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor 101.
[0086] As a non-volatile computer-readable storage medium, the memory 102 can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory 102 may include at least one type of storage medium. For example, it may include flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (RAM), a static random access memory (SRAM), a programmable read-only memory (PROM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic memory, a magnetic disk, an optical disk, and so on. The memory 102 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 102 in this embodiment may also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data.
[0087] By programming the design of the processor 101, the code corresponding to the security verification method introduced in the foregoing embodiments can be solidified into the chip, so that the chip can execute when running Figure 1Steps of the causal heuristic-based unbiased pest identification method shown. How to design and program the processor 101 is a well-known technology to those skilled in the art and will not be elaborated herein.
[0088] Embodiment 3
[0089] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the causal heuristic-based unbiased pest identification method as described in Embodiment 1 are implemented.
[0090] The computer-readable storage medium may include flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage medium may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Of course, the storage medium may also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the memory is generally used to store the operating system and various application software installed on the computer device. In addition, the memory can also be used to temporarily store various data that have been output or will be output.
[0091] As described above, only the preferred specific embodiments of the present invention are provided, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, makes equivalent substitutions or changes, and all should be covered by the protection scope of the present invention.
Claims
1. An unbiased pest identification method based on causal inspiration, characterized in that, It includes the following steps: S1. Collect pest images with distribution bias from a multi-source pest dataset and perform preprocessing to obtain the original images; S2. Construct a causal heuristic learning framework, which includes a causal feature separation module and a causal heuristic data reconstruction module; the causal feature separation module is used to generate a pest area mask, and use the mask to extract the low-dimensional causal features of the pest objects in the original image to complete the separation of causal factors; the causal heuristic data reconstruction module is used to combine the low-dimensional causal features and text prompts to generate reconstructed images with diverse backgrounds; S3. Construct an unbiased constraint module, which uses a scene discriminator and an object discriminator to calculate the scene scores and object scores of the original image and the reconstructed image respectively, and extracts the scene score difference and object score difference between the reconstructed image and the original image through an object-scene distance metric strategy, and filters out the constrained reconstructed images based on the relative metric constraint scores and thresholds; S4. Input the original image and the constrained reconstructed image into a classification model based on a convolutional neural network for training to optimize the network weights; S5. Input the pest image to be recognized into the trained classification model for prediction to obtain the evaluation indexes of the corresponding pest category and the corresponding confidence level.
2. The unbiased pest identification method based on causal inspiration according to claim 1, wherein In the unbiased constraint module, the original image I and the reconstructed image I' are respectively obtained by the scene discriminator F scene and the object discriminator F object to obtain their corresponding scores, and the score formula is expressed as: (S, S′) = F scene (I, I′) (O,O′) = F object (I,I′) In the formula, S and S′ represent the scene scores of the original image and the reconstructed image respectively, and O and O′ represent the object scores of the original image and the reconstructed image respectively; Calculate the object and scene differences between each reconstructed image and the original image through the Euclidean distance, and then calculate the constraint score of the relative metric, and the expression formula is: In the formula, Dis(·,·) represents the Euclidean distance; A represents the constraint score of the relative metric, that is, the set of constraint scores of all reconstructed images; Judge the data reliability through a threshold, and the expression formula is as follows: I″ = I′(a i > α) where I″ represents the reconstructed image with constraints; a i represents the constraint score of a single reconstructed image; α represents the threshold of the constraint score.
3. The unbiased pest identification method based on causal inspiration according to claim 1, wherein The classification model adopts ResNet-50, DenseNet-201 or ConvNeXt-B.
4. The unbiased pest identification method based on causal inspiration according to claim 1, wherein Use the YOLOv11 detector to combine with the original image to obtain the training weights and save the parameters as the object discriminator; use the YOLOv11 classifier to combine with the place365 dataset to obtain the training weights and save the parameters as the scene discriminator.
5. The unbiased pest identification method based on causal inspiration according to claim 1, wherein In step S1, the preprocessing includes: in the collected data, eliminate duplicate, blurred and images with interfering watermarks; then use a web crawler to crawl image data on the network to supplement the dataset.
6. The unbiased pest identification method based on causal inspiration according to claim 5, characterized in that, In step S1, the collected data is also divided, and the pest images with the same background are used as the training set, and the pest images with multiple backgrounds are used as the test set to simulate the out-of-distribution generalization problem in the field of pest recognition.
7. The unbiased pest identification method based on causal inspiration according to claim 1, wherein In step S2, the causal feature separation module uses a pre-trained image segmentation model to generate a pest area mask and extract low-dimensional causal features; the causal heuristic data reconstruction module uses a pre-trained image diffusion model to combine the low-dimensional causal features and text prompts to generate reconstructed images.
8. The unbiased pest identification method based on causal inspiration according to claim 7, wherein The image segmentation model adopts SAM, and the image diffusion model adopts LDMs.
9. A computer terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the unbiased pest identification method based on causal inspiration as described in any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, the steps of the unbiased pest identification method based on causal inspiration as described in any one of claims 1 to 8 are implemented.