CN109829879B - Method and device for detecting vascular bundle - Google Patents

Method and device for detecting vascular bundle Download PDF

Info

Publication number
CN109829879B
CN109829879B CN201811474473.XA CN201811474473A CN109829879B CN 109829879 B CN109829879 B CN 109829879B CN 201811474473 A CN201811474473 A CN 201811474473A CN 109829879 B CN109829879 B CN 109829879B
Authority
CN
China
Prior art keywords
picture
vascular bundle
vascular
coordinate information
definition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811474473.XA
Other languages
Chinese (zh)
Other versions
CN109829879A (en
Inventor
王汉坤
余雁
易武坤
黎静
石俊利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Laiteerman Electronic Technology Co ltd
International Center for Bamboo and Rattan
Original Assignee
Beijing Laiteerman Electronic Technology Co ltd
International Center for Bamboo and Rattan
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Laiteerman Electronic Technology Co ltd, International Center for Bamboo and Rattan filed Critical Beijing Laiteerman Electronic Technology Co ltd
Priority to CN201811474473.XA priority Critical patent/CN109829879B/en
Publication of CN109829879A publication Critical patent/CN109829879A/en
Application granted granted Critical
Publication of CN109829879B publication Critical patent/CN109829879B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The embodiment of the invention provides a method and a device for detecting a vascular bundle, wherein the method comprises the following steps: acquiring a high-definition scanning picture of a plant cross section, detecting vascular bundles in the high-definition scanning picture through a pre-trained YOLOv3 model, acquiring coordinate information of each vascular bundle and counting the number of the vascular bundles; the Yolov3 model is trained according to the sample high-definition scanning picture and the label of each vascular bundle in the sample high-definition scanning picture. The embodiment of the invention not only greatly saves the processing flow of materials, but also realizes the comprehensive analysis of the whole structure of the plant stem.

Description

Method and device for detecting vascular bundle
Technical Field
The embodiment of the invention relates to the technical field of plant detection, in particular to a method and a device for detecting vascular bundles.
Background
The quantity and the tissue ratio of vascular bundles in vascular plant stems such as bamboo, rattan, palm and the like are important for researching the tissue structure and the mechanical property of the vascular plant stems, but no relevant patent, paper or method is available for automatic counting and tissue ratio calculation at present.
Previous studies have relied on manual counting when counting vascular bundles. The counting workload is very huge, and taking moso bamboos as an example, the manual counting is difficult to calculate clearly because 7000 fiber bundles are surrounded by one bamboo ring.
Disclosure of Invention
Embodiments of the present invention provide a method and apparatus for inspecting a vascular bundle that overcomes, or at least partially solves, the above-mentioned problems.
In a first aspect, an embodiment of the present invention provides a method for detecting a vascular bundle, including:
obtaining a high-definition scanning picture of a plant cross section, detecting the vascular bundles in the high-definition scanning picture through a pre-trained Yolov3 model, obtaining the coordinate information of each vascular bundle and counting the number of the vascular bundles, wherein the Yolov3 model is trained according to a sample high-definition scanning picture and the marks of the vascular bundles in the sample high-definition scanning picture.
In a second aspect, an embodiment of the present invention provides an apparatus for inspecting a vascular bundle, including:
the image acquisition module is used for acquiring a high-definition scanning image of the plant cross section;
and the vascular bundle information detection module is used for detecting the vascular bundles in the high-definition scanned picture through a pre-trained YOLOv3 model to obtain the coordinate information of each vascular bundle and count the number of the vascular bundles, wherein the YOLOv3 model is trained according to the sample high-definition scanned picture and the marks of the vascular bundles in the sample high-definition scanned picture.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method provided in the first aspect when executing the program.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the method as provided in the first aspect.
The method and the device for detecting the vascular bundles, provided by the embodiment of the invention, are used for acquiring the high-definition scanning picture of the plant cross section, detecting the vascular bundles in the high-definition scanning picture through the pre-trained YOLOv3 model, acquiring the coordinate information of each vascular bundle and counting the number of the vascular bundles, thereby greatly saving the processing flow of materials and realizing the comprehensive analysis of the whole structure of the plant stem.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for inspecting a vascular bundle according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an apparatus for inspecting a vascular bundle according to an embodiment of the present invention;
fig. 3 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to overcome the above problems in the prior art, an embodiment of the present invention provides a method for detecting a vascular bundle, and the inventive concept is as follows: the plant vascular bundles are detected and counted through a machine learning algorithm and an image processing technology, and the problems of time consumption, labor consumption and low precision in the process of counting the number of the plant vascular bundles and calculating the tissue specific quantity in a manual mode are solved.
Fig. 1 is a schematic flow chart of a method for detecting a vascular bundle according to an embodiment of the present invention, as shown in fig. 1, including:
s101, obtaining a high-definition scanning picture of the plant cross section.
According to the embodiment of the invention, after the detection part of a target plant, such as a vascular plant such as bamboo, rattan and palm, is cut, air-dried, and then polished by fine sand paper, a high-quality polished surface is obtained, and then a high-definition scanner is used for scanning, so that a high-definition scanning picture is obtained.
Specifically, aiming at vascular plants such as bamboo, rattan, palm and the like, a test part is intercepted, attention is paid to when the sample is intercepted, a sample which is complete in structure and has no processing defects is selected, the sample is placed in a room temperature environment to be air-dried, then a sander is used for surface polishing treatment, the mesh number of abrasive paper is larger than 200 meshes so as to ensure polishing precision, the fiber sheath and the thin-walled cell boundary part is clear and recognizable, the sample is placed under a body type microscope to be inspected after being processed, high-definition scanning is carried out on the surface of the sample meeting requirements, the scanning equipment adopted by scanning in the embodiment of the invention is a high-definition scanner, scanning is carried out in a gray scale mode, and the scanning resolution is.
It should be noted that the embodiment of the present invention uses fine sand paper for polishing, which not only can accurately distinguish the boundary between the fiber sheath and the parenchyma cell, but also can fill large pores such as large ducts, phloem, etc. in the vascular bundle in the sample, thereby avoiding the interference of duct pores on the calculation of the fiber sheath area. The high-definition scanner can quickly obtain a complete cross-section picture of the plant stem, and the method is convenient and quick and obtains more comprehensive and accurate information.
S102, detecting the vascular bundles in the high-definition scanning picture through a pre-trained YOLOv3 model, obtaining coordinate information of each vascular bundle and counting the number of the vascular bundles.
It should be understood that the YoLO model is another framework proposed by Ross Girshick for the DL target detection speed problem following RCNN, fast-RCNN, and fast-RCNN. The core idea of YOLO is to use the whole graph as the input of the network and directly return the position of the bounding box (bounding box) and the class to which it belongs in the output layer. The Yolov3 model in the embodiment of the invention is trained according to a sample high-definition scanning picture and the label of each vascular bundle in the sample high-definition scanning picture, wherein the sample high-definition scanning picture is used as the input of a network, and the label of each vascular bundle in the sample high-definition scanning picture is used as the output of the network. The current YOLO model has three versions of v1, v2 and v3, and the embodiment of the invention adopts a v3 version, which processes 608X608 images on Pascal Titan X at a speed of 20FPS, and mAP @0.5 on COCO test-dev reaches 57.9%, which is similar to the result of RetinaNet and is 4 times faster.
The method for detecting the vascular bundle in the embodiment of the invention detects and counts the plant vascular bundle through a machine learning algorithm and an image processing technology, and solves the problems of time consumption, labor consumption and low precision in the process of manually counting the number of the plant vascular bundles and calculating the tissue specific quantity. The embodiment of the invention adopts the machine learning algorithm to identify and calculate the vascular bundles for the first time, not only can accurately identify the vascular bundles to obtain the number of the vascular bundles, but also can obtain the accurate coordinate of each vascular bundle, thereby providing important basis for researching the distribution characteristics of the vascular bundles in the stems and researching and developing the bionic materials.
When calculating the area and the tissue ratio of the vascular bundle, Image-ProPlus and other Image processing software is generally adopted to carry out binarization processing on the Image obtained by the body type microscope, and then software is adopted to carry out automatic frame selection or manual drawing on the region for calculation. In the aspect of area calculation, conventional software only depends on manual binaryzation, the boundary determination artificial influence factors are too many, different people have large difference when drawing, binaryzation and area calculation are inaccurate, requirements are difficult to meet, the visual field of the body type microscope is small, only small local pictures of stalks can be obtained, and the reflected plant structure information is not comprehensive.
In order to overcome the above problem, on the basis of the foregoing embodiments, as an alternative embodiment, the obtaining coordinate information of each vascular bundle and counting the number of the vascular bundles further includes:
and capturing the vascular bundles from the high-definition scanned picture according to the coordinate information of each vascular bundle, performing binarization processing, and restoring the vascular bundles subjected to binarization processing to a blank picture with the same size as the high-definition scanned picture according to the corresponding coordinate information to obtain a binarization picture.
Calculating the area of the fiber sheath according to the binarization picture, calculating the area of the plant cross section according to a mobile smooth integration method in combination with coordinate information of the vascular bundle in the binarization picture, and calculating the tissue specific quantity according to the ratio of the area of the fiber sheath to the area of the plant cross section.
It should be noted that, in the embodiment of the present invention, each bundle of dimensions is marked by a unique rectangular frame, so that the coordinates of the bundle of dimensions can be represented by the corresponding rectangular frame, specifically, the coordinates of the element at the upper left corner of the rectangular frame can be used as the coordinates of the bundle of dimensions, and in addition, the coordinates of the elements at multiple corners of the rectangular frame can also be used as the coordinates of the bundle of dimensions. 2) For example, in a 1000 x 1000 picture, the coordinates of the top left vertex of the bundle are (100,200) and the coordinates of the bottom right vertex are (300,400), the pixel values of the bundle can be easily grabbed by the following Python code: wgs img [200:400,100:300 ].
Because each vascular bundle has a unique coordinate, the embodiment of the invention realizes the purpose of grabbing the vascular bundle from a high-definition scanning picture according to the coordinate, and the prior art cannot realize the effect of grabbing any vascular bundle because the coordinate of the vascular bundle is not accurately identified.
It can be understood that the vascular bundle has a darker color in the scanned image, and the cellular fluid and the parenchyma cells have a lighter color in the scanned image, so that the boundary of the fiber sheath and the parenchyma cells can be automatically identified by performing binarization processing on the vascular bundle, the automatic calculation of the area of the fiber sheath is completed, and the data is accurate and reliable. The area of the plant cross section can be conveniently obtained by a moving smooth integration method.
On the basis of the above embodiments, as an alternative embodiment, the method for training the YOLOv3 model includes:
and cutting the sample high-definition scanning picture into a plurality of sub-pictures, marking the complete vascular bundle in each sub-picture by a rectangular frame, and generating coordinates according to the rectangular frame to be used as a training set of a YOLOv3 model.
Specifically, the embodiment of the present invention segments the high definition image obtained by the scanner into a plurality of sub-images, and labels (frames) the coordinates of the complete bundle of the dimensions in the sub-images respectively by the LabelImg software, thereby obtaining an XML file containing the coordinates of all bundles of the dimensions. And then, integrating the subgraph and the corresponding XML file as a data set of the YOLOv3 model. The total number of samples should be greater than 10000. As an alternative embodiment, the embodiment of the invention trains the model using Keras version YOLO v3 open source code.
And performing KMeans clustering on the height and width of each rectangular frame in the training set as sample characteristics to obtain 9 clustering centers, wherein each clustering center is used for representing the height-width ratio of one rectangular frame.
In order to improve the accuracy of the model, according to the requirement of YOLO v3, KMeans clustering is performed using the height and width of all labeled boxes of the data set as sample features (k is 9), 9 cluster centers, that is, 9 pairs of height and width values are obtained, and the obtained cluster centers are arranged in a config.json file to serve as a reference for generating the size of a candidate box of the YOLO 3 model.
And carrying out data enhancement processing on the sample features in the training set in batches, wherein the data enhancement processing comprises random scaling and horizontal turning.
It should be noted that, in order to increase the variability and randomness of the samples, thereby improving the model generalization capability and preventing overfitting, the embodiment of the present invention performs data enhancement processing on the sample characteristics, wherein the random scaling is to randomly scale the height and width of the rectangular frame, and the horizontal flipping is to rotate the rectangular frame.
Inputting the sample characteristics after data enhancement processing into a YOLOv3 model with preset initialization parameters for training, reserving the weight of the YOLOv3 model after each epoch training is finished, and terminating the training when the loss value is stable and the epoch iteration does not decrease any more;
it should be noted that a larger batch _ size is beneficial to find a gradient direction in which LOSS drops faster in the iterative process, so as to accelerate the convergence of the model. The appropriate batch _ size should be determined based on the device configuration, should be determined by trial and error, or otherwise would cause memory overflow and fail training. In order to speed up model training and obtain the LOSS value as small as possible, an algorithm for dynamically adjusting the learning rate is adopted. When the LOSS value is still not improved at 2 epoch training, the learning rate is automatically reduced by an order of magnitude.
In the training process of the embodiment of the invention, parameters of the model are saved after each epoch training is finished, key parameters of the model such as loss value, learning rate, time consumption and the like are output, and finally, when the loss value is stable and is not reduced any more after multiple epoch iterations, the training can be terminated.
After the model training is finished, the trained model is used for testing the verification set, and indexes such as mAP (average precision), recal 50 (recall rate when the iou threshold is 50%), recal 75 (recall rate when the iou threshold is 75%) and the like on the verification set are calculated to evaluate the performance of the model.
On the basis of the above embodiments, the bundle of dimensions in the high-definition scanned picture is detected through a pre-trained YOLOv3 model, so as to obtain the coordinate information of each bundle of dimensions and count the number of bundles of dimensions, specifically:
dividing the high-definition scanning picture into 4 sets of subgraphs according to an offset dividing method, wherein the size of each set of subgraphs is consistent with that of the divided subgraphs of the training set;
setting testing parameters of a pre-trained YOLOv3 model, and then respectively inputting 4 sets of sub-graphs into the YOLOv3 model to obtain coordinate information of each candidate box in the 4 sets of sub-graphs.
In particular, the test parameters include the size (height, width) of the network input, which must be a multiple of 32, the smaller the prediction speed, but the accuracy may be affected. obj _ thresh is a threshold for checking whether an object exists in the candidate box, and nms _ thresh, i.e., a non-maximum suppression threshold, is used to define the repeated candidate boxes, so as to select the candidate box with the highest score. The candidate box is a prediction box generated by a YOLOV3 model and used for predicting the position and the classification of the object.
The actual test sample is detected through the trained model, and all the vascular bundles except for a few incomplete vascular bundles on the cutting line can be well detected by the model.
In order to improve the accuracy of the detection result, on the basis of the foregoing embodiments, outputting a sub-graph marking a rectangular frame (i.e., an alternative frame) of each complete bundle of dimensions, and then further including:
filtering the alternative frames of the 4 sets of sub-images according to a preset area threshold and an aspect ratio threshold to obtain filtered alternative frames; for example, discarding alternative boxes that are smaller than 4000 square pixels, the aspect ratio can be made larger than 4: the alternative box of 1 is deleted.
And merging the filtered alternative frames, removing repeated alternative frames, and recording the coordinate information and the number of the residual alternative frames in all the subgraphs as the coordinate and the number of the vascular bundle respectively.
It should be noted that, the original high-definition scanned picture is divided into a plurality of subgraphs for prediction, and the bundle of dimensions on the cutting line may not be predicted or only an incomplete bundle of dimensions may be predicted due to incompleteness. The problem can be solved by adopting an algorithm of dividing 4 sets of subgraphs in an offset manner and then combining and removing the duplicate of the prediction results of a plurality of sets of subgraphs, so that the overall accuracy of the algorithm is further improved.
On the basis of the above embodiments, calculating the area of the fiber sheath according to the binarized image specifically includes:
and counting the number of pixel points used for representing the fiber sheath in the binarization picture, and multiplying the number by the actual area represented by each pixel point to obtain the area of the fiber sheath.
Because the calculation of the area of the fiber sheath depends on a binarization image, most of the traditional binarization algorithms are based on a threshold value (a fixed threshold value or an adaptive threshold value), and are easily influenced by the overall environment, background, chromaticity, chromatic aberration, noise and the like of the image, and the precision is not high. The embodiment of the invention grabs each vascular bundle from an original image one by one according to the coordinate information of the vascular bundle, then flattens all pixel values of the vascular bundle as a characteristic, utilizes a Kmean clustering algorithm to cluster all pixel points into 2 types (black and white), then respectively calculates the mean value of the pixel values of each type, the mean value is white as the mean value is large, the mean value is black as the mean value is small, and then the mean value is reduced into a binary image, thereby eliminating the interference of the whole environment as much as possible, distinguishing the vascular bundle and the background as clear as possible, reducing the binary image of all the vascular bundles into a blank image of the size of the original image according to the coordinate information to generate the whole binary image, and calculating the area of the fibrous sheath by counting the number of black pixel points and multiplying the actual area represented by each pixel point based on the whole binary image.
On the basis of the above embodiments, the calculating the area of the plant cross section according to the moving smooth integration method in combination with the coordinate information of the vascular bundle in the binarized picture specifically includes:
setting sliding windows on the binarization picture, and calculating the lowest position and the highest position of the fiber sheath in each sliding window;
performing transverse and longitudinal expansion on the lowest position and the highest position according to a preset threshold value to form a rectangle which is used as a part of a transverse section of the implant in the sliding window; the preset threshold value is determined according to the artificial measurement results of various plants;
filling the rectangular binaryzation into a blank picture with the same size as the original picture until a binaryzation picture distributed on the cross section of the whole plant is obtained;
and obtaining the area of the plant cross section by calculating the number of pixel points representing the plant cross section in the binary image and multiplying the number by the actual area represented by each pixel point.
Specifically, as the vascular bundles are almost distributed in the whole plant, the cross-sectional area of the sample can be approximately calculated by adopting a moving smooth integration method through the coordinate distribution of all the vascular bundles. The algorithm is as follows:
a) and taking a slender rectangle with the width being [ width ] px (for example, 10-50 pixels) and the height being the image height, and smoothly scanning the whole vascular bundle binary image by taking [ step ] px as a step length from left to right.
b) Calculating the minimum (min _ height) and the maximum (max _ height) of a fiber sheath in the region every time the sliding frame moves [ step ] px, and respectively expanding the extended _ w _ thresh and the extended _ h _ thresh px in the horizontal direction and the longitudinal direction (the threshold value can be adjusted according to comparison with the manual measurement and calculation result of each type of plants) to obtain a slender rectangle which is used as the cross section part of the sample in the sliding frame and is binarized and filled into a blank picture with the same size as the original picture;
c) and (c) repeating the step (b) until the sliding frame moves to the rightmost end of the image, thereby obtaining a binary image of the distribution of the cross section of the whole sample, and based on the image, calculating the number of black pixel points and multiplying the number by the actual area represented by each pixel point, thereby approximately calculating the area of the cross section of the sample.
Fig. 2 is a schematic structural diagram of an inspection apparatus for a vascular bundle according to an embodiment of the present invention, as shown in fig. 2, the inspection apparatus for a vascular bundle includes: picture acquisition module 201 and vascular bundle information detection module 202, wherein:
the picture acquiring module 201 is configured to acquire a high-definition scanning picture of a plant cross section.
Specifically, according to the embodiment of the invention, after the detection part of a target plant, such as a vascular plant such as bamboo, rattan, palm, and the like, is cut, air-dried, and then polished by fine sand paper, a high-quality polished surface is obtained, and then scanned by a high-definition scanner, so that a high-definition scanning picture is obtained.
The vascular bundle information detection module 202 detects the vascular bundles in the high-definition scanned picture through a pre-trained YOLOv3 model, obtains coordinate information of each vascular bundle, and counts the number of the vascular bundles.
It should be understood that the YoLO model is another framework proposed by Ross Girshick for the DL target detection speed problem following RCNN, fast-RCNN, and fast-RCNN. The core idea of YOLO is to use the whole graph as the input of the network and directly return the position of the bounding box (bounding box) and the class to which it belongs in the output layer. The Yolov3 model in the embodiment of the invention is trained according to a sample high-definition scanning picture and the label of each vascular bundle in the sample high-definition scanning picture, wherein the sample high-definition scanning picture is used as the input of a network, and the label of each vascular bundle in the sample high-definition scanning picture is used as the output of the network. The current YOLO model has three versions of v1, v2 and v3, and the embodiment of the invention adopts a v3 version, which processes 608X608 images on Pascal Titan X at a speed of 20FPS, and mAP @0.5 on COCO test-dev reaches 57.9%, which is similar to the result of RetinaNet and is 4 times faster.
The method for detecting the vascular bundle in the embodiment of the invention detects and counts the plant vascular bundle through a machine learning algorithm and an image processing technology, and solves the problems of time consumption, labor consumption and low precision in the process of manually counting the number of the plant vascular bundles and calculating the tissue specific quantity. The embodiment of the invention adopts the machine learning algorithm to identify and calculate the vascular bundles for the first time, not only can accurately identify the vascular bundles to obtain the number of the vascular bundles, but also can obtain the accurate coordinates of each vascular bundle, thereby providing an important basis for researching the branch characteristics of the vascular bundles in the stems and researching and developing bionic materials.
The apparatus for detecting a vascular bundle provided in the embodiments of the present invention specifically executes the flow of the above method for detecting a vascular bundle, and please refer to the content of the above method for detecting a vascular bundle for details, which is not described herein again. The vascular bundle detection device provided by the embodiment of the invention not only greatly saves the processing flow of materials, but also realizes the comprehensive analysis of the whole structure of the plant stem; the detection, counting, area measurement and other work of the vascular bundle can be completed within several minutes, so that the efficiency is greatly improved, the time is saved, and the resolution and calculation precision is greatly improved.
Fig. 3 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 3, the electronic device may include: a processor (processor)310, a communication Interface (communication Interface)320, a memory (memory)330 and a communication bus 340, wherein the processor 310, the communication Interface 320 and the memory 330 communicate with each other via the communication bus 340. The processor 310 may invoke a computer program stored on the memory 330 and executable on the processor 310 to perform the detection methods provided by the various embodiments described above, including, for example: acquiring a high-definition scanning picture of a plant cross section, detecting vascular bundles in the high-definition scanning picture through a pre-trained YOLOv3 model, acquiring coordinate information of each vascular bundle and counting the number of the vascular bundles; the Yolov3 model is trained according to the sample high-definition scanning picture and the label of each vascular bundle in the sample high-definition scanning picture.
In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Embodiments of the present invention further provide a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the detection method provided in the foregoing embodiments when executed by a processor, and the detection method includes: acquiring a high-definition scanning picture of a plant cross section, detecting vascular bundles in the high-definition scanning picture through a pre-trained YOLOv3 model, acquiring coordinate information of each vascular bundle and counting the number of the vascular bundles; the Yolov3 model is trained according to the sample high-definition scanning picture and the label of each vascular bundle in the sample high-definition scanning picture.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A method of inspecting a vascular bundle, comprising:
acquiring a high-definition scanning picture of a plant cross section, detecting vascular bundles in the high-definition scanning picture through a pre-trained YOLOv3 model, acquiring coordinate information of each vascular bundle and counting the number of the vascular bundles;
the Yolov3 model is trained according to the sample high-definition scanning picture and the mark of each vascular bundle in the sample high-definition scanning picture;
the obtaining of coordinate information of each vascular bundle and the counting of the number of the vascular bundles further comprises:
capturing a vascular bundle from the high-definition scanned picture according to the coordinate information of each vascular bundle, performing binarization processing, and restoring the vascular bundle subjected to binarization processing to a blank picture with the same size as the high-definition scanned picture according to the corresponding coordinate information to obtain a binarization picture;
calculating the area of a fiber sheath according to the binarization picture, calculating the area of a plant cross section according to a mobile smooth integration method in combination with coordinate information of a vascular bundle in the binarization picture, and calculating a tissue specific quantity according to the ratio of the area of the fiber sheath to the area of the plant cross section;
the method comprises the following steps of grabbing a vascular bundle from a high-definition scanning picture according to the coordinate information of each vascular bundle, carrying out binarization processing on the vascular bundle, and restoring the vascular bundle subjected to binarization processing to a blank picture with the same size as the high-definition scanning picture according to corresponding coordinate information to obtain a binarization picture, and specifically comprises the following steps:
capturing each vascular bundle from the high-definition scanning picture one by one according to coordinate information of the vascular bundle, then respectively flattening all pixel values of each vascular bundle as features, clustering all pixel points into black and white 2 classes by using a Kmean clustering algorithm, respectively calculating the mean value of each class of pixel values, taking the mean value with a large mean value as white, taking the mean value with a small mean value as black, then reducing the mean value into a binary picture, reducing the binary picture of all the vascular bundles into a blank picture with the same size as the high-definition scanning picture according to the coordinate information, and generating the binary picture.
2. The detection method according to claim 1, wherein the YOLOv3 model is trained by:
cutting a sample high-definition scanning image into a plurality of sub-images, marking complete vascular bundles in each sub-image by a rectangular frame, and generating coordinates according to the rectangular frame to be used as a training set of a YOLOv3 model;
performing KMeans clustering on the height and width of each rectangular frame in the training set as sample characteristics to obtain 9 clustering centers, wherein each clustering center is used for representing the height-width ratio of one rectangular frame;
carrying out data enhancement processing on sample features in a training set in batches, wherein the data enhancement processing comprises random scaling and horizontal turning;
inputting the sample characteristics after data enhancement processing into a YOLOv3 model with preset initialization parameters for training, reserving the weight of the YOLOv3 model after each epoch training is finished, and terminating the training when the loss value is stable and the epoch iteration does not decrease any more;
the parameters include batch size, learning rate, training times nb _ epochs, detection threshold, ignore _ thresh, and the number of GPUs involved in training.
3. The detection method according to claim 1, wherein the vascular bundles in the high-definition scanned picture are detected through a pre-trained YOLOv3 model, and coordinate information of each vascular bundle is obtained, specifically:
dividing the high-definition scanning picture into 4 sets of subgraphs according to an offset dividing method, wherein the size of each set of subgraphs is consistent with that of the divided subgraphs of the training set;
setting testing parameters of a pre-trained YOLOv3 model, and then respectively inputting 4 sets of sub-graphs into the YOLOv3 model to obtain coordinate information of each candidate box in the 4 sets of sub-graphs.
4. The detection method according to claim 3, wherein the obtained candidate box coordinate information is detected for each of the 4 sets of sub-maps, and then further comprising:
filtering the alternative frames of the 4 sets of sub-images according to a preset area threshold and an aspect ratio threshold to obtain filtered alternative frames;
and merging the filtered alternative frames, removing repeated alternative frames, and recording the coordinates and the number of the remaining alternative frames in all the subgraphs as the coordinates and the number of the vascular bundles respectively.
5. The detection method according to claim 1, wherein the area of the fibrous sheath is calculated from the binarized image, specifically:
and counting the number of pixel points used for representing the fiber sheath in the binarization picture, and multiplying the number by the actual area represented by each pixel point to obtain the area of the fiber sheath.
6. The detection method according to claim 1, wherein the area of the plant cross section is calculated according to a moving smooth integration method in combination with coordinate information of the vascular bundle in the binarized picture, specifically:
setting sliding windows on the binarization picture, and calculating the lowest position and the highest position of the fiber sheath in each sliding window;
performing transverse and longitudinal expansion on the lowest position and the highest position according to a preset threshold value to form a rectangle which is used as a part of a transverse section of the implant in the sliding window; the preset threshold value is determined according to the artificial measurement results of various plants;
filling the rectangular binaryzation into a blank picture with the same size as the original picture until a binaryzation picture distributed on the cross section of the whole plant is obtained;
and obtaining the area of the plant cross section by calculating the number of pixel points representing the vascular bundle in the binary image and multiplying the number by the actual area represented by each pixel point.
7. An apparatus for inspecting a vascular bundle, comprising:
the image acquisition module is used for acquiring a high-definition scanning image of the plant cross section;
the vascular bundle information detection module is used for detecting the vascular bundles in the high-definition scanning picture through a pre-trained YOLOv3 model to obtain coordinate information of each vascular bundle and count the number of the vascular bundles;
the Yolov3 model is trained according to the sample high-definition scanning picture and the mark of each vascular bundle in the sample high-definition scanning picture;
the obtaining of coordinate information of each vascular bundle and the counting of the number of the vascular bundles further comprises:
capturing a vascular bundle from the high-definition scanned picture according to the coordinate information of each vascular bundle, performing binarization processing, and restoring the vascular bundle subjected to binarization processing to a blank picture with the same size as the high-definition scanned picture according to the corresponding coordinate information to obtain a binarization picture;
calculating the area of a fiber sheath according to the binarization picture, calculating the area of a plant cross section according to a mobile smooth integration method in combination with coordinate information of a vascular bundle in the binarization picture, and calculating a tissue specific quantity according to the ratio of the area of the fiber sheath to the area of the plant cross section;
the method comprises the following steps of grabbing a vascular bundle from a high-definition scanning picture according to the coordinate information of each vascular bundle, carrying out binarization processing on the vascular bundle, and restoring the vascular bundle subjected to binarization processing to a blank picture with the same size as the high-definition scanning picture according to corresponding coordinate information to obtain a binarization picture, and specifically comprises the following steps:
capturing each vascular bundle from the high-definition scanning picture one by one according to coordinate information of the vascular bundle, then respectively flattening all pixel values of each vascular bundle as features, clustering all pixel points into black and white 2 classes by using a Kmean clustering algorithm, respectively calculating the mean value of each class of pixel values, taking the mean value with a large mean value as white, taking the mean value with a small mean value as black, then reducing the mean value into a binary picture, reducing the binary picture of all the vascular bundles into a blank picture with the same size as the high-definition scanning picture according to the coordinate information, and generating the binary picture.
8. An electronic device, comprising:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the detection method of any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the detection method according to any one of claims 1 to 6.
CN201811474473.XA 2018-12-04 2018-12-04 Method and device for detecting vascular bundle Active CN109829879B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811474473.XA CN109829879B (en) 2018-12-04 2018-12-04 Method and device for detecting vascular bundle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811474473.XA CN109829879B (en) 2018-12-04 2018-12-04 Method and device for detecting vascular bundle

