A field inspection method and system based on machine learning

Through the machine learning-based field patrol method, multi-spectral image and feature fusion technology are used to accurately distinguish and identify weeds, solving the problem of distinguishing weeds and crops in the field patrol of drones, improving the recognition accuracy and weeding scheme effectiveness.

CN117853930BActive Publication Date: 2024-11-05湖南省第二测绘院
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410102260.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-25
Publication Date
2024-11-05
Estimated Expiration
2044-01-25

AI Technical Summary

Technical Problem

The existing drone field patrol technology is difficult to accurately distinguish and identify weeds when weeds and crops are grown in a mixed manner, affecting crop growth and yield.

Method used

Using machine learning-based field patrol method, pixelation and binary grayscale transformation of multispectral images collected by drones, feature fusion is performed using preset crop feature sets and weed feature sets to divide crop areas and miscellaneous grass area and mixed area, and identified and classified by grayscale symbiosis matrix segmentation and DBSCAN algorithm.

Benefits of technology

It improves the ability to identify and classify weeds, reduces detection interference in mixed areas, improves recognition accuracy, provides a herbicide solution, and solves the problem of distinguishing and identifying under mixed growth of weeds and crops.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117853930B_ABST
    Figure CN117853930B_ABST
Patent Text Reader

Abstract

The invention discloses a field inspection method and system based on machine learning, and relates to the technical field of data processing. The method comprises the following steps: crops in a target image are identified by a preset crop feature set to obtain a target crop row and a weed row; weeds of different forms in a weed row are segmented by a gray-level co-occurrence matrix to obtain a weed feature set, data support is provided for subsequent weed identification in a second weed area; weeds in the weed row are marked to obtain a first weed area; the target crop row is divided into regions according to the preset crop feature set and the weed feature set to obtain a mixed region; the mixed region is compared by a comparison feature set to obtain a third weed region; a weed control scheme is obtained by the first weed area, the second weed area and the third weed area, thereby solving the problem that it is difficult to accurately distinguish and identify weeds when weeds and crops grow in a mixed manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data processing, and in particular relates to a field inspection method and system based on machine learning. Background Art

[0002] Weeds usually have well-developed root systems and strong absorption capabilities. They compete with crops for nutrients, water and light needed for growth, resulting in poor crop growth, reduced yield and quality. Some weeds may become hosts for diseases and pests, causing these pests to spread in farmland, further endangering the health of crops.

[0003] Field inspection is an important way of farmland management. Its main purpose is to check the condition of farmland, including crop growth, soil condition, pest and disease conditions, etc., so as to find problems and deal with them in time. Field inspection is usually carried out regularly or irregularly by farmers or agricultural managers to ensure the normal growth and production of farmland. However, if the inspection is not timely or the frequency is too low, weeds may grow rapidly, compete with crops for nutrients, and affect the normal growth of crops.

[0004] In recent years, with the development of drone technology, the use of drones for field inspection has become a hot topic, which has greatly improved work efficiency and reduced the consumption of manpower and material resources. However, there are still some problems with existing drone field inspections, especially when weeds and crops grow together, it is difficult to accurately distinguish and identify weeds. Summary of the invention

[0005] The purpose of the present invention is to solve the problem that it is difficult to accurately distinguish and identify weeds when weeds and crops grow together, and to propose a field inspection method and system based on machine learning.

[0006] In a first aspect of the present invention, a field inspection method based on machine learning is first proposed, the method comprising:

[0007] The multispectral image collected by the UAV is pixelated and binary grayscale transformed to obtain a target image, and the crops in the target image are identified by a preset crop feature set to obtain target crop rows, and the remaining areas are recorded as weed rows; the preset crop feature set includes features of detecting images corresponding to crops in different growth environments and different growth stages;

[0008] Segmenting the weeds of different forms in the weed row using a gray level co-occurrence matrix to obtain a weed feature set, and marking pixels corresponding to each weed region in the weed row to obtain a first weed region;

[0009] Performing feature fusion on the weed feature set and the preset crop feature set to obtain a comparison feature set;

