A method, device, medium and equipment for detecting and evaluating quality of fruits
By employing multi-dimensional detection and radar chart construction methods, the problem of the singularity of traditional fruit quality detection is solved, enabling precise grading and standardized evaluation of fruit quality, and improving the accuracy and efficiency of detection results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2026-03-31
AI Technical Summary
Traditional fruit quality testing methods focus on a single dimension, which cannot comprehensively reflect the true quality of fruit and is difficult to meet the modern market's demand for precise grading and standardization of fruit quality.
A multi-dimensional detection method is adopted, including safety, quality and appearance detection. Initial detection data is obtained, target detection data is screened, pre-processed, and a radar chart is constructed to calculate the quality score. The radar chart coordinate axis and data points are determined by the pre-set arrangement order and angle, and the area of the graphic is calculated to characterize the fruit quality.
This improves the accuracy and efficiency of fruit quality testing, ensures the rationality and reliability of test results, and can more accurately reflect the overall quality of fruits.
Smart Images

Figure CN119991595B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural product quality and safety standards, and in particular to a method, apparatus, medium, and equipment for quality testing and evaluation of fruit. Background Technology
[0002] With consumers' increasing demands for fruit quality and increasingly fierce market competition, accurate testing of fruit quality is of paramount importance in all aspects of fruit production, sales, and consumption.
[0003] Traditional fruit quality testing methods often focus on a single dimension, such as checking for obvious blemishes in the fruit's appearance or simply detecting common safety issues like excessive pesticide residues. This single-dimensional approach fails to comprehensively reflect the true quality of the fruit, easily leading to the overlooking of potential quality problems and making it difficult to meet the modern market's demands for precise fruit grading and standardization.
[0004] Therefore, improving the accuracy of fruit quality testing and evaluation results has become an urgent problem to be solved. Summary of the Invention
[0005] To address the aforementioned technical problems, the present invention provides a method for quality detection and evaluation of fruit, which includes the following steps:
[0006] S1, obtain the initial detection data corresponding to the target fruit, N preset detection dimensions, and the preset arrangement angle and preset arrangement order corresponding to each predicted detection dimension. The initial detection data includes the data corresponding to M initial detection dimensions, and the preset detection dimensions include preset safety detection dimension, preset quality detection dimension, and preset appearance detection dimension. M and N are integers greater than 0 and M≥N.
[0007] S2, based on preset detection dimensions, select target detection data corresponding to the target fruit from the initial detection data, including target safety detection data, target quality detection data, and target appearance detection data.
[0008] S3, perform preset processing on the target detection data to obtain the reference detection data corresponding to the target fruit, including reference safety detection data, reference quality detection data and reference appearance detection data.
[0009] S4. Obtain the safety test results corresponding to the target fruit based on the reference safety test data. The safety test results include safe and unsafe.
[0010] S5. If the safety test result is unsafe, the preset score will be set as the target quality score corresponding to the target fruit.
[0011] S6. If the safety detection result is safe, then according to the preset sorting angle, preset arrangement order and reference detection data corresponding to each predicted detection dimension, obtain the radar chart corresponding to the target fruit. In the radar chart, the dimensions corresponding to the N coordinate axes are determined by the preset arrangement order corresponding to the N preset detection dimensions, the angle between adjacent coordinate axes is determined by the preset arrangement angle corresponding to the N preset detection dimensions, and the data points on each coordinate axis are determined by the detection data corresponding to each preset detection dimension in the reference detection data.
[0012] S7, calculate the area of the target graphic on the radar image, and determine the target graphic area as the target quality score corresponding to the target fruit.
[0013] The present invention also provides a fruit quality detection and evaluation device, which includes:
[0014] The data acquisition module is used to acquire the initial detection data corresponding to the target fruit, N preset detection dimensions, and the preset arrangement angle and preset arrangement order corresponding to each predicted detection dimension. The initial detection data includes data corresponding to M initial detection dimensions, and the preset detection dimensions include preset safety detection dimension, preset quality detection dimension, and preset appearance detection dimension. M and N are integers greater than 0 and M≥N.
[0015] The data filtering module is used to filter the target detection data corresponding to the target fruit from the initial detection data according to the preset detection dimensions. The target detection data includes target safety detection data, target quality detection data, and target appearance detection data.
[0016] The data processing module is used to perform pre-processing on the target detection data to obtain the reference detection data corresponding to the target fruit. The reference detection data includes reference safety detection data, reference quality detection data, and reference appearance detection data.
[0017] The safety detection module is used to obtain the safety detection results corresponding to the target fruit based on reference safety detection data. The safety detection results include safe and unsafe.
[0018] The first quality inspection module is used to determine the preset score as the target quality score corresponding to the target fruit if the safety inspection result is unsafe.
[0019] The radar chart construction module is used to obtain the radar chart corresponding to the target fruit if the safety detection result is safe, based on the preset sorting angle, preset arrangement order and reference detection data corresponding to each predicted detection dimension. The dimensions corresponding to the N coordinate axes in the radar chart are determined by the preset arrangement order corresponding to the N preset detection dimensions, the angle between adjacent coordinate axes is determined by the preset arrangement angle corresponding to the N preset detection dimensions, and the data points on each coordinate axis are determined by the detection data corresponding to each preset detection dimension in the reference detection data.
[0020] The second quality detection module is used to calculate the area of the target graphic on the radar image and determine the target graphic area as the target quality score corresponding to the target fruit.
[0021] The present invention also provides a non-transitory computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the above-described method for quality detection and evaluation of fruit.
[0022] The present invention also provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0023] This invention has at least the following beneficial effects: By obtaining the preset arrangement order and preset arrangement angle of each preset detection dimension of the target fruit, it provides a reasonable and evidence-based set of basic parameters for the subsequent construction of radar charts and the quality detection of the target fruit; by removing information that is not closely related to the core quality assessment of the target fruit, it avoids irrelevant data from interfering with the quality detection results; by clarifying the dimensions corresponding to the coordinate axes, the angles between adjacent coordinate axes, and the data points on the coordinate axes, it constructs a radar chart that can accurately display the quality of the target fruit, ensuring that the radar chart conforms to the correlation and importance between each dimension in terms of position distribution and angle layout, so that the shape, angle, and value of the entire radar chart can reasonably reflect the relationship between each preset detection dimension and the quality score of the target fruit, making the method of characterizing quality based on graphic area more accurate and orderly, thereby improving the accuracy of the quality detection results. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart of a fruit quality detection and evaluation method provided in Embodiment 1 of the present invention;
[0026] Figure 2 This is a schematic diagram of a fruit quality detection and evaluation device provided in Embodiment 2 of the present invention. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is understood that, where appropriate, the terms used to distinguish similar objects can be interchanged so that the invention can also be implemented in other embodiments besides the illustrated or described embodiments. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
[0029] Example 1
[0030] This embodiment provides a method for quality detection and evaluation of fruit. The method includes the following steps: Figure 1 As shown:
[0031] S1, obtain the initial detection data corresponding to the target fruit, N preset detection dimensions, and the preset arrangement angle and preset arrangement order corresponding to each predicted detection dimension. The initial detection data includes the data corresponding to M initial detection dimensions, and the preset detection dimensions include preset safety detection dimension, preset quality detection dimension, and preset appearance detection dimension. M and N are integers greater than 0 and M≥N.
[0032] The target fruit can be of various types. Randomly selecting a large number of fruits and using each selected fruit as the target fruit for quality testing is of great significance in optimizing fruit cultivation techniques, maintaining market order, and protecting consumer health.
[0033] The initial detection data includes data corresponding to M initial detection dimensions. The initial detection data is the raw information about the target fruit collected at the beginning, which may come from various detection instruments, manual observation records, etc.
[0034] The preset safety testing dimensions primarily focus on the safety of fruit for consumption, including pesticide residues, harmful microbial contamination levels, mycotoxin content, and heavy metal content. The results of these preset safety testing dimensions directly determine whether the fruit can safely enter the market. The preset quality testing dimensions primarily focus on dimensions related to the taste and nutritional value of fruit, including sweetness, acidity, soluble solids content, titratable acidity, and vitamin C. The preset appearance testing dimensions primarily focus on the visually apparent characteristics of the fruit, such as its shape, skin condition, and color uniformity. These preset quality and appearance testing dimensions help to assess the quality of fruit and meet the diverse quality requirements of consumers.
[0035] Different types of fruits possess unique biological characteristics, growth environment requirements, consumer market demands, and common quality issues. Therefore, quality testing for different types of fruits requires focusing on different data dimensions. For example, berries such as strawberries and blueberries have thin skins, high water content, and short shelf lives, making them susceptible to microbial growth that can quickly affect fruit quality and food safety. Therefore, in the pre-set safety testing dimensions, in addition to routine pesticide residue testing, the focus is more on detecting microbial contamination such as mold. From the pre-set quality testing dimensions, the sweetness, acidity, and firmness of berries have a greater impact on taste and shelf life, while the browning and stone cell content inside stone fruits such as apples and pears have a greater impact on the smoothness of the taste. From the appearance testing dimension, the peel color and smoothness of citrus fruits are related to fruit ripeness and storage conditions, while the black spots on banana peels are also related to fruit ripeness and storage conditions.
[0036] Therefore, by first collecting initial test data on appearance, internal quality, and safety, there is no need to customize different data acquisition starting points for each type of fruit. This greatly enhances the applicability of the data acquisition method across the entire fruit category. Subsequently, the test data that is truly needed for the target fruit is extracted through screening, reducing repetitive testing actions, saving time and labor costs, and thus improving the overall efficiency of quality testing.
[0037] The preset layout angle is used to determine the angular distribution of each preset detection dimension in the graph when the radar chart is built. The preset layout order is used to determine the positional distribution of each preset detection dimension in the graph when the radar chart is built, so that the data of different dimensions have a reasonable and clear spatial layout in the radar chart.
[0038] The above-mentioned in-depth correlation analysis using data from similar reference fruits scientifically determined the preset arrangement order and angle of the preset detection dimensions, providing a reasonable and evidence-based basis for the subsequent quality detection process of the target fruit, which helps to evaluate the quality of the fruit more accurately, comprehensively and intuitively.
[0039] In one specific embodiment, S1 includes the following steps:
[0040] S11, obtain K reference fruits belonging to the same category as the target fruit, the reference detection data and target quality score corresponding to each reference fruit, where K is an integer greater than 0.
[0041] S12. Based on the target quality scores corresponding to K reference fruits, obtain the quality score vector, where the value of the t-th element in the quality score vector is the target quality score corresponding to the t-th reference fruit, t = 1, 2, ..., K.
[0042] S13. For any preset detection dimension, based on the reference detection data corresponding to each reference fruit, obtain the detection data vector corresponding to the current preset detection dimension. The value of the t-th element in the detection data vector corresponding to the current preset detection dimension is the data of the reference detection data corresponding to the t-th reference fruit relative to the current preset detection dimension.
[0043] S14. Based on the quality score vector and the detection data vector corresponding to the current preset detection dimension, obtain the first correlation degree between the current preset detection dimension and the target quality score.
[0044] S15, based on the detection data vectors corresponding to the current preset detection dimension and any other preset detection dimension, obtain the second correlation degree between the current preset detection dimension and any other preset detection dimension.
[0045] S16, iterate through N preset detection dimensions, obtain the first correlation degree between each preset detection dimension and the target quality score, and the second correlation degree between any two preset detection dimensions.
[0046] S17. Based on the first priority of each preset detection dimension and the second correlation between each preset detection dimension and other preset detection dimensions, obtain the preset arrangement order corresponding to each preset detection dimension.
[0047] S18. Based on the preset arrangement order corresponding to each preset detection dimension, the first correlation degree corresponding to each preset detection dimension, and the second correlation degree between each preset detection dimension and other preset detection dimensions, obtain the preset arrangement angle corresponding to each preset detection dimension.
[0048] Fruits of the same category are consistent and similar in terms of safety, quality, and appearance. Based on the reference test data and target quality scores of the reference fruits, the first degree of correlation between each preset test dimension and the target quality score is analyzed to characterize the importance of each preset test dimension to the overall quality evaluation of the fruit. The second degree of correlation between different preset test dimensions is also analyzed to characterize the mutual influence, synergistic effect, and other relationships between different preset test dimensions. Then, based on the correlation, the preset arrangement order and preset arrangement angle corresponding to each preset test dimension are obtained.
[0049] Specifically, by pre-setting the arrangement order, confusion can be avoided when interpreting the quality meaning represented by the area of the graphic due to the disordered arrangement of dimensions. By presenting highly correlated dimensions adjacently on the radar chart, the area enclosed by adjacent dimensions can more accurately reflect the comprehensive situation that conforms to the actual quality correlation, thereby making the method of characterizing quality based on the area of the graphic more accurate and orderly.
[0050] The angle between adjacent dimensions in a radar chart determines the weight of each preset detection dimension in the entire graph. Correspondingly, two preset detection dimensions that are more important to the overall quality evaluation of fruit and have a stronger correlation can be set with a relatively large angle on the radar chart. This allows for a larger effective area in area calculation, which is more in line with the synergistic relationship in actual quality impact. This enables data from each dimension to participate in the comprehensive quality representation in a more accurate and fair manner, improving the accuracy of judging quality based on area.
[0051] Based on the first correlation between each preset detection dimension and the target quality score and the second correlation between different preset detection dimensions, the position order and angle of each dimension in the radar chart are obtained. Taking into full account factors such as the importance, correlation and weight of the dimensions, the radar chart is optimized to represent the quality of the fruit, making it more accurate, reliable and more in line with the actual quality of the target fruit when measuring the quality of the target fruit based on the area of the radar chart.
[0052] In one specific embodiment, S17 includes the following steps:
[0053] S171, the preset detection dimension corresponding to the highest first priority is determined as the first target detection dimension.
[0054] S172, initialize R = 1.
[0055] S173, the Rth target detection dimension is determined as the intermediate detection dimension, and the other preset detection dimensions other than the 1st target detection dimension to the Rth target detection dimension are determined as candidate detection dimensions.
[0056] S174, based on the second correlation degree between the intermediate detection dimension and each candidate detection dimension, the candidate detection dimension corresponding to the largest second correlation degree of the intermediate detection dimension is determined as the R+1th target detection dimension.
[0057] S175, update R = R + 1, return to step S173, until R = N - 1, and obtain N object detection dimensions.
[0058] S176, the order of the first target detection dimension to the Nth target detection dimension is determined as the preset arrangement order corresponding to each predicted detection dimension when constructing the radar chart.
[0059] The first priority reflects the importance of the preset detection dimension in detecting the target quality score. Therefore, prioritizing the most important dimension to start sorting helps to construct a dimension sequence that is more logical and in line with the order of importance.
[0060] Specifically, in each iteration, the current intermediate detection dimension and candidate detection dimension are clearly defined. This facilitates the selection of the candidate detection dimension with the strongest correlation to the intermediate detection dimension as the next target detection dimension based on the second correlation between the intermediate detection dimension and each candidate detection dimension. By continuously iterating, the order of the N target detection dimensions is gradually determined, making the adjacent target detection dimensions more closely related in terms of logic and actual data.
[0061] The order of the first to Nth target detection dimensions is directly set to the preset arrangement order corresponding to each preset detection dimension when constructing the radar chart. In the subsequent analysis of the quality of the target fruit based on the radar chart, the area enclosed by the adjacent dimensions can more accurately reflect the comprehensive situation that conforms to the actual quality correlation, thereby making the method of characterizing quality based on the area of the graphic more accurate and orderly.
[0062] As described above, the candidate detection dimension with the strongest correlation to the intermediate detection dimension is selected based on the second degree of relevance and determined as the next target detection dimension. Through multiple rounds of iteration, the order of N target detection dimensions is gradually determined, making the adjacent target detection dimensions more closely related in terms of logic and actual data. The area enclosed by the adjacent dimensions can more accurately reflect the comprehensive situation that conforms to the actual quality correlation, thereby improving the accuracy of the quality detection results.
[0063] In one specific embodiment, S18 includes the following steps:
[0064] S181, for any preset detection dimension, obtain the next preset detection dimension corresponding to the current preset detection dimension according to the preset arrangement order corresponding to each preset detection dimension.
[0065] S182, based on the first relevance degree corresponding to the current preset detection dimension, the first relevance degree corresponding to the next preset detection dimension corresponding to the current preset detection dimension, and the second relevance degree between the current preset detection dimension and the next preset detection dimension corresponding to the current preset detection dimension, obtain the first angle priority between the current preset detection dimension and the next preset detection dimension.
[0066] S183, traverse all preset detection dimensions and obtain the first angle priority corresponding to each predicted detection dimension.
[0067] S184, normalize the first angle priority corresponding to the N prediction detection dimensions to obtain the second angle priority corresponding to each prediction detection dimension.
[0068] S185, based on the preset total angle and the second angle priority corresponding to each predicted detection dimension, obtain the preset arrangement angle corresponding to each preset detection dimension. The preset arrangement angle refers to the angle between each preset detection dimension and the corresponding next preset detection dimension in the radar image.
[0069] Among these, the greater the first degree of relevance, the more important the corresponding preset detection dimension is in characterizing fruit quality; the greater the second degree of relevance, the more accurately the area enclosed by the two preset detection dimensions reflects the fruit quality. Therefore, the priority of the first angle is positively correlated with both the first and second degrees of relevance.
[0070] Correspondingly, we can obtain the first preset weight corresponding to the first relevance of the current preset detection dimension, the second preset weight corresponding to the first relevance of the next preset detection dimension, and the third preset weight corresponding to the second relevance between the current preset detection dimension and the next preset detection dimension. We can then obtain the first angle priority between the current preset detection dimension and the next preset detection dimension by weighted summation.
[0071] The specific values of the preset total angle, the first preset weight, the second preset weight, and the third preset weight can be set by the implementer according to the actual situation. For example, the preset total angle can be set to 360 degrees.
[0072] The value range of the second angle priority is (0, 1). The product of the preset total angle and each second angle priority is determined as the corresponding preset arrangement angle. This allows the two preset detection dimensions with higher importance and stronger correlation to the overall quality evaluation of the fruit to be set with a relatively large angle on the radar chart. This results in a larger effective area when calculating the area, which is more in line with the synergistic relationship in the actual quality impact. This allows the data of each dimension to participate in the comprehensive quality representation in a more accurate and fair way, and improves the accuracy of judging quality based on area.
[0073] The above approach, by comprehensively considering various relevant factors, rationally allocates angles to each preset detection dimension in the radar chart, reflecting the relative weight of each preset detection dimension in quality evaluation and the close correlation between preset detection dimensions. This ensures that when analyzing fruit quality based on the radar chart, each preset detection dimension can participate in the overall quality representation with an appropriate proportion, avoiding overemphasis or underemphasis on certain preset detection dimensions due to unreasonable angles. As a result, the radar chart more accurately reflects the overall quality of the fruit and improves the accuracy of measuring fruit quality based on features such as radar chart area.
[0074] S2, based on preset detection dimensions, select target detection data corresponding to the target fruit from the initial detection data, including target safety detection data, target quality detection data, and target appearance detection data.
[0075] In order to accurately assess the quality of different types of fruit, the most relevant target test data is selected from the initial test data based on the characteristics of the target fruit. That is, the test data corresponding to each preset test dimension is selected, and the relevant data of irrelevant dimensions are deleted. This avoids excessive attention to irrelevant data and waste of resources during the test process, while ensuring that the unique quality problems and advantages of various fruits can be accurately discovered.
[0076] The above-mentioned method, by obtaining target detection data corresponding to N preset detection dimensions that are of greater concern to the target fruit, removes information that is not closely related to the core quality assessment of the target fruit, improves the efficiency of subsequent data processing and analysis, and avoids irrelevant data from interfering with the quality detection results, thereby improving the accuracy of the quality detection results.
[0077] S3, perform preset processing on the target detection data to obtain the reference detection data corresponding to the target fruit, including reference safety detection data, reference quality detection data and reference appearance detection data.
[0078] In one specific embodiment, the preset processing includes normalization processing and quantization processing, and S3 includes the following steps:
[0079] S31, obtain the data type and preset model corresponding to each preset detection dimension, where the data type includes numerical type and text type.
[0080] S32, for any preset detection dimension, if the data type corresponding to the current preset detection dimension is numerical, then the detection data corresponding to the current preset detection dimension in the target detection data is normalized to obtain the intermediate detection data corresponding to the current preset detection dimension.
[0081] S33, if the data type corresponding to the current preset detection dimension is text, then perform vector transformation processing on the detection data corresponding to the current preset detection dimension in the target detection data to obtain the detection vector corresponding to the current preset detection dimension, input the detection vector corresponding to the current preset detection dimension into the preset model, and obtain the intermediate detection data corresponding to the current preset detection dimension.
[0082] S34, traverse N preset detection dimensions and obtain the intermediate detection data corresponding to each preset detection dimension.
[0083] S35: Based on the intermediate detection data corresponding to N preset detection dimensions, obtain the reference detection data corresponding to the target fruit.
[0084] The data type corresponding to each preset detection dimension can be numerical or textual. For example, the preset detection dimensions include sweetness and appearance color description. Sweetness corresponds to specific sweetness values such as 12°Bx (Degrees Brix) and 15°Bx, while appearance color description corresponds to textual expressions such as "bright color" and "dull color". The preset model can be a machine learning model that has been trained to convert color-related textual descriptions into quantitative values.
[0085] The detection data corresponding to the current preset detection dimension in the target detection data is normalized to unify data of different magnitudes and ranges to a standard scale. Specifically, if the detection data corresponding to the current preset detection dimension is positively correlated with fruit quality, the ratio of the detection data corresponding to the current preset detection dimension to the maximum detection data corresponding to the current preset detection dimension is determined as the intermediate detection data corresponding to the current preset detection dimension. If the detection data corresponding to the current preset detection dimension is negatively correlated with fruit quality, the ratio of the minimum detection data corresponding to the current preset detection dimension to the detection data corresponding to the current preset detection dimension is determined as the intermediate detection data corresponding to the current preset detection dimension.
[0086] Those skilled in the art will know that any vector transformation technique in the prior art falls within the protection scope of this invention, and will not be elaborated further here.
[0087] The intermediate detection data obtained from each preset detection dimension are integrated together to form the reference detection data corresponding to the target fruit.
[0088] The aforementioned reference testing data contains information that has been uniformly processed and can comprehensively and scientifically reflect the quality characteristics of fruits from different dimensions, providing an accurate data foundation for further analysis of fruit quality.
[0089] S4. Obtain the safety test results corresponding to the target fruit based on the reference safety test data. The safety test results include safe and unsafe.
[0090] In one specific implementation, the data type corresponding to the reference security detection data is numerical, and S4 includes the following steps:
[0091] S41, obtain the preset data threshold corresponding to each preset security detection dimension.
[0092] S42, for any preset safety detection dimension, if the detection data corresponding to the current preset safety detection dimension in the reference safety detection data is greater than the preset data threshold corresponding to the current preset safety detection dimension, then the safety detection result corresponding to the target fruit is determined to be unsafe.
[0093] The specific values of the preset data thresholds corresponding to each preset security detection dimension can be set by the implementer according to the actual situation.
[0094] S5. If the safety test result is unsafe, the preset score will be set as the target quality score corresponding to the target fruit.
[0095] If the test data for any preset safety test dimension corresponding to the target fruit does not meet the safety requirements, the safety test result corresponding to the target fruit can be determined as unsafe, that is, the target fruit belongs to the category of fruit that does not meet safety standards and is of poor quality.
[0096] The specific value of the preset score can be set by the implementer according to the actual situation. For example, a preset score of 0 is used to indicate that the safety and quality of the target fruit is substandard.
[0097] The above approach uses each preset safety testing dimension as the sole standard for measuring the safety of the target fruit. By directly assigning preset scores, unsafe fruits can be quickly identified in terms of quality. This simplifies the processing flow in the quality testing process and ensures the efficiency and rationality of the quality testing results.
[0098] S6. If the safety detection result is safe, then according to the preset sorting angle, preset arrangement order and reference detection data corresponding to each predicted detection dimension, obtain the radar chart corresponding to the target fruit. In the radar chart, the dimensions corresponding to the N coordinate axes are determined by the preset arrangement order corresponding to the N preset detection dimensions, the angle between adjacent coordinate axes is determined by the preset arrangement angle corresponding to the N preset detection dimensions, and the data points on each coordinate axis are determined by the detection data corresponding to each preset detection dimension in the reference detection data.
[0099] In one specific embodiment, the radar chart includes N coordinate axes, and S6 includes the following steps:
[0100] S61, according to the preset arrangement order corresponding to each predicted detection dimension, the u-th target detection dimension is determined as the dimension corresponding to the u-th coordinate axis in the radar image, where u = 1, 2, ..., N.
[0101] S62, based on the preset arrangement angle corresponding to each predicted detection dimension, the preset arrangement angle corresponding to the u-th target detection dimension is determined as the angle between the u-th coordinate axis and the (u+1)-th coordinate axis in the radar image. When u = N, the preset arrangement angle corresponding to the N-th target detection dimension is determined as the angle between the N-th coordinate axis and the 1-th coordinate axis in the radar image.
[0102] S63, the detection data corresponding to the u-th target detection dimension in the reference detection data is determined as the corresponding data point on the u-th coordinate axis in the radar image.
[0103] In this process, each preset detection dimension is assigned to the various coordinate axes of the radar chart according to the preset arrangement order corresponding to each preset detection dimension. This establishes a correspondence between the dimensions of quality detection and the coordinate axes of the radar chart, so that each coordinate axis of the radar chart has a clear quality meaning, thus preparing for the subsequent accurate detection of fruit quality information.
[0104] The angle between adjacent coordinate axes is determined by setting the preset arrangement angle for each preset detection dimension, thereby ensuring that the radar chart conforms to the correlation and importance between each dimension in terms of angle layout. This allows the shape and angle distribution of the entire radar chart to reasonably reflect the relationship between the various quality dimensions of the target fruit, which helps to analyze the quality of the target fruit more scientifically and intuitively.
[0105] By converting the specific detection data corresponding to each preset detection dimension into data points on the coordinate axes of the radar chart, the reference detection data is accurately mapped onto the coordinate axes of the radar data chart. This allows the radar chart to be drawn based on the actual detection data, truly reflecting the specific situation of the target fruit in each quality dimension. In this way, abstract data can be displayed in a visual graphic form, making it convenient and intuitive to analyze the quality characteristics of the target fruit.
[0106] The above describes how a radar chart can accurately display the quality of a target fruit by defining the dimensions of the coordinate axes, the angles between adjacent coordinate axes, and the data points on the coordinate axes. This provides an important foundation for subsequent analysis of the target fruit quality based on the area of the graphic in the radar chart.
[0107] S7, calculate the area of the target graphic on the radar image, and determine the target graphic area as the target quality score corresponding to the target fruit.
[0108] The radar image obtains the target area by connecting data points on adjacent coordinate axes with line segments. This closed target shape is then divided into multiple triangles, and the areas of each triangle are calculated and summed. Correspondingly, a larger target area indicates better performance of the target fruit across various preset detection dimensions, and thus higher fruit quality.
[0109] Furthermore, the quality of target fruits can be evaluated using target quality scores. For example, a batch of target fruits can be graded as premium, first-grade, second-grade, third-grade, etc., based on the score, and the fruit quality evaluation results can be promptly fed back to fruit suppliers, growers, or relevant production and sales personnel. For batches with excellent quality, best practices can be summarized; for batches with quality problems, the issues can be clearly identified, and improvement suggestions can be made, such as optimizing planting and management measures, adjusting harvesting time, and improving packaging and transportation methods, to promote the improvement of fruit quality.
[0110] The above-mentioned method provides a reasonable and evidence-based basis for setting the preset arrangement order and preset arrangement angle of each preset detection dimension of the target fruit, thus providing a basis for the construction of the radar chart and the quality detection of the target fruit. By removing information that is not closely related to the core quality assessment of the target fruit, irrelevant data is avoided from interfering with the quality detection results. By clarifying the dimensions corresponding to the coordinate axes, the angles between adjacent coordinate axes, and the data points on the coordinate axes, a radar chart that can accurately display the quality of the target fruit is constructed. This ensures that the radar chart conforms to the correlation and importance between each dimension in terms of position distribution and angle layout, so that the shape, angle, and value of the entire radar chart can reasonably reflect the relationship between each preset detection dimension and the quality score of the target fruit. This makes the method of characterizing quality based on graphic area more accurate and orderly, thereby improving the accuracy of the quality detection results.
[0111] Example 2
[0112] This second embodiment provides a fruit quality detection and evaluation device, which includes, for example, Figure 2 As shown:
[0113] The data acquisition module 21 is used to acquire the initial detection data corresponding to the target fruit, N preset detection dimensions, and the preset arrangement angle and preset arrangement order corresponding to each predicted detection dimension. The initial detection data includes data corresponding to M initial detection dimensions, and the preset detection dimensions include preset safety detection dimension, preset quality detection dimension, and preset appearance detection dimension. M and N are integers greater than 0 and M≥N.
[0114] The data filtering module 22 is used to filter the target detection data corresponding to the target fruit from the initial detection data according to the preset detection dimensions. The target detection data includes target safety detection data, target quality detection data and target appearance detection data.
[0115] The data processing module 23 is used to perform preset processing on the target detection data to obtain the reference detection data corresponding to the target fruit. The reference detection data includes reference safety detection data, reference quality detection data, and reference appearance detection data.
[0116] The safety detection module 24 is used to obtain the safety detection result corresponding to the target fruit based on the reference safety detection data, wherein the safety detection result includes safe and unsafe.
[0117] The first quality inspection module 25 is used to determine the preset score as the target quality score corresponding to the target fruit if the safety inspection result is unsafe.
[0118] The radar chart construction module 26 is used to obtain the radar chart corresponding to the target fruit based on the preset sorting angle, preset arrangement order and reference detection data corresponding to each predicted detection dimension if the safety detection result is safe. In the radar chart, the dimensions corresponding to the N coordinate axes are determined by the preset arrangement order corresponding to the N preset detection dimensions, the angle between adjacent coordinate axes is determined by the preset arrangement angle corresponding to the N preset detection dimensions, and the data points on each coordinate axis are determined by the detection data corresponding to each preset detection dimension in the reference detection data.
[0119] The second quality detection module 27 is used to calculate the area of the target graphic on the radar image and determine the target graphic area as the target quality score corresponding to the target fruit.
[0120] In one specific embodiment, the data acquisition module 21 includes:
[0121] The first data acquisition submodule is used to acquire K reference fruits belonging to the same category as the target fruit, the reference detection data corresponding to each reference fruit, and the target quality score, where K is an integer greater than 0.
[0122] The quality score vector acquisition submodule is used to obtain a quality score vector based on the target quality scores corresponding to K reference fruits. The value of the t-th element in the quality score vector is the target quality score corresponding to the t-th reference fruit, where t = 1, 2, ..., K.
[0123] The detection data vector acquisition submodule is used to obtain the detection data vector corresponding to the current preset detection dimension for any preset detection dimension, based on the reference detection data corresponding to each reference fruit. The value of the t-th element in the detection data vector corresponding to the current preset detection dimension is the data of the reference detection data corresponding to the t-th reference fruit relative to the current preset detection dimension.
[0124] The first correlation degree acquisition submodule is used to obtain the first correlation degree between the current preset detection dimension and the target quality score based on the quality score vector and the detection data vector corresponding to the current preset detection dimension.
[0125] The second correlation degree acquisition submodule is used to obtain the second correlation degree between the current preset detection dimension and any other preset detection dimension based on the detection data vectors corresponding to the current preset detection dimension and any other preset detection dimension.
[0126] The dimension traversal submodule is used to traverse N preset detection dimensions, obtain the first correlation degree between each preset detection dimension and the target quality score, and the second correlation degree between any two preset detection dimensions.
[0127] The preset arrangement order acquisition submodule is used to obtain the preset arrangement order corresponding to each preset detection dimension based on the first priority corresponding to each preset detection dimension and the second correlation between each preset detection dimension and other preset detection dimensions.
[0128] The preset layout angle acquisition submodule is used to obtain the preset layout angle corresponding to each preset detection dimension based on the preset layout order corresponding to each preset detection dimension, the first correlation degree corresponding to each preset detection dimension, and the second correlation degree between each preset detection dimension and other preset detection dimensions.
[0129] In one specific implementation, the preset arrangement order acquisition submodule includes:
[0130] The first target detection dimension determination unit is used to determine the preset detection dimension corresponding to the highest first priority as the first target detection dimension.
[0131] An initialization unit used to initialize R = 1.
[0132] The detection dimension classification unit is used to determine the Rth target detection dimension as the intermediate detection dimension and to determine other preset detection dimensions other than the 1st target detection dimension to the Rth target detection dimension as candidate detection dimensions.
[0133] The second target detection dimension determination unit is used to determine the candidate detection dimension corresponding to the largest second correlation between the intermediate detection dimension and each candidate detection dimension as the (R+1)th target detection dimension based on the second correlation between the intermediate detection dimension and each candidate detection dimension.
[0134] The third object detection dimension determination unit is used to update R = R + 1 and return to execute step S173 until R = N - 1, obtaining N object detection dimensions.
[0135] The preset arrangement order acquisition unit is used to determine the order of the first target detection dimension to the Nth target detection dimension as the preset arrangement order corresponding to each predicted detection dimension when constructing the radar chart.
[0136] In one specific implementation, the preset arrangement angle acquisition submodule includes:
[0137] The dimension analysis unit is used to obtain the next preset detection dimension corresponding to the current preset detection dimension based on the preset arrangement order corresponding to each preset detection dimension for any preset detection dimension.
[0138] The first priority acquisition unit is used to obtain the first angle priority between the current preset detection dimension and the next preset detection dimension based on the first relevance degree corresponding to the current preset detection dimension, the first relevance degree corresponding to the next preset detection dimension corresponding to the current preset detection dimension, and the second relevance degree between the current preset detection dimension and the next preset detection dimension corresponding to the current preset detection dimension.
[0139] The second priority acquisition unit is used to traverse all preset detection dimensions and obtain the first angle priority corresponding to each predicted detection dimension.
[0140] The third priority acquisition unit is used to normalize the first angle priority corresponding to the N prediction detection dimensions and obtain the second angle priority corresponding to each prediction detection dimension.
[0141] The preset arrangement angle acquisition unit is used to obtain the preset arrangement angle corresponding to each preset detection dimension based on the preset total angle and the second angle priority corresponding to each predicted detection dimension. The preset arrangement angle refers to the angle between each preset detection dimension and the corresponding next preset detection dimension in the radar image.
[0142] In one specific embodiment, the radar chart includes N coordinate axes, and the radar chart construction module 26 includes:
[0143] The coordinate axis dimension determination submodule is used to determine the u-th target detection dimension as the dimension corresponding to the u-th coordinate axis in the radar image according to the preset arrangement order corresponding to each predicted detection dimension, where u = 1, 2, ..., N.
[0144] The coordinate axis angle determination submodule is used to determine the preset arrangement angle corresponding to the u-th target detection dimension as the angle between the u-th coordinate axis and the (u+1)-th coordinate axis in the radar image based on the preset arrangement angle corresponding to each predicted detection dimension. When u=N, the preset arrangement angle corresponding to the N-th target detection dimension is determined as the angle between the N-th coordinate axis and the 1-th coordinate axis in the radar image.
[0145] The coordinate axis data point determination submodule is used to determine the detection data corresponding to the u-th target detection dimension in the reference detection data as the corresponding data point on the u-th coordinate axis in the radar image.
[0146] In one specific embodiment, the preset processing includes normalization processing and quantization processing, and the data processing module 23 includes:
[0147] The second data acquisition submodule is used to acquire the data type and preset model corresponding to each preset detection dimension. The data types include numerical and text types.
[0148] The first data processing submodule is used to perform normalization processing on the detection data corresponding to the current preset detection dimension in the target detection data if the data type corresponding to the current preset detection dimension is numerical, and to obtain the intermediate detection data corresponding to the current preset detection dimension.
[0149] The second data processing submodule is used to perform vector conversion processing on the detection data corresponding to the current preset detection dimension in the target detection data if the data type corresponding to the current preset detection dimension is text, to obtain the detection vector corresponding to the current preset detection dimension, and input the detection vector corresponding to the current preset detection dimension into the preset model to obtain the intermediate detection data corresponding to the current preset detection dimension.
[0150] The third data processing submodule is used to traverse N preset detection dimensions and obtain the intermediate detection data corresponding to each preset detection dimension.
[0151] The reference detection data acquisition submodule is used to obtain the reference detection data corresponding to the target fruit based on the intermediate detection data corresponding to N preset detection dimensions.
[0152] In one specific implementation, the data type corresponding to the reference security detection data is numerical, and the security detection module 24 includes:
[0153] The third data acquisition submodule is used to acquire the preset data thresholds corresponding to each preset security detection dimension.
[0154] The safety detection submodule is used to determine the safety detection result of the target fruit as unsafe if the detection data corresponding to the current preset safety detection dimension in the reference safety detection data is greater than the preset data threshold corresponding to the current preset safety detection dimension for any preset safety detection dimension.
[0155] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0156] Example 3
[0157] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium, which stores at least one instruction or at least one program segment, wherein the at least one instruction or at least one program segment is loaded and executed by a processor to implement the following steps:
[0158] S1, obtain the initial detection data corresponding to the target fruit, N preset detection dimensions, and the preset arrangement angle and preset arrangement order corresponding to each predicted detection dimension. The initial detection data includes the data corresponding to M initial detection dimensions, and the preset detection dimensions include preset safety detection dimension, preset quality detection dimension, and preset appearance detection dimension. M and N are integers greater than 0 and M≥N.
[0159] S2, based on preset detection dimensions, select target detection data corresponding to the target fruit from the initial detection data, including target safety detection data, target quality detection data, and target appearance detection data.
[0160] S3, perform preset processing on the target detection data to obtain the reference detection data corresponding to the target fruit, including reference safety detection data, reference quality detection data and reference appearance detection data.
[0161] S4. Obtain the safety test results corresponding to the target fruit based on the reference safety test data. The safety test results include safe and unsafe.
[0162] S5. If the safety test result is unsafe, the preset score will be set as the target quality score corresponding to the target fruit.
[0163] S6. If the safety detection result is safe, then according to the preset sorting angle, preset arrangement order and reference detection data corresponding to each predicted detection dimension, obtain the radar chart corresponding to the target fruit. In the radar chart, the dimensions corresponding to the N coordinate axes are determined by the preset arrangement order corresponding to the N preset detection dimensions, the angle between adjacent coordinate axes is determined by the preset arrangement angle corresponding to the N preset detection dimensions, and the data points on each coordinate axis are determined by the detection data corresponding to each preset detection dimension in the reference detection data.
[0164] S7, calculate the area of the target graphic on the radar image, and determine the target graphic area as the target quality score corresponding to the target fruit.
[0165] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0166] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0167] Example 4
[0168] Embodiment 4 of the present invention provides an electronic device, which includes a processor and a non-transitory computer-readable storage medium as described in Embodiment 3 of the present invention.
[0169] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A method of quality detection and evaluation of fruits, characterized in that, The fruit quality detection and evaluation method comprises the following steps: S1, obtaining initial detection data corresponding to the target fruit, N preset detection dimensions, and preset arrangement angles and preset arrangement sequences corresponding to each prediction detection dimension, wherein the initial detection data comprises data corresponding to M initial detection dimensions, the preset detection dimensions comprise preset safety detection dimensions, preset quality detection dimensions, and preset appearance detection dimensions, M and N are integers greater than 0 and M>=N, S1 comprises the following steps: S11, obtaining K reference fruits belonging to the same category as the target fruit, reference detection data corresponding to each reference fruit, and a target quality score, wherein K is an integer greater than 0; S12, obtaining a quality score vector according to the target quality scores corresponding to the K reference fruits, wherein the value of the tth element in the quality score vector is the target quality score corresponding to the tth reference fruit, t=1, 2, …, K; S13, for any preset detection dimension, obtaining a detection data vector corresponding to the current preset detection dimension according to the reference detection data corresponding to each reference fruit, wherein the value of the tth element in the detection data vector corresponding to the current preset detection dimension is the data corresponding to the tth reference fruit with respect to the current preset detection dimension in the reference detection data; S14, obtaining a first correlation degree between the current preset detection dimension and the target quality score according to the quality score vector and the detection data vector corresponding to the current preset detection dimension; S15, obtaining a second correlation degree between the current preset detection dimension and any other preset detection dimension according to the detection data vectors corresponding to the current preset detection dimension and any other preset detection dimension; S16, traversing the N preset detection dimensions to obtain the first correlation degree between each preset detection dimension and the target quality score, and the second correlation degree between any two preset detection dimensions; S17, obtaining a preset arrangement sequence corresponding to each preset detection dimension according to the first priority degree corresponding to each preset detection dimension and the second correlation degree between each preset detection dimension and other preset detection dimensions; S18, obtaining a preset arrangement angle corresponding to each preset detection dimension according to the preset arrangement sequence corresponding to each preset detection dimension, the first correlation degree corresponding to each preset detection dimension, and the second correlation degree between each preset detection dimension and other preset detection dimensions; S2, screening the target detection data corresponding to the target fruit from the initial detection data according to the preset detection dimensions, wherein the target detection data comprises target safety detection data, target quality detection data, and target appearance detection data; S3, performing preset processing on the target detection data to obtain reference detection data corresponding to the target fruit, wherein the reference detection data comprises reference safety detection data, reference quality detection data, and reference appearance detection data; S4, obtaining a safety detection result corresponding to the target fruit according to the reference safety detection data, wherein the safety detection result comprises safety and insecurity; S5, if the safety detection result is unsafe, determining a preset score as a target quality score corresponding to the target fruit; S6, if the safety detection result is safe, obtaining a radar chart corresponding to the target fruit according to a preset arrangement angle, a preset arrangement order of each prediction detection dimension, and the reference detection data, wherein the dimensions corresponding to the N coordinate axes in the radar chart are determined by the preset arrangement order of the N preset detection dimensions, the angle between adjacent coordinate axes is determined by the preset arrangement angle of the N preset detection dimensions, and the data points on each coordinate axis are determined by the detection data corresponding to each preset detection dimension in the reference detection data; S7, calculating a target graph area of the radar chart, and determining the target graph area as the target quality score corresponding to the target fruit.
2. The method of quality detection and evaluation of fruits according to claim 1, characterized in that, S17 includes the following steps: S171, determining the preset detection dimension corresponding to the maximum first priority degree as the first target detection dimension; S172, initializing R=1; S173, determining the Rth target detection dimension as an intermediate detection dimension, and determining the preset detection dimensions other than the first target detection dimension to the Rth target detection dimension as candidate detection dimensions; S174, determining the candidate detection dimension corresponding to the maximum second correlation degree between the intermediate detection dimension and each candidate detection dimension as the R+1th target detection dimension according to the second correlation degree between the intermediate detection dimension and each candidate detection dimension; S175, updating R=R+1, returning to step S173 until R=N-1, and obtaining the N target detection dimensions; S176, determining the order of the first target detection dimension to the Nth target detection dimension as the preset arrangement order of each prediction detection dimension when constructing the radar chart.
3. The method of quality detection and evaluation of fruits according to claim 2, characterized in that, S18 includes the following steps: S181, for any preset detection dimension, obtaining the next preset detection dimension corresponding to the current preset detection dimension according to the preset arrangement order of each preset detection dimension; S182, obtaining the first angle priority between the current preset detection dimension and the next preset detection dimension according to the first correlation degree of the current preset detection dimension, the first correlation degree of the next preset detection dimension corresponding to the current preset detection dimension, and the second correlation degree between the current preset detection dimension and the next preset detection dimension corresponding to the current preset detection dimension; S183, traversing all preset detection dimensions to obtain the first angle priority of each prediction detection dimension; S184, normalizing the first angle priorities of the N prediction detection dimensions to obtain the second angle priority of each prediction detection dimension; S185, obtaining the preset arrangement angle of each preset detection dimension according to the preset total angle and the second angle priority of each prediction detection dimension, wherein the preset arrangement angle refers to the angle between each preset detection dimension and the corresponding next preset detection dimension in the radar chart.
4. The method of quality detection and evaluation of fruits according to claim 2, characterized in that, The radar chart includes N coordinate axes, and S6 includes the following steps: S61, determining the u-th target detection dimension as a dimension corresponding to the u-th coordinate axis in the radar chart according to a preset arrangement order corresponding to each predicted detection dimension, where u=1, 2, …, N; S62, determining a preset arrangement angle corresponding to the u-th target detection dimension as an angle between the u-th coordinate axis and the u+1-th coordinate axis in the radar chart according to a preset arrangement angle corresponding to each predicted detection dimension, where when u=N, the preset arrangement angle corresponding to the N-th target detection dimension is determined as an angle between the N-th coordinate axis and the 1-th coordinate axis in the radar chart; S63, determining detection data corresponding to the u-th target detection dimension in the reference detection data as a data point corresponding to the u-th coordinate axis in the radar chart.
5. The method of quality detection and evaluation of fruits according to claim 1, characterized in that, The preset processing includes normalization processing and quantization processing, and S3 includes the following steps: S31, obtaining a data type and a preset model corresponding to each preset detection dimension, where the data type includes a numerical type and a text type; S32, for any preset detection dimension, if the data type corresponding to the current preset detection dimension is the numerical type, performing normalization processing on the detection data corresponding to the current preset detection dimension in the target detection data to obtain intermediate detection data corresponding to the current preset detection dimension; S33, if the data type corresponding to the current preset detection dimension is the text type, performing vector conversion processing on the detection data corresponding to the current preset detection dimension in the target detection data to obtain a detection vector corresponding to the current preset detection dimension, inputting the detection vector corresponding to the current preset detection dimension into the preset model, and obtaining intermediate detection data corresponding to the current preset detection dimension; S34, traversing N preset detection dimensions to obtain intermediate detection data corresponding to each preset detection dimension; S35, obtaining reference detection data corresponding to the target fruit according to the intermediate detection data corresponding to the N preset detection dimensions.
6. The method of quality detection and evaluation of fruits according to claim 5, characterized in that, The data type corresponding to the reference safety detection data is the numerical type, and S4 includes the following steps: S41, obtaining a preset data threshold corresponding to each preset safety detection dimension; S42, for any preset safety detection dimension, if the detection data corresponding to the current preset safety detection dimension in the reference safety detection data is greater than the preset data threshold corresponding to the current preset safety detection dimension, determining that the safety detection result corresponding to the target fruit is unsafe.
7. A device for detecting and evaluating the quality of fruits, characterized by The fruit quality detection and evaluation device includes: A data acquisition module configured to obtain initial detection data corresponding to a target fruit, N preset detection dimensions, and a preset arrangement angle and a preset arrangement order corresponding to each predicted detection dimension, where the initial detection data includes data corresponding to M initial detection dimensions, the preset detection dimensions include preset safety detection dimensions, preset quality detection dimensions, and preset appearance detection dimensions, M and N are integers greater than 0 and M≥N, and the data acquisition module includes: The first data acquisition submodule is configured to acquire K reference fruits of the same category as the target fruit, reference detection data corresponding to each reference fruit, and a target quality score, where K is an integer greater than 0. The quality score vector acquisition submodule is configured to acquire a quality score vector according to the target quality scores of the K reference fruits, where a value of a t th element in the quality score vector is a target quality score corresponding to a t th reference fruit, t = 1, 2, …, K. The detection data vector acquisition submodule is configured to acquire, for any preset detection dimension, a detection data vector corresponding to the current preset detection dimension according to the reference detection data corresponding to each reference fruit, where a value of a t th element in the detection data vector corresponding to the current preset detection dimension is data corresponding to the t th reference fruit with respect to the current preset detection dimension. The first correlation degree acquisition submodule is configured to acquire a first correlation degree between the current preset detection dimension and the target quality score according to the quality score vector and the detection data vector corresponding to the current preset detection dimension. The second correlation degree acquisition submodule is configured to acquire a second correlation degree between the current preset detection dimension and any other preset detection dimension according to the detection data vectors corresponding to the current preset detection dimension and the other preset detection dimension. The dimension traversal submodule is configured to traverse N preset detection dimensions to acquire a first correlation degree between each preset detection dimension and the target quality score, and a second correlation degree between any two preset detection dimensions. The preset arrangement order acquisition submodule is configured to acquire a preset arrangement order corresponding to each preset detection dimension according to a first priority degree corresponding to each preset detection dimension and a second correlation degree between each preset detection dimension and other preset detection dimensions. The preset arrangement angle acquisition submodule is configured to acquire a preset arrangement angle corresponding to each preset detection dimension according to a preset arrangement order corresponding to each preset detection dimension, a first correlation degree corresponding to each preset detection dimension, and a second correlation degree between each preset detection dimension and other preset detection dimensions. The data screening module is configured to screen target detection data corresponding to the target fruit from the initial detection data according to the preset detection dimensions, where the target detection data includes target safety detection data, target quality detection data, and target appearance detection data. The data processing module is configured to perform preset processing on the target detection data to acquire reference detection data corresponding to the target fruit, where the reference detection data includes reference safety detection data, reference quality detection data, and reference appearance detection data. The safety detection module is configured to acquire a safety detection result corresponding to the target fruit according to the reference safety detection data, where the safety detection result includes safety and unsafety. The first quality detection module is configured to determine a preset score as the target quality score corresponding to the target fruit if the safety detection result is unsafety. a radar chart construction module, configured to, if the safety detection result is safe, acquire a radar chart corresponding to the target fruit according to each preset arrangement angle of each preset detection dimension, a preset arrangement sequence, and the reference detection data, wherein dimensions corresponding to N coordinate axes in the radar chart are determined by a preset arrangement sequence corresponding to N preset detection dimensions, an angle between adjacent coordinate axes is determined by a preset arrangement angle corresponding to the N preset detection dimensions, and a data point on each coordinate axis is determined by detection data corresponding to each preset detection dimension in the reference detection data; a second quality detection module, configured to calculate a target graph area of the radar chart, and determine the target graph area as a target quality score corresponding to the target fruit. 8.A non-transitory computer-readable storage medium having stored therein at least one instruction or at least one piece of program, characterized in that, The at least one instruction or the at least one program is loaded and executed by the processor to implement the fruit quality detection and evaluation method according to any one of claims 1-6.
9. An electronic device, comprising: The non-transitory computer-readable storage medium is included in the processor. The non-transitory computer-readable storage medium is included in the processor.
Citation Information
Patent Citations
Method for quantifying wine taste
CN108196016A
Multi-index system evaluation method suitable for food detection
CN113762759A