Publications (2)

Publication Number Publication Date
CN109829879A CN109829879A (en) 2019-05-31
CN109829879B true CN109829879B (en) 2021-01-15

Family

ID=66859835

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811474473.XA Active CN109829879B (en) 2018-12-04 2018-12-04 Method and device for detecting vascular bundle

Country Status (1)

Country Link
CN (1) CN109829879B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111414880B (en) * 2020-03-26 2022-10-14 电子科技大学 Method for detecting target of active component in microscopic image based on improved RetinaNet
CN115965582B (en) * 2022-11-22 2024-03-08 哈尔滨岛田大鹏工业股份有限公司 Ultrahigh-resolution-based method for detecting surface defects of cylinder body and cylinder cover of engine

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107886497A (en) * 2017-10-05 2018-04-06 北京林业大学 A kind of wheat flag leaf automatic nondestructive detection and measuring method based on image
CN108527382A (en) * 2018-04-09 2018-09-14 上海方立数码科技有限公司 A kind of crusing robot
CN108596174A (en) * 2018-04-28 2018-09-28 中南大学 A kind of lesion localization method of skin disease image
CN108647652A (en) * 2018-05-14 2018-10-12 北京工业大学 A kind of cotton development stage automatic identifying method based on image classification and target detection

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101238987A (en) * 2007-09-06 2008-08-13 深圳先进技术研究院 Processing method of CT cerebral hemorrhage image
WO2009086500A1 (en) * 2007-12-28 2009-07-09 Pioneer Hi-Bred International, Inc. Using structural variation to analyze genomic differences for the prediction of heterosis
US8488863B2 (en) * 2008-11-06 2013-07-16 Los Alamos National Security, Llc Combinational pixel-by-pixel and object-level classifying, segmenting, and agglomerating in performing quantitative image analysis that distinguishes between healthy non-cancerous and cancerous cell nuclei and delineates nuclear, cytoplasm, and stromal material objects from stained biological tissue materials
CN104182763B (en) * 2014-08-12 2017-11-07 中国计量学院 A kind of floristics identifying system based on flower feature

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107886497A (en) * 2017-10-05 2018-04-06 北京林业大学 A kind of wheat flag leaf automatic nondestructive detection and measuring method based on image
CN108527382A (en) * 2018-04-09 2018-09-14 上海方立数码科技有限公司 A kind of crusing robot
CN108596174A (en) * 2018-04-28 2018-09-28 中南大学 A kind of lesion localization method of skin disease image
CN108647652A (en) * 2018-05-14 2018-10-12 北京工业大学 A kind of cotton development stage automatic identifying method based on image classification and target detection

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Micron-scale phenotyping quantification and three-dimensional microstructure reconstruction of vascular bundles within maize stalks based on micro-CT scanning;Jianjun Du 等;《Functional Plant Biology》;20160805;第44卷(第1期);第10-22页 *