[0010] The target crop row is divided into a crop area, a second weed area and a mixed area according to the preset crop feature set and the weed feature set; the crop area is an area in the target crop row that only includes crops; the second weed area is an area in the target crop row that only includes weeds; and the mixed area is an area in the target crop row where crops and weeds overlap;

[0011] Obtaining a feature set of the mixed area and comparing it with the comparison feature set to obtain a third weed area;

[0012] A weed control plan is obtained according to the first weed area, the second weed area and the third weed area.

[0013] Optionally, identifying the crops in the target image by using a preset crop feature set to obtain a target crop row specifically includes:

[0014] Inputting the preset crop feature set into a preset trained YOLOv8 model to obtain a bounding box of each crop feature in the target image;

[0015] The center coordinates of each bounding box are obtained, and the center coordinates of each bounding box are identified and grouped using the DBSCAN algorithm to obtain the target crop rows.

[0016] Optionally, fusing the weed feature set with the preset crop feature set to obtain a comparison feature set includes:

[0017] Determine the image perimeter and the first area of ​​the first image, determine the second area of ​​the second image, and obtain the number of target placement images according to the image perimeter, the first area, and the second area; the first image is any image in the preset crop feature set; the second image is any image in the weed feature set; the second image is smaller than the first image;

[0018] The first image is taken as the lower layer image, and the second image is taken as the upper layer image. The second image is placed at random positions along the edge of the first image according to the number of target placement images, and image fusion is performed to obtain a contrast feature set.

[0019] Optionally, obtaining the number of target placement images according to the image perimeter, the first area, and the second area includes:

[0020] according to Get the number of target placement images;

[0021] Where Num is the number of target placement images, γ is a preset parameter, S A is the first area, C A is the image perimeter, S a is the second area.

[0022] Optionally, dividing the target crop row into a crop area, a second weed area and a mixed area according to the preset crop feature set and the weed feature set includes:

[0023] Performing region segmentation according to the center coordinates of two adjacent crop boundary boxes in the target crop row to obtain a plurality of detection regions;

[0024] For each detection area, the detection area is divided into an inner area and an outer area according to the crop boundary box;

[0025] Performing weed identification on the area outside the frame according to the weed feature set to obtain a second weed area;

[0026] Crop recognition is performed on the area within the frame according to the preset crop feature set to determine whether the area within the frame is a crop area or a mixed area.

[0027] In a second aspect of the present invention, a machine learning-based field patrol system is proposed, the system comprising a crop row division module, a first weed region module, a comparison feature set module, a second weed region module, a third weed region module and a weed control scheme module:

[0028] The crop row division module is used to pixelate and binary grayscale transform the multispectral image collected by the drone to obtain a target image, identify the crops in the target image through a preset crop feature set to obtain target crop rows, and record the remaining areas as weed rows; the preset crop feature set includes features of detecting images corresponding to crops in different growth environments and different growth stages;

[0029] The first weed region module is used to segment the weeds of different forms in the weed row by using a gray level co-occurrence matrix to obtain a weed feature set, and mark the pixels corresponding to each weed region in the weed row to obtain a first weed region;

[0030] The comparison feature set module is used to perform feature fusion on the weed feature set and the preset crop feature set to obtain a comparison feature set;

[0031] The second weed area module is used to divide the target crop row into a crop area, a second weed area and a mixed area according to the preset crop feature set and the weed feature set; the crop area is an area in the target crop row that only includes crops; the second weed area is an area in the target crop row that only includes weeds; and the mixed area is an area in the target crop row where crops and weeds overlap;

[0032] The third weed area module is used to obtain the feature set of the mixed area and compare it with the comparison feature set to obtain a third weed area;

[0033] The weed control scheme module is used to obtain a weed control scheme according to the first weed area, the second weed area and the third weed area.

[0034] Optionally, the crop row segmentation module includes a crop boundary box determination module and a target crop row identification module:

[0035] The crop bounding box determination module is used to input the preset crop feature set into a preset trained YOLOv8 model to obtain a bounding box of each crop feature in the target image;

[0036] The target crop row identification module is used to obtain the center coordinates of each bounding box, and identify and group the center coordinates of each bounding box through the DBSCAN algorithm to obtain the target crop row.

[0037] Optionally, the comparison feature set module includes a target placement image quantity determination module and a comparison feature set determination module:

[0038] The target placement image quantity determination module is used to determine the image perimeter and the first area of ​​the first image, determine the second area of ​​the second image, and obtain the number of target placement images according to the image perimeter, the first area and the second area; the first image is any image in the preset crop feature set; the second image is any image in the weed feature set; the second image is smaller than the first image;

[0039] The contrast feature set determination module is used to use the first image as a lower layer image and the second image as an upper layer image, place the second image at random positions along the edge of the first image according to the target placement image quantity, and perform image fusion to obtain a contrast feature set.

[0040] Optionally, the target placement image quantity determination module is based on Get the number of target placement images;

[0041] Where Num is the number of target placement images, γ is a preset parameter, S A is the first area, C A is the image perimeter, S a is the second area.

[0042] Optionally, the second weed region module includes an adjacent region segmentation module, a bounding box region segmentation module, a second weed region recognition module and a crop recognition module:

[0043] The adjacent region segmentation module is used to perform region segmentation according to the center coordinates of two adjacent crop boundary boxes in the target crop row to obtain multiple detection regions;

[0044] The boundary box region segmentation module is used for dividing each detection region into an inner region and an outer region according to the crop boundary box;

[0045] The second weed region identification module is used to identify weeds in the area outside the frame according to the weed feature set to obtain a second weed region;

[0046] The crop recognition module is used to perform crop recognition on the area within the frame according to the preset crop feature set, and determine whether the area within the frame is a crop area or a mixed area.

[0047] Beneficial effects of the present invention:

[0048] The present invention proposes a field inspection method based on machine learning. The crops in the target image are identified by a preset crop feature set to obtain a target crop row, and the remaining area is recorded as a weed row. The weeds of different forms in the weed row are segmented by a gray-level co-occurrence matrix to obtain a weed feature set, and the pixels corresponding to each weed area in the weed row are marked to obtain a first weed area; the weed feature set and the preset crop feature set are feature-fused to obtain a comparison feature set; the target crop row is divided into a crop area, a second weed area and a mixed area according to the preset crop feature set and the weed feature set; the feature set of the mixed area is obtained and compared with the comparison feature set to obtain a third weed area; and a weed control scheme is obtained according to the first weed area, the second weed area and the third weed area. By dividing the target image into target crop rows and weed rows, and segmenting the weed rows through the grayscale co-occurrence matrix, the recognition and classification capabilities of non-target crops are improved, so that all weeds in the entire weed row are classified and feature extracted, providing data support for weed identification in the second weed area. The target crop row is then divided into crop area, second weed area and mixed area through crop feature set and weed feature set, and the area containing only weeds and the area containing only crops are separated, thereby reducing interference in detecting the mixed area. By fusing the weed feature set and the preset crop feature set, a more comprehensive feature set can be obtained, which improves the accuracy of subsequent mixed area image recognition and solves the problem that it is difficult to accurately distinguish and identify weeds when weeds and crops grow together. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The present invention will be further described below in conjunction with the accompanying drawings.

[0050] Figure 1 A flowchart of a field inspection method based on machine learning is provided for an embodiment of the present invention;

[0051] Figure 2 A crop row determination segmentation schematic diagram is provided for an embodiment of the present invention;

[0052] Figure 3A framework diagram of a field patrol system based on machine learning is provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] The embodiment of the present invention provides a field inspection method based on machine learning. Figure 1 , Figure 1 A flow chart of a field inspection method based on machine learning provided in an embodiment of the present invention. The method comprises the following steps:

[0055] S101, pixelate and binary grayscale transform the multispectral image collected by the UAV to obtain a target image, identify crops in the target image through a preset crop feature set to obtain target crop rows, and the remaining area is recorded as a weed row.

[0056] S102, segmenting weeds of different forms in a weed row using a gray level co-occurrence matrix to obtain a weed feature set, and marking pixels corresponding to each weed region in the weed row to obtain a first weed region.

[0057] S103, performing feature fusion on the weed feature set and the preset crop feature set to obtain a comparison feature set.

[0058] S104, dividing the target crop row into a crop area, a second weed area and a mixed area according to a preset crop feature set and a weed feature set.

[0059] S105, obtaining a feature set of the mixed area and comparing it with the comparison feature set to obtain a third weed area.

[0060] S106, obtaining a weed control plan according to the first weed area, the second weed area, and the third weed area.

[0061] Among them, the preset crop feature set includes the features of the corresponding images of crops in different growth environments and different growth stages; the crop area is the area in the target crop row that only includes crops; the second weed area is the area in the target crop row that only includes weeds; the mixed area is the area in the target crop row where crops and weeds overlap.

[0062] According to a machine learning-based field inspection method provided by an embodiment of the present invention, crops in a target image are identified by a preset crop feature set to obtain target crop rows and weed rows, and then weeds of different forms in the weed row are segmented by a gray-level co-occurrence matrix to obtain a weed feature set, which provides data support for subsequent weed identification in a second weed area, and the weeds in the weed row are marked to obtain a first weed area, and the target crop row is divided into regions according to the preset crop feature set and the weed feature set to obtain a mixed region, and then the mixed region is compared by comparing the feature set to obtain a third weed region, and a weed control scheme is obtained by the first weed area, the second weed area and the third weed area, thereby solving the problem that it is difficult to accurately distinguish and identify weeds when weeds and crops grow together.

[0063] In one implementation, pixels in an image can be divided into two categories, crop and non-crop, by binarization, making subsequent classification and recognition easier.

[0064] In one implementation, all weeds in the entire weed row are obtained, and all weeds are classified according to their morphological similarity. Feature fusion is performed on each type of weeds to obtain a standard weed image corresponding to each type of weeds, which is recorded as a feature map of the weed type.

[0065] In one implementation, by fusing the weed feature set with the preset crop feature set, a more comprehensive feature set can be obtained, which helps to improve the accuracy of subsequent classification and recognition.

[0066] In one implementation, the weed situation in the patrolled area is obtained through the weed distribution of the first weed area, the second weed area and the third weed area. When the weed distribution exceeds a preset value, manual weeding, mechanical weeding, physical weeding, mulching weeding, chemical weeding, biological weeding, etc. can be used. Manual weeding can be done by pulling out weeds by hand and using simple farm tools. Mechanical weeding can be done by using a weeding machine pulled by animal power or mechanical power. Physical weeding can be done by using physical factors such as water, light and heat. Mulching weeding can be done by covering the surface of the farmland with straw, plastic film, etc. to inhibit weed growth. Chemical weeding can use chemical herbicides to remove weeds. Biological weeding can use insects, livestock, pathogenic microorganisms and highly competitive replacement plants and their metabolites to prevent and control weeds.

[0067] In one embodiment, see Figure 2 , Figure 2 Determine a segmentation diagram for a crop row. Step S101 specifically includes:

[0068] Input the preset crop feature set into the preset trained YOLOv8 model to obtain the bounding box of each crop feature in the target image;

[0069] The center coordinates of each bounding box are obtained, and the center coordinates of each bounding box are identified and grouped using the DBSCAN algorithm to obtain the target crop rows.

[0070] In one implementation, Figure 2 (A) is a schematic diagram of the bounding box of each crop feature, which contains a top view of the crop. Figure 2 The center point of the bounding box of each crop feature in (A) is obtained Figure 2 (B) Figure 2 The center points of each crop feature in (B) are connected in sequence to obtain the center line, and the crop row boundary line is determined based on the center line to obtain Figure 2 (C).

[0071] In one implementation, the preset trained YOLOv8 model replaces the C2f modules of the 4th and 8th layers of the backbone network structure and the C2f modules of the 13th, 17th and 21st layers in the Neck network in the original YOLOv8 network structure with transformation modules, wherein the transformation module consists of 4 DCNv2 modules and n Bottleneck modules. The DCNv2 and Bottleneck modules usually have a smaller computational amount, which helps to reduce the overall computational cost while maintaining performance.

[0072] In one embodiment, S103 specifically includes:

[0073] Determine the image perimeter and the first area of ​​the first image, determine the second area of ​​the second image, and obtain the number of target placement images according to the image perimeter, the first area, and the second area; the first image is any image in a preset crop feature set; the second image is any image in a preset weed feature set; the second image is smaller than the first image;

[0074] The first image is taken as the lower layer image and the second image is taken as the upper layer image. The second image is placed at random positions along the edge of the first image according to the target number of images and image fusion is performed to obtain a contrast feature set.

[0075] In one implementation, the second image is randomly placed along the edge of the first image according to the target number of images, thereby removing untouched images and completely covered images, reducing the amount of data in the fused image set, simplifying the calculation process, and improving efficiency.

[0076] In one embodiment, obtaining the number of target placement images according to the image perimeter, the first area, and the second area includes:

[0077] according to Get the number of target placement images;

[0078] Among them, Num is the number of target placement images, γ is the preset parameter, S Ais the first area, C A is the image perimeter, S a The second area.

[0079] In one implementation, the preset parameter is related to the type of weeds in the area, and the type of weeds is related to the weed reproduction speed. The faster the reproduction speed, the larger γ is.

[0080] In one embodiment, step S104 specifically includes:

[0081] Performing region segmentation according to the center coordinates of two adjacent crop boundary boxes in the target crop row to obtain multiple detection regions;

[0082] For each detection area, the detection area is divided into an inner area and an outer area according to the crop boundary box;

[0083] Weeds are identified in the area outside the frame according to the weed feature set to obtain a second weed area;

[0084] Crop recognition is performed on the area within the frame according to a preset crop feature set to determine whether the area within the frame is a crop area or a mixed area.

[0085] In one implementation, the crop area is an area in the target crop row that includes only crops; the second weed area is an area in the target crop row that includes only weeds; and the mixed area is an area in the target crop row where crops and weeds overlap.

[0086] In one implementation, according to Figure 2 The midpoint of the center line of (C) is parallel to the dividing line of the bounding box to divide each detection area into regions. Figure 2 (D); or Figure 2 (C) The midpoint of the center line is divided perpendicularly to the center line to obtain multiple detection areas.

[0087] In one implementation, each detection area is divided into regions by a crop boundary box, so that crop recognition can be performed more centrally within the crop boundary box, thereby improving crop recognition efficiency.

[0088] Based on the same inventive concept, the embodiment of the present invention also provides a field inspection system based on machine learning. Figure 3 , Figure 3 A framework diagram of a field patrol system based on machine learning provided in an embodiment of the present invention, the system comprising: a crop row division module, a first weed region module, a comparison feature set module, a second weed region module, a third weed region module and a weed control scheme module:

[0089] The crop row segmentation module is used to pixelate and binary grayscale transform the multispectral image collected by the UAV to obtain the target image, identify the crops in the target image through the preset crop feature set to obtain the target crop row, and the remaining area is recorded as the weed row; the preset crop feature set includes the features of detecting the corresponding images of crops in different growth environments and different growth stages;

[0090] A first weed region module is used to segment weeds of different forms in a weed row by using a gray-level co-occurrence matrix to obtain a weed feature set, and mark pixels corresponding to each weed region in the weed row to obtain a first weed region;

[0091] A comparison feature set module is used to fuse the weed feature set with the preset crop feature set to obtain a comparison feature set;

[0092] The second weed area module is used to divide the target crop row into a crop area, a second weed area and a mixed area according to a preset crop feature set and a weed feature set; the crop area is an area in the target crop row that only includes crops; the second weed area is an area in the target crop row that only includes weeds; and the mixed area is an area in the target crop row where crops and weeds overlap;

[0093] A third weed region module, used to obtain a feature set of a mixed region and compare it with a comparison feature set to obtain a third weed region;

[0094] The weed control scheme module is used to obtain a weed control scheme according to the first weed area, the second weed area and the third weed area.

[0095] A field inspection system based on machine learning provided by an embodiment of the present invention identifies crops in a target image through a preset crop feature set to obtain target crop rows and weed rows, and then divides weeds of different forms in the weed row through a gray-level co-occurrence matrix to obtain a weed feature set, thereby providing data support for subsequent weed identification in a second weed area, marking the weeds in the weed row to obtain a first weed area, dividing the target crop row into regions according to the preset crop feature set and the weed feature set to obtain a mixed region, and then comparing the mixed region through a comparison feature set to obtain a third weed region, and obtaining a weed control plan through the first weed area, the second weed area and the third weed area, thereby solving the problem that it is difficult to accurately distinguish and identify weeds when weeds and crops grow together.

[0096] In one embodiment, the crop row segmentation module includes a crop bounding box determination module and a target crop row identification module:

[0097] The crop bounding box determination module is used to input the preset crop feature set into the preset trained YOLOv8 model to obtain the bounding box of each crop feature in the target image;

[0098] The target crop row recognition module is used to obtain the center coordinates of each bounding box, and identify and group the center coordinates of each bounding box through the DBSCAN algorithm to obtain the target crop row.

[0099] In one embodiment, the contrast feature set module includes a target placement image quantity determination module and a contrast feature set determination module:

[0100] a module for determining the number of target placement images, for determining the image perimeter and the first area of ​​the first image, determining the second area of ​​the second image, and obtaining the number of target placement images according to the image perimeter, the first area, and the second area; the first image is any image in a preset crop feature set; the second image is any image in a preset weed feature set; and the second image is smaller than the first image;

[0101] The contrast feature set determination module is used to use the first image as the lower layer image and the second image as the upper layer image, place the second image at random positions along the edge of the first image according to the target number of images, and perform image fusion to obtain the contrast feature set.

[0102] In one embodiment, the target placement image quantity determination module is based on Get the number of target placement images;

[0103] Among them, Num is the number of target placement images, γ is the preset parameter, S A is the first area, C A is the image perimeter, S a The second area.

[0104] In one embodiment, the second weed region module includes an adjacent region segmentation module, a bounding box region segmentation module, a second weed region recognition module and a crop recognition module:

[0105] An adjacent region segmentation module is used to perform region segmentation according to the center coordinates of two adjacent crop boundary boxes in the target crop row to obtain multiple detection regions;

[0106] A bounding box region segmentation module is used for dividing each detection region into an inner region and an outer region according to a crop bounding box;

[0107] A second weed region identification module is used to identify weeds in the area outside the frame according to the weed feature set to obtain a second weed region;

[0108] The crop recognition module is used to perform crop recognition on the area within the frame according to a preset crop feature set, and determine whether the area within the frame is a crop area or a mixed area.

[0109] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.

Claims

1. A field inspection method based on machine learning, characterized in that: The method comprises: The multispectral image collected by the UAV is pixelated and binary grayscale transformed to obtain a target image, and the crops in the target image are identified by a preset crop feature set to obtain target crop rows, and the remaining areas are recorded as weed rows; the preset crop feature set includes features of detecting images corresponding to crops in different growth environments and different growth stages; Segmenting the weeds of different forms in the weed row using a gray level co-occurrence matrix to obtain a weed feature set, and marking pixels corresponding to each weed region in the weed row to obtain a first weed region; Performing feature fusion on the weed feature set and the preset crop feature set to obtain a comparison feature set; The target crop row is divided into a crop area, a second weed area and a mixed area according to the preset crop feature set and the weed feature set; the crop area is an area in the target crop row that only includes crops; the second weed area is an area in the target crop row that only includes weeds; and the mixed area is an area in the target crop row where crops and weeds overlap; Obtaining a feature set of the mixed area and comparing it with the comparison feature set to obtain a third weed area; obtaining a weed control plan according to the first weed area, the second weed area, and the third weed area; The weed feature set and the preset crop feature set are subjected to feature fusion to obtain a comparison feature set, which includes: Determine the image perimeter and the first area of ​​the first image, determine the second area of ​​the second image, and obtain the number of target placement images according to the image perimeter, the first area, and the second area; the first image is any image in the preset crop feature set; the second image is any image in the weed feature set; the second image is smaller than the first image; The first image is taken as a lower layer image, the second image is taken as an upper layer image, the second image is placed at random positions along the edge of the first image according to the number of target placement images, and image fusion is performed to obtain a contrast feature set; Obtaining the number of target placement images according to the image perimeter, the first area, and the second area includes: Get the number of target placement images; in, The number of images placed for the target, is the preset parameter, is the first area, is the image perimeter, is the second area.

2. A field inspection method based on machine learning according to claim 1, characterized in that: Identifying the crops in the target image by using a preset crop feature set to obtain a target crop row specifically includes: Inputting the preset crop feature set into a preset trained YOLOv8 model to obtain a bounding box of each crop feature in the target image; The center coordinates of each bounding box are obtained, and the center coordinates of each bounding box are identified and grouped using the DBSCAN algorithm to obtain the target crop rows.

3. A field inspection method based on machine learning according to claim 2, characterized in that: Dividing the target crop row into a crop area, a second weed area and a mixed area according to the preset crop feature set and the weed feature set comprises: Performing region segmentation according to the center coordinates of two adjacent crop boundary boxes in the target crop row to obtain a plurality of detection regions; For each detection area, the detection area is divided into an inner area and an outer area according to the crop boundary box; Performing weed identification on the area outside the frame according to the weed feature set to obtain a second weed area; Crop recognition is performed on the area within the frame according to the preset crop feature set to determine whether the area within the frame is a crop area or a mixed area.

4. A field inspection system based on machine learning, characterized in that: The system includes a crop row division module, a first weed area module, a comparison feature set module, a second weed area module, a third weed area module and a weed control scheme module: The crop row division module is used to pixelate and binary grayscale transform the multispectral image collected by the drone to obtain a target image, identify the crops in the target image through a preset crop feature set to obtain target crop rows, and record the remaining areas as weed rows; the preset crop feature set includes features of detecting images corresponding to crops in different growth environments and different growth stages; The first weed region module is used to segment the weeds of different forms in the weed row by using a gray level co-occurrence matrix to obtain a weed feature set, and mark the pixels corresponding to each weed region in the weed row to obtain a first weed region; The comparison feature set module is used to perform feature fusion on the weed feature set and the preset crop feature set to obtain a comparison feature set; The second weed area module is used to divide the target crop row into a crop area, a second weed area and a mixed area according to the preset crop feature set and the weed feature set; the crop area is an area in the target crop row that only includes crops; the second weed area is an area in the target crop row that only includes weeds; and the mixed area is an area in the target crop row where crops and weeds overlap; The third weed area module is used to obtain the feature set of the mixed area and compare it with the comparison feature set to obtain a third weed area; The weed control scheme module is used to obtain a weed control scheme according to the first weed area, the second weed area and the third weed area; The contrast feature set module includes a target placement image quantity determination module and a contrast feature set determination module: The target placement image quantity determination module is used to determine the image perimeter and the first area of ​​the first image, determine the second area of ​​the second image, and obtain the number of target placement images according to the image perimeter, the first area and the second area; the first image is any image in the preset crop feature set; the second image is any image in the weed feature set; the second image is smaller than the first image; The contrast feature set determination module is used to take the first image as a lower layer image and the second image as an upper layer image, place the second image at random positions along the edge of the first image according to the number of target placement images, and perform image fusion to obtain a contrast feature set; The target placement image quantity determination module is based on Get the number of target placement images; in, The number of images placed for the target, is the preset parameter, is the first area, is the image perimeter, is the second area.

5. A field inspection system based on machine learning according to claim 4, characterized in that: The crop row segmentation module includes a crop boundary box determination module and a target crop row identification module: The crop bounding box determination module is used to input the preset crop feature set into a preset trained YOLOv8 model to obtain a bounding box of each crop feature in the target image; The target crop row identification module is used to obtain the center coordinates of each bounding box, and identify and group the center coordinates of each bounding box through the DBSCAN algorithm to obtain the target crop row.

6. A field inspection system based on machine learning according to claim 5, characterized in that: The second weed region module includes an adjacent region segmentation module, a bounding box region segmentation module, a second weed region recognition module and a crop recognition module: The adjacent region segmentation module is used to perform region segmentation according to the center coordinates of two adjacent crop boundary boxes in the target crop row to obtain multiple detection regions; The boundary box region segmentation module is used for dividing each detection region into an inner region and an outer region according to the crop boundary box; The second weed region identification module is used to identify weeds in the area outside the frame according to the weed feature set to obtain a second weed region; The crop recognition module is used to perform crop recognition on the area within the frame according to the preset crop feature set, and determine whether the area within the frame is a crop area or a mixed area.