Fruit or vegetable inspection method and apparatus, and device

By identifying the tissue parts of fruits and vegetables using computed tomography images and image segmentation models, the problem of high loss in fruit and vegetable detection has been solved, and efficient and accurate volume and mass calculations have been achieved.

WO2026237500A1PCT designated stage Publication Date: 2026-11-19TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/082761
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-12
Filing Date
2026-03-11
Publication Date
2026-11-19

AI Technical Summary

Technical Problem

In the process of fruit and vegetable testing, existing technologies result in significant fruit and vegetable losses, for example, requiring the peeling of the fruit shell or the stripping of tissue parts to determine volume and quality.

Method used

Using computed tomography imaging technology, combined with a pre-trained image segmentation model, the tissue parts of fruits and vegetables are identified, and the actual volume and mass are calculated through the mapping relationship between density and pixel values, thus avoiding physical stripping.

Benefits of technology

It reduces fruit and vegetable spoilage, improves the accuracy and efficiency of testing, and can accurately determine the volume and quality of fruits and vegetables.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026082761_19112026_PF_FP_ABST
    Figure CN2026082761_19112026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present disclosure is a fruit or vegetable inspection method, which can be applied to the technical field of image processing. The fruit or vegetable inspection method comprises: determining, as an image to be subjected to recognition, a computed tomography image of a fruit or vegetable to be analyzed; using a pre-trained image segmentation model to predict fruit or vegetable tissue portions to which pixel points in the image to be subjected to recognition belong; for each pixel point that belongs to a target tissue portion in a prediction result, determining a corresponding actual volume, and determining, on the basis of the sum of the determined actual volumes, the volume of the target tissue portion in the fruit or vegetable to be analyzed; for each pixel point that belongs to the target tissue portion in the prediction result, determining a corresponding actual mass on the basis of the corresponding actual volume, and determining, on the basis of the sum of the determined actual masses, the mass of the target tissue portion in the fruit or vegetable to be analyzed; and on the basis of the mass of the target tissue portion, determining an inspection result of the fruit or vegetable to be analyzed. Provided in the present disclosure are a fruit or vegetable inspection method and apparatus, and a device.
Need to check novelty before this filing date? Find Prior Art

Description

Fruit and vegetable testing methods, devices and equipment

[0001] This disclosure claims priority to Chinese Patent Application No. 202510607760.7, filed on May 12, 2025, the contents of which are incorporated herein by reference. Technical Field

[0002] This disclosure relates to the field of image processing technology, and more specifically, to a method, apparatus, and equipment for detecting fruits and vegetables. Background Technology

[0003] As living standards improve, people have increasingly higher demands for fruits and vegetables. Therefore, testing is often necessary for fruits and vegetables. Specific test results include, for example, the size of the fruit flesh, the size of the edible portion of vegetables, and the overall quality of the produce.

[0004] The process of testing fruits and vegetables often results in significant losses. For example, when testing lychees, it is necessary to manually peel them to determine the size of the flesh in order to assess their quality; similarly, when testing mushrooms, it is necessary to manually separate the edible parts to determine their quality.

[0005] There is an urgent need for a fruit and vegetable testing method that can reduce fruit and vegetable losses.

[0006] It should be noted that the above introduction to the technical background is only for the purpose of providing a clear and complete explanation of the technical solutions disclosed herein, and for facilitating understanding by those skilled in the art. It should not be assumed that these technical solutions are known to those skilled in the art simply because they have been described in the background section of this disclosure. Summary of the Invention

[0007] In view of the above problems, embodiments of this disclosure provide a method, apparatus and equipment for detecting fruits and vegetables, which solves the problem of how to reduce fruit and vegetable losses during the detection process.

[0008] According to a first aspect of this disclosure, a method for detecting fruits and vegetables is provided, comprising: determining a computed tomography image of the fruit or vegetable to be analyzed as an image to be identified; using a pre-trained image segmentation model to predict the fruit or vegetable tissue to which pixels in the image to be identified belong; determining the corresponding actual volume for each pixel belonging to the target tissue in the prediction result, and determining the volume of the target tissue in the fruit or vegetable to be analyzed based on the sum of the determined actual volumes; determining the corresponding actual mass for each pixel belonging to the target tissue in the prediction result based on the corresponding actual volume, and determining the mass of the target tissue in the fruit or vegetable to be analyzed based on the sum of the determined actual masses; and determining the detection result of the fruit or vegetable to be analyzed based on the mass of the target tissue.

[0009] According to some embodiments, determining the corresponding actual mass based on the corresponding actual volume includes: based on the mapping relationship between density and pixel values ​​of computed tomography images, for any pixel point, determining the actual density value corresponding to its own pixel value, and determining the corresponding actual mass based on the product between the corresponding actual volume and the determined actual density value.

[0010] According to some embodiments, the method for determining the mapping relationship between density and pixel values ​​of computed tomography (CT) images includes: for several fruit and vegetable samples of a single fruit and vegetable variety, determining the comprehensive density value of any tissue part and the comprehensive pixel value corresponding to the same tissue part in the CT image; and determining the mapping relationship between density and pixel values ​​of CT images based on the determined correspondence between comprehensive density value and comprehensive pixel value.

[0011] According to some embodiments, determining the corresponding actual volume includes: determining the actual physical size of the pixels in the image to be identified based on the parameters of the computed tomography image of the fruit and vegetable to be analyzed, and determining the corresponding actual volume based on the determined actual physical size.

[0012] According to some embodiments, determining the actual physical size of a pixel in the image to be identified based on the parameters of the computed tomography image of the fruit and vegetable to be analyzed includes: acquiring the parameters of the computed tomography image, the parameters including the X-axis pixel spacing, Y-axis pixel spacing and Z-axis layer thickness in the computed tomography image; and calculating the actual physical size of a single pixel based on the acquired parameters of the computed tomography image.

[0013] According to some embodiments, determining the computed tomography image of the fruit and vegetable to be analyzed as the image to be identified includes at least one of the following: determining the three-dimensional computed tomography image of the fruit and vegetable to be analyzed as the image to be identified; determining multiple two-dimensional slice images obtained based on the three-dimensional computed tomography image of the fruit and vegetable to be analyzed as the image to be identified.

[0014] According to some embodiments, the method further includes: using a pre-trained anomaly detection model to predict abnormal fruit and vegetable regions in the image to be identified.

[0015] According to some embodiments, the abnormal region detection model includes a downsampling layer; the downsampling layer is used to: downsample the input feature map through a convolutional layer to obtain a first downsampled feature map; downsample the input feature map through a pooling layer to obtain a second downsampled feature map; fuse the obtained first downsampled feature map and second downsampled feature map, and output the fusion result.

[0016] A second aspect of this disclosure provides a fruit and vegetable detection device, comprising: an image determination unit for determining a computed tomography (CT) image of a fruit or vegetable to be analyzed as an image to be identified; a segmentation unit for predicting the fruit or vegetable tissue to which pixels in the image to be identified belong using a pre-trained CT image segmentation model; a volume unit for determining the corresponding actual volume for each pixel belonging to the target tissue in the prediction result, and determining the volume of the target tissue in the fruit or vegetable to be analyzed based on the sum of the determined actual volumes; a mass unit for determining the corresponding actual mass for each pixel belonging to the target tissue in the prediction result based on the corresponding actual volume, and determining the mass of the target tissue in the fruit or vegetable to be analyzed based on the sum of the determined actual masses; and a result unit for determining the detection result of the fruit or vegetable to be analyzed based on the mass of the target tissue.

[0017] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above-described fruit and vegetable detection method.

[0018] A fourth aspect of this disclosure also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described fruit and vegetable detection method.

[0019] The fifth aspect of this disclosure also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described fruit and vegetable detection method.

[0020] As can be seen from the above embodiments, by determining the fruit and vegetable information in the fruits and vegetables to be analyzed based on the determined computed tomography images, the loss of fruits and vegetables can be reduced during the detection process.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0022] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0023] Figure 1 schematically illustrates a flowchart of a fruit and vegetable detection method according to an embodiment of the present disclosure;

[0024] Figure 2 schematically illustrates a flowchart of another fruit and vegetable detection method according to an embodiment of the present disclosure;

[0025] Figure 3 schematically illustrates a structural block diagram of a fruit and vegetable detection device according to an embodiment of the present disclosure; and

[0026] Figure 4 schematically illustrates a block diagram of an electronic device suitable for implementing a fruit and vegetable detection method according to an embodiment of the present disclosure. Detailed Implementation

[0027] To enable those skilled in the art to better understand the technical solutions in this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of the embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this disclosure.

[0028] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0029] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0030] When using expressions such as "at least one of A, B, and C," the meaning should generally be interpreted according to the understanding of someone skilled in the art. For example, "a system having at least one of A, B, and C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C. Similarly, when using expressions such as "at least one of A, B, or C," the meaning should generally be interpreted according to the understanding of someone skilled in the art. For example, "a system having at least one of A, B, or C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C.

[0031] In existing fruit and vegetable detection methods, significant losses occur during the process of determining information about the tissue components of fruits and vegetables. For example, determining the volume of the pulp tissue in a fruit requires peeling off the outer shell or peel and removing the pit, resulting in fruit loss. Similarly, determining the volume of the leaf tissue in a vegetable requires removing the leaf tissue, leading to vegetable loss. The method provided in this disclosure allows for the acquisition of a computed tomography (CT) image of any fruit or vegetable to be detected. Further analysis of the CT image is then performed, specifically through an image segmentation model to identify the tissue components within the CT image and to analyze relevant information about the identified tissue components.

[0032] Because it uses computed tomography (CT) scanning, it is possible to obtain images of the inside of fruits and vegetables without peeling or removing any tissue parts, thus reducing fruit and vegetable loss during the inspection process.

[0033] By identifying the tissue components in computed tomography (CT) images of fruits and vegetables, and further analyzing relevant information based on the characteristics of the CT images themselves, the accuracy and efficiency of fruit and vegetable detection can be improved.

[0034] For example, based on the identification results of tissue portions in computed tomography images of fruits and vegetables, and combined with the characteristics of the computed tomography images, the volume and mass of the tissue portions can be determined. Therefore, based on the volume and mass of the tissue portions, the corresponding fruit and vegetable detection results can be determined. The fruit and vegetable detection results may include the volume and mass of the tissue portions, or information such as the quality of the fruits and vegetables.

[0035] Understandably, based on the established information about fruits and vegetables, this information can be directly displayed for user convenience, and the quality of the fruits and vegetables can be determined, and they can be graded, etc.

[0036] In some specific examples, the volume of pulp in lychees can be determined by the method provided in the embodiments of this disclosure, which makes it easier for customers to decide whether they need to buy them; the volume ratio of pulp in mangosteens can also be determined by the method provided in the embodiments of this disclosure, which makes it easier to determine the quality of mangosteens and to grade them according to their quality, etc.

[0037] The fruit and vegetable testing method provided in this disclosure will be explained in detail below with reference to the accompanying drawings.

[0038] As one aspect of the present disclosure, a method for detecting fruits and vegetables is provided. FIG1 schematically shows a flowchart of a method for detecting fruits and vegetables according to an embodiment of the present disclosure.

[0039] The fruit and vegetable detection method according to the embodiments of this disclosure does not limit the specific execution subject. The execution subject can be any electronic device, such as a server, terminal, or detection device, etc.

[0040] As shown in Figure 1, the fruit and vegetable detection method in this embodiment may include the following steps S101-S105.

[0041] In step S101, the computed tomography images of the fruits and vegetables to be analyzed are identified as images to be identified.

[0042] In step S102, a pre-trained image segmentation model is used to predict the fruit and vegetable tissue part to which the pixel in the image to be identified belongs.

[0043] In step S103, for each pixel in the prediction result that belongs to the target tissue part, the corresponding actual volume is determined, and the volume of the target tissue part in the fruit and vegetable to be analyzed is determined based on the sum of the determined actual volumes.

[0044] In step S104, for each pixel in the prediction result that belongs to the target tissue part, the corresponding actual mass is determined based on the corresponding actual volume, and the mass of the target tissue part in the fruit and vegetable to be analyzed is determined based on the sum of the determined actual masses.

[0045] In step S105, the test results of the fruits and vegetables to be analyzed are determined based on the quality of the target tissue portion.

[0046] In the embodiments of this disclosure, an image segmentation model can be used to identify and predict the fruit and vegetable tissue parts to which pixels belong in computed tomography images of fruits and vegetables to be analyzed, thereby improving the accuracy and efficiency of fruit and vegetable tissue part identification. Furthermore, the prediction results of the aforementioned image segmentation model can be combined to further analyze the target tissue part to be analyzed, determine the volume and mass of the target tissue part, and determine the detection result of the fruit and vegetable based on the mass of the target tissue part. This further improves the accuracy and efficiency of determining the detection information of fruit and vegetable tissue parts, building upon the already improved accuracy and efficiency of fruit and vegetable tissue part identification.

[0047] This disclosure does not limit the specific types of fruits and vegetables, which may include at least one of the following: fruits and vegetables, etc. Examples of fruits include bananas, peaches, apples, and kiwis, etc.; examples of vegetables include cabbage, potatoes, and tomatoes, etc. Fruits and vegetables may also include edible fruits, such as sunflower seeds, peanuts, and pine nuts, etc.

[0048] This disclosure does not limit the division of specific tissues in fruits and vegetables. Optionally, the division can be based on the actual tissues in the fruits and vegetables, such as the peel, shell, pulp, and pit of fruits, or the roots, stems, leaves, fruits, and flowers of vegetables; or it can be based on function, such as edible parts and inedible parts.

[0049] This disclosure does not limit the specific definition of the target tissue portion; in fact, it can be any tissue portion of the fruit or vegetable to be analyzed that requires information to be determined as the target tissue portion. For example, if the fruit or vegetable to be analyzed is a watermelon, the target tissue portion can be the flesh of the watermelon.

[0050] Specifically, in step S101, the computed tomography (CT) image of the fruit or vegetable to be analyzed is determined as the image to be identified. In this step, the method of determining the fruit or vegetable to be analyzed is not limited. Optionally, any fruit or vegetable can be determined as the fruit or vegetable to be analyzed, or the fruit or vegetable to be scanned and analyzed can be determined as the fruit or vegetable to be analyzed, or the fruit or vegetable within a preset scanning area can be determined as the fruit or vegetable to be analyzed. For example, the device using the fruit and vegetable detection method can be used to capture CT images; specifically, a scanning device can be used to capture CT images of a preset scanning area, thereby determining the fruit or vegetable within the preset scanning area as the fruit or vegetable to be analyzed.

[0051] Furthermore, the fruit and vegetable detection method does not limit the quantity and type of fruits and vegetables to be analyzed. Optionally, multiple fruits and vegetables can be identified as those to be analyzed, and the computed tomography (CT) image can include image information of multiple fruits and vegetables. These multiple fruits and vegetables can include different fruits and vegetables belonging to the same species, or different fruits and vegetables belonging to different species.

[0052] Exemplarily, the fruit and vegetable detection method does not limit the method of determining the computed tomography (CT) images of the fruit and vegetable to be analyzed. Optionally, a CT scan can be performed on the fruit and vegetable to be analyzed in real time to obtain CT images; alternatively, pre-stored CT images of the fruit and vegetable to be analyzed can be acquired. The CT images can be used to characterize the overall information of the fruit and vegetable to be analyzed, which may include information about the internal structure of the fruit and vegetable. The fruit and vegetable detection method also does not limit the specific form of the CT images of the fruit and vegetable to be analyzed. Optionally, the CT images can be in the form of three-dimensional images or multiple two-dimensional images, specifically used to characterize the overall information of the fruit and vegetable to be analyzed (including internal information). It is understood that multiple two-dimensional images can be obtained by segmenting a three-dimensional image.

[0053] In other words, in the embodiments of this disclosure, corresponding to the specific form of the above-mentioned computed tomography scan image, the computed tomography scan image of the fruit and vegetable to be analyzed is determined as the image to be identified, which can specifically be at least one of the following: 1) the computed tomography scan three-dimensional image of the fruit and vegetable to be analyzed is determined as the image to be identified; 2) multiple two-dimensional slice images obtained based on the computed tomography scan three-dimensional image of the fruit and vegetable to be analyzed are determined as the image to be identified.

[0054] For example, a two-dimensional slice image can be a CT slice. A CT slice refers to a two-dimensional cross-sectional image generated by CT technology. It is reconstructed using X-ray data and can provide detailed information about the interior of the scanned object. Each slice represents a cross-section of the object being measured at a specific location, and the slice thickness can be set in millimeters.

[0055] Understandably, in one optional embodiment, a computed tomography three-dimensional image of the fruit and vegetable to be analyzed can be divided into multiple two-dimensional segmented images along multiple different directions and used together as the image to be identified for fruit and vegetable detection. This allows for fruit and vegetable detection from multiple different angles, improving the accuracy and comprehensiveness of fruit and vegetable detection.

[0056] Specifically, in step S102, a pre-trained image segmentation model is used to predict the fruit and vegetable tissue part to which the pixel in the image to be identified belongs.

[0057] In this step, the specific model structure of the image segmentation model is not limited, nor is the specific image segmentation algorithm used by the image segmentation model limited. Optionally, the image segmentation model may specifically adopt image segmentation algorithms such as U-Net (U-shaped Network), V-Net, Attention U-Net, 3D U-net, YOLO (You Only Look Once) v5 / v8, etc.

[0058] Optionally, the image segmentation model can be used to predict the fruit or vegetable tissue to which a pixel in the image belongs, based on a computed tomography image of a single fruit or vegetable species. In this embodiment, prediction can be based on an image segmentation model that focuses on a single fruit or vegetable species. Since the image segmentation model focuses on a single fruit or vegetable species, the training difficulty of the image segmentation model can be reduced, the training efficiency and training effect of the image segmentation model can be improved, and the prediction accuracy and prediction efficiency of the image segmentation model can also be improved.

[0059] Optionally, the image segmentation model can also predict only a single fruit or vegetable tissue portion, specifically whether a pixel in the input image belongs to a specified fruit or vegetable tissue portion. The specified fruit or vegetable tissue portion can be the target tissue portion in step S103. The image segmentation model can be used to predict whether a pixel in the input image belongs to the target tissue portion.

[0060] In the embodiments of this disclosure, the specific training method of the image segmentation model is not limited. Optionally, during the training process, the image quality in the samples can be improved. Specifically, image enhancement processing can be performed on the original computed tomography (CT) images to adjust the contrast, brightness, and sharpness of the images, thereby improving the image quality and readability. For example, histogram equalization and adjusting window width and level can be used to enhance the overall contrast of the image, highlight the details of different tissues, and improve the visibility of details; noise reduction methods such as Gaussian filtering and mean filtering can be used to reduce or remove noise in the image to improve image quality; edge enhancement methods such as Laplacian operator and Sobel operator can be used to improve the sharpness of edges in the image. Then, the processed CT images need to be segmented, labeled, and formatted to mark the regions of different tissue parts, such as the kernel, pulp, and shell. Finally, the processed sample data is divided into training, validation, and test sets for training the image segmentation model. Regarding the image segmentation model, deep learning image segmentation techniques can be used to identify and locate tissue parts. In terms of model evaluation, metrics such as Dice, precision, and recall can be used for assessment.

[0061] In step S103, for each pixel in the prediction result belonging to the target tissue portion, the corresponding actual volume is determined, and the volume of the target tissue portion in the fruit or vegetable to be analyzed is determined based on the sum of the determined actual volumes. For example, the actual physical size corresponding to the pixel in the image to be identified can be determined based on the parameters of the computed tomography image of the fruit or vegetable to be analyzed, and the corresponding actual volume can be determined based on the determined actual physical size.

[0062] In some exemplary embodiments, the actual physical dimensions of a single pixel in three-dimensional space can be determined based on the parameters of the computed tomography (CT) image of the fruit or vegetable to be analyzed. Specifically, the image parameters may include the length, width, and height of this three-dimensional space, thereby allowing the calculation of the actual volume of the three-dimensional space, which is then used as the actual volume corresponding to that pixel. It should be noted that, in the case of CT images, a single pixel can be understood as a three-dimensional voxel in the CT image.

[0063] For example, determining the actual volume corresponding to a single pixel based on parameters of a computed tomography image can be achieved through the following steps.

[0064] First, obtain the parameters of the computed tomography (CT) image. For example, these parameters can be obtained from the CT equipment's configuration file. The CT image may include an XYZ coordinate system, and the parameters may include: X-axis pixel spacing, Y-axis pixel spacing, and Z-axis slice thickness. The X-axis and Y-axis pixel spacing are the actual physical dimensions of a single pixel in the XY plane, and this pixel spacing can be determined by the detector spacing and reconstruction algorithm of the CT scan. The Z-axis slice thickness is the inter-slice spacing between adjacent tomographic images, which can be determined by the collimation width and scanning mode of the CT equipment.

[0065] Then, based on the parameters of the acquired computed tomography (CT) image, the actual physical size corresponding to a single pixel is calculated. For example, the actual physical size corresponding to a single pixel can be calculated using the following formula:

[0066] Vvoxel=Δx×Δy×Δz

[0067] Where Δx and Δy represent the pixel spacing along the X-axis and the pixel spacing along the Y-axis, respectively, Δz represents the layer thickness along the Z-axis, and Vvoxel represents the actual physical size of a single pixel (i.e., the actual physical size of a voxel).

[0068] In the embodiments of this disclosure, the actual volume corresponding to a pixel can be determined by combining parameters from a computed tomography (CT) image, thereby improving the efficiency and accuracy of determining the actual volume corresponding to a pixel. Furthermore, through standardized parameter extraction and geometric calculation, a precise mapping from two-dimensional pixels to three-dimensional physical space is achieved, providing a foundation for subsequent accurate calculation of the volume of the target tissue.

[0069] Optionally, in a computed tomography (CT) image, the actual volume corresponding to different pixels can be the same. Accordingly, the sum of the actual volumes can be determined by multiplying the number of pixels belonging to the target tissue in the predicted result with the determined actual volume. Alternatively, in a CT image, the actual volume corresponding to different pixels may also be different. Accordingly, the actual volume corresponding to each pixel belonging to the target tissue in the predicted result can be determined separately, and then the actual volumes corresponding to each pixel can be summed to determine the sum of the actual volumes.

[0070] For example, all voxels have the same volume size. In this case, for each pixel v... i , i = 1, ..., N, the specific voxel volume size V(v i ) = V0, where N is the total number of pixels, or the total number of voxels. Therefore, the overall volume can be expressed as:

[0071] The above formula allows for the convenient calculation of the sum of the actual volumes of each pixel belonging to the target tissue.

[0072] For example, information about mangosteen can be determined, specifically the volume of its pulp. Therefore, a computed tomography (CT) 3D image of the mangosteen to be analyzed can be acquired first, and this image can be identified as the target image. Then, a pre-trained image segmentation model can be used to predict the fruit / vegetable tissue to which each pixel in the image belongs; specifically, it can predict whether a pixel belongs to the pulp tissue. For each pixel that is predicted to belong to the pulp tissue, its corresponding actual volume is determined, and the sum of these determined actual volumes is used to determine the volume of the pulp tissue in the mangosteen being analyzed.

[0073] In step S104, for each pixel in the prediction result that belongs to the target tissue part, the corresponding actual mass is determined based on the corresponding actual volume, and the mass of the target tissue part in the fruit and vegetable to be analyzed is determined based on the sum of the determined actual masses.

[0074] In some optional embodiments, the mass of the target tissue portion can be determined based on the actual volume of the target tissue portion determined in the above steps, combined with the density of the target tissue portion; or the mass of the target tissue portion can be estimated based on the actual volume ratio of the target tissue portion, combined with the total mass of the fruits and vegetables to be analyzed. Specifically, the mass of the target tissue portion can be determined by multiplying the total mass of the fruits and vegetables to be analyzed by the actual volume ratio of the target tissue portion.

[0075] In some preferred embodiments of this disclosure, the actual quality corresponding to each pixel can be determined, thereby determining the quality of the target tissue portion based on the sum of the actual qualities corresponding to each pixel belonging to the target tissue portion in the prediction result. Optionally, for each pixel belonging to the target tissue portion in the prediction result, the corresponding actual quality distribution can be determined, and the average actual quality can be determined based on the determined actual quality distribution. The product between the average actual quality and the number of pixels in the target tissue portion can be used to determine the sum of the actual qualities. Alternatively, for each pixel belonging to the target tissue portion in the prediction result, the actual qualities corresponding to the pixels in the target tissue portion can be summed to obtain the sum of the actual qualities.

[0076] In this embodiment, the actual mass corresponding to a pixel is determined by combining the actual volume of the pixel, so as to determine the mass of the target tissue part. This can improve the comprehensiveness of the fruit and vegetable information obtained from the analysis, improve the accuracy of the mass determined for the fruit and vegetable tissue parts, and reduce fruit and vegetable loss in the process of determining the mass of the fruit and vegetable tissue parts.

[0077] In embodiments of this disclosure, the density of a target tissue portion can be determined by combining pixel values ​​in a computed tomography image.

[0078] The basic principle of computed tomography (CT) imaging is to reflect the physical structure and density of a material by measuring the attenuation of X-rays as they propagate through it. The atomic number and density of a material have a significant impact on the attenuation coefficient. Generally speaking, the denser the material, the more X-rays are absorbed, resulting in a higher CT value (i.e., the pixel value of the computed tomography image).

[0079] When X-rays penetrate fruit, the calculated density (CT) values ​​are similar for the same or similar components, but often differ significantly for completely different components. Therefore, the CT values ​​of the analyzed fruits and vegetables can be used as a mapping to density. In other words, a mapping relationship can be established between the CT value and density of each component in the analyzed fruits and vegetables, allowing the determination of the density corresponding to different CT values ​​based on this mapping relationship.

[0080] Furthermore, based on the mapping relationship between density and pixel values ​​in computed tomography images, for any pixel, the actual density value corresponding to its own pixel value is determined, and the corresponding actual mass is determined by the product between the corresponding actual volume and the determined actual density value.

[0081] In this embodiment, the actual quality corresponding to a pixel can be determined by combining the mapping relationship between density and pixel values ​​of computed tomography images, thereby improving the accuracy of the quality determined for fruit and vegetable tissues.

[0082] Specifically, the above mapping relationship includes two variables: density and pixel value of computed tomography (CT) image. The mapping relationship can be used to reflect the correlation and change between these two variables. Specifically, it can be the mapping relationship between pixel value and corresponding actual density for any pixel in a CT image.

[0083] However, the pixel values ​​corresponding to the target tissue portion in the predicted result may differ in the computed tomography (CT) image. Therefore, the actual density corresponding to each pixel value can be determined pixel-by-pixel, and the corresponding actual mass can be calculated. Finally, the sum of the actual masses corresponding to all pixels belonging to the target tissue portion in the predicted result can be determined.

[0084] In one optional embodiment, data from fruit and vegetable samples can be collected first. Specifically, data such as the actual density of the samples and the actual pixel values ​​of the samples in computed tomography (CT) images can be collected. Through data analysis, the mapping relationship between density and pixel values ​​in CT images can be determined.

[0085] Regarding density, optionally, pixel values ​​in computed tomography images are often determined for individual pixels, but the density corresponding to a single pixel is often difficult to determine. Typically, the overall density is determined for the entire fruit and vegetable sample, using both volume and mass, or it can be determined for the tissue portion within a single fruit and vegetable sample, using both volume and mass. Therefore, when collecting fruit and vegetable sample data, either the overall density of the fruit and vegetable sample or the overall density of the tissue portion within the sample can be collected.

[0086] Regarding pixel values, optionally, since the whole fruit and vegetable sample corresponds to multiple pixels in the computed tomography (CT) image, a single pixel value can be determined as a representative value by combining the pixel values ​​of the whole fruit and vegetable sample in the CT image. For ease of description, this can be called the composite pixel value. This embodiment does not limit the method of determining the composite pixel value; specifically, it can be a statistical value of the pixel values ​​corresponding to the whole fruit and vegetable sample in the CT image, such as the mean pixel value, the weighted mean pixel value, or the mode pixel value, etc. Similarly, for the tissue portion of the fruit and vegetable sample, a composite pixel value can also be determined by combining the pixel values ​​of the tissue portion in the CT image.

[0087] As an example, the collected fruit and vegetable sample data can specifically be the overall density of the fruit and vegetable sample as a whole, and the correspondence between the overall pixel values ​​of a single fruit and vegetable sample in a computed tomography image; or it can be the overall density of the tissue portion in the fruit and vegetable sample, and the correspondence between the overall pixel values ​​of the same tissue portion in a single fruit and vegetable sample in a computed tomography image.

[0088] For example, if it is necessary to determine a mapping relationship applicable to multiple different types of fruits and vegetables, data collected for different fruit and vegetable types can be selected. Specifically, multiple fruit and vegetable samples of different types can be selected, and the overall density value and corresponding overall pixel value of each sample can be determined for subsequent data analysis to determine the mapping relationship. Alternatively, multiple fruit and vegetable samples of different types can be selected, and the overall density value and corresponding overall pixel value of each tissue portion can be determined for subsequent data analysis to determine the mapping relationship.

[0089] To determine a mapping relationship applicable to a single fruit or vegetable variety, data can be collected from fruit and vegetable samples of that variety. Specifically, multiple samples of a single fruit or vegetable variety can be selected, and the overall density and corresponding pixel values ​​of each sample can be determined for subsequent data analysis to establish the mapping relationship. Alternatively, multiple samples of a single fruit or vegetable variety can be selected, and the overall density and corresponding pixel values ​​of each tissue portion can be determined for subsequent data analysis to establish the mapping relationship.

[0090] If it is necessary to determine the mapping relationship that can be applied to a single tissue part (referred to as the target tissue part for ease of description) in a single fruit and vegetable variety, you can choose to collect data for the target tissue part in a single fruit and vegetable variety. Specifically, you can choose multiple fruit and vegetable samples for a single fruit and vegetable variety, and determine the comprehensive density value and the corresponding comprehensive pixel value of the target tissue part for subsequent data analysis to determine the mapping relationship.

[0091] In other words, in some embodiments, the method for determining the mapping relationship between density and pixel values ​​of computed tomography images may specifically include the following steps: for several fruit and vegetable samples of a single fruit and vegetable variety, determine the comprehensive density value of any tissue part and the comprehensive pixel value of the same tissue part in the computed tomography image; based on the determined correspondence between the comprehensive density value and the comprehensive pixel value, determine the mapping relationship between density and pixel values ​​of the computed tomography image.

[0092] It should be noted that the embodiments of this disclosure are not limited to the form of the mapping relationship. Optionally, the mapping relationship can be in the form of a function or in the form of multiple sets of numerical pairs.

[0093] For example, based on the correspondence between the comprehensive density value and the comprehensive pixel value in fruit and vegetable sample data, the mapping relationship can be determined through numerical analysis, specifically through regression analysis. In a concrete example, the correspondence between the comprehensive density value and the comprehensive pixel value can be defined as a series of coordinate values, thereby allowing regression analysis to determine a functional relationship between density and pixel values ​​in computed tomography images. This functional relationship can be defined as the aforementioned mapping relationship.

[0094] In this embodiment, determining the mapping relationship for samples of a single fruit and vegetable species can improve the accuracy of the mapping relationship between the density of a single fruit and vegetable species and the pixel values ​​of a computed tomography image, and further improve the accuracy of the quality determined for the tissue parts of fruits and vegetables.

[0095] For example, the mapping relationship between density ρ and pixel value (i.e. CT value of pixel) x in a computed tomography image is a mapping relationship f, such that ρ = f(x).

[0096] Since mass = volume multiplied by density, and mass can be calculated by summing the mass elements (mass of each pixel), and for volume, the voxels of each pixel can be represented by v. i Let i = 1, ..., N, and represent the specific voxel volume V(v i ) = V0, and the CT value of each pixel can be represented as x i Let i = 1, ..., N, where N is the total number of pixels. Therefore, the total mass M of the object can be expressed as:

[0097] Using the above formula, the mapping relationship f(x) between density and pixel values ​​in computed tomography images can be combined to easily calculate the sum of the actual masses of each pixel belonging to the target tissue.

[0098] For example, for a target fruit A, its target tissue parts can be denoted as a, b, c, ... By measuring the mass and volume of multiple sets of samples, the corresponding comprehensive density is calculated. Then, combined with the CT value of the measured sample, regression analysis is used to analyze and establish the mapping relationship f(x) between density and CT value. In this way, mapping relationships between different tissue parts of various fruits can be established.

[0099] In image segmentation, each pixel is assigned a label indicating which tissue part it belongs to. Therefore, based on the segmentation results of a fruit CT image, the number of voxels for each target category (tissue part) can be calculated.

[0100] Then, methods such as absolute error, mean absolute error, mean squared error, and relative error can be used to measure the quality value M among n samples. C and the true value of quality M T The difference in MSE between the two methods is used to evaluate the computational accuracy of the scheme. For example:

[0101] After determining the error and calculation accuracy, some values ​​set in the previous calculation process can be further adjusted to improve the calculation accuracy and reduce the error.

[0102] In step S105, the test results of the fruits and vegetables to be analyzed are determined based on the quality of the target tissue portion. Optionally, the volume and quality of the target tissue portion can be used as the test results of the fruits and vegetables to be analyzed; alternatively, the quality of the fruits and vegetables to be analyzed can be determined based on the quality of the target tissue portion according to a preset fruit and vegetable quality standard, and the determined quality of the fruits and vegetables can be used as the test results, thereby enabling automatic detection of fruit and vegetable quality.

[0103] Figure 2 schematically illustrates a flowchart of another fruit and vegetable detection method according to an embodiment of the present disclosure. As shown in Figure 2, the fruit and vegetable detection method in this embodiment may include the following steps S201-S206.

[0104] In step S201, the computed tomography images of the fruits and vegetables to be analyzed are identified as images to be identified.

[0105] In step S202, a pre-trained image segmentation model is used to predict the fruit and vegetable tissue part to which the pixel in the image to be identified belongs.

[0106] In step S203, for each pixel in the prediction result that belongs to the target tissue part, the corresponding actual volume is determined, and the volume of the target tissue part in the fruit and vegetable to be analyzed is determined based on the sum of the determined actual volumes.

[0107] In step S204, for each pixel in the prediction result that belongs to the target tissue part, the corresponding actual mass is determined based on the corresponding actual volume, and the mass of the target tissue part in the fruit and vegetable to be analyzed is determined based on the sum of the determined actual masses.

[0108] In step S205, a pre-trained abnormal region detection model is used to predict abnormal fruit and vegetable regions in the image to be identified.

[0109] In step S206, the detection results of the fruits and vegetables to be analyzed are determined based on the abnormal areas of the fruits and vegetables and the quality of the target tissue.

[0110] It should be noted that steps S201-S204 can be referred to the descriptions of steps S101-S104 above, and will not be repeated here.

[0111] In this embodiment, other information, such as abnormal regions within the fruit and vegetable being analyzed, can be determined based on computed tomography images. The detected abnormal regions can be used to determine the detection result of the fruit and vegetable being analyzed. Specifically, the detection result is determined based on the detected abnormal regions and the quality of the target tissue portion. This can be either determining the quality of the fruit and vegetable as the detection result, or determining the detection result based on both the detected abnormal regions and the quality of the target tissue portion.

[0112] In the embodiments of this disclosure, the specific form of abnormal areas in fruits and vegetables is not limited. Optionally, abnormal areas in fruits and vegetables can specifically refer to areas in the fruits and vegetables that exhibit abnormalities, including at least one of the following: damage or cracking on the surface of the fruits and vegetables, internal or external pests and diseases, and decay, etc. Abnormal areas can be located on the surface of the fruits and vegetables or inside the fruits and vegetables.

[0113] Since computed tomography (CT) images can be used to characterize the overall information of the fruits and vegetables being analyzed, including their internal information, detecting and identifying abnormal regions in the fruits and vegetables based on CT images can improve the comprehensiveness and accuracy of abnormal region detection.

[0114] Optionally, machine learning, specifically using a pre-trained deep learning model, can be used to predict and determine abnormal regions in fruits and vegetables. Specifically, the above method may further include: using a pre-trained anomaly detection model to predict abnormal regions in the image to be identified. In this embodiment, abnormal regions can be predicted as determined fruit and vegetable information, thereby improving the comprehensiveness of the analyzed fruit and vegetable information, increasing the accuracy of predictions for abnormal regions, and reducing fruit and vegetable loss during the anomaly detection process by performing anomaly detection on the image to be identified, i.e., on the computed tomography (CT) image.

[0115] The anomaly region detection model in this embodiment can be used to predict abnormal fruit and vegetable regions in an input image. Specifically, it can be used to predict whether a pixel in the input image belongs to an abnormal fruit and vegetable region. Optionally, the anomaly region detection model can be used to predict abnormal fruit and vegetable regions for input images of multiple different fruit and vegetable varieties, or it can be used to predict abnormal fruit and vegetable regions for input images of a single fruit and vegetable variety.

[0116] Optionally, the anomaly detection model can be used to predict abnormal regions in computed tomography images of fruits and vegetables for a single variety. Because the anomaly detection model can focus on a single fruit or vegetable variety, it reduces the training difficulty, improves training efficiency and effectiveness, and ultimately enhances detection accuracy.

[0117] Optionally, the anomaly detection model can be a target detection model, specifically employing algorithms such as Region-based Convolutional Neural Networks (RCNN), YOLO (You Only Look Once), SSD (Single Shot Multibox Detector), DETR (Detection Transformer), etc.

[0118] Optionally, the anomaly detection model can be used to predict the existence and location of anomaly regions in an image. The location of anomaly regions can be represented by detection boxes or coordinate boxes. The original computed tomography images can be preprocessed to adjust contrast, brightness, and sharpness, improving image quality and readability. Then, data augmentation techniques are used to generate more samples. Because the sample size for anomalies such as damage, cracks, and pests is relatively small, data augmentation and data synthesis methods can be used to expand the sample size. On the one hand, data augmentation methods such as flipping, translation, scaling, and color transformation can be used to expand the sample size; on the other hand, synthetic data and generative adversarial networks can be used to create more samples. Finally, the processed samples are labeled, and the labeled samples are divided into training, validation, and test sets. For model evaluation, metrics such as precision, recall, and mean AP50 can be used for evaluation.

[0119] Preferably, the anomaly region detection model may include a downsampling layer; the downsampling layer may be used to: downsample the input feature map through a convolutional layer to obtain a first downsampled feature map; downsample the input feature map through a pooling layer to obtain a second downsampled feature map; fuse the obtained first downsampled feature map and second downsampled feature map, and output the fusion result.

[0120] In this embodiment, the efficiency and effectiveness of downsampling can be improved by using parallel convolutional and pooling downsampling layers in the downsampling layer, and by fusing the two downsampling results. This enhances the feature extraction performance of the anomaly detection model and further improves the accuracy of anomaly detection. Optionally, the anomaly detection model can also employ an attention mechanism to extract global and local features from the input feature map, and further fuse these features for subsequent prediction, thereby improving feature extraction performance and the prediction accuracy of the anomaly detection model. Optionally, the anomaly detection model can also include an upsampling layer. The upsampling layer can be used to perform upsampling through DUpsampling, thereby improving feature extraction performance and the prediction accuracy of the anomaly detection model.

[0121] In a specific example, to improve the accuracy of identifying anomalous regions, the downsampling and upsampling layers can be improved. The new downsampling layer combines convolutional and max-pooling layers, generating a new feature map by fusing the feature information from both. The upsampling layer introduces DUpsampleing, achieving efficient upsampling of the feature map through a series of 1x1 convolutions and feature reshaping operations. Furthermore, an attention-based feature fusion module is embedded in the backbone, effectively fusing global and local features through a multi-channel attention mechanism, enabling better capture of the target's detailed information.

[0122] In addition, optionally, to improve the comprehensiveness and accuracy of abnormal region detection, two-dimensional segmented images obtained by segmenting the three-dimensional computed tomography (CT) image of the fruit and vegetable to be analyzed along multiple different directions can be determined. For ease of description, multiple groups of two-dimensional segmented images can be determined from the three-dimensional CT image of the fruit and vegetable to be analyzed; any one of these two-dimensional segmented image groups is obtained by segmenting the three-dimensional CT image of the fruit and vegetable to be analyzed along one direction. Different groups of two-dimensional segmented image groups are obtained by segmenting along different directions. Then, abnormal regions of the fruit and vegetable to be analyzed can be detected for different groups of two-dimensional segmented image groups using this embodiment. Since different groups of two-dimensional segmented image groups can represent the overall information of the fruit and vegetable to be analyzed from different angles, the comprehensiveness and accuracy of abnormal region detection can be improved. Specifically, multiple determined groups of two-dimensional segmented image groups can all be used as images to be identified, and abnormal regions can be detected using this embodiment.

[0123] In this embodiment, the determined information about the fruits and vegetables to be analyzed can be directly displayed, or it can be used for fruit and vegetable quality analysis, anomaly detection to select high-quality fruits and vegetables without abnormal areas, or for fruit and vegetable sorting or screening. For example, based on the determined information, the quality of fruits and vegetables can be determined according to preset rules, thereby achieving automatic quality determination, improving the efficiency of quality determination, and reducing fruit and vegetable losses during the quality determination process. A specific example of a preset rule could be that fruits with a flesh percentage greater than a preset flesh percentage threshold, a flesh volume greater than a preset flesh volume threshold, and no abnormal areas can be determined as excellent quality.

[0124] The embodiments disclosed herein are not limited to specific product forms used to implement the above method embodiments.

[0125] In one alternative embodiment, the above method embodiments can be implemented by any electronic device. For example, the above method embodiments can be implemented by a server, which can provide a fruit and vegetable detection service and determine fruit and vegetable information based on uploaded computed tomography (CT) scan images of the fruits and vegetables to be analyzed. Alternatively, the above method embodiments can be implemented by a terminal, allowing a user to determine fruit and vegetable information based on acquired CT scan images of the fruits and vegetables to be analyzed.

[0126] Alternatively, the above-described method embodiments can be implemented using a detection device. This detection device may be equipped with the function of capturing computed tomography (CT) images, thereby integrating the functions of capturing CT images and determining fruit and vegetable information based on the captured images.

[0127] For example, the detection equipment can be used to take computed tomography images of objects in a detection area. Then, based on the captured images, the fruit and vegetable information can be determined using the methods described above, thereby achieving automated determination of fruit and vegetable information, improving the efficiency of determining fruit and vegetable information, realizing high-throughput automated detection of the internal and external quality of fruits and vegetables, and reducing detection losses.

[0128] In one specific example, the aforementioned testing equipment can be deployed in fruit and vegetable factories or fruit and vegetable vendors to determine the quality of fruits and vegetables; alternatively, the aforementioned testing equipment can be deployed on fruit and vegetable production lines. After determining the information of the fruits and vegetables, the equipment on the production line can be further controlled for sorting. For example, for fruits whose pulp volume is greater than a preset volume threshold detected by the testing equipment, they can be transported to the sorting area corresponding to the quality of the fruits and vegetables through a robotic arm or sorting device.

[0129] Based on the above method embodiments, this disclosure also provides a fruit and vegetable detection device. The device will be described in detail below with reference to FIG3.

[0130] Figure 3 schematically illustrates a structural block diagram of a fruit and vegetable detection device according to an embodiment of the present disclosure.

[0131] As shown in Figure 3, the fruit and vegetable detection device 400 in this embodiment may include an image determination unit 410, a segmentation unit 420, a volume unit 430, a mass unit 440, and a result unit 450.

[0132] The image determination unit 410 is used to determine the computed tomography scan image of the fruit and vegetable to be analyzed as the image to be identified. In one embodiment, the image determination unit 410 may be used to perform the operation S101 or S201 described above, which will not be repeated here.

[0133] The segmentation unit 420 is used to predict the fruit and vegetable tissue portion to which a pixel in the image to be identified belongs, using a pre-trained computed tomography image segmentation model. In one embodiment, the segmentation unit 420 may be used to perform the operations S102 or S202 described above, which will not be repeated here.

[0134] The volume unit 430 is used to determine the corresponding actual volume for each pixel point belonging to the target tissue portion in the prediction result, and to determine the volume of the target tissue portion in the fruit and vegetable to be analyzed based on the sum of the determined actual volumes. In one embodiment, the volume unit 430 can be used to perform the operation S103 or S203 described above, which will not be repeated here.

[0135] The quality unit 440 is used to determine the actual mass of each pixel belonging to the target tissue portion in the prediction result based on its corresponding actual volume, and to determine the mass of the target tissue portion in the fruit or vegetable to be analyzed based on the sum of the determined actual masses. In one embodiment, the quality unit 440 can be used to perform the operations S104 or S204 described above, which will not be repeated here.

[0136] Results unit 450 is used to determine the test results of the fruits and vegetables to be analyzed based on the quality of the target tissue portion.

[0137] According to embodiments of this disclosure, any plurality of modules among the image determination unit 410, segmentation unit 420, volume unit 430, quality unit 440, and result unit 450 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the image determination unit 410, segmentation unit 420, volume unit 430, quality unit 440, and result unit 450 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any one of the three implementation methods or a suitable combination of any of them.

[0138] Figure 4 schematically illustrates a block diagram of an electronic device suitable for implementing a fruit and vegetable detection method according to an embodiment of the present disclosure.

[0139] As shown in FIG. 4, an electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage portion 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0140] RAM 903 stores various programs and data required for the operation of electronic device 900. Processor 901, ROM 902, and RAM 903 are interconnected via bus 904. Processor 901 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 902 and / or RAM 903. It should be noted that the programs may also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.

[0141] According to embodiments of this disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to a bus 904. The electronic device 900 may also include one or more of the following components connected to the input / output (I / O) interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.

[0142] This disclosure also provides a computer-readable storage medium, which may be included in the apparatus described in the above embodiments; or it may exist independently and not assembled into the apparatus. The computer-readable storage medium carries one or more programs, which, when executed, implement the fruit and vegetable detection method provided in the embodiments of this disclosure or any of the above method embodiments.

[0143] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 902 and / or RAM 903 and / or one or more memories other than ROM 902 and RAM 903 described above.

[0144] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the fruit and vegetable detection method provided in the embodiments of this disclosure or any of the above-described method embodiments.

[0145] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 909, and / or installed from a removable medium 911. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0146] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of this disclosure. It should be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two connected blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and combinations of blocks in the block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0147] Those skilled in the art will understand that the features described in the various embodiments of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments of this disclosure can be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

Claims

1. A method for detecting fruits and vegetables, comprising: The computed tomography images of the fruits and vegetables to be analyzed are identified as the images to be identified. Using a pre-trained image segmentation model, predict the fruit and vegetable tissue part to which the pixel in the image to be identified belongs; For each pixel in the prediction result that belongs to the target tissue part, the corresponding actual volume is determined, and the volume of the target tissue part in the fruit and vegetable to be analyzed is determined based on the sum of the determined actual volumes. For each pixel in the prediction result that belongs to the target tissue part, the corresponding actual mass is determined based on the corresponding actual volume, and the mass of the target tissue part in the fruit and vegetable to be analyzed is determined based on the sum of the determined actual masses. as well as The test results of the fruits and vegetables to be analyzed are determined based on the quality of the target tissue portion.

2. The fruit and vegetable inspection method according to claim 1, wherein The step of determining the corresponding actual mass based on the corresponding actual volume includes: based on the mapping relationship between density and pixel values ​​of computed tomography images, for any pixel point, determining the actual density value corresponding to its own pixel value, and determining the corresponding actual mass based on the product between the corresponding actual volume and the determined actual density value.

3. The fruit and vegetable inspection method according to claim 2, wherein The method for determining the mapping relationship between density and pixel values ​​of computed tomography images includes: For several fruit and vegetable samples of a single fruit and vegetable variety, the comprehensive density value of any tissue portion and the corresponding comprehensive pixel value of the same tissue portion in a computed tomographic image were determined; and Based on the established correspondence between the comprehensive density value and the comprehensive pixel value, the mapping relationship between density and pixel value of computed tomography image is determined.

4. The fruit and vegetable detection method according to any one of claims 1 to 3, wherein, The determination of the corresponding actual volume includes: determining the actual physical size of the pixels in the image to be identified based on the parameters of the computed tomography image of the fruit and vegetable to be analyzed, and determining the corresponding actual volume according to the determined actual physical size.

5. The fruit and vegetable inspection method according to claim 4, wherein The determination of the actual physical size of pixels in the image to be identified based on parameters of the computed tomography image of the fruit and vegetable to be analyzed includes: Obtain parameters of the computed tomography (CT) image, including the X-axis pixel spacing, Y-axis pixel spacing, and Z-axis slice thickness in the CT image; Calculate the actual physical size of a single pixel based on the parameters of the acquired computed tomography image.

6. The fruit and vegetable detection method according to any one of claims 1 to 5, wherein, The process of identifying the computed tomography images of the fruits and vegetables to be analyzed as images to be identified includes at least one of the following: The computed tomography three-dimensional images of the fruits and vegetables to be analyzed are identified as the images to be identified. Multiple two-dimensional slice images obtained from the three-dimensional computed tomography images of the fruits and vegetables to be analyzed are identified as images to be identified.

7. The fruit and vegetable inspection method according to any one of claims 1 to 6, further comprising: An anomaly detection model, which is pre-trained, is used to predict abnormal fruit and vegetable regions in the image to be identified.

8. The fruit and vegetable inspection method according to claim 7, wherein The abnormal region detection model includes a downsampling layer; The downsampling layer is used to: downsample the input feature map through a convolutional layer to obtain a first downsampled feature map; downsample the input feature map through a pooling layer to obtain a second downsampled feature map; fuse the obtained first downsampled feature map and second downsampled feature map, and output the fusion result.

9. A fruit and vegetable detection device, comprising: The image determination unit is used to determine the computed tomography images of the fruits and vegetables to be analyzed as images to be identified. The segmentation unit is used to predict the fruit and vegetable tissue part to which the pixel in the image to be identified belongs by using a pre-trained computed tomography image segmentation model; A volume unit is used to determine the actual volume of each pixel in the prediction result that belongs to the target tissue part, and to determine the volume of the target tissue part in the fruit and vegetable to be analyzed based on the sum of the determined actual volumes. A mass unit is used to determine the actual mass of each pixel in the prediction result that belongs to the target tissue part based on the corresponding actual volume, and to determine the mass of the target tissue part in the fruit and vegetable to be analyzed based on the sum of the determined actual masses. The result unit is used to determine the test results of the fruit and vegetable to be analyzed based on the quality of the target tissue portion.

10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The one or more processors execute the one or more computer programs to implement the steps of the fruit and vegetable detection method according to any one of claims 1 to 8.

11. A computer readable storage medium having stored thereon a computer program or instructions, wherein, When the computer program or instructions are executed by the processor, they implement the steps of the fruit and vegetable detection method according to any one of claims 1 to 8.

12. A computer program product comprising computer programs or instructions, wherein, When the computer program or instructions are executed by the processor, they implement the steps of the fruit and vegetable detection method according to any one of claims 1 to 8.