Also Published As

Publication number Publication date
CN109829879A (en) 2019-05-31

Similar Documents

Publication Publication Date Title
CN109580630B (en) Visual inspection method for defects of mechanical parts
CN111402226A (en) Surface defect detection method based on cascade convolution neural network
Liu et al. A vision-based robust grape berry counting algorithm for fast calibration-free bunch weight estimation in the field
US11501446B2 (en) Segmenting 3D intracellular structures in microscopy images using an iterative deep learning workflow that incorporates human contributions
US20090252429A1 (en) System and method for displaying results of an image processing system that has multiple results to allow selection for subsequent image processing
GB2478593A (en) Segmentation of cell nuclei in histological sections
CN106340016A (en) DNA quantitative analysis method based on cell microscope image
CN109241867B (en) Method and device for recognizing digital rock core image by adopting artificial intelligence algorithm
CN107590512B (en) The adaptive approach and system of parameter in a kind of template matching
CN106355579A (en) Defect detecting method of cigarette carton surface wrinkles
CN109829879B (en) Method and device for detecting vascular bundle
CN112614062A (en) Bacterial colony counting method and device and computer storage medium
DE202009013865U1 (en) Concept for selecting an optimized evaluation feature subset for inspection of free-form surfaces and concept for inspecting a free-form surface
CN114926407A (en) Steel surface defect detection system based on deep learning
CN103268492B (en) A kind of corn grain type identification method
CN112819821A (en) Cell nucleus image detection method
CN112001901A (en) Apple defect detection method and system based on convolutional neural network
CN114581805A (en) Coating roller surface defect detection method adopting 3D line laser profile technology
CN112419291A (en) Training method of bottle blank defect detection model, storage medium and terminal equipment
CN117635615B (en) Defect detection method and system for realizing punching die based on deep learning
CN116797602A (en) Surface defect identification method and device for industrial product detection
CN116824273A (en) Method for judging attributes of two-dimensional projection image patches of aviation manufacturing piece at any view angle
CN112837271B (en) Melon germplasm resource character extraction method and system
CN113763384B (en) Defect detection method and defect detection device in industrial quality inspection
Borianne et al. Automated valuation of leaves area for large-scale analysis needing data coupling or petioles deletion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant