The research was conducted at the Department of CSE, Anurag University, Hyderabad, during the period November 2025-June 2026, where all activities related to synthetic data generation, model training and performance evaluation took place.
Proposed AI-driven synthetic data generation flow
To concretely address this data scarcity and accelerate the development of more robust camouflaged insect detection models, we propose a novel, AI-driven methodology for synthetic camouflaged insect image generation. This approach leverages the capabilities of advanced AI agents throughout the process, creating a self-improving cycle for dataset enrichment.
The core idea described in this paper is to take images of pests where the pest-detection models can detect the pests. New images will be generated based on these detected pest images to add the effect of camouflage. Various images are generated where the model cannot detect camouflaged pests, which were detected earlier without the camouflage effect. These generated images can then be added to the training data to improve the model. This is depicted in the Fig 1.
The methodology is structured into seven interconnected steps under three AI agents, designed to systematically generate diverse and challenging camouflaged insect images. Fig 2 provides a conceptual illustration of this iterative process, showing the flow of information.
Step-1: Knowledge extraction
LLMs are prompted to compile comprehensive lists of insect pests affecting various crops. For each pest, they extract crucial ecological and morphological details, including.
• Specific plant parts where they are typically found (
e.
g., underside of leaves, stems, flowers, fruits, roots).
• Their typical size range, colour variations and texture characteristics.
• Known camouflage strategies (
e.
g., background matching, disruptive coloration, masquerade, transparency).
• Life cycle stages and associated visual changes.
• Any other important details that can help generate realistic synthetic camouflaged images, such as preferred lighting conditions or common environmental contexts.
A sub-agent under a knowledge agent is used to implement this step. The information about a given pest is generated with the help of an LLM. The LLM that is being used here is Gemini 1.5 Flash. Zero-shot prompting is used in this case. The prompt to LLM requests for information of the pest like life cycle, crops affected, ecological details, morpohological details. The LLM generates the output in JSON format mapping pests to crops affected, their preferred micro-habitats on plants and detailed camouflage-relevant attributes. The knowledge information about the pests retrieved by invoking the LLMs are later used in the image generation steps.
Step-2: Asset collection for pests and plants
With the information generated in Step 1 about the pests, images of the pests and their associated host plants are collected. This includes:
• Images of the pest species in various orientations, lighting conditions and life stages.
• Images of the specific plant parts (leaves, stems, flowers, fruits) that serve as common backgrounds, captured under different lighting, angles and growth stages to ensure environmental variability.
This step is implemented as a tool under the knowledge agent which extracts information needed to get unique pest and crop/plant images from the internet
• The information extracted for pests include life_stages and host_plants.
• For the plant, information about the parts of the plant where the pests are found are extracted from the JSON.
Once the above information is extracted it creates multiple queries. For each of the queries, it scrapes image URLs from Google Images. The images from these URLs are then extracted to a local path.
Step-3: Image separation (foreground/background segmentation)
For each collected pest image, automatically segment the insect from its original background, generating a clean foreground mask. Similarly, clean background elements (
e.
g., individual leaves, sections of stems) are extracted from the plant images. This step is critical to ensure precise placement and realistic blending in the synthetic images.
This step is implemented as a tool under knowledge agent, that processes each image with the help of a library rembg to remove the background and only keep the pest in the image (
Bappy, 2024).
The output of this step is isolated pest foregrounds (with corresponding pixel-level masks).
Step-4: Synthetic image generation with varied parameters
This is the core step that generates images with varying parameters. The isolated pest foregrounds are blended onto the plant backgrounds. For each pest-plant pair, several camouflaged images are generated by systematically varying key parameters like position of pests on plant background, orientation of the pest, scale, blending technique based on pest camouflage strategies, environmental conditions like lighting, occlusion, background noise.
The logic in this step to generate synthetic images using the extracted pest and background from previous steps is implemented under generation agent. We have used Stable Diffusion pipeline that takes instructions and images as inputs to generate the desired synthetic output image. Annotations/labels are automatically generated in yolo format for the generated synthetic images.
The output is a large, diverse dataset of synthetically generated camouflaged insect images, each accompanied by precise bounding box annotations in yolo format.
Step-5: Initial detection and classification by existing models
The newly generated synthetic images are fed through a suite of current detection models. Each image is then classified as ‘detected’ or ‘not-detected’ based on predefined performance thresholds (
e.
g., Intersection over Union (IoU) for bounding boxes/masks, or confidence scores).
The output is a categorized list of synthetic images (detected/not-detected) along with their detection metrics and confidence scores from the existing models.
Step-6: Dataset enhancement with challenging samples
The images that were classified as ‘not-detected’ by the existing models are identified as particularly challenging examples. These images can be added to the existing datasets to enhance them. This step helps in improving the dataset by adding real camouflaged pest images, which are most valuable for improving model robustness.
This step generates an enhanced dataset of camouflaged pest images. This new dataset includes images enriched with difficult-to-detect instances.
Step-7: Training new models with enhanced datasets
The enhanced dataset, which is the output of Step 6 is used to train new camouflaged pest detection models. This training can be done from scratch, or an existing one can be fine-tuned. These enhanced images ensure that subsequent models learn directly from the weaknesses of their predecessors. It will lead to continuous improvement in detection performance and generalisation capabilities.
This step produces improved camouflaged pest detection models with better performance on challenging, camouflaged pests.
This structured approach, driven by AI agents at each stage, creates a self-improving cycle for generating high-quality, challenging camouflaged insect data. It directly addresses the data scarcity problem by providing an inexhaustible and intelligently curated source of training data, thereby accelerating the development of more robust and accurate camouflaged insect detection systems for real-world agricultural applications.