Image detection methods, devices, electronic equipment and storage media
By using an improved YOLO network for multi-scale feature extraction and fusion, the problem of insufficient seedling identification accuracy in traditional methods is solved, and the accuracy of seedling and weed identification and detection is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 北京观微科技有限公司
- Filing Date
- 2025-03-25
- Publication Date
- 2026-06-30
AI Technical Summary
Traditional machine learning methods suffer from poor detection accuracy in field seedling identification, mainly due to insufficient accuracy and robustness in the diverse weed species and complex backgrounds. Simple feature extractors cannot extract effective local features and contain redundant features, resulting in insufficient representation of global semantic details.
An improved YOLO network is adopted, which introduces multiple branch networks into the backbone network to perform dilated convolution operations, and combines the neck network and head network to extract object features at different scales. Furthermore, the object type is analyzed by rotating the detection head, and edge and differential feature processing is enhanced to achieve multi-scale feature extraction and fusion.
It significantly improves image detection accuracy, can accurately identify seedlings and weeds, enhances robustness and detection precision in complex environments, avoids the extraction and reuse of redundant features, and enriches the global and contextual semantic details representation.
Smart Images

Figure CN120411764B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and more particularly to an image detection method, apparatus, electronic device, and storage medium. Background Technology
[0002] In agriculture, image-based target detection technology plays a crucial role in promoting agricultural development. Taking seedlings in the field as an example, weed management and monitoring of growth and density are critical in the early stages of seedling growth. However, traditional machine learning methods perform poorly in seedling identification in the field, mainly due to the diversity and uneven distribution of weed species, as well as insufficient accuracy and robustness in complex backgrounds. Traditional machine learning methods primarily rely on image processing and sensor technology, using image segmentation and crop row extraction to identify seedlings. Because this method is susceptible to weed interference, its detection accuracy is relatively poor.
[0003] In recent years, convolutional neural networks have been applied in the agricultural field, but their detection accuracy still has certain limitations. Taking seedlings as an example, due to the large scale range and dense distribution of seedlings, simple feature extractors have difficulty extracting effective local features. Furthermore, the features extracted by simple feature extractors contain a large number of redundant features, resulting in insufficient representation of global semantic details, which in turn leads to poor image detection accuracy. Summary of the Invention
[0004] This application provides an image detection method, apparatus, electronic device, and storage medium to address the shortcomings of existing technologies, such as the inability to extract effective local features using simple feature extractors, excessive redundant features in the extracted features, and insufficient global semantic detail representation, thereby significantly improving image detection accuracy.
[0005] This application provides an image detection method, including the following steps:
[0006] Obtain an image to be detected, wherein the image to be detected includes at least one object of a type to be identified;
[0007] The image to be detected is input into the target detection model, and the image features of each object in the image to be detected are analyzed by the target detection model to obtain the recognition result representing the type of each object;
[0008] The target detection model is pre-trained based on a YOLO network, which includes a first feature extraction network. The first feature extraction network includes multiple different branch networks, each of which uses different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of the object at different scales.
[0009] According to an image detection method provided in this application, the YOLO network includes a backbone network, a neck network, and a head network connected in sequence. The method involves analyzing the image features of each object in the image to be detected using the target detection model to obtain recognition results characterizing the type of each object, including:
[0010] The image to be detected is input into the backbone network, and the features of each object in the image to be detected are extracted through the backbone network to obtain the first image features;
[0011] The first image features are input into the neck network, and the features in the first image features are extracted by the neck network and feature fusion is performed to obtain the second image features;
[0012] The second image features are input into the head network, and the head network analyzes the second image features to obtain the recognition results that characterize the type of each object.
[0013] According to an image detection method provided in this application, a first feature extraction network is located in a backbone network, and the backbone network further includes a second feature extraction network. The output of the second feature extraction network is connected to the input of the first feature extraction network. The step of extracting features of each object in the image to be detected through the backbone network to obtain a first image feature includes:
[0014] The second feature extraction network extracts features of each object in the image to be detected to obtain the first feature.
[0015] The first feature is obtained by extracting features from each of the branch networks in the first feature extraction network, and then performing a feature fusion operation on the features output by each of the branch networks.
[0016] Based on the first feature and the second feature, the first image feature is obtained using the following formula:
[0017]
[0018] in, The first image feature, The first feature is N, where N is the number of branch networks. The features output by each branch network, For activation function, For convolution operations, For feature splicing operations, As the second feature, For average pooling operation, H, W, and C represent the height, width, and channel dimension of the feature map corresponding to the first feature, respectively. This is a feature-based skip connection.
[0019] According to an image detection method provided in this application, each of the branch networks includes sequentially connected convolutional kernels of a first size and a second size. The method involves extracting features from the first feature through each of the branch networks in the first feature extraction network, and performing feature fusion on the features output by each of the branch networks to obtain a second feature, including:
[0020] For each branch network, the first feature is extracted using a convolution kernel of the first size to obtain a third feature, and the third feature is extracted using a convolution kernel of the second size and the dilated convolution coefficients corresponding to the current branch network to obtain the feature output by the current branch network.
[0021] The second feature is obtained by performing a feature fusion operation on the features output by each of the branch networks.
[0022] The first size of the convolution kernel used by each of the branch networks in the process of extracting the third feature is different.
[0023] According to an image detection method provided in this application, the object type includes a target type, the head network includes multiple different rotating detection heads, different rotating detection heads are used to analyze second image features of objects at different scales, and the output features of the rotating detection heads include at least a confidence score that the object belongs to the target type; the step of analyzing the second image features through the head network to obtain recognition results characterizing the type of each object includes:
[0024] The confidence level of each object belonging to the target type is obtained based on the output characteristics of each of the rotating detection heads;
[0025] Based on the comparison between the confidence level of each object and the confidence level interval of the target type, an identification result representing whether each object belongs to the target type is obtained.
[0026] According to the image detection method provided in this application, the step of inputting the image to be detected into a target detection model and analyzing the image features of each object in the image to be detected through the target detection model includes:
[0027] The edge features of each object in the overlapping objects in the image to be detected are enhanced, and / or the difference features between the image region and the background region corresponding to each object are enhanced to obtain the processed image;
[0028] The processed image is input into the target detection model, and the target detection model analyzes the image features of each object in the processed image.
[0029] According to an image detection method provided in this application, the types of objects include seedlings and weeds. The method involves inputting the image to be detected into a target detection model, analyzing the image features of each object in the image through the target detection model, and obtaining recognition results characterizing the type of each object, including:
[0030] The target detection model is used to analyze the image features of each object in the image to be detected, and the confidence level of each object belonging to a seedling is determined.
[0031] If the confidence level of the object is within the confidence interval of the seedling, the type of the object is determined to be a seedling;
[0032] If the confidence level of the object is not within the confidence level range corresponding to the seedling, the object is determined to be a weed.
[0033] This application also provides an image detection device, including the following modules:
[0034] The acquisition module is used to acquire an image to be detected, wherein the image to be detected includes at least one object of a type to be identified;
[0035] The analysis module is used to input the image to be detected into the target detection model, and analyze the image features of each object in the image to be detected through the target detection model to obtain the recognition result characterizing the type of each object;
[0036] The target detection model is pre-trained based on a YOLO network, which includes a first feature extraction network. The first feature extraction network includes multiple different branch networks, each of which uses different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of the object at different scales.
[0037] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the image detection method as described above.
[0038] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image detection method as described above.
[0039] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the image detection method as described above.
[0040] This application provides an image detection method, apparatus, electronic device, and storage medium. The image detection method of this application first acquires an image to be detected, which includes at least one object of a certain type to be identified. Then, the image to be detected is input into a target detection model, which analyzes the image features of the image to obtain recognition results representing the types of each object. The target detection model is pre-trained based on a YOLO network, which includes a first feature extraction network. The first feature extraction network includes multiple different branch networks, each using different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of objects at different scales. In this application, the multi-scale convolution module in the first feature extraction network is used as a feature extractor. By expanding the receptive field of the feature extractor, features of small-scale and large-scale objects are fully extracted, achieving the extraction and aggregation of local detail features of objects at different scales. This fully acquires the local detail features of each object, enriches the global and contextual semantic detail representation, avoids the extraction of a large number of redundant features, and prevents insufficient global and contextual semantic detail representation due to repeated use of redundant features, thus significantly improving image detection accuracy. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a flowchart illustrating an image detection method according to an embodiment of this application;
[0043] Figure 2 This is a schematic diagram of the structure of an improved YOLO V10 network shown in one embodiment of this application;
[0044] Figure 3 This is a schematic diagram of the structure of a first feature extraction network shown in one embodiment of this application;
[0045] Figure 4This is a structural block diagram of an image detection device according to an embodiment of this application;
[0046] Figure 5 This is a schematic diagram of the physical structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0048] The following will combine Figures 1 to 3 The image detection method of this application is described in detail.
[0049] Figure 1 This is a flowchart illustrating an image detection method according to an embodiment of this application. (Refer to...) Figure 1 The image detection method of this application may include the following steps:
[0050] Step 101: Obtain the image to be detected, which includes at least one object of the type to be identified.
[0051] In this embodiment, the object can be a plant-type object, such as a seedling or weeds. Of course, the object can also be a non-plant-type object, which can be set according to actual needs.
[0052] To facilitate the description of the image detection method of this application, it is hereby specifically stated that the types of objects in this application are mainly divided into target types and non-target types. For example, when the target type is seedlings, the non-target type is weeds.
[0053] Step 102: Input the image to be detected into the target detection model. The target detection model analyzes the image features of each object in the image to be detected to obtain the recognition results that represent the type of each object.
[0054] The object detection model is pre-trained based on the YOLO (You Only Look Once) network. The YOLO network includes a first feature extraction network, which includes multiple different branch networks. Each branch network uses different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of objects at different scales.
[0055] In this embodiment, the object detection model can be pre-trained based on an improved YOLO V10 network. The YOLO V10 network mainly consists of a backbone, a neck, and a head. The backbone is responsible for feature extraction and initial downsampling, the neck is responsible for further feature fusion and multi-scale information extraction, and the head is the key part for object classification and location regression. This application improves the backbone by replacing the PSA Block module after the SPPF (Spatial Pyramid Pooling Fast) layer in the YOLO V10 network with a first feature extraction network. The first feature extraction network specifically includes multiple different branch networks, each of which can perform dilated convolution operations on the input features using different dilated convolution coefficients to extract image features of objects at different scales.
[0056] The number of branch networks in the first feature extraction network can be set according to actual needs, and this embodiment does not impose any restrictions on this.
[0057] In this embodiment, objects can be divided into multiple scales based on the number of pixels they occupy in the area of the image to be detected. For example, when the number of pixels corresponding to an object is less than a first threshold, the object is determined to be a small-scale object; when the number of pixels corresponding to an object is greater than or equal to the first threshold and less than a second threshold, the object is determined to be a medium-scale object; and when the number of pixels corresponding to an object is greater than or equal to the second threshold, the object is determined to be a large-scale object, where the first threshold is less than the second threshold. Small-scale objects occupy a small portion of the image to be detected and have fewer pixels. For example, a small-scale seedling could be a newly sprouted seedling or a densely growing seedling that is relatively small. Large-scale objects occupy a larger portion of the image to be detected and have more pixels. A large-scale seedling could be a lush, large seedling.
[0058] Dilated convolution is a special type of convolution that expands the receptive field by introducing dilation rates (d) between the elements of a standard convolution kernel without increasing the number of parameters or losing resolution.
[0059] In this context, the dilated convolution coefficient *d* represents the spacing between elements in the convolution kernel. When *d* = 1, dilated convolution degenerates into ordinary convolution (without dilation). When *d* > 1, there is a spacing of (d-1) pixels between the elements of the convolution kernel, increasing the receptive field, but the actual size of the convolution kernel remains unchanged. In other words, *d* = 1 represents standard convolution, *d* = 2 represents a spacing of 1 pixel between each kernel element, and *d* = 3 represents a spacing of 2 pixels between each kernel element.
[0060] In this embodiment, using different dilated convolution coefficients in different branch networks has at least the following effects:
[0061] (1) Expand the receptive field and enhance the ability to capture contextual information: Different d values can cover features at different scales, enabling the object detection model to focus on local details (smaller d) and capture a wider range of background information (larger d).
[0062] (2) Maintain feature resolution: Multi-scale feature extraction can be achieved by using different d values without losing spatial resolution, avoiding the reduction of feature map size due to downsampling.
[0063] (3) Handling small and large targets: Small-scale objects (such as newly sprouted seedlings) require a smaller receptive field (d = 1, 3) to capture local details. Large-scale objects (such as mature seedlings) require a larger receptive field (d = 3, 5) to capture global features. This multi-scale strategy can improve the robustness and accuracy of the object detection model in complex environments.
[0064] (4) Alleviating the problem of redundant features: dilated convolutions of different scales can avoid repeatedly extracting the same features, reduce redundant features, and improve the expressive power of the target detection model.
[0065] Taking seedlings as an example, related technologies for identifying seedlings in images to be detected suffer from at least the following problems: First, the scale range of seedlings in the image is large, and a single-scale feature extractor cannot extract effective local detail features from the image. Specifically, in the image to be detected, seedlings often exhibit significant scale variations, meaning that the size, shape, and appearance features of seedlings vary in the image. In addition, the distribution of seedlings is often dense, with multiple seedlings possibly closely adjacent. Therefore, if a single-scale feature extractor is used, due to its inherent limitations, it cannot effectively adapt to scale variations and dense distribution, thus failing to accurately extract key detail features of seedlings at smaller or larger scales, ultimately leading to a decline in detection performance. Second, when using a single-scale feature extractor to extract deep features of seedlings, a large number of redundant features are extracted, and redundant features are reused multiple times, resulting in insufficient representation of global and contextual semantic details. Specifically, when using a single-scale feature extractor to extract features of seedlings, it may only extract relatively basic information, such as color and shape, and this basic information is similar among most seedlings. Therefore, single-scale feature extractors exhibit a high degree of redundancy when extracting features from seedlings. It is evident that single-scale feature extractors are insufficient in representing global and contextual semantic details, failing to fully capture and express the complex relationship between the seedling and its surrounding environment, as well as the seedling's position within the overall scene. This lack of global semantic information further limits the recognition capability and generalization performance of object detection models.
[0066] In this application, the PSA Block module in the YOLO V10 network is replaced with a first feature extraction network. Different branches of the first feature extraction network employ dilated convolution coefficients suitable for objects at different scales. By increasing the receptive field, the model's ability to capture local detail features is improved, enabling better extraction of local detail features from objects with large scale differences in the image. This overcomes the limitation of single-scale feature extractors in failing to extract effective local detail features from images. Secondly, this application uses convolutional modules of different scales in multiple branch networks as feature extractors to extract deep features from multi-scale objects in the image, instead of using a single-scale feature extractor. This avoids extracting a large number of redundant features and repeatedly using redundant features, which can lead to insufficient global and contextual semantic detail representation.
[0067] Therefore, the image detection method of this application first acquires an image to be detected, which includes at least one object of a certain type to be identified; then, the image to be detected is input into a target detection model, which analyzes the image features of the image to obtain the identification results representing the types of each object. The target detection model is pre-trained based on a YOLO network, which includes a first feature extraction network. This first feature extraction network includes multiple different branch networks, each using different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of objects at different scales. In this application, the multi-scale convolution module in the first feature extraction network is used as a feature extractor. By expanding the receptive field of the feature extractor, features of small-scale and large-scale objects are fully extracted, achieving the extraction and aggregation of local detail features of objects at different scales. This allows for the full acquisition of local detail information of each object, enriching the global and contextual semantic detail representations, avoiding the extraction of a large number of redundant features and the insufficient global and contextual semantic detail representations caused by repeatedly using redundant features, thus significantly improving image detection accuracy.
[0068] In this application, the object detection model is pre-trained based on the improved YOLO V10 network. The training process can generally include the following steps:
[0069] Step 1: Environment Configuration. Install all necessary software packages and configure acceleration libraries such as CUDA to ensure that the deep learning framework can efficiently utilize GPU resources.
[0070] Step 2: Data preparation.
[0071] Collect image datasets and preprocess the images in the datasets, including data augmentation techniques such as image scaling, cropping, and flipping, to increase the diversity and generalization ability of the datasets.
[0072] Use annotation tools to annotate objects in the image, generating annotation files. These files typically include information such as the type and location (bounding boxes) of the objects. Convert the annotation files to a format supported by YOLOv10, such as VOC or COCO format.
[0073] To improve recognition performance, during preprocessing, the image is cropped to 640×640 pixels with a cropping step size r = 200 to ensure that the image size is not affected by the difference.
[0074] Secondly, the number of images in the dataset can be increased through cropping, color and brightness transformations, and image enhancement techniques (such as rotation and flipping). Cropping can generate multiple different sub-images, thereby expanding the size of the image dataset. Randomly changing the brightness, contrast, or applying color jitter to images can simulate different environmental conditions, further expanding the diversity of the image dataset. Transforming images by rotating, flipping, or scaling can generate more variant images, expanding the size of the image dataset.
[0075] To ensure the superior performance of the object detection model on small samples, all images in the image dataset are divided into three parts: training, testing, and validation sets in a ratio of 5:1:4.
[0076] Step 3: Modify the YOLOv10 configuration file according to the characteristics of the dataset and training requirements. The configuration file usually includes information such as the dataset path, model structure, and training parameters (such as learning rate, batch size, training epochs, etc.).
[0077] Step 4: Model training.
[0078] Run the training script to begin the model training process. During training, monitor changes in the loss function and performance on the validation set, adjusting training parameters and model structure as needed. Based on the monitoring results, fine-tune hyperparameters, such as adjusting the learning rate to balance convergence speed and final performance, adjusting the batch size to accommodate GPU memory limitations, and determining the number of training epochs based on validation set performance. Pay attention to the changing trends of the composite loss function (including classification loss, bounding box regression loss, and target loss) to ensure that each loss term is effectively optimized.
[0079] Step 5: After training is complete, save the trained model to the specified path.
[0080] Of course, other methods can be used to train the target detection model according to actual needs. This application does not impose specific restrictions on the training method.
[0081] Figure 2 This is a schematic diagram of an improved YOLO V10 network structure shown in one embodiment of this application. Figure 2 The diagram illustrates the connections between the improved YOLO V10 backbone network, neck network, and head network. (See reference...) Figure 2 Step 102 may include:
[0082] Step 1021: Input the image to be detected into the backbone network, and extract the features of each object in the image to be detected through the backbone network to obtain the first image features.
[0083] exist Figure 2 In this context, conv stands for convolution module, used to perform convolution operations. 1*1 ( ) indicates a 1x1 convolution operation. C2F and C2FCIB are both feature extraction modules used to perform feature extraction operations. SCDown is a downsampling module used to perform spatial and channel decoupling downsampling operations. SPPF represents a pyramid-structured feature fusion module used to perform feature fusion operations. MFBConv is the first feature extraction network.
[0084] In this embodiment, Conv is a standard convolution operation. This operation extracts features from the image by weighted summation of local regions through the sliding of the convolution kernel on the input feature map. C2F is an improved feature extraction module in Yolov10, which improves the efficiency and accuracy of feature extraction through specific design. The C2F module can combine various techniques, such as residual connections and attention mechanisms, to enhance feature representation capabilities. C2FCIB is a further improvement of C2F, which can introduce advanced techniques such as iterative attention feature fusion to better integrate features of different scales and semantic inconsistencies, thereby improving the accuracy of object detection. This embodiment does not limit the specific implementation of C2F and C2FCIB.
[0085] In this embodiment, since directly using a large convolution kernel is computationally expensive, we can first use a conv... 1*1 ( ) Convolution operations reduce dimensionality, and then use larger convolution kernels to perform convolution operations to reduce computational complexity.
[0086] SCDown can achieve effects such as spatial downsampling (reducing the size of feature maps), channel separation, and enhanced semantic information. In this application, multiple downsampling operations are performed to progressively reduce resolution, expand the receptive field, and allow the network to focus on a larger contextual region. Secondly, feature maps at different scales contain different levels of information; performing multiple downsampling operations helps the object detection model identify objects of different sizes. Taking seedlings as an example, small-scale features are used to detect small seedlings, while large-scale features are used to detect large seedlings.
[0087] SPPF is used to perform pooling operations at different scales. SPPF can be used to enhance the receptive field (by expanding the receptive field through multi-scale pooling operations, so that the object detection model can focus on features of both large and local regions at the same time), feature fusion, and reduce computational cost.
[0088] Step 1022: Input the first image features into the neck network, extract the features from the first image features through the neck network and perform feature fusion to obtain the second image features.
[0089] exist Figure 2In this context, Upsample represents the upsampling operation. Upsample can be used to restore feature details, adapt to small target detection (if the object is small in scale, upsampling can increase the probability of detecting small-scale objects), and align features.
[0090] In this embodiment, performing multiple upsampling operations can restore the feature map resolution layer by layer, gradually refining the detection results. Furthermore, after each layer of upsampling, fusion with higher-level features helps to separate objects belonging to the target type from those belonging to non-target types in complex backgrounds, such as separating seedlings from weeds.
[0091] Concat stands for Feature Concatenation, a method of feature fusion used to combine feature maps from different layers along the channel dimension. Concat enables feature fusion, information supplementation, and multi-scale feature extraction (by concatenating feature maps of different resolutions, it can improve the multi-scale detection capability of object detection models and enhance robustness to changes in object scale).
[0092] In this embodiment, multiple feature splicing operations are performed. After each splicing, the number of channels in the feature map increases, and the feature representation capability is enhanced. Splicing feature maps of different scales multiple times helps the network to capture the multi-scale features of seedlings more comprehensively and improves the detection accuracy in complex scenarios.
[0093] Step 1023: Input the second image features into the head network, analyze the second image features through the head network, and obtain the recognition results representing the type of each object.
[0094] In this embodiment, the head network includes multiple different Oriented Bounding Boxes (OBBs). Different OBBs are used to analyze the second image features of objects at different scales. The output features of the OBBs include at least the confidence that the object belongs to the target type.
[0095] In a head-based network, a rotating detection head can output bounding boxes with angle information, making it suitable for detecting objects with variable orientations. For example, in seedling detection tasks, seedlings may grow at arbitrary angles. Ordinary horizontal bounding boxes (HBBs) may not accurately enclose the seedlings, leading to inaccurate detection or excessive background noise. However, by adding an angle parameter θ, OBBs can more tightly enclose tilted seedlings, improving detection accuracy.
[0096] In this embodiment, each rotating detection head outputs multiple candidate bounding boxes. Each bounding box may contain the following information: category confidence (confidence that the predicted object belongs to the target type) and location information, enabling the target detection model to more accurately describe the actual position and orientation of the object. The location information includes the center coordinates (x, y) of the bounding box, the width w and height h of the bounding box, and the rotation angle θ.
[0097] Therefore, by analyzing the features of the second image through the head network, the recognition results representing the types of each object can be obtained, which may specifically include:
[0098] The confidence level of each object belonging to the target type is obtained based on the output characteristics of each rotating detection head;
[0099] Based on the comparison between the confidence level of each object and the confidence level interval of the target type, the identification result representing whether each object belongs to the target type is obtained.
[0100] exist Figure 2 In the image, the bottommost OBB (shallow OBB) is used to detect small-scale objects. Shallow features have high resolution and can retain more detail information in the image, making them suitable for detecting small-scale or densely distributed objects. The middle OBB (medium-sized OBB) is used to detect medium-scale objects. Medium-sized features have moderate resolution, balancing detail and semantic information, making them suitable for detecting medium-sized objects and exhibiting strong recognition capabilities in complex backgrounds. The topmost OBB (high-level OBB) is used to detect large-scale objects. High-level features have lower resolution but contain rich semantic information, making them suitable for detecting large-scale objects, reducing background interference, and improving the accuracy of object localization and classification.
[0101] Taking seedlings as the target type and weeds as the non-target type as an example, the image features of the image to be detected are analyzed by the object detection model to obtain the identification results representing the type of each object, which may include:
[0102] The image features of the image to be detected are analyzed by the object detection model to determine the confidence level of each object belonging to a seedling;
[0103] If the confidence level of the object falls within the confidence interval of the seedling, the object type is determined to be a seedling.
[0104] If the confidence level of the object is not within the confidence level interval corresponding to the seedling, the object type is determined to be weed.
[0105] In this embodiment, the bounding boxes output by multiple OBBs undergo post-processing steps such as non-maximum suppression to filter out duplicate or low-confidence bounding boxes, retaining the best detection results. Specifically, taking seedlings as an example, to retain the seedling information in the image, the confidence level of each object belonging to a seedling is compared with the corresponding confidence interval for seedlings. Only when the confidence level of an object falls within the confidence interval for seedlings is the object considered a seedling. Similarly, when the confidence level of an object does not fall within the confidence interval for seedlings, the object is considered a weed. By judging each object in this way, all seedlings and weeds in the image can be identified.
[0106] In one embodiment, after obtaining the identification results characterizing the types of each object, the method of this application may further include:
[0107] Identify the target object that belongs to the target type;
[0108] Based on the parameters representing the position of the target object in the image to be detected from the output features of each rotating detection head, the bounding box corresponding to the target object is displayed in the image to be detected.
[0109] The positional parameters include: the center coordinates (x, y) of the bounding box, the width w, the height h, and the rotation angle θ. Taking seedlings as an example, the bounding boxes corresponding to each seedling can be displayed in the image based on the positional parameters of each object.
[0110] In this application, the PSA Block module in the YOLO V10 network is replaced with the first feature extraction network, which can fully acquire the local detailed features of each object, enrich the global and contextual semantic detail representation, and thus achieve accurate identification of the type of object in the image to be detected.
[0111] In one embodiment, in conjunction with the above embodiments, the backbone network further includes a second feature extraction network, the output of which is connected to the input of the first feature extraction network. The second feature extraction network is... Figure 2 The backbone network in the middle, excluding the MFBCconv part.
[0112] Accordingly, the features of each object in the image to be detected are extracted through the backbone network to obtain the first image features, which may include:
[0113] The first feature is obtained by extracting the features of each object in the image to be detected through the second feature extraction network;
[0114] The first feature is obtained by extracting features from each branch network of the first feature extraction network, and then performing feature fusion operation on the features output by each branch network to obtain the second feature.
[0115] Based on the first feature and the second feature, the first image feature is obtained using the following formula:
[0116]
[0117] in, The first image feature, The first feature is N, where N is the number of branch networks. The features output by each branch network, For activation function, For convolution operations, For feature splicing operations, As the second feature, For average pooling operation, H, W, and C represent the height, width, and channel dimension of the feature map corresponding to the first feature, respectively. This is a feature-based skip connection.
[0118] Each branch network includes sequentially connected convolutional kernels of a first size and a second size. Features from the first feature extraction network are extracted from each branch network, and feature fusion is performed on the output features of each branch network to obtain the second feature, which may include:
[0119] For each branch network, the first feature is extracted by a convolution kernel of the first size to obtain the third feature, and the third feature is extracted by a convolution kernel of the second size and the dilated convolution coefficients corresponding to the current branch network to obtain the feature output by the current branch network.
[0120] The features output by each branch network are fused to obtain the second feature.
[0121] The first size of the convolution kernel used by each branch network in the process of extracting the third feature is different.
[0122] Figure 3 This is a schematic diagram illustrating the structure of a first feature extraction network according to an embodiment of this application. Figure 3 In this example, the number of branch networks, N, is 4. (Refer to...) Figure 3 Assume the first feature output by the SPPF module is X, which is the feature map input to the first feature extraction network (MFBConv). To obtain useful local detail features, the first feature extraction network performs the following steps sequentially:
[0123] Step 1: Input the feature map X into an adaptive average pooling layer for activation to obtain F(X), the specific equation is as follows:
[0124]
[0125] in, This indicates an adaptive average pooling operation.
[0126] Step 2: Input the activated feature map F(X) into different branch networks (from left to right: first branch network, second branch network, third branch network, and fourth branch network). Simultaneously, to better extract features from objects at different scales, dilated convolution coefficients suitable for different object scales are introduced into each of the four branch networks. This increases the receptive field and improves the object detection model's ability to capture local detail features. The specific operations of the four different branch networks are as follows:
[0127]
[0128]
[0129]
[0130]
[0131] in, The features output by the first branch network, The features output by the second branch network, The features output by the third branch network, These are the features output by the fourth branch network.
[0132] Reference Figure 3 In step 2, a 1*1 convolution kernel is first used to process the first feature (i.e., the feature map). Perform a 1x1 convolution operation, and input the resulting features into... Figure 3The diagram shows four branch networks. In the first branch network, a 1x1 convolution operation is first performed on the input features using a 1x1 convolution kernel. Then, a 3x3 convolution kernel with dilated coefficient 1 is used to perform a 3x3 dilated convolution operation on the features obtained in the previous step. In the second branch network, a 1x3 convolution kernel is first performed on the input features using a 1x3 convolution kernel. Then, a 3x3 convolution kernel with dilated coefficient 3 is used to perform a 3x3 dilated convolution operation on the features obtained in the previous step. In the third branch network, a 3x1 convolution kernel is first performed on the input features using a 3x1 convolution kernel. Then, a 3x3 convolution kernel with dilated coefficient 3 is used to perform a 3x3 dilated convolution operation on the features obtained in the previous step. In the fourth branch network, a 3x3 convolutional kernel is first used to perform a 3x3 convolution operation on the input features. Then, a 3x3 convolutional kernel with a dilated coefficient of 5 is used to perform a 3x3 dilated convolution operation on the features obtained in the previous step. In this process, the features obtained after 1x1, 1x3, 3x1, and 3x3 convolution operations are the third features. The first size of the convolutional kernels used by each branch network in obtaining the third features is 1x1, 1x3, 3x1, and 3x3, respectively. The dilated convolutional coefficients used by each branch network are 1, 3, 3, and 5, respectively. In actual implementation, the dilated convolutional coefficients can be set according to actual needs. Secondly, each branch network uses a second-size (3x3) convolutional kernel for dilated convolution operations. In actual implementation, the second size can be set according to needs.
[0133] Step 3: To obtain effective global and contextual semantic details, the extracted features are fused layer by layer, and the fused output features are... for:
[0134]
[0135] In this application, the multi-scale convolutional module in the first feature extraction network is used as the feature extractor. By expanding the receptive field of the feature extractor, the features of small-scale and large-scale objects are fully extracted, thereby fully acquiring the local detailed features of each object, enriching the global and contextual semantic detail representation, avoiding the situation where the global and contextual semantic detail representation is insufficient when extracting too many redundant features and repeatedly using redundant features, which can significantly improve the detection accuracy.
[0136] In one implementation, based on the above embodiments, the image to be detected is input into a target detection model, and the target detection model analyzes the image features of each object in the image to be detected, which may include:
[0137] If there are overlapping objects in the image to be detected, the edge features of each object in the overlapping objects are enhanced to obtain the first image;
[0138] The first image is input into the object detection model, which then analyzes the image features of each object in the first image.
[0139] In this embodiment, methods such as bilateral filtering, edge enhancement, and local contrast enhancement can be used to enhance the edge attribute information of each object in the overlapping objects.
[0140] Bilateral filtering is a technique that smooths an image while preserving edge information. It reduces noise and unwanted details while retaining important edge features, especially in overlapping areas, helping to highlight the edges of objects without blurring details. Bilateral filtering smooths images by considering pixel spatial distances and brightness differences, smoothing in areas of similar brightness while preserving edges in areas of significant brightness difference, thus avoiding blurring of object outlines due to overlap.
[0141] Edge enhancement refers to using edge detection algorithms (such as the Sobel operator and Canny edge detection) to enhance the edge information between overlapping objects (e.g., overlapping seedlings). These algorithms can highlight areas with large brightness variations in an image, thus making the edges of each object clearer.
[0142] Local contrast enhancement refers to enhancing the local contrast of an image when processing overlapping regions. By increasing the contrast of edge areas, the edges of overlapping regions can be made more prominent, thus aiding in the detection and separation of adjacent objects.
[0143] In practice, other methods can also be used to enhance the edge features of each object in an overlapping object, and this embodiment does not impose any specific restrictions on this.
[0144] In this embodiment, when detecting the type of an object in the image to be detected, the image to be detected is first preprocessed to enhance the edge features between overlapping objects, which makes the overlapping objects clearer and easier to identify, thereby improving the accuracy of the detection results.
[0145] In one implementation, based on the above embodiments, the image to be detected is input into a target detection model, and the target detection model analyzes the image features of each object in the image to be detected, which may include:
[0146] Identify the background region in the image to be detected;
[0147] The difference features between the image region and the background region corresponding to each object are enhanced to obtain the second image;
[0148] The second image is input into the object detection model, which analyzes the image features of each object in the second image.
[0149] In this embodiment, color space conversion, brightness enhancement (contrast adjustment), pseudo-color processing, and other methods can be used to enhance the difference between each object and the background.
[0150] For color space conversion (e.g., RGB to HSV), in the RGB color space, the distinction between colors can be greatly affected by ambient light and other factors, resulting in indistinct differences between objects and the background. Converting an image to the HSV (Hue, Saturation, Value) color space makes it easier to distinguish objects from the background. In particular, in HSV, hue effectively distinguishes color categories, while saturation and value enhance the contrast between objects and the background. For example, if the object is a seedling, the seedling is typically within a specific hue range (e.g., green), while the background may be a more uniform or varied color range. By enhancing the differences in hue and saturation, the seedling can be more easily distinguished from the background.
[0151] For brightness enhancement (contrast adjustment), image brightness is one of the key factors affecting object detection, especially under different lighting conditions. To enhance the difference between objects and the background, image brightness can be enhanced, making objects stand out more against the background. Methods such as contrast stretching and histogram equalization can improve image contrast, especially in low-light or high-light areas. By increasing local contrast, the brightness of objects can be more clearly separated from the background.
[0152] For pseudo-color processing, if the differences in color and brightness of an image are still not obvious, pseudo-color processing can be used. By color mapping the image, different brightness values correspond to different colors, thus allowing objects to appear in unique colors within the image, thereby creating a greater difference from the background.
[0153] In this embodiment, when detecting the type of an object in the image to be detected, the image to be detected is first preprocessed, which can enhance the difference between the image region and the background region corresponding to each object, making each object clearer and easier to identify, and can significantly improve the accuracy of the detection results.
[0154] In summary, this application replaces the PSA Block module in the YOLO V10 network with a first feature extraction network. Different branches of the first feature extraction network employ dilated convolution coefficients suitable for objects at different scales. By increasing the receptive field, the model's ability to capture local detail features is improved, enabling better extraction of local detail features from objects with significant scale differences in images. This overcomes the limitation of single-scale feature extractors in failing to extract effective local detail features from images. Secondly, this application uses convolutional modules of different scales in multiple branch networks as feature extractors to extract deep features from multi-scale objects in images, instead of using a simple feature extractor to extract deep features from each object in the image. This avoids extracting a large number of redundant features and repeatedly using redundant features, which can lead to insufficient global and contextual semantic detail representation, thus significantly improving image detection accuracy.
[0155] The image detection apparatus provided in this application is described below. The image detection apparatus described below can be referred to in correspondence with the image detection method described above.
[0156] Figure 4 This is a structural block diagram of an image detection device according to an embodiment of this application. (Refer to...) Figure 4 The image detection device 400 of this application may include:
[0157] Acquisition module 401 is used to acquire an image to be detected, wherein the image to be detected includes at least one object of a type to be identified;
[0158] Analysis module 402 is used to input the image to be detected into the target detection model, and analyze the image features of each object in the image to be detected through the target detection model to obtain the recognition result characterizing the type of each object;
[0159] The target detection model is pre-trained based on a YOLO network, which includes a first feature extraction network. The first feature extraction network includes multiple different branch networks, each of which uses different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of the object at different scales.
[0160] According to an image detection device provided in this application, the YOLO network includes a backbone network, a neck network, and a head network connected in sequence, and the analysis module 402 includes:
[0161] The first feature extraction submodule is used to input the image to be detected into the backbone network, and extract the features of each object in the image to be detected through the backbone network to obtain the first image features;
[0162] The second feature extraction submodule is used to input the first image features into the neck network, extract features from the first image features through the neck network and perform feature fusion operation to obtain the second image features.
[0163] The feature analysis submodule is used to input the second image features into the head network, analyze the second image features through the head network, and obtain the recognition results that characterize the type of each object.
[0164] According to the image detection device provided in this application, the first feature extraction network is located in the backbone network, and the backbone network further includes a second feature extraction network. The output of the second feature extraction network is connected to the input of the first feature extraction network. The first feature extraction submodule includes:
[0165] The third feature extraction submodule is used to extract features of each object in the image to be detected through the second feature extraction network to obtain the first feature;
[0166] The fourth feature extraction submodule is used to extract features from the first feature through each of the branch networks in the first feature extraction network, and to perform feature fusion operation on the features output by each of the branch networks to obtain the second feature;
[0167] The first acquisition submodule is used to obtain the first image feature based on the first feature and the second feature using the following formula:
[0168]
[0169] in, The first image feature, The first feature is N, where N is the number of branch networks. The features output by each branch network, For activation function, For convolution operations, For feature splicing operations, As the second feature, For average pooling operation, H, W, and C represent the height, width, and channel dimension of the feature map corresponding to the first feature, respectively. For feature skip connections. According to an image detection apparatus provided in this application, each of the branch networks includes sequentially connected convolutional kernels of a first size and a second size. The fourth feature extraction submodule includes:
[0170] The fifth feature extraction submodule is used to perform feature extraction on the first feature using a convolution kernel of the first size for each branch network to obtain a third feature, and to perform feature extraction on the third feature using a convolution kernel of the second size and the dilated convolution coefficients corresponding to the current branch network to obtain the feature output by the current branch network.
[0171] The feature fusion submodule is used to perform feature fusion operations on the features output by each of the branch networks to obtain the second feature;
[0172] The first size of the convolution kernel used by each of the branch networks in the process of extracting the third feature is different.
[0173] According to an image detection device provided in this application, the object type includes a target type, the head network includes multiple different rotating detection heads, different rotating detection heads are used to analyze the second image features of objects at different scales, and the output features of the rotating detection heads include at least a confidence that the object belongs to the target type; the analysis module 402 includes:
[0174] The second acquisition submodule is used to acquire the confidence level of each object belonging to the target type based on the output features of each of the rotating detection heads;
[0175] The third acquisition submodule is used to obtain an identification result representing whether each object belongs to the target type based on the comparison result between the confidence level corresponding to each object and the confidence level interval corresponding to the target type.
[0176] According to an image detection device provided in this application, the output features of the rotating detection head further include a parameter characterizing the position of the object in the image to be detected, and the image detection device 400 further includes:
[0177] The first determining module is used to determine the target object belonging to the target type after obtaining the identification results representing the types of each of the objects;
[0178] The display module is used to display the bounding box corresponding to the target object in the image to be detected based on the parameters characterizing the position of the target object in the image to be detected from the output features of each of the rotating detection heads.
[0179] According to the image detection apparatus provided in this application, the analysis module 402 includes:
[0180] An enhancement submodule is used to enhance the edge features of each object in the overlapping objects in the image to be detected, and / or to enhance the difference features between the image region and the background region corresponding to each object, so as to obtain the processed image.
[0181] The input submodule is used to input the processed image into the target detection model, and to analyze the image features of each object in the processed image through the target detection model.
[0182] According to an image detection device provided in this application, the types of objects include seedlings and weeds, and the analysis module 402 includes:
[0183] The second determining module is used to analyze the image features of the image to be detected through the target detection model and determine the confidence level of each object belonging to a seedling;
[0184] The third determining module is used to determine that the type of the object is a seedling if the confidence level corresponding to the object is within the confidence interval corresponding to the seedling.
[0185] The fourth determining module is used to determine that the type of the object is weed if the confidence level corresponding to the object is not in the confidence level interval corresponding to the seedling.
[0186] Figure 5 This is a schematic diagram of the physical structure of an electronic device according to an embodiment of this application. Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call logical instructions in the memory 530 to execute an image detection method, the method including: acquiring an image to be detected, wherein the image to be detected includes at least one object of a type to be identified;
[0187] The image to be detected is input into the target detection model, and the image features of each object in the image to be detected are analyzed by the target detection model to obtain the recognition result representing the type of each object;
[0188] The target detection model is pre-trained based on a YOLO network, which includes a first feature extraction network. The first feature extraction network includes multiple different branch networks, each of which uses different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of the object at different scales.
[0189] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0190] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to perform the image detection method provided by the above methods, the method including:
[0191] Obtain an image to be detected, wherein the image to be detected includes at least one object of a type to be identified;
[0192] The image to be detected is input into the target detection model, and the image features of each object in the image to be detected are analyzed by the target detection model to obtain the recognition result representing the type of each object;
[0193] The target detection model is pre-trained based on a YOLO network, which includes a first feature extraction network. The first feature extraction network includes multiple different branch networks, each of which uses different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of the object at different scales.
[0194] In another aspect, this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the image detection methods provided by the methods described above, the method comprising:
[0195] Obtain an image to be detected, wherein the image to be detected includes at least one object of a type to be identified;
[0196] The image to be detected is input into the target detection model, and the image features of each object in the image to be detected are analyzed by the target detection model to obtain the recognition result representing the type of each object;
[0197] The target detection model is pre-trained based on a YOLO network, which includes a first feature extraction network. The first feature extraction network includes multiple different branch networks, each of which uses different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of the object at different scales.
[0198] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0199] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0200] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. An image detection method, characterized in that, include: Obtain an image to be detected, wherein the image to be detected includes at least one object of a type to be identified; The image to be detected is input into the target detection model, and the image features of each object in the image to be detected are analyzed by the target detection model to obtain the recognition result representing the type of each object; The target detection model is pre-trained based on a YOLO network. The YOLO network includes a backbone network, which includes a first feature extraction network and a second feature extraction network. The output of the second feature extraction network is connected to the input of the first feature extraction network. The first feature extraction network includes multiple different branch networks. Each branch network uses different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of the object at different scales. The YOLO network is obtained by replacing the PSA Block module with the first feature extraction network based on the YOLO V10 network. The steps for the backbone network to extract features of each object in the image to be detected are as follows: The second feature extraction network extracts features of each object in the image to be detected to obtain the first feature. The first feature is obtained by extracting features from each of the branch networks in the first feature extraction network, and then performing a feature fusion operation on the features output by each of the branch networks. Based on the first feature and the second feature, the first image feature is obtained using the following formula: in, Features extracted from the backbone network The first feature is N, where N is the number of branch networks. The features output by each branch network, For activation function, For convolution operations, For feature splicing operations, As the second feature, For average pooling operation, H, W, and C are the height, width, and channel dimension of the feature map corresponding to the first feature, respectively. This is a feature-based skip connection.
2. The image detection method according to claim 1, characterized in that, The YOLO network also includes a neck network and a head network. The analysis of image features of each object in the image to be detected using the target detection model to obtain recognition results characterizing the type of each object includes: The image to be detected is input into the backbone network, and the features of each object in the image to be detected are extracted through the backbone network to obtain the first image features; The first image features are input into the neck network, and the features in the first image features are extracted by the neck network and feature fusion is performed to obtain the second image features; The second image features are input into the head network, and the head network analyzes the second image features to obtain the recognition results that characterize the type of each object.
3. The image detection method according to claim 1, characterized in that, Each of the aforementioned branch networks includes sequentially connected convolutional kernels of a first size and a second size. The process involves extracting features from the first feature through each of the branch networks in the first feature extraction network, and performing feature fusion on the features output by each of the branch networks to obtain the second feature, including: For each branch network, the first feature is extracted using a convolution kernel of the first size to obtain a third feature, and the third feature is extracted using a convolution kernel of the second size and the dilated convolution coefficients corresponding to the current branch network to obtain the feature output by the current branch network. The second feature is obtained by performing a feature fusion operation on the features output by each of the branch networks. The first size of the convolution kernel used by each of the branch networks in the process of extracting the third feature is different.
4. The image detection method according to claim 2, characterized in that, The object type includes a target type, the head network includes multiple different rotation detection heads, different rotation detection heads are used to analyze the second image features of objects at different scales, and the output features of the rotation detection head include at least the confidence that the object belongs to the target type; The step of analyzing the second image features through the head network to obtain recognition results characterizing the types of each object includes: The confidence level of each object belonging to the target type is obtained based on the output characteristics of each of the rotating detection heads; Based on the comparison between the confidence level of each object and the confidence level interval of the target type, an identification result representing whether each object belongs to the target type is obtained.
5. The image detection method according to any one of claims 1-4, characterized in that, The step of inputting the image to be detected into the target detection model and analyzing the image features of each object in the image to be detected by the target detection model includes: The edge features of each object in the overlapping objects in the image to be detected are enhanced, and / or the difference features between the image region and the background region corresponding to each object are enhanced to obtain the processed image; The processed image is input into the target detection model, and the target detection model analyzes the image features of each object in the processed image.
6. The image detection method according to any one of claims 1-4, characterized in that, The types of objects include seedlings and weeds. The step involves inputting the image to be detected into a target detection model, and then analyzing the image features of each object in the image to obtain recognition results characterizing the type of each object, including: The target detection model is used to analyze the image features of each object in the image to be detected, and the confidence level of each object belonging to a seedling is determined. If the confidence level of the object is within the confidence interval of the seedling, the type of the object is determined to be a seedling; If the confidence level of the object is not within the confidence level range corresponding to the seedling, the object is determined to be a weed.
7. An image detection device, characterized in that, include: The acquisition module is used to acquire an image to be detected, wherein the image to be detected includes at least one object of a type to be identified; The analysis module is used to input the image to be detected into the target detection model, and analyze the image features of each object in the image to be detected through the target detection model to obtain the recognition result characterizing the type of each object; The target detection model is pre-trained based on a YOLO network. The YOLO network includes a backbone network, which includes a first feature extraction network and a second feature extraction network. The output of the second feature extraction network is connected to the input of the first feature extraction network. The first feature extraction network includes multiple different branch networks. Each branch network uses different dilated convolution coefficients to perform dilated convolution operations on the input features to extract image features of the object at different scales. The YOLO network is obtained by replacing the PSA Block module with the first feature extraction network based on the YOLO V10 network. The steps for the backbone network to extract features of each object in the image to be detected are as follows: The second feature extraction network extracts features of each object in the image to be detected to obtain the first feature. The first feature is obtained by extracting features from each of the branch networks in the first feature extraction network, and then performing a feature fusion operation on the features output by each of the branch networks. Based on the first feature and the second feature, the first image feature is obtained using the following formula: in, Features extracted from the backbone network The first feature is N, where N is the number of branch networks. The features output by each branch network, For activation function, For convolution operations, For feature splicing operations, As the second feature, For average pooling operation, H, W, and C are the height, width, and channel dimension of the feature map corresponding to the first feature, respectively. This is a feature-based skip connection.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the image detection method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the image detection method as described in any one of claims 1 to 6.