Persimmon quality detection method and system based on machine vision

Through the persimmon cake quality detection method based on machine vision, problems such as the strong subjectivity of persimmon cake quality detection in the existing technology and the inability to comprehensively evaluate the quality of persimmon cake quality are solved, comprehensive non-destructive testing of the appearance and internal quality of persimmon cake is achieved, the objectivity and efficiency of quality detection are improved, and a closed-loop system for quality warning and process optimization is formed.

CN119810100AActive Publication Date: 2025-04-11SHAANXI FUPING DAFANG TIANXI GREEN AGRI DEV CO LTD

Patent Information

Application Number
CN202510293073.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-04-11
Estimated Expiration
2045-03-13

AI Technical Summary

Technical Problem

The existing persimmon cake quality detection technology has problems such as strong subjectivity, low efficiency, inability to comprehensively evaluate the quality of persimmon cake, high destructiveness, long time consumption, high cost, lack of multi-dimensional characteristics comprehensive analysis and internal quality non-destructive testing capabilities, as well as lack of quality data analysis and process optimization feedback mechanism.

Method used

The persimmon cake quality detection method based on machine vision is adopted, and multi-angle and multi-spectral imaging acquisition and pre-processing is carried out through the industrial camera array system to build a standardized persimmon cake image data set, color, frosting, texture and shape characteristics are extracted, spectral analysis and non-destructive testing are carried out, defects are identified and comprehensive quality scores are calculated, and a quality warning mechanism and process optimization plan are established.

Benefits of technology

A comprehensive non-destructive inspection of the appearance and internal quality of persimmon cakes is achieved, the objectivity and efficiency of quality inspection are improved, and a closed-loop system of quality early warning and process optimization is formed, which enhances the quality stability and traceability of persimmon cake production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810100A_ABST
    Figure CN119810100A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a dried persimmon quality detection method and system based on machine vision. The method comprises the following steps: performing multi-angle multi-spectral imaging through an industrial camera array to generate a standard image set; extracting quantitative dried persimmon appearance characteristics; the internal quality is subjected to nondestructive testing by using a spectrum; identifying defects and grading; analyzing a quality trend and establishing an early warning mechanism; and correlating process parameters to optimize the production process, and constructing a quality tracing system. According to the invention, comprehensive nondestructive testing of the appearance and internal quality of the dried persimmons is realized, a closed-loop system of quality early warning and process optimization is formed through data analysis and mining, and the quality stability and traceability of dried persimmon production are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a persimmon quality detection method and system based on machine vision. Background Art

[0002] As a traditional agricultural product, the quality inspection of persimmons has long relied mainly on manual experience, including visual inspection of appearance characteristics, measurement of softness and hardness by hand, and evaluation of sweetness and taste by tasting. With the development of the food industry, some primary mechanized inspection methods have begun to be applied, such as using a colorimeter to measure surface color, using a texture analyzer to measure hardness, and using a saccharimeter to measure soluble solids content. In addition, laboratory analysis methods such as high-performance liquid chromatography and infrared spectroscopy have also been used to study the composition characteristics of persimmons. In recent years, computer vision technology has made certain progress in the field of agricultural product quality inspection, and simple image processing technology has been used for persimmon appearance grading, but most of them are limited to the detection of a single parameter or feature.

[0003] However, the existing persimmon quality inspection technology has many shortcomings. First, manual inspection is highly subjective, inefficient, and has inconsistent standards, making it difficult to meet the needs of large-scale production; although traditional mechanical inspection methods are objective, they are mostly single-parameter inspections and cannot comprehensively evaluate the quality of persimmons; although laboratory analysis methods are accurate, they are highly destructive, time-consuming, and costly, and are not suitable for online inspection on production lines; existing computer vision technology is simple to apply, mostly targeting single features such as color or shape, and lacks the ability to comprehensively analyze multidimensional features and non-destructive testing of internal quality; at the same time, existing technologies generally lack the analysis and mining of historical quality data and the feedback mechanism for process optimization, and cannot form a closed-loop management and traceability system for the entire quality process, resulting in quality fluctuations in the production process that are difficult to control, poor product consistency, and a lack of data support for process parameter optimization. Summary of the invention

[0004] The present application provides a persimmon cake quality inspection method and system based on machine vision, which is used to realize comprehensive non-destructive inspection of the appearance and internal quality of persimmon cakes, and through data analysis and mining, form a closed-loop system of quality warning and process optimization, so as to improve the quality stability and traceability of persimmon cake production.

[0005] In a first aspect, the present application provides a persimmon quality detection method based on machine vision, and the persimmon quality detection method based on machine vision comprises: performing multi-angle and multi-spectral imaging acquisition and preprocessing on persimmon samples through an industrial camera array system to form a standardized persimmon image data set; extracting and quantitatively analyzing the color, icing, texture and shape features of the persimmon according to the standardized persimmon image data set, and constructing a persimmon appearance feature index set; using the standardized persimmon image data set and the persimmon appearance feature index set, performing spectral analysis and non-destructive testing on the internal quality parameters of the persimmon to form a persimmon comprehensive quality feature library ; Based on the persimmon appearance characteristic index set and the persimmon comprehensive quality characteristic library, persimmon defects are identified and classified, the comprehensive quality score of persimmons is calculated, and a persimmon quality grading result table is generated; according to the persimmon quality grading result table and the persimmon appearance characteristic index set, time series analysis and trend mining are performed on persimmon quality parameters, a quality early warning mechanism is established, and an intelligent analysis report and early warning plan for persimmon quality are formed; based on the persimmon quality intelligent analysis report and early warning plan, correlation analysis and optimization are performed on persimmon production process parameters and quality characteristics, a quality traceability system is constructed, and a persimmon process parameter optimization plan and a quality traceability file are generated.

[0006] In a second aspect, the present application provides a persimmon quality detection system based on machine vision, and the persimmon quality detection system based on machine vision comprises: The acquisition module is used to perform multi-angle and multi-spectral imaging acquisition and preprocessing of persimmon samples through an industrial camera array system to form a standardized persimmon image data set; A quantification module is used to extract and quantify the color, icing, texture and shape features of the persimmons according to the standardized persimmon image data set, and to construct a persimmon appearance feature index set; A detection module, used to perform spectral analysis and non-destructive detection on the internal quality parameters of persimmons by using the standardized persimmon image data set and the persimmon appearance feature index set, so as to form a persimmon comprehensive quality feature library; A classification module, for identifying and classifying persimmon defects based on the persimmon appearance feature index set and the persimmon comprehensive quality feature library, calculating the persimmon quality comprehensive score, and generating a persimmon quality grading result table; A mining module, for performing time series analysis and trend mining on persimmon quality parameters according to the persimmon quality grading result table and the persimmon appearance characteristic index set, establishing a quality early warning mechanism, and forming a persimmon quality intelligent analysis report and early warning plan; The analysis module is used to perform correlation analysis and optimization on the persimmon production process parameters and quality characteristics based on the persimmon quality intelligent analysis report and early warning plan, build a quality traceability system, and generate a persimmon process parameter optimization plan and quality traceability file.

[0007] The third aspect of the present invention provides a computer device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the computer device executes the above-mentioned persimmon quality detection method based on machine vision.

[0008] A fourth aspect of the present invention provides a computer-readable storage medium, in which instructions are stored, which, when executed on a computer, enable the computer to execute the above-mentioned persimmon quality detection method based on machine vision.

[0009] In the technical solution provided by the present application, in the process of constructing the standardized persimmon image dataset, the improved Retinex algorithm and the edge-preserving filtering technology are integrated to effectively eliminate the influence of uneven illumination, improve the texture contrast of the feature area, and provide a high-quality data basis for subsequent feature extraction; the HSV color space transformation combined with the adaptive threshold segmentation algorithm realizes the accurate identification of the frosting area on the surface of the persimmon, so that the frosting coverage and distribution uniformity can be accurately quantified, overcoming the problem of brightness and color confusion in traditional RGB space processing; the internal quality parameters of the persimmon are quantitatively evaluated by near-infrared spectral analysis technology, and a regression model of sugar content and absorbance at a specific wavelength is established to realize non-destructive inspection of internal quality. The method can avoid the sample loss of traditional destructive detection methods; the edge detection and regional growth algorithms are integrated to finely segment the surface of persimmon cakes, and the defect feature descriptors are classified by support vector machine classifier, which greatly improves the accuracy of defect recognition, especially for defects with similar visual characteristics but different types. The time series analysis method processes the quality data, and the moving average method and anomaly detection algorithm are used to realize the early identification of quality fluctuations, so that quality problems can be discovered before large-scale losses are caused. Multivariate regression analysis is combined with genetic algorithms to optimize process parameters, and the optimal process parameter combination is found under complex parameter interaction conditions, which improves the quality consistency of persimmon cake production and reduces the unqualified rate. In the data processing process, special attention is paid to the contribution of algorithm features to the scheme. For example, the improved local binary pattern algorithm takes into account the radial texture distribution characteristics when extracting the texture features of persimmon cakes, and improves the distinguishing ability of feature vectors. The application of multispectral data fusion technology in internal quality detection solves the problem of insufficient single-band information and improves the robustness of the prediction model. The quality warning mechanism based on threshold triggering screens real anomalies through statistical significance tests, effectively reducing the false alarm rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0011] Figure 1 A schematic diagram of an embodiment of a dried persimmon quality detection method based on machine vision in an embodiment of the present application; Figure 2 This is a schematic diagram of an embodiment of a persimmon quality detection system based on machine vision in an embodiment of the present application; Figure 3 It is a schematic block diagram of the structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0012] The embodiment of the present application provides a method and system for detecting the quality of dried persimmons based on machine vision. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0013] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 In the embodiment of the present application, an embodiment of the dried persimmon quality detection method based on machine vision includes: Step S101, performing multi-angle and multi-spectral imaging acquisition and preprocessing on dried persimmon samples through an industrial camera array system to form a standardized dried persimmon image data set; Step S102, extracting and quantitatively analyzing the color, icing, texture and shape features of the persimmons according to the standardized persimmon image dataset, and constructing a persimmon appearance feature index set; Step S103, using the standardized persimmon image data set and the persimmon appearance feature index set, spectral analysis and non-destructive testing are performed on the internal quality parameters of the persimmon to form a persimmon comprehensive quality feature library; Step S104, based on the dried persimmon appearance feature index set and the dried persimmon comprehensive quality feature library, identify and classify the dried persimmon defects, calculate the dried persimmon quality comprehensive score, and generate a dried persimmon quality grading result table; Step S105, according to the persimmon quality grading result table and the persimmon appearance characteristic index set, time series analysis and trend mining are performed on the persimmon quality parameters, a quality early warning mechanism is established, and an intelligent analysis report and early warning plan for persimmon quality are formed; Step S106: Based on the persimmon quality intelligent analysis report and early warning plan, the persimmon production process parameters and quality characteristics are correlated and optimized, a quality traceability system is constructed, and a persimmon process parameter optimization plan and a quality traceability file are generated.

[0014] It is understandable that the execution subject of the present application can be a persimmon quality inspection system based on machine vision, or a terminal or a server, which is not limited here. The present application embodiment is described by taking the server as the execution subject as an example.

[0015] Specifically, the persimmon samples were collected and preprocessed by multi-angle and multi-spectral imaging through an industrial camera array system to form a standardized persimmon image dataset. The industrial camera array system includes a top main camera and four surrounding side cameras, which simultaneously capture the surface and side features of the persimmon from different angles to generate a set of original persimmon images. At the same time, three light source modes, namely diffuse white light illumination, side oblique light illumination and narrow spectrum light source illumination, were used to collect persimmon images under different lighting conditions and construct a multispectral image sequence. These original images need to be geometrically corrected to eliminate the distortion caused by the lens and viewing angle, so as to achieve accurate splicing of multi-angle images and generate a panoramic image of persimmon. Then, the foreground of the panoramic image of persimmon is extracted by an adaptive threshold segmentation algorithm. The algorithm dynamically adjusts the threshold according to the gray value distribution of the local area, accurately separates the persimmon target and the background, and obtains a persimmon target area map. Subsequently, the persimmon target area map is processed by an improved Retinex algorithm for color standardization and image enhancement. The algorithm decomposes the image into illumination component and reflection component, adjusts the illumination component to enhance the dark area details and texture contrast, and establishes an enhanced persimmon image. The enhanced persimmon image is denoised by combining Gaussian filtering and edge-preserving filtering to retain the surface texture details of the persimmon while suppressing random noise, forming a standardized persimmon image dataset.

[0016] According to the standardized persimmon image dataset, the color, icing, texture and shape features of persimmon are extracted and quantitatively analyzed to construct a persimmon appearance feature index set. Specifically, the color of the standardized persimmon image is converted by HSV color space transformation. The HSV color space divides the color into three dimensions: hue, saturation and value, which is more in line with human perception characteristics. The hue distribution, saturation distribution and value distribution parameters of the persimmon surface are calculated to form the persimmon color feature vector. Then, the icing area of ​​the standardized persimmon image is identified by the adaptive threshold segmentation algorithm. The algorithm can automatically determine the optimal segmentation threshold according to the local area characteristics of the image, calculate the icing coverage, distribution uniformity and crystallization mode, and construct the persimmon icing feature descriptor. Then, the texture analysis of the standardized persimmon image is carried out based on the local binary pattern (LBP) and gray level co-occurrence matrix (GLCM). LBP generates binary code by calculating the relationship between the central pixel and the surrounding pixels. GLCM describes the texture features by statistically analyzing the grayscale relationship of pixel pairs, extracting texture uniformity, directionality and roughness values, and generating a persimmon texture feature set. In addition, the shape analysis of the standardized persimmon image was performed using contour extraction and morphological analysis methods, and the roundness, symmetry and perimeter-to-area ratio of the persimmon were calculated to establish a persimmon shape descriptor. The wrinkle feature analysis of the standardized persimmon image was performed using an edge detection algorithm. The algorithm detected the areas with large grayscale value changes in the grayscale image, measured the wrinkle density, depth and direction distribution parameters, and formed a persimmon surface structure feature map. The persimmon color feature vector, persimmon icing feature descriptor, persimmon texture feature set, persimmon shape descriptor and persimmon surface structure feature map were weighted fused to construct a persimmon appearance feature index set.

[0017] Using the standardized persimmon image dataset and the persimmon appearance characteristic index set, the internal quality parameters of persimmons are spectrally analyzed and non-destructively tested to form a comprehensive quality feature library for persimmons. In the specific implementation, the near-infrared (780-2500nm), ultraviolet (200-400nm) and visible light (400-780nm) band images in the standardized persimmon image dataset are spectrally separated and extracted, the reflectance and transmittance values ​​of persimmons at different wavelengths are calculated, and the multi-spectral characteristic curve of persimmons is constructed. By analyzing the absorption characteristics of the near-infrared band in the multi-spectral characteristic curve of persimmons, especially the relationship between the absorption peaks near the wavelengths of 1450nm and 1930nm and the sugar content, the sugar content of persimmons is quantitatively evaluated, and a persimmon sweetness distribution map is generated. According to the grayscale distribution characteristics of the image of the moisture characteristic absorption band (such as 1450nm, 1940nm), combined with the texture parameters in the persimmon appearance characteristic index set, the moisture content of persimmons is calculated to form a persimmon moisture content distribution map. Ultraviolet fluorescence imaging technology was used to enhance the specific wavelength response in the standardized persimmon image dataset, detect the potential moldy area inside the persimmon, and establish a mold risk assessment index. Based on the differences in the multispectral transmission characteristics of the standardized persimmon image dataset, the internal tissue of the persimmon was layered and analyzed to evaluate the uniformity and density of the internal tissue, and to construct a persimmon internal structure model. The persimmon sweetness distribution map, persimmon moisture content distribution map, mold risk assessment index and persimmon internal structure model were integrated, and the correlation analysis was performed with the persimmon appearance characteristic index set to form a persimmon comprehensive quality feature library.

[0018] Based on the persimmon appearance feature index set and the persimmon comprehensive quality feature library, the persimmon defects are identified and classified, the persimmon quality comprehensive score is calculated, and the persimmon quality grading result table is generated. In the specific implementation, the persimmon surface is finely segmented by fusing edge detection and region growing algorithms. The edge detection algorithm identifies the areas with significant grayscale value changes in the image. The region growing algorithm gradually expands similar pixel areas from the seed point, identifies the surface abnormal structure and color deviation area, and generates the persimmon defect candidate map. The local color, texture and shape feature parameters are extracted from the persimmon defect candidate map, and the defect feature descriptor is constructed by combining the standard features in the persimmon appearance feature index set. The defect feature descriptor is classified by the support vector machine (SVM) classifier. The SVM distinguishes different categories by constructing the optimal hyperplane, and divides the surface defects of persimmon into mildew, insect damage, mechanical damage and rot and deterioration categories, forming a persimmon defect type distribution map. According to the persimmon defect type distribution map, the area proportion, severity and location distribution of each defect are calculated, and the defect scoring matrix is ​​established by combining the aesthetic parameters in the persimmon appearance feature index set. Based on the internal quality data in the persimmon comprehensive quality feature library, the sugar content, moisture content and tissue characteristics of the persimmons were evaluated and scored, and the defect scoring matrix was integrated to calculate the comprehensive quality score of the persimmons. According to the comprehensive quality score of the persimmons and the industry standard grading threshold, the persimmon samples were divided into five grades: special grade, first grade, second grade, qualified and unqualified, and a persimmon quality grading result table was generated.

[0019] According to the persimmon quality grading result table and characteristic data, the persimmon quality parameters are analyzed and trended, a quality early warning mechanism is established, and an intelligent analysis report and early warning plan for persimmon quality are formed. In the specific implementation, a time series storage structure for persimmon quality data is established, and the persimmon quality grading result table is organized and stored by time, batch and origin to build a persimmon quality history database. The changes in quality parameters in the persimmon quality history database are tracked and analyzed by time series analysis methods, including statistical methods such as moving average method, exponential smoothing method and autoregressive model, to identify the quality fluctuation rules and abnormal change points, and form a persimmon quality trend chart. The quality data of persimmons from different batches and different origins are statistically calculated for distribution, and the key parameters in the persimmon appearance characteristic index set and the persimmon comprehensive quality characteristic library are combined to find the quality influencing factors and establish a persimmon quality correlation factor table. Based on the statistical analysis results of the persimmon quality grading result table, the proportion of each grade, the unqualified rate and the quality consistency index are calculated, and the batch quality assessment report is generated in combination with the persimmon quality trend chart. Integrate environmental monitoring data with the table of factors associated with persimmon quality, explore the mapping relationship between environmental factors and persimmon quality through multi-source data fusion analysis, and build a persimmon quality change prediction model. Design an automatic warning rule for quality anomalies based on threshold triggering. When abnormal fluctuations or downward trends in persimmon quality parameters are detected, an early warning signal and cause analysis are automatically generated to form an intelligent analysis report and early warning plan for persimmon quality.

[0020] The production process parameters and quality characteristics of persimmons were analyzed and optimized, a quality traceability system was established, and a persimmon process parameter optimization plan and quality traceability archive were generated. In the specific implementation, a correlation data model of the production process parameters and quality characteristics of persimmons was constructed, and the drying temperature, humidity, time and flip frequency were mapped and associated with the persimmon appearance characteristic index set, the persimmon comprehensive quality characteristic library and the persimmon quality grading result table to form a process-quality correlation data table. The process-quality correlation data table was processed by multivariate regression analysis to identify the key process parameter combinations that significantly affect the final quality of persimmons, and to establish a process parameter impact weight table. Based on the high-quality persimmon sample data in the persimmon quality intelligent analysis report, the corresponding process parameter configuration was extracted, and the process parameter optimization space was constructed in combination with the process parameter impact weight table. A genetic algorithm was used to perform parameter optimization calculations on the process parameter optimization space. The algorithm simulated the natural evolution process, iteratively optimized the parameter combination, searched for the process parameter combination that maximized the persimmon quality score, and generated a persimmon production process parameter optimization plan. Establish a digital traceability structure for the entire persimmon production process, assign a unique identification code to each batch of persimmons, link the raw material source, processing technology, persimmon quality grading result table, persimmon quality intelligent analysis report and early warning plan data, and build a persimmon quality chain diagram. Develop a QR code scanning interface to encode the quality inspection results, production date and origin information in the persimmon quality chain diagram into the product identification to form a persimmon quality traceability file.

[0021] For example, when the industrial camera array system collects dried persimmon images, it obtains the RGB original image, and each pixel contains three channel values. In the process of geometric correction, perspective transformation is used to map images at different angles to a unified coordinate system. In the adaptive threshold segmentation, the average grayscale value of pixels in the local area is calculated, and a constant is subtracted from the local average value to obtain the dynamic threshold of each position. When the improved Retinex algorithm is processed, the image is decomposed into illumination component and reflection component, and then the illumination component is subjected to logarithmic transformation, Gaussian filtering is applied to the illumination component, and then the enhanced reflection component is subtracted from the illumination component. In the HSV color space transformation, the RGB value is mapped to the HSV space through nonlinear transformation to obtain the hue, saturation and brightness value of each pixel. In the local binary pattern analysis, the pixels in the neighborhood of the central pixel are binarized to obtain binary coding, and then the coding histogram of the entire image is counted as the texture feature. In the calculation of the grayscale co-occurrence matrix, the co-occurrence frequency of the grayscale values ​​of the pixel pairs with a certain distance is counted to form a matrix, and then the statistics such as energy, contrast, and correlation are extracted from it. During the near-infrared spectroscopy analysis, by comparing the reflectivity differences at different wavelengths and using the absorption characteristics of sugar at specific wavelengths, a regression model of sugar content and absorbance is established. During support vector machine classification, the extracted defect feature vector is mapped to a high-dimensional feature space, and a maximum interval hyperplane is constructed to separate different types of defects. In time series analysis, a moving average window is used to smooth historical quality data to eliminate the impact of short-term fluctuations and highlight long-term trends. When the genetic algorithm optimizes process parameters, a population is defined, and new parameter combinations are generated through crossover and mutation operations. Excellent individuals are selected and retained according to the fitness function, and the optimal parameter combination is found after multiple generations of iterations.

[0022] In the embodiment of the present application, in the process of constructing the standardized persimmon image data set, the improved Retinex algorithm and the edge-preserving filtering technology are integrated to effectively eliminate the influence of uneven illumination, improve the texture contrast of the feature area, and provide a high-quality data basis for subsequent feature extraction; the HSV color space transformation combined with the adaptive threshold segmentation algorithm realizes the accurate identification of the frosting area on the surface of the persimmon, so that the frosting coverage and distribution uniformity can be accurately quantified, overcoming the problem of brightness and color confusion in traditional RGB space processing; the internal quality parameters of the persimmon are quantitatively evaluated by near-infrared spectral analysis technology, and a regression model of sugar content and absorbance at a specific wavelength is established, realizing non-destructive detection of internal quality. The sample loss of traditional destructive detection methods is avoided; the edge detection and regional growth algorithms are integrated to finely segment the surface of persimmon cakes, and the defect feature descriptors are classified by support vector machine classifier, which greatly improves the accuracy of defect recognition, especially for defects with similar visual characteristics but different types. The time series analysis method processes the quality data, and the moving average method and anomaly detection algorithm are used to realize the early identification of quality fluctuations, so that quality problems can be discovered before large-scale losses are caused; multivariate regression analysis is combined with genetic algorithms to optimize the process parameters, and the optimal process parameter combination is found under complex parameter interaction conditions, which improves the quality consistency of persimmon cake production and reduces the unqualified rate. In the data processing process, special attention is paid to the contribution of algorithm features to the scheme. For example, the improved local binary pattern algorithm takes into account the radial texture distribution characteristics when extracting the texture features of persimmon cakes, and improves the distinguishing ability of feature vectors; the application of multispectral data fusion technology in internal quality detection solves the problem of insufficient single-band information and improves the robustness of the prediction model; the quality warning mechanism based on threshold triggering screens real anomalies through statistical significance tests, effectively reducing the false alarm rate.

[0023] In a specific embodiment, the process of executing step S101 may specifically include the following steps: (1) The top main camera and surrounding side cameras are used to collect all-round images of the persimmons to obtain the surface and side feature images of the persimmons and form a set of original persimmon images; (2) Use diffuse white light, side oblique light, and narrow-spectrum light sources to illuminate the persimmon cakes, collect multispectral images of the persimmon cakes under different lighting conditions, and construct a multispectral image sequence; (3) The original persimmon image group is subjected to distortion elimination and perspective unification processing through geometric correction methods to achieve accurate stitching of multi-angle images and generate a panoramic image of persimmon; (4) Based on the adaptive threshold segmentation algorithm, the foreground of the persimmon panorama image is extracted, the persimmon target and the background are accurately separated, and the persimmon target area map is obtained; (5) The color of the persimmon target area image was standardized and image enhanced by improving the Retinex algorithm to enhance the dark area details and texture contrast, and to establish an enhanced persimmon image; (6) The enhanced persimmon images were denoised by combining Gaussian filtering and edge-preserving filtering, which retained the surface texture details of the persimmons while suppressing random noise, thus forming a standardized persimmon image dataset.

[0024] Specifically, the top main camera and the surrounding side cameras are used to collect all-round images of the persimmons, obtain the surface and side feature images of the persimmons, and form the original image group of the persimmons. The top main camera is installed vertically downward, and is mainly responsible for collecting information on the surface of the persimmons, including color, shape, and surface texture; while the surrounding side cameras are facing the center of the persimmons at an angle of 45° or 60°, responsible for collecting the side features of the persimmons, such as thickness, edge contour, and side icing distribution. The images collected by each camera are high-resolution digital images, usually with a resolution of more than 2000×1500 pixels, to ensure that the subtle features of the surface of the persimmons can be captured. The multi-angle images collected by these cameras together form the original image group of persimmons.

[0025] Then, the persimmons were illuminated by diffuse white light, side oblique light and narrow spectrum light sources, and multi-spectral images of persimmons under different lighting conditions were collected to construct a multi-spectral image sequence. Diffuse white light illumination is a uniformly diffused light source provided by a large-area soft light box. It is mainly used to evenly illuminate the surface of persimmons, reduce shadows and highlights, and obtain the true color and overall morphological characteristics of persimmons; side oblique light illumination illuminates the surface of persimmons from a low angle, and enhances the texture and tiny concave-convex structure of the surface of persimmons by generating shadows, which helps to detect surface wrinkles and defects; narrow spectrum light source refers to a light source in a specific wavelength range, such as a specific wavelength LED or laser, which is used to stimulate the reaction of persimmons at a specific wavelength, such as near-infrared light source (780-2500nm) for detecting sugar and moisture content, and ultraviolet light source (200-400nm) for detecting potential moldy areas, because some molds produce specific fluorescence under ultraviolet light. Through imaging under these three different light source conditions, an image sequence containing different spectral information is formed, enriching the multi-dimensional perception ability of persimmon characteristics.

[0026] The original persimmon image group is subjected to distortion elimination and perspective unification processing by the geometric correction method, so as to achieve accurate stitching of multi-angle images and generate a panoramic image of persimmon. The geometric correction method mainly solves the problem of image deformation caused by perspective effect and lens distortion. Lens distortion correction is performed to eliminate radial and tangential distortion caused by the optical characteristics of the lens. The Zhang Zhengyou chessboard calibration method is usually used to obtain the camera intrinsic parameters and distortion coefficients, and then the original image is corrected by inverse transformation. Subsequently, the perspective is unified to unify the images taken at different angles into the same coordinate system. This process involves coordinate transformation and image registration. Feature point matching methods such as SIFT (Scale Invariant Feature Transform) or SURF (Speeded Up Robust Feature) algorithms are used to detect and match key points in different images, establish corresponding relationships, and then the correct matching point pairs are screened out by the RANSAC (Random Sampling Consensus) algorithm, and the perspective transformation matrix is ​​calculated. The images at multiple angles are mapped to a unified perspective by applying image transformation. Through image fusion methods such as weighted averaging or multi-resolution spline fusion, the pixels in the overlapping areas are processed to ensure a natural transition, thereby generating a seamless panoramic image of persimmon cakes, providing complete visual information for subsequent analysis.

[0027] Based on the adaptive threshold segmentation algorithm, the foreground of the persimmon panoramic image is extracted, the persimmon target and the background are accurately separated, and the persimmon target area map is obtained. The adaptive threshold segmentation algorithm is different from the global threshold segmentation. It can dynamically adjust the threshold value according to the grayscale distribution characteristics of different areas in the image, and is more suitable for processing images with uneven lighting or complex backgrounds. The specific implementation method is to move the sliding window on the image, calculate the local statistical characteristics (such as mean, median or weighted average) for each window area, obtain the local threshold of the area, and then use the threshold to binarize the center point of the current window. If the grayscale value of the point is greater than the local threshold plus an offset constant, it is judged as the foreground (persimmon area), otherwise it is judged as the background. This algorithm has strong adaptability to lighting gradients and uneven backgrounds, and can effectively process the transition area between the edge and background of persimmons and extract accurate persimmon contours. The persimmon target area map obtained after processing is a binary image, in which the white area represents persimmons and the black area represents the background, providing an accurate area of ​​interest for subsequent image analysis.

[0028] The improved Retinex algorithm is used to perform color standardization and image enhancement on the persimmon target area map, improve the dark area details and texture contrast, and establish an enhanced persimmon image. The Retinex algorithm is based on the color constancy theory of the human visual system, and aims to eliminate the influence of illumination changes and restore the reflective characteristics of the object itself. The improved Retinex algorithm decomposes the image into an illumination component and a reflective component. The illumination component represents the ambient lighting conditions, and the reflective component contains the characteristic information of the object itself. The traditional Retinex algorithm converts the multiplication relationship into an addition relationship through logarithmic domain transformation, and then estimates the illumination component through Gaussian filtering, but this method is prone to "halo" effect. The improved version uses multi-scale decomposition and edge-preserving filtering to more accurately estimate the illumination component and reduce artifacts. By adjusting the dynamic range of the illumination component and enhancing the local contrast of the reflective component, the detail visibility and texture feature contrast of the dark area in the persimmon image are improved. Color standardization is to adjust the color distribution in the image to the standard distribution range, eliminate the color deviation caused by the difference in light source color temperature, and make the persimmon images collected from different batches and under different conditions comparable.

[0029] The enhanced persimmon image is denoised by combining Gaussian filtering and edge-preserving filtering, retaining the texture details of the persimmon surface while suppressing random noise, forming a standardized persimmon image dataset. Gaussian filtering is a linear smoothing filter that blurs the image by weighted averaging the neighborhood pixel values ​​with a Gaussian function, effectively suppressing high-frequency noise, but also blurring the image edges and texture details. Edge-preserving filtering is a type of nonlinear filtering method, such as bilateral filtering, guided filtering or non-local mean filtering. This method not only considers the spatial distance of pixels, but also the similarity of pixel values, and can preserve edge and structural information while smoothing the image. In this method, Gaussian filtering is applied to perform preliminary denoising on the image to eliminate most of the random noise; then edge-preserving filtering is used for further processing to repair the edge blurring problem that may be introduced by Gaussian filtering, retaining the key features of the persimmon surface, such as texture details, icing crystals and wrinkled structures. This dual filtering strategy can not only effectively suppress image noise, but also retain the characteristic information of the persimmon surface, forming a clear, low-noise, and standardized persimmon image dataset.

[0030] For example, during the actual persimmon quality inspection process, the persimmon is placed on the conveyor belt. When passing through the inspection area, the top main camera and the surrounding side cameras are triggered at the same time to collect multi-angle images of the persimmon. The top camera captures a 2448×2048 resolution plane image, and the four side cameras collect a 2048×1536 resolution side image from different angles, forming a total of five original images. Then the system switches three light sources in turn: diffuse white light, 45° side oblique light, and near-infrared narrow spectrum light source, and repeatedly collects under each lighting condition to form 15 multispectral images. After the acquisition is completed, the system performs geometric correction on these images, corrects lens distortion through pre-calibrated parameters, and then uses the SIFT algorithm to extract feature points in the image, finds about 200-300 pairs of matching points between adjacent images, selects accurate matching points through the RANSAC algorithm, calculates the perspective transformation matrix, transforms the side image to the same perspective as the top image, and processes the overlapping area through multi-resolution fusion technology to generate a seamless panoramic image of the persimmon. Then, adaptive threshold segmentation was applied to the panoramic image, using a sliding window of 11×11 pixels, calculating the local mean and subtracting a constant of 10 as the threshold, successfully separating the persimmon area from the background. Then, the improved Retinex algorithm was applied, using a three-scale Gaussian kernel to decompose the illumination component, and the image was reconstructed after adjusting the dynamic range, which significantly improved the visibility of the details in the dark area of ​​the persimmon and the frosting structure. Preliminary noise reduction was performed through Gaussian filtering, and then bilateral filtering was applied to retain edge details, resulting in a standardized persimmon image with extremely low noise and complete texture information.

[0031] In a specific embodiment, the process of executing step S102 may specifically include the following steps: (1) The color of the standardized persimmon image dataset was converted by HSV color space transformation, and the hue, saturation and brightness distribution parameters of the persimmon surface were calculated to form the persimmon color feature vector; (2) An adaptive threshold segmentation algorithm was used to identify the frosting area of ​​the standardized persimmon image dataset, calculate the frosting coverage, distribution uniformity, and crystallization pattern, and construct a persimmon frosting feature descriptor; (3) Texture analysis of the standardized persimmon image dataset was performed based on local binary patterns and gray-level co-occurrence matrix to extract texture uniformity, directionality, and roughness values, and generate a persimmon texture feature set; (4) Shape analysis of the standardized persimmon image dataset was performed using contour extraction and morphological analysis methods to calculate the roundness, symmetry, and perimeter-to-area ratio of the persimmons and establish a persimmon shape descriptor. (5) The wrinkle feature analysis of the standardized persimmon image dataset was performed using an edge detection algorithm to measure the wrinkle density, depth, and direction distribution parameters to form a surface structural feature map of the persimmon; (6) The persimmon color feature vector, persimmon icing feature descriptor, persimmon texture feature set, persimmon shape descriptor and persimmon surface structure feature map are weightedly fused to construct a persimmon appearance feature index set.

[0032] Specifically, the color conversion of the standardized persimmon image dataset is performed through HSV color space transformation, and the distribution parameters of the persimmon surface hue, saturation and brightness are calculated to form the persimmon color feature vector, which is an important part of persimmon quality detection. HSV color space is a color representation method that is more in line with human perception characteristics, where H represents hue, which represents the basic attributes of color, such as red, blue, etc., with a value range of 0-360 degrees; S represents saturation, which represents the purity of the color. The higher the saturation, the brighter the color, with a value range of 0-1; V represents value, which represents the brightness of the color, with a value range of 0-1. The process of converting from RGB color space to HSV color space requires converting each pixel in the RGB image. After the conversion, the HSV value of the entire persimmon area is statistically analyzed, and the statistical characteristics such as the mean, standard deviation, skewness, and kurtosis of hue, saturation, and brightness are calculated to form a persimmon color feature vector. These characteristics can effectively describe the maturity, dryness and quality status of persimmons, because high-quality persimmons usually have a specific range of hue distribution and appropriate saturation, and a uniform lightness distribution represents a consistent drying effect.

[0033] The adaptive threshold segmentation algorithm is used to identify the frosting area of ​​the standardized persimmon image dataset, calculate the frosting coverage, distribution uniformity and crystallization pattern, and construct the persimmon frosting feature descriptor. The adaptive threshold segmentation algorithm is a method that dynamically adjusts the threshold for the grayscale value of the local area, which is particularly suitable for processing images with uneven lighting. In persimmon images, the frosting area usually presents high brightness and low saturation features, so segmentation conditions can be designed in HSV space based on these characteristics. Specifically, the formula for calculating the frosting coverage (FC) is: ; in, Indicates whether the i-th pixel is a frosting area (value is 1 or 0), and N represents the total number of pixels in the dried persimmon area. The frosting distribution uniformity (FD) can be evaluated by calculating the consistency of the distribution of the frosting area on the dried persimmon surface: ; in, is the standard deviation of the icing coverage of each quadrant after the dried persimmon surface is divided into multiple quadrants. is the average of the frosting coverage in each quadrant. The crystallization pattern (FP) is characterized by analyzing the morphological characteristics of the frosting area: ; in, represents the frosting area density, Indicates the average size of the frosting particles. represents the regularity of the frosting distribution pattern, , , is the weight coefficient. These three feature parameters together constitute the persimmon icing feature descriptor, which is used to evaluate the icing quality of persimmon.

[0034] Based on local binary pattern and gray level co-occurrence matrix, the texture analysis of the standardized persimmon image dataset was carried out to extract the texture uniformity, directionality and roughness values, and generate the persimmon texture feature set. Local binary pattern (LBP) is a method for texture feature extraction. It generates binary codes by comparing the gray value size relationship between the central pixel and the surrounding pixels, and then counts the distribution of various codes in the entire image. In the analysis of persimmon images, the gray image is divided into small windows such as 3×3 or 5×5 according to the pixel points. For each window, the gray value of the central pixel is compared with that of the surrounding pixels. If the surrounding pixels are greater than or equal to the central pixel, the code is 1, otherwise it is 0. In this way, each window generates a binary string. After converting it to a decimal number, the frequency distribution of each code value in the entire image is counted to form an LBP histogram. The gray level co-occurrence matrix (GLCM) counts the spatial relationship of gray value pairs in the image. By calculating the co-occurrence frequency of gray values ​​of two pixels with a certain distance and direction relationship, a matrix is ​​formed, and then statistical features such as energy, contrast, homogeneity, correlation, etc. are extracted from the matrix. Texture uniformity can be characterized by the homogeneity feature of GLCM, directionality is quantified by analyzing the changes in GLCM features in different directions, and roughness is represented by the concentration of the LBP spectrum or the contrast of GLCM. These features are combined to form a set of persimmon texture features, which can effectively describe the fineness of the surface structure and the drying quality of persimmons. The shape analysis of the standardized persimmon image dataset was performed using contour extraction and morphological analysis methods, and the roundness, symmetry and perimeter area ratio of the persimmons were calculated to establish a persimmon shape descriptor. Contour extraction refers to the process of extracting the boundary of the target from a binary image. Usually, an edge tracking algorithm is used, starting from an edge point, and searching for adjacent edge points along the edge in sequence until returning to the starting point to form a closed contour line. The extracted persimmon contour is subjected to morphological analysis to calculate the roundness (Cir), that is, the degree of closeness of the actual shape to the perfect circle:

[0035] in, Indicates the area of ​​dried persimmon. represents the perimeter of the persimmon. Symmetry (Sym) can be measured by calculating the mirror image consistency of the persimmon shape on different axes: ; in, and is a pair of points on the contour that are symmetrical about the axis of symmetry, and D represents the distance difference between the points. is the number of sampling point pairs. The perimeter-to-area ratio (PAR) directly calculates the ratio of the perimeter to the area of ​​the dried persimmon:

[0036] These shape feature parameters together constitute the shape descriptor of persimmon, which is used to evaluate the shape regularity and consistency of persimmon. The wrinkle feature analysis of the standardized persimmon image dataset was carried out by edge detection algorithm, and the wrinkle density, depth and direction distribution parameters were measured to form the surface structure feature map of persimmon. Edge detection algorithm is a method to detect the area where the gray value changes sharply in the image. Commonly used operators include Sobel operator and Canny operator. Sobel operator detects edges by calculating the gradient of the image in the horizontal and vertical directions, while Canny operator is a multi-stage edge detection algorithm, including Gaussian smoothing, gradient calculation, non-maximum suppression and double threshold processing. In the wrinkle analysis of persimmon, the wrinkles appear as dense edge lines in the edge image obtained after edge detection. The wrinkle density is measured by the number of edge pixels per unit area, the wrinkle depth can be indirectly expressed by the edge intensity (gradient amplitude), and the wrinkle direction distribution is obtained by statistically analyzing the distribution histogram of the edge gradient direction. These wrinkle features reflect the shrinkage degree and uniformity of persimmon during the drying process, which is of great significance for judging the maturity and processing technology of persimmon.

[0037] The persimmon color feature vector, persimmon icing feature descriptor, persimmon texture feature set, persimmon shape descriptor and persimmon surface structure feature map are weighted fused to construct a persimmon appearance feature index set. Weighted fusion refers to the process of assigning different weight coefficients to each feature according to its importance to quality assessment, and then combining the features linearly or nonlinearly. The optimal weight can be determined by expert scoring or machine learning methods. The fusion process standardizes features of different dimensions to make their numerical ranges consistent, and then performs weighted summation or more complex fusion operations according to preset weights. The persimmon appearance feature index set formed after fusion is a multidimensional feature vector that comprehensively describes the appearance quality characteristics of persimmons and provides a data basis for subsequent quality rating and defect detection.

[0038] For example, when extracting the appearance features of a batch of dried persimmon samples, a standardized dried persimmon image is obtained and the RGB image is converted into the HSV color space. During the conversion process, assuming that the RGB value of a pixel in a dried persimmon image is (210, 150, 90), the HSV value of the point is calculated by the HSV conversion formula to be approximately (30°, 0.57, 0.82), indicating orange-brown, medium saturation, and high brightness. Statistics are taken for the entire dried persimmon area, and characteristic parameters such as the hue mean of 25°, the standard deviation of 5°, the saturation mean of 0.62, and the brightness mean of 0.75 are obtained to form a color feature vector. Then, the frosting area is identified, and the threshold condition of the HSV space is set: the area with high brightness (V>0.8) and low saturation (S<0.2) is determined as frosting. After the frosting area is identified through the adaptive threshold segmentation algorithm, the frosting coverage, distribution uniformity, and crystallization pattern parameters are calculated. Then, the LBP algorithm was applied to compare the central pixel with the 8 neighboring pixels in the 3×3 window selected from the grayscale image, generate binary codes and statistically distribute them. At the same time, the grayscale co-occurrence matrix was constructed, and the statistical features such as contrast, correlation, energy and homogeneity in the four directions of 0°, 45°, 90° and 135° were calculated. The contour of the binary image of persimmon was extracted, and the basic geometric features such as area and perimeter were calculated, and then the roundness, symmetry and perimeter-to-area ratio were calculated. The Canny edge detector was used for wrinkle analysis, and the low threshold and high threshold were set to 30% and 70% of the average gradient of the image, respectively, to obtain the edge map and statistically calculate the wrinkle features. According to the importance of each feature to the quality, these features were assigned weight coefficients for fusion: color feature weight 0.3, icing feature weight 0.25, texture feature weight 0.2, shape feature weight 0.15, wrinkle feature weight 0.1, to generate a comprehensive persimmon appearance feature index set. This set of indicators not only reflects the intuitive qualities of persimmon cakes, such as color and shape, but also includes subtle features such as icing distribution and surface texture, comprehensively and accurately describing the appearance quality status of persimmon cakes.

[0039] In a specific embodiment, the process of executing step S103 may specifically include the following steps: (1) Spectra of near-infrared, ultraviolet, and visible light band images in the standardized persimmon image dataset were separated and extracted, the reflectance and transmittance values ​​of persimmon at different wavelengths were calculated, and the multispectral characteristic curve of persimmon was constructed; (2) By analyzing the absorption characteristics of the near-infrared band in the multi-spectral characteristic curve of persimmon, the sugar content of persimmon was quantitatively evaluated and a sweetness distribution map of persimmon was generated; (3) Based on the grayscale distribution characteristics of the moisture characteristic absorption band image and the texture parameters in the dried persimmon appearance characteristic index set, the moisture content of the dried persimmon is calculated to form a dried persimmon moisture content distribution map; (4) Using ultraviolet fluorescence imaging technology to enhance the specific wavelength response in the standardized persimmon image dataset, detect the potential moldy areas inside the persimmon, and establish a mold risk assessment index; (5) Based on the differences in multispectral transmission characteristics of the standardized persimmon image dataset, a hierarchical analysis of the internal structure of the persimmon was performed to evaluate the uniformity and density of the internal structure of the persimmon, and to construct a persimmon internal structure model; (6) The sweetness distribution map of persimmon cake, the moisture content distribution map of persimmon cake, the mold risk assessment index and the internal structure model of persimmon cake were integrated and correlated with the persimmon cake appearance characteristic index set to form a comprehensive quality characteristic library of persimmon cake.

[0040] Specifically, multispectral images refer to multiple images of the same target acquired in different wavelength ranges, including near-infrared (780-2500nm), ultraviolet (200-400nm) and visible light (400-780nm) bands. Spectral separation and extraction refers to separating single-band images of different wavelengths from a multispectral image sequence, and calculating the reflection and transmission characteristics of persimmons to light at each wavelength. The reflectivity (R) represents the ratio of the light intensity reflected back from the surface of the persimmon to the incident light intensity, and the transmittance (T) represents the ratio of the light intensity after pennetrating the persimmon to the incident light intensity. The calculation formulas for reflectivity and transmittance at different wavelengths are as follows:

[0041] in, The wavelength is The reflectivity at Represents the intensity of reflected light, represents the incident light intensity, represents the calibration factor, which is used to compensate for the deviation of the device response curve. The transmittance calculation uses a similar formula:

[0042] in, The wavelength is The transmittance at represents the intensity of transmitted light, represents the transmission calibration coefficient, represents the thickness compensation factor, Indicates the thickness of the persimmon sample. Connect the reflectance and transmittance data points at different wavelengths to form a spectrum curve, namely the persimmon multi-spectral characteristic curve.

[0043] By analyzing the absorption characteristics of the near-infrared band in the multispectral characteristic curve of persimmon, the sugar content of persimmon is quantitatively evaluated and a sweetness distribution map of persimmon is generated. The near-infrared band is sensitive to the vibration and rotation of organic molecules, and different chemical bonds will produce characteristic absorption peaks at specific wavelengths. Sugar compounds such as sucrose, glucose and fructose have obvious absorption characteristics in the near-infrared region, especially near 900nm, 1100nm, 1450nm and 1930nm. The absorption values ​​of these characteristic wavelengths are extracted from the multispectral characteristic curve, and then a sugar content prediction model is established by a multivariate correction method. Commonly used multivariate correction methods include partial least squares regression (PLSR) and principal component regression (PCR), which can handle the correlation between multivariate data, extract effective information and establish a prediction model. The established model is applied to each pixel point to calculate the sugar content at the corresponding position, and a sweetness distribution map of persimmon is drawn to intuitively display the distribution of sugar in different areas of persimmon, which is of great significance for evaluating the maturity and taste uniformity of persimmon.

[0044] According to the grayscale distribution characteristics of the moisture characteristic absorption band image, combined with the texture parameters in the persimmon appearance characteristic index set, the moisture content of the persimmon is calculated to form a persimmon moisture content distribution map. Water has two main absorption peaks in the near-infrared region, located near 1450nm and 1940nm respectively. These wavelengths correspond to the OH bond vibration characteristics of water molecules. The formula for calculating the moisture content of persimmon is as follows: ; in, Representing coordinates The moisture content at is the bias constant, represents the absorbance of the i-th moisture characteristic absorption band and is calculated as , is the reflectivity corresponding to the wavelength, is the absorbance weight coefficient; represents the jth texture parameter in the persimmon appearance feature index set, such as texture uniformity, directionality, etc. is the corresponding weight coefficient; Represents the gray value, is the grayscale correction function, which is used to adjust the moisture estimation value at different grayscale levels. Indicates the number of characteristic absorption bands used for moisture detection. For example, if two main moisture absorption bands of 1450nm and 1940nm are used, then =2. Indicates the number of texture parameters used. For example, if three texture parameters are used: texture uniformity, directionality, and roughness, then =3. The formula takes into account the influence of spectral characteristics and texture characteristics on moisture prediction, making the moisture content estimation more accurate. The calculation results are visualized to form a persimmon moisture content distribution map, which intuitively shows the distribution of moisture in various parts of the persimmon, providing a basis for evaluating drying uniformity and storage stability.

[0045] Ultraviolet fluorescence imaging technology is used to enhance the specific wavelength response in the standardized persimmon image dataset, detect the potential moldy area inside the persimmon, and establish a mold risk assessment index. Ultraviolet fluorescence imaging is a technology that uses the principle that certain substances emit visible light fluorescence under ultraviolet light to detect samples. Molds and their metabolites such as aflatoxin will produce specific fluorescence reactions under ultraviolet light, usually showing blue-green or yellow fluorescence. In specific implementation, ultraviolet light with a wavelength of about 365nm is used to irradiate persimmons, and fluorescent images are captured by a camera with a specific filter. The fluorescent image is processed by image enhancement, including contrast stretching, adaptive histogram equalization, and pseudo-color enhancement, so that the potential moldy area is more visually obvious. Then, by setting the fluorescence intensity threshold, possible moldy areas are identified, and mold risk indicators such as the area ratio of the fluorescent area, the mean value of the fluorescence intensity, and the distribution characteristics are calculated. These indicators are combined to form a mold risk assessment index, which is used to detect the mold risk of persimmons at an early stage and prevent the spread of contamination.

[0046] Based on the difference in multispectral transmission characteristics of standardized persimmon image datasets, the internal tissue of persimmons was layered and analyzed, the uniformity and density of the internal tissue of persimmons were evaluated, and the internal structure model of persimmons was constructed. Light of different wavelengths has different penetration capabilities on persimmon tissues. Short-wave visible light mainly reflects surface information, while long-wave near-infrared light can penetrate deeper and provide internal tissue information. By analyzing the differences in transmission images of different wavelengths, the layered structure inside persimmons can be inferred. The specific method is to select a series of transmission images from short wave to long wave, and calculate the difference maps between adjacent wavelength images. These difference maps represent the information of different depth layers. Then, image segmentation and feature extraction techniques are used to extract tissue features such as density distribution, texture characteristics, and uniformity from each layer of the difference map. Based on these features, a three-dimensional structural model of the internal persimmon is constructed. The model describes the tissue change characteristics of persimmons from the surface to the core, reflects the uniformity of water migration and tissue shrinkage during the drying process, and provides an intuitive representation for evaluating the internal quality of persimmons.

[0047] The persimmon sweetness distribution map, persimmon moisture content distribution map, mold risk assessment index and persimmon internal structure model are integrated and analyzed with the persimmon appearance characteristic index set to form a comprehensive quality feature library of persimmon. Association analysis is the process of exploring the relationship between different features, and quantifying the strength of the association between features by calculating correlation coefficients, mutual information or more complex statistical models. For example, analyze the spatial correlation between sugar distribution and moisture distribution, explore the relationship between internal tissue density and surface texture characteristics, and the dependency between mold risk and moisture content. These association analysis results form knowledge rules, which together with the original feature data constitute a comprehensive quality feature library of persimmon. This feature library contains both individual quality parameters and association rules between parameters, comprehensively and systematically describing the quality status of persimmons, and providing rich feature information for subsequent quality rating and classification.

[0048] An example is given to illustrate the spectral analysis and nondestructive testing process of the internal quality parameters of persimmons: a batch of persimmon samples are subjected to multispectral imaging, and a series of images with wavelengths ranging from 400nm to 2500nm are collected. A total of 30 sampling wavelength points are set to obtain 30 images of different wavelengths. For each wavelength image, a pre-calibrated reflectance standard plate is used for calibration to eliminate the influence of light source fluctuations and uneven camera response, and the reflectance and transmittance values ​​of the persimmon at each wavelength point are calculated. For example, at a wavelength of 1100nm, the reflectance of a certain persimmon sample is 32% and the transmittance is 8%. The reflectance and transmittance values ​​of all wavelength points are connected to form a multispectral characteristic curve of the persimmon. For the evaluation of sugar content, the absorbance values ​​of the three wavelength points of 900nm, 1100nm and 1600nm are extracted from the multispectral curve. Combined with the reference sample data measured in the laboratory, a sugar prediction model is established by the partial least squares regression method, which is applied to the entire persimmon image to generate a sugar content distribution map. Similarly, for moisture content analysis, the absorbance values ​​at wavelengths of 1450nm and 1940nm were used in combination with morphological texture parameters such as texture contrast and uniformity to establish a moisture content prediction model and calculate the moisture distribution map. When conducting mold risk assessment, a 365nm ultraviolet light source was used to illuminate the persimmons to capture the fluorescence image. After the fluorescence image was enhanced, it was found that some persimmons had weak abnormal fluorescence reactions in the edge area. The mold risk was assessed by calculating the area and intensity of the fluorescence area. In the internal structure analysis, the differences in the transmission images of three wavelengths of 800nm, 1200nm and 1600nm were compared to construct a three-layer structure model to describe the changes in tissue density from the epidermis to the core. A comprehensive analysis of these data showed that the sweetness of persimmons was negatively correlated with the moisture distribution, and the high sugar content area usually had a lower moisture content; there was also a positive correlation between the internal tissue density and the surface wrinkle density, reflecting the shrinkage characteristics during the drying process; at the same time, the high moisture area was positively correlated with the mold risk.

[0049] In a specific embodiment, the process of executing step S104 may specifically include the following steps: (1) The persimmon surface is finely segmented by fusing edge detection and region growing algorithms, abnormal surface structures and color deviation areas are identified, and a candidate persimmon defect map is generated; (2) Extract local color, texture, and shape feature parameters from the persimmon defect candidate image, and construct a defect feature descriptor by combining the standard features in the persimmon appearance feature index set; (3) The defect feature descriptors were classified using a support vector machine classifier, and the surface defects of persimmons were divided into mildew, insect damage, mechanical damage, and rot and deterioration categories, forming a distribution map of persimmon defect types; (4) Based on the dried persimmon defect type distribution map, the area proportion, severity and location distribution of each defect were calculated, and the defect scoring matrix was established by combining the aesthetic parameters in the dried persimmon appearance characteristic index set; (5) Based on the internal quality data in the persimmon comprehensive quality feature library, the sugar content, moisture content and tissue characteristics of the persimmon were evaluated and scored, and the defect scoring matrix was integrated to calculate the comprehensive quality score of the persimmon; (6) Based on the comprehensive quality score of persimmon cakes and the industry standard grading threshold, the persimmon cake samples are divided into five grades: special grade, first grade, second grade, qualified and unqualified, and a persimmon cake quality grading result table is generated.

[0050] Specifically, edge detection algorithms are mainly used to identify areas in an image where grayscale values ​​change dramatically. These areas usually correspond to object boundaries or surface structural changes. In dried persimmon defect detection, the edge detection algorithms used include the Canny algorithm, which performs Gaussian filtering on the image to reduce noise, then calculates the gradient amplitude and direction, and then retains the local maximum gradient value through non-maximum suppression. The double threshold method is used to detect and connect edges, which can effectively detect structural abnormalities such as cracks and depressions on the dried persimmon surface. The region growing algorithm starts from a preset seed point and gradually merges the surrounding pixels that meet the similarity conditions into the current region until there are no pixels that meet the conditions. In dried persimmon detection, points with color or texture features that are significantly different from the normal dried persimmon surface are selected as seed points, and then the region is expanded according to the color similarity threshold to identify color deviation areas such as browning and discoloration. When these two algorithms are combined, edge detection is used to find potential defect boundaries, and then the region growing algorithm is applied inside and around these boundaries to accurately locate and segment the complete defect area. This fusion strategy makes full use of the edge detection algorithm's sensitivity to structural changes and the region growing algorithm's ability to maintain regional consistency. The generated persimmon defect candidate map contains various possible surface abnormal areas, laying the foundation for subsequent defect feature extraction and classification.

[0051] The local color, texture and shape feature parameters are extracted from the dried persimmon defect candidate map, and the defect feature descriptor is constructed by combining the standard features in the dried persimmon appearance feature index set. The local color feature mainly describes the color characteristics of the defect area, including the average hue, saturation, brightness in the HSV color space, and the color difference with the normal area. The texture feature is used to characterize the surface structure characteristics of the defect area. The statistics such as texture energy, contrast, and correlation are extracted through the local binary pattern and gray level co-occurrence matrix, which can reflect the texture roughness and regularity of the defect area. The shape feature characterizes the geometric characteristics of the defect area, including parameters such as defect area, perimeter, roundness, rectangularity, eccentricity, etc., which are used to distinguish different types of defect morphology. These local features are compared with the standard features in the dried persimmon appearance feature index set to calculate deviation metrics, such as relative color difference, texture abnormality, and shape specificity. These feature parameters and deviation quantification indicators are combined to form a multidimensional defect feature descriptor, which comprehensively characterizes the various characteristics of the defect area and provides sufficient feature information for subsequent defect classification.

[0052] The defect feature descriptors are classified using a support vector machine classifier, and the surface defects of persimmons are divided into mildew, insect pests, mechanical damage, and rot and deterioration categories, forming a distribution map of persimmon defect types. Support vector machine is a supervised learning model that achieves high-accuracy classification by finding the optimal classification hyperplane in a high-dimensional feature space and maximizing the interval between samples of different categories. In the classification of persimmon defects, it is necessary to construct a training data set containing feature descriptors of various known defects and corresponding category labels. During the training process, the support vector machine algorithm finds the decision boundary that can best distinguish between various defects by solving a quadratic optimization problem. For multi-category classification problems, a one-to-many strategy is adopted to construct multiple binary classifiers, each classifier distinguishing one defect type from other types. When encountering a new candidate defect area for persimmons, its feature descriptor is extracted and input into the trained support vector machine classifier to obtain the defect type prediction result. Mildew defects usually manifest as local mold and mildew spots with special color and texture characteristics; insect pest defects include insect bite marks and insect tunnels, which are irregular in shape and have clear edges; mechanical damage is mainly deformation and cracks caused by extrusion and collision; rot and deterioration are manifested by softening, exudation, and darkening of color. The classification results are mapped back to the original image space, and the category information is annotated for each defect area to form a distribution map of dried persimmon defect types, which intuitively displays the spatial distribution of various defects.

[0053] According to the distribution map of persimmon defect types, the area proportion, severity and location distribution of each defect are calculated, and the defect scoring matrix is ​​established by combining the aesthetic parameters in the persimmon appearance characteristic index set. The area proportion refers to the ratio of the area of ​​each defect area to the total area of ​​the persimmon, which directly reflects the range of the defect. The severity is quantified by the degree to which the characteristics of the defect area deviate from the normal value, including a comprehensive evaluation of the degree of color deviation, texture abnormality and shape distortion. The location distribution examines the spatial distribution characteristics of defects on the persimmon, such as central distribution, edge distribution or random distribution, as well as the degree of aggregation and dispersion of defects. The aesthetic parameters are comprehensive evaluation indicators in the persimmon appearance characteristic index set, reflecting the overall appearance quality of persimmon, including color uniformity, shape regularity and surface finish. These parameters are organized into a matrix form, with rows representing different defect types, columns representing various evaluation indicators, and each matrix element representing the score of the corresponding type of defect on the indicator. The defect scoring matrix comprehensively reflects the severity and distribution of surface defects of persimmons. Based on the internal quality data in the comprehensive quality feature library of persimmon cake, the sugar content, moisture content and tissue characteristics of persimmon cake are evaluated and scored, and the defect scoring matrix is ​​integrated to calculate the comprehensive quality score of persimmon cake. The internal quality data is obtained through the previous spectral analysis and non-destructive testing, including sugar content distribution, moisture content distribution, internal tissue structure characteristics, etc. When evaluating and scoring, scoring standards are set for each internal quality parameter, such as the appropriate range of sugar content, the reasonable range of moisture content and the requirements for tissue uniformity. Then, scores are given according to the degree of compliance between the actual test value and the standard to obtain the sugar score, moisture content score and tissue characteristic score. These internal quality scores are integrated with the previous defect scoring matrix, and the weighted summation method is used to calculate the comprehensive score. The weights of different quality parameters are set according to their influence on the overall quality of persimmon cake. For example, the weight of moldy defects is higher because it directly affects food safety; the weight of sugar content is also higher because it determines the taste and flavor of persimmon cake. Through this weight distribution mechanism, it is ensured that the comprehensive score can truly reflect the overall quality of persimmon cake.

[0054] According to the comprehensive quality score of persimmons and the industry standard grading threshold, the persimmon samples are divided into five grades: special grade, first grade, second grade, qualified and unqualified, and a persimmon quality grading result table is generated. The industry standard grading threshold is an evaluation standard based on expert experience and market demand, which clearly stipulates the quality requirements of persimmons of different grades. During the grading process, the comprehensive quality score of the persimmons is compared with the threshold of each grade to determine the final grade. Special grade persimmons require no obvious defects, high sugar content, moderate moisture, and uniform tissue structure; first grade persimmons are allowed to have a small number of minor defects, and other indicators are close to special grade; second grade persimmons can have a certain number of minor defects, but should not affect the edible quality; qualified grade persimmons allow more defects, but food safety must be guaranteed; unqualified products have defects that seriously affect edible quality or safety. The grading results are recorded in a table, including the persimmon ID, comprehensive score, scores of each sub-item and final grade information, which is convenient for production management and quality traceability.

[0055] For example, when a batch of dried persimmons to be inspected are quality inspected, defects are identified through standardized images of dried persimmons. In the defect identification stage, the Canny edge detection algorithm is first applied, and the low and high thresholds are set to 30% and 70% of the average gradient of the dried persimmon image, respectively, to detect the edge structure of the dried persimmon surface, including natural texture and potential defect boundaries. Then, in the HSV color space, the area where the color deviates from the normal dried persimmon is selected as the seed point, such as the area that is significantly darker or lighter, and the defect area is expanded using the region growing algorithm to generate the dried persimmon defect candidate map. When extracting features from the defect candidate area, the HSV mean, local binary pattern histogram and grayscale co-occurrence matrix features of each area, as well as shape parameters such as area, perimeter, and roundness are calculated to form the defect feature descriptor. These feature descriptors are input into the pre-trained support vector machine classifier, which classifies defects into four categories by analyzing the feature patterns: the moldy area usually presents blue-gray spots and rough texture, the insect-infested area presents small holes or serpentine channels, the mechanically damaged area presents indentations or cracks, and the rotten area presents brown softened areas. After classification, a defect distribution map is generated, the proportion and severity of each type of defect are calculated, and a defect scoring matrix is ​​established. At the same time, the sugar content score and moisture content score are evaluated from the sugar and moisture data obtained by multispectral analysis, and the internal structure analysis results are converted into tissue characteristic scores. According to the preset weights, the weight of mold defects is 0.35, the weight of mechanical damage is 0.2, the weight of sugar content is 0.2, the weight of moisture content is 0.15, and the weight of tissue characteristics is 0.1, and the comprehensive quality score of dried persimmon is calculated. According to the industry standard threshold, 90 points or more are special grade, 80-90 points are first grade, 70-80 points are second grade, 60-70 points are qualified, and below 60 points are unqualified, and a quality grading result table is generated. In this process, a key point is the correspondence between defect characteristics and classification: mold defects usually have specific color characteristics and texture characteristics, insect pest defects have obvious shape characteristics, and mechanical damage has significant characteristics in structure. Through these correspondences, the support vector machine can accurately identify different types of defects, thereby achieving accurate quality rating.

[0056] In a specific embodiment, the process of executing step S105 may specifically include the following steps: (1) Establish a time series storage structure for persimmon quality data, organize and store the persimmon quality grading result table by time, batch and origin, and build a persimmon quality history database; (2) Track and analyze the changes in quality parameters in the persimmon quality history database through time series analysis, identify quality fluctuation patterns and abnormal change points, and form a persimmon quality trend chart; (3) Calculate the statistical distribution of persimmon quality data from different batches and origins, combine the persimmon appearance characteristic index set and the key parameters in the persimmon comprehensive quality characteristic database, discover the quality influencing factors, and establish a persimmon quality correlation factor table; (4) Based on the statistical analysis results of the dried persimmon quality grading result table, calculate the proportion of each grade, unqualified rate and quality consistency index, and generate a batch quality assessment report in combination with the dried persimmon quality trend chart; (5) Integrate environmental monitoring data with the table of factors associated with persimmon quality, explore the mapping relationship between environmental factors and persimmon quality through multi-source data fusion analysis, and construct a prediction model for persimmon quality changes; (6) Design an automatic warning rule for quality anomalies based on threshold triggering. When abnormal fluctuations or downward trends in persimmon quality parameters are detected, a warning signal and cause analysis are automatically generated to form an intelligent analysis report and warning plan for persimmon quality.

[0057] Specifically, this time-series storage structure adopts a multidimensional database design to organize and index the data in the persimmon quality grading result table according to the time dimension, batch dimension and origin dimension. The time dimension includes time points such as production date, inspection date, and storage date, which can be further divided into multiple granularity levels such as year, month, day, and hour; the batch dimension records information such as production batch number and inspection batch number; the origin dimension contains spatial information such as raw material source and processing location. This multidimensional structure allows data to be quickly queried and analyzed from different angles, such as viewing quality changes within a specific time period, and comparing the quality differences of persimmons from different origins. In the actual storage process, a combination of relational database and NoSQL database is adopted. The relational database stores structured quality parameter data, and the NoSQL database stores unstructured data such as image features. By establishing appropriate indexes, query efficiency is optimized to ensure that efficient data access and analysis capabilities can be maintained even when a large amount of historical data is accumulated.

[0058] The changes of quality parameters in the persimmon quality history database are tracked and analyzed by time series analysis method, and the quality fluctuation rules and abnormal change points are identified to form a persimmon quality trend chart. Time series analysis is a statistical method for studying a sequence of data points arranged in chronological order, with the aim of extracting meaningful statistical features and rules. In the analysis of persimmon quality, commonly used time series analysis methods include moving average method, exponential smoothing method, autoregressive integrated moving average model, etc. The moving average method generates a smooth curve by calculating the average value of data within a certain window period, reducing the impact of short-term fluctuations and highlighting long-term trends; the exponential smoothing rule gives a higher weight to recent data and a decreasing weight to long-term data, which is suitable for processing data with certain trends; the autoregressive integrated moving average model comprehensively considers the autocorrelation, trend and periodicity of the data, and can more accurately describe complex time series characteristics. In practical applications, time series data of key quality parameters such as comprehensive scores and defect rates are extracted from the quality history database, and then the above method is applied for analysis to identify trend components, seasonal components and irregular components in the data. The trend component reflects the long-term change direction of the quality parameters, the seasonal component reveals the law of periodic fluctuations, and the irregular component may contain abnormal fluctuation points. By setting a statistical significance threshold, we detect data points in the time series that are significantly deviated from the expected value and mark them as abnormal change points. We visualize the analysis results to form a persimmon quality trend chart, which intuitively shows the change patterns and abnormalities of quality parameters over time.

[0059] The statistical distribution of persimmon quality data from different batches and different origins was calculated. The key parameters in the persimmon appearance characteristic index set and the persimmon comprehensive quality characteristic library were combined to find the quality influencing factors and establish a persimmon quality correlation factor table. Statistical distribution calculation refers to the quantitative description of the statistical characteristics of the data set, including statistical quantities such as mean, median, standard deviation, quartile, and distribution forms such as histogram and density curve. In the persimmon quality analysis, these statistical characteristics are calculated for the persimmon quality data from different batches and different origins, and the differences between them are compared. Then, key parameters such as color characteristics, shape characteristics, and texture characteristics are selected from the persimmon appearance characteristic index set, and internal quality parameters such as sugar content, moisture content, and tissue characteristics are selected from the comprehensive quality characteristic library, and correlation analysis is performed with the quality rating results. Correlation analysis methods include Pearson correlation coefficient calculation, Spearman rank correlation analysis, partial correlation analysis, etc., and variance analysis, regression analysis and other methods can also be used to explore the relationship between factors. Through these analyses, it is determined which parameters have a strong correlation with the quality rating results, that is, which factors have a significant impact on the quality of persimmons. At the same time, the interaction between different influencing factors was explored, such as the comprehensive impact of the ratio of sugar content and water content on quality. The analysis results were organized into a table of factors related to persimmon quality, which lists the correlation coefficient, significance level and influence direction of each influencing factor, providing data support for subsequent quality control and process optimization.

[0060] Based on the statistical analysis results of the persimmon quality grading result table, the proportion of each grade, the unqualified rate and the quality consistency index are calculated, and the batch quality assessment report is generated in combination with the persimmon quality trend chart. The proportion of each grade refers to the percentage of the number of persimmons of the five grades of special grade, first grade, second grade, qualified and unqualified in the total number, reflecting the overall quality distribution. The unqualified rate focuses on the proportion of unqualified products and is an important indicator of quality control. The quality consistency index is a parameter to measure the stability of the quality of persimmons in the same batch. It is usually expressed by calculating the standard deviation or coefficient of variation of the quality score. The smaller the standard deviation, the more consistent the quality. The calculation of these indicators is based on the data in the persimmon quality grading result table and is obtained by descriptive statistical methods. Combining these statistical indicators with the quality trend chart generated previously, the quality of a batch can be comprehensively evaluated. Not only can the current quality distribution be understood, but also it can be compared with historical data to judge the changes in quality trends. The assessment report also includes abnormal analysis of key quality parameters, indicating which parameters have obvious deviations and possible explanations of the reasons, providing a decision-making basis for quality management.

[0061] The environmental monitoring data and the table of factors associated with the quality of persimmons were integrated, and the mapping relationship between environmental factors and the quality of persimmons was explored through the multi-source data fusion analysis method, and a prediction model for the quality change of persimmons was constructed. Environmental monitoring data include environmental parameters such as temperature, humidity, light, and air quality. These factors may affect the drying process and storage conditions of persimmons, and thus affect the final quality. Multi-source data fusion refers to the process of integrating and analyzing heterogeneous data from different sources in order to obtain more complete and accurate information. In the quality analysis of persimmons, a combination of feature-level fusion and decision-level fusion was used to perform correlation analysis between environmental monitoring data and the quality-related factor table established previously. Feature-level fusion is to merge data features from different sources in the feature extraction stage to form a joint feature vector; decision-level fusion is to merge the results in the decision-making stage after independent analysis of each data source. By calculating the time-lag correlation between environmental parameters and quality indicators, the time-delay effect of environmental factors on quality is determined, providing a reference for the time dimension of the prediction model. Based on the results of the fusion analysis, a prediction model for persimmon quality changes was constructed. The prediction model can use machine learning methods such as multivariate linear regression, artificial neural network, and random forest to input environmental parameters and process parameters and output the predicted quality score. Historical data is used for parameter optimization during model training, and then the model performance is evaluated through cross-validation to ensure the reliability of the prediction results.

[0062] Design an automatic warning rule for quality anomalies based on threshold triggering. When abnormal fluctuations or downward trends in persimmon quality parameters are detected, warning signals and cause analysis are automatically generated to form an intelligent analysis report and warning plan for persimmon quality. The threshold trigger mechanism refers to a method that triggers an early warning when the monitoring indicator exceeds the preset threshold range. In the persimmon quality early warning system, three types of threshold rules are set: fixed threshold rules, statistical threshold rules, and trend threshold rules. The fixed threshold rule sets the allowable range of quality parameters based on industry standards or expert experience, and triggers an early warning when the parameter value exceeds the range; the statistical threshold rule is based on the statistical distribution of historical data, and defines the anomaly as a value that deviates from the mean by more than a certain multiple of the standard deviation, which is suitable for processing situations with large data fluctuations; the trend threshold rule focuses on the trend of parameter changes, and triggers an early warning when a downward or upward trend is detected for multiple consecutive cycles, which helps to discover potential problems in advance. When the early warning is triggered, the early warning system automatically analyzes the possible causes by querying the quality correlation factor table, finding out the influencing factors that are strongly correlated with the abnormal parameters, and combining environmental monitoring data and processing parameter records to infer the possible causes. Early warning information is graded according to severity. Emergency situations are notified to relevant personnel immediately through text messages, phone calls, etc., and general situations are included in daily reports. The early warning plan includes response suggestions and provides targeted improvement measures based on the abnormality type and cause, such as adjusting drying parameters, improving storage conditions, etc. The entire early warning process forms a quality intelligent analysis report, which not only contains early warning information, but also detailed data analysis and trend prediction, providing comprehensive support for quality management.

[0063] For example, a dried persimmon production company continuously recorded quality inspection data for three months, including the quality scores and key parameters of 30 dried persimmon samples randomly sampled daily. These data are stored in the quality history database according to the dimensions of time, batch and origin, forming a structured time series data set. Time series analysis performs a seven-day moving average processing on the comprehensive quality score to eliminate the impact of daily fluctuations, and finds that the quality score begins to show a downward trend in the middle of the second month. Further analysis found that a number of key parameters change synchronously: the sugar content is stable, but the moisture content gradually increases, while the surface wrinkle characteristics decrease and the texture becomes softer. The statistical distribution calculation of data from different batches shows that there are significant differences between batches from different drying rooms, and the variance analysis confirms that this difference is statistically significant. Correlation analysis of these quality parameters with environmental monitoring data shows that two weeks before the quality decline, the humidity control system of a drying room has fluctuated, and the humidity periodically increases to the upper limit of the normal value. The random forest prediction model trained based on historical data shows that if the environmental humidity continues to be high, the quality score of dried persimmons will further decline in the next week, especially the moisture-sensitive parameters. At this time, the quality early warning system automatically triggered the humidity abnormality warning, because it detected that the humidity value was higher than the standard value by 1.5 times the standard deviation for 5 consecutive days, and the quality trend forecast showed that the failure rate would increase within a week. The analysis report generated by the early warning system pointed out that abnormal humidity control was the main reason for the increase in the moisture content of persimmon cakes, which in turn affected the drying effect and the formation of the organizational structure. If not intervened in time, more batches of persimmon cakes will fail to meet the first-class quality standards. The early warning plan recommends: immediately check and repair the humidity control system, adjust the drying parameters to increase the ventilation frequency, conduct additional quality inspections on semi-finished products that have been dried, and appropriately extend the drying time of the current batch. Through this set of time series analysis and early warning mechanisms, enterprises can promptly detect quality fluctuations in the production process, find out the root causes, and take targeted measures to ensure the stability of the quality of persimmon cakes.

[0064] In a specific embodiment, the process of executing step S106 may specifically include the following steps: (1) Construct a data model for associating dried persimmon production process parameters with quality characteristics, map and associate drying temperature, humidity, time, and flip frequency with dried persimmon appearance characteristic index set, dried persimmon comprehensive quality characteristic library, and dried persimmon quality grading result table to form a process-quality association data table; (2) The process-quality correlation data table was processed through multivariate regression analysis to identify the key process parameter combinations that significantly affect the final quality of dried persimmons, and a process parameter influence weight table was established; (3) Based on the high-quality persimmon sample data in the persimmon quality intelligent analysis report, the corresponding process parameter configuration is extracted, and the process parameter optimization space is constructed in combination with the process parameter influence weight table; (4) Genetic algorithm was used to perform parameter optimization calculation in the process parameter optimization space, search for the process parameter combination that maximizes the persimmon quality score, and generate the persimmon production process parameter optimization plan; (5) Establish a digital traceability structure for the entire persimmon production process, assign a unique identification code to each batch of persimmons, link the raw material source, processing technology, persimmon quality grading result table, persimmon quality intelligent analysis report and early warning plan data, and construct a persimmon quality chain diagram; (6) Develop a QR code scanning interface to encode the quality inspection results, production date and origin information in the persimmon quality chain diagram into the product label to form a persimmon quality traceability file.

[0065] Specifically, the associated data model is a data structure used to describe the mapping relationship between different data entities. In the production of persimmons, it mainly involves the association of two major types of data: process parameters and quality characteristics. The process parameters include drying temperature (the ambient temperature during the drying process of persimmons, usually in the range of 20-40°C), humidity (relative humidity of the drying environment, usually in the range of 40%-70%), time (the duration of the entire drying process, usually 10-20 days) and flipping frequency (the number of times the persimmons are turned over, which affects the uniformity of drying, usually 1-3 times a day). These process parameters are obtained through automated equipment or manual records in the production process to form a process parameter data set. On the other hand, the quality characteristic data comes from multiple results generated in the aforementioned machine vision inspection process, including a set of persimmon appearance characteristic indicators (color, icing, texture and shape characteristics), a persimmon comprehensive quality characteristic library (sugar content, moisture content, mildew risk assessment indicators, etc.) and a persimmon quality grading result table (grade division and comprehensive score). The process of building the associated data model cleans and standardizes the process parameter and quality characteristic data, eliminates outliers and missing values, unifies the data format and measurement units, and then establishes a relational mapping to associate the process parameters and quality characteristic data of the same batch through batch numbers or timestamps, forming a process-quality associated data table containing multi-dimensional process parameters and multi-dimensional quality characteristics.

[0066] The process-quality correlation data table was processed by multivariate regression analysis to identify the key process parameter combinations that have a significant impact on the final quality of dried persimmons, and to establish a process parameter influence weight table. Multivariate regression analysis is a statistical method used to study the relationship between multiple independent variables (here, process parameters) and dependent variables (here, quality characteristics), and to quantify the degree of influence of each variable on the dependent variable by establishing a mathematical model. In the quality analysis of dried persimmons, the multivariate regression methods used include linear regression, ridge regression, and elastic net regression. Linear regression assumes that there is a linear relationship between the dependent variable and the independent variable, and estimates the model parameters by the least squares method; ridge regression introduces the L2 regularization term to alleviate the multicollinearity problem and improve the stability of the model; elastic net regression uses L1 and L2 regularization at the same time, which can handle collinearity and achieve variable selection. The specific steps of regression analysis select the quality comprehensive score or specific quality index as the dependent variable, and each process parameter as the independent variable, then use the training data to fit the regression model, and calculate the regression coefficients of each process parameter. These coefficients reflect the direction and intensity of the influence of each process parameter on the quality. Then, the significance of the regression coefficient was evaluated through statistical methods such as t-test, and the key process parameters that significantly affect the quality were screened out. Considering the possible interaction between process parameters, it is also necessary to add interaction terms to the regression model, such as the interaction between temperature and humidity, the interaction between time and flipping frequency, etc., to evaluate the significance of these interaction terms. According to the absolute value and significance level of the regression coefficient, a weight value is assigned to each process parameter, and a process parameter influence weight table is established. This table clearly quantifies the degree of influence of each process parameter on the quality of dried persimmons, providing a scientific basis for subsequent process optimization.

[0067] Based on the high-quality persimmon sample data in the persimmon quality intelligent analysis report, the corresponding process parameter configuration is extracted, and the process parameter optimization space is constructed in combination with the process parameter influence weight table. High-quality persimmon samples refer to persimmon samples rated as special or first grade in quality grading. The process parameter configuration of these samples represents the successful experience of producing high-quality persimmons. The process parameter data of these high-quality samples, including drying temperature, humidity, time and flip frequency, are extracted from the quality intelligent analysis report to form a set of high-quality process parameters. Then, combined with the process parameter influence weight table established earlier, the importance of the influence of each parameter is determined, and the key parameters with higher weights are focused on. The process parameter optimization space refers to the range and constraints allowed for each process parameter. Its construction process performs statistical analysis on the process parameters of high-quality samples, calculates the mean, median, standard deviation and other statistics of each parameter, and determines the central trend and fluctuation range of the parameter. Then, according to the physical meaning of the parameter and the actual production conditions, the upper and lower limit constraints of the parameter are set, such as the temperature cannot exceed the maximum temperature allowed by the equipment, and the humidity cannot be lower than the minimum humidity of the local climate conditions. In addition, the mutual constraints between parameters need to be considered, such as temperature and humidity are usually negatively correlated, and high temperature usually needs to be combined with low humidity. The process parameter optimization space finally formed is a multi-dimensional parameter space, where each dimension corresponds to a process parameter, and each point in the space represents a set of process parameter combinations. The goal of optimization is to find the point in this space that can produce the highest quality persimmons. A genetic algorithm is used to perform parameter optimization calculations on the process parameter optimization space, search for the process parameter combination that maximizes the persimmon quality score, and generate an optimization solution for the persimmon production process parameters. Genetic algorithm is an optimization algorithm that simulates the natural evolution process. It continuously evolves solutions through selection, crossover, and mutation operations, and is suitable for solving high-dimensional, nonlinear optimization problems. In the optimization of persimmon process parameters, the specific implementation steps of the algorithm include encoding, initialization, fitness evaluation, selection, crossover, mutation, and termination judgment. In the encoding stage, the process parameters are represented as chromosomes, and each gene represents a parameter value; in the initialization stage, multiple process parameter combinations are randomly generated in the process parameter optimization space to form an initial population; in the fitness evaluation stage, the multivariate regression model established earlier is used to predict the persimmon quality score under each set of parameters as the fitness value; in the selection stage, excellent individuals are selected to enter the next generation according to the fitness value. Common selection methods include roulette selection and tournament selection; in the crossover stage, the genes of the two parent individuals are exchanged to generate new offspring individuals to increase the diversity of solutions; in the mutation stage, the values ​​of certain genes are randomly changed with a certain probability to prevent the algorithm from falling into the local optimum; in the termination judgment stage, the algorithm stops when the maximum number of iterations is reached or the fitness value is no longer significantly improved. The whole process is continuously iterated, and the population gradually evolves to a better solution, and finally finds the process parameter combination that can maximize the persimmon quality score.This set of parameters constitutes the optimization scheme for the production process parameters of dried persimmon, including the optimal drying temperature, humidity, time and turning frequency, as well as their implementation details and precautions.

[0068] Establish a digital traceability structure for the entire production process of persimmons, assign a unique identification code to each batch of persimmons, associate the raw material source, processing technology, persimmon quality grading result table, persimmon quality intelligent analysis report and early warning plan data, and build a persimmon quality chain diagram. The digital traceability structure refers to the digital recording of the entire production process of persimmons from raw material procurement to final product, so as to achieve traceability of the entire process. The unique identification code is the core of the traceability system. Each batch of persimmons is assigned a unique code, which is usually a combination of production date, batch number and product serial number to ensure global uniqueness. The data content of digital traceability includes: raw material source information (raw material type, origin, harvest date, supplier, etc.), processing technology information (actual implementation of the aforementioned optimized process parameters, operators, equipment status, etc.), quality inspection information (quality grading results, test values ​​of various quality parameters) and quality analysis information (quality intelligent analysis report content, early warning plan records, etc.). These data are stored and managed through database technology to establish the association between various data entities, such as the association between raw material batches and persimmon batches, and the association between persimmon batches and quality inspection results. The persimmon quality chain diagram is a visual representation of the traceability structure. It graphically displays the complete flow process of persimmon from raw materials to finished products, as well as the key data and quality status of each link, making it easy to intuitively understand and analyze quality changes and key control points in the entire production process.

[0069] Develop a QR code scanning interface to encode the quality inspection results, production date and origin information in the persimmon quality chain diagram into the product identification to form a persimmon quality traceability file. QR code is a two-dimensional barcode that can store more information than traditional barcodes and is suitable as a carrier for product quality traceability. The QR code scanning interface consists of two parts: the encoding interface and the decoding interface. The encoding interface is responsible for converting the persimmon quality information into a QR code image, and the decoding interface is responsible for extracting information from the scanned QR code. In practical applications, key information is extracted from the persimmon quality chain diagram, including quality inspection results (quality grade, key quality parameter value), production information (production date, batch number) and origin information (raw material source, processing location), and then this information is encoded into the QR code together with the unique identification code. In order to ensure information security and authenticity, digital signatures and encryption mechanisms can also be added to prevent information from being tampered with. The generated QR code is printed on the product packaging or attached to the product label. Consumers scan the QR code through mobile phones and other devices to connect to the quality traceability platform to view the detailed quality information and production process records of the batch of persimmons, so as to achieve transparency and traceability of product quality. The persimmon cake quality traceability file is a collection of quality records of the entire process from raw materials to finished products for a specific batch of persimmon cakes. It contains complete content such as raw material information, production process records, quality inspection data, analysis reports, etc., to support the tracing of quality problems and the determination of responsibility.

[0070] For example, a persimmon production company collected production data for the past two years, including 500 batches of persimmon production records. Each batch recorded process parameters (drying temperature, humidity, time and flip frequency) and quality characteristic data obtained through machine vision inspection. A correlation data model was established to associate the process parameters of each batch with the corresponding quality characteristic data to form a process-quality correlation data table. Then a multivariate regression analysis was performed, with the persimmon quality comprehensive score as the dependent variable and each process parameter as the independent variable, and the elastic net regression method was used to process the data. The regression results showed that the regression coefficient of drying temperature was 0.65 (positive correlation), humidity was -0.48 (negative correlation), time was 0.32 (positive correlation), and flip frequency was 0.25 (positive correlation). At the same time, the regression coefficient of the interaction term between temperature and humidity was -0.42, indicating that high temperature combined with low humidity had the best effect. According to the absolute value and significance of the regression coefficient, the process parameter influence weight table was determined: temperature weight 0.40, humidity weight 0.30, time weight 0.20, flip frequency weight 0.10. Then, 100 batches of persimmon sample data rated as special grade were selected from the quality intelligent analysis report, and their process parameter configurations were extracted. Statistical analysis showed that the drying temperature of these high-quality persimmons was concentrated at 28-35°C, the humidity was 45-60%, the drying time was 14-18 days, and the turnover frequency was 2-3 times a day. Combined with physical constraints, such as the upper limit of the equipment temperature was 38°C, the optimization space of the process parameters was determined. The genetic algorithm was used for parameter optimization. The initial population size was set to 50, each individual was represented by a set of process parameter combinations, and the fitness function was the quality score predicted by the regression model. After 100 generations of evolution, the algorithm converged to the optimal solution: drying temperature 32°C, humidity 52%, drying time 16 days, and turnover frequency 2 times a day. The verification experiment showed that the quality score of the persimmon samples produced using this set of optimized parameters was significantly improved, especially the uniformity of sugar crystallization and tissue density were significantly improved. At the same time, a digital traceability structure for the entire production process of persimmons is established, and each batch of persimmons is assigned a unique identification code in the form of "KC-20250227-001", where KC represents the persimmon product code, 20250227 represents the production date, and 001 represents the batch number of the day. The traceability system records the entire process data from raw material procurement to finished product testing, including raw material supplier information, actual process parameters, machine vision inspection results, and quality grading. The quality chain diagram intuitively displays the key nodes and indicator changes in the entire production process, such as the temperature and humidity change curve of the raw material moisture content after entering the production, and the quality grade distribution of the final finished product. The key quality information is encoded into a QR code and printed on the product packaging. Consumers can scan the QR code to obtain the origin, production date, quality grade and main quality parameters of the batch of persimmons, realizing full quality traceability from field to table.

[0071] The above describes the dried persimmon quality detection method based on machine vision in the embodiment of the present application. The following describes the dried persimmon quality detection system based on machine vision in the embodiment of the present application. Figure 2 In the embodiment of the present application, an embodiment of a persimmon quality detection system based on machine vision includes: The acquisition module is used to perform multi-angle and multi-spectral imaging acquisition and preprocessing of persimmon samples through an industrial camera array system to form a standardized persimmon image data set; A quantification module is used to extract and quantify the color, icing, texture and shape features of the persimmons according to the standardized persimmon image data set, and to construct a persimmon appearance feature index set; A detection module, used to perform spectral analysis and non-destructive detection on the internal quality parameters of persimmons by using the standardized persimmon image data set and the persimmon appearance feature index set, so as to form a persimmon comprehensive quality feature library; A classification module, for identifying and classifying persimmon defects based on the persimmon appearance feature index set and the persimmon comprehensive quality feature library, calculating the persimmon quality comprehensive score, and generating a persimmon quality grading result table; A mining module, for performing time series analysis and trend mining on persimmon quality parameters according to the persimmon quality grading result table and the persimmon appearance characteristic index set, establishing a quality early warning mechanism, and forming a persimmon quality intelligent analysis report and early warning plan; The analysis module is used to perform correlation analysis and optimization on the persimmon production process parameters and quality characteristics based on the persimmon quality intelligent analysis report and early warning plan, build a quality traceability system, and generate a persimmon process parameter optimization plan and quality traceability file.

[0072] Through the collaborative efforts of the above components, the improved Retinex algorithm and edge-preserving filtering technology were integrated in the construction of the standardized persimmon image dataset, which effectively eliminated the impact of uneven lighting and improved the texture contrast of the feature area, providing a high-quality data foundation for subsequent feature extraction; the HSV color space transformation combined with the adaptive threshold segmentation algorithm realized the accurate identification of the frosting area on the surface of the persimmon, so that the frosting coverage and distribution uniformity could be accurately quantified, overcoming the problem of brightness and color confusion in traditional RGB space processing; the internal quality parameters of the persimmon were quantitatively evaluated through near-infrared spectroscopy analysis technology, and a regression model of sugar content and absorbance at a specific wavelength was established, realizing the non-infrared internal quality. The method can detect the damage of dried persimmon cakes and avoid the sample loss of traditional destructive detection methods; the edge detection and regional growth algorithms are integrated to finely segment the surface of dried persimmon cakes, and the defect feature descriptors are classified by the support vector machine classifier, which greatly improves the accuracy of defect recognition, especially for defects with similar visual characteristics but different types. The time series analysis method processes the quality data, and the moving average method and the anomaly detection algorithm are used to realize the early identification of quality fluctuations, so that quality problems can be discovered before large-scale losses are caused; multivariate regression analysis is combined with genetic algorithms to optimize the process parameters, and the optimal process parameter combination is found under complex parameter interaction conditions, which improves the quality consistency of dried persimmon cake production and reduces the unqualified rate. In the data processing process, special attention is paid to the contribution of algorithm features to the scheme. For example, the improved local binary pattern algorithm takes into account the radial texture distribution characteristics when extracting the texture features of dried persimmon cakes, and improves the distinguishing ability of feature vectors; the application of multispectral data fusion technology in internal quality detection solves the problem of insufficient single-band information and improves the robustness of the prediction model; the quality warning mechanism based on threshold triggering screens real anomalies through statistical significance tests, effectively reducing the false alarm rate.

[0073] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.

[0074] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied.

[0075] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0076] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided by the present invention and used in the embodiments may 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. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM.

[0077] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0078] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0079] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A persimmon quality detection method based on machine vision, characterized in that: The persimmon quality detection method based on machine vision comprises: The industrial camera array system was used to collect and preprocess multi-angle and multi-spectral images of persimmon samples to form a standardized persimmon image dataset. According to the standardized persimmon image dataset, the color, icing, texture and shape features of the persimmon are extracted and quantitatively analyzed to construct a persimmon appearance feature index set; Using the standardized persimmon image data set and the persimmon appearance feature index set, spectral analysis and non-destructive testing are performed on the internal quality parameters of the persimmon to form a persimmon comprehensive quality feature library; Based on the dried persimmon appearance characteristic index set and the dried persimmon comprehensive quality characteristic library, dried persimmon defects are identified and classified, the comprehensive quality score of the dried persimmon is calculated, and a dried persimmon quality grading result table is generated; According to the persimmon quality grading result table and the persimmon appearance characteristic index set, time series analysis and trend mining are performed on the persimmon quality parameters, a quality early warning mechanism is established, and an intelligent analysis report and early warning plan for persimmon quality are formed; Based on the persimmon cake quality intelligent analysis report and early warning scheme, the persimmon cake production process parameters and quality characteristics are correlated and optimized, a quality traceability system is constructed, and a persimmon cake process parameter optimization scheme and quality traceability file are generated.

2. The dried persimmon quality detection method based on machine vision according to claim 1, characterized in that: The method uses an industrial camera array system to perform multi-angle and multi-spectral imaging acquisition and preprocessing on dried persimmon samples to form a standardized dried persimmon image data set, including: The top main camera and surrounding side cameras are used to collect all-round images of the persimmons, obtain the surface and side feature images of the persimmons, and form an original image group of the persimmons; The persimmon cakes were illuminated by diffuse white light, side oblique light and narrow spectrum light source, and multispectral images of persimmon cakes under different lighting conditions were collected to construct multispectral image sequences. The original persimmon image group is subjected to distortion elimination and perspective unification processing by a geometric correction method, so as to achieve accurate stitching of multi-angle images and generate a panoramic persimmon image; Based on the adaptive threshold segmentation algorithm, the foreground of the persimmon panorama image is extracted to accurately separate the persimmon target and the background, so as to obtain a persimmon target area map; The color of the persimmon target area image is standardized and image enhanced by improving the Retinex algorithm, thereby improving the dark area details and texture contrast, and establishing an enhanced persimmon image; The enhanced persimmon image is subjected to denoising processing by combining Gaussian filtering and edge-preserving filtering, thereby retaining the surface texture details of the persimmon and suppressing random noise, thereby forming a standardized persimmon image dataset.

3. The dried persimmon quality detection method based on machine vision according to claim 1, characterized in that: According to the standardized persimmon image data set, the color, icing, texture and shape features of the persimmon are extracted and quantitatively analyzed to construct a persimmon appearance feature index set, including: Performing color conversion on the standardized persimmon image dataset by HSV color space transformation, calculating the persimmon surface hue, saturation and brightness distribution parameters, and forming a persimmon color feature vector; Using an adaptive threshold segmentation algorithm to identify the frosting area of ​​the standardized dried persimmon image dataset, calculate the frosting coverage, distribution uniformity and crystallization pattern, and construct a dried persimmon frosting feature descriptor; Performing texture analysis on the standardized persimmon image dataset based on local binary patterns and gray-level co-occurrence matrix, extracting texture uniformity, directionality and roughness values, and generating a persimmon texture feature set; The shape analysis of the standardized persimmon image dataset is performed using contour extraction and morphological analysis methods, the roundness, symmetry and perimeter-to-area ratio of the persimmon are calculated, and a persimmon shape descriptor is established; Performing wrinkle feature analysis on the standardized persimmon image data set by edge detection algorithm, measuring wrinkle density, depth and direction distribution parameters, and forming a persimmon surface structure feature map; The persimmon color feature vector, persimmon icing feature descriptor, persimmon texture feature set, persimmon shape descriptor and persimmon surface structure feature map are weightedly fused to construct a persimmon appearance feature index set.

4. The dried persimmon quality detection method based on machine vision according to claim 1, characterized in that: The method uses the standardized persimmon image data set and the persimmon appearance feature index set to perform spectral analysis and non-destructive testing on the internal quality parameters of the persimmon to form a persimmon comprehensive quality feature library, including: Spectral separation and extraction are performed on the near-infrared, ultraviolet and visible light band images in the standardized persimmon image data set, the reflectance and transmittance values ​​of the persimmon at different wavelengths are calculated, and a multispectral characteristic curve of the persimmon is constructed; By analyzing the absorption characteristics of the near-infrared band in the persimmon multi-spectral characteristic curve, the sugar content of the persimmon is quantitatively evaluated to generate a persimmon sweetness distribution map; The moisture content of the dried persimmons is calculated based on the grayscale distribution characteristics of the moisture characteristic absorption band image and the texture parameters in the dried persimmon appearance characteristic index set to form a dried persimmon moisture content distribution map; Using ultraviolet fluorescence imaging technology to enhance the specific wavelength response in the standardized persimmon image data set, detect potential moldy areas inside the persimmon, and establish a mold risk assessment index; Based on the differences in multispectral transmission characteristics of the standardized persimmon image data set, a hierarchical analysis of the internal tissue of the persimmon is performed to evaluate the uniformity and density of the internal tissue of the persimmon, and to construct an internal structure model of the persimmon; The persimmon sweetness distribution map, persimmon moisture content distribution map, mold risk assessment index and persimmon internal structure model are integrated, and correlation analysis is performed with the persimmon appearance characteristic index set to form a persimmon comprehensive quality characteristic library.

5. The dried persimmon quality detection method based on machine vision according to claim 1, characterized in that: Based on the dried persimmon appearance characteristic index set and the dried persimmon comprehensive quality characteristic library, the dried persimmon defects are identified and classified, the comprehensive quality score of the dried persimmon is calculated, and a dried persimmon quality grading result table is generated, including: The persimmon surface is finely segmented by fusing edge detection and region growing algorithms, abnormal surface structures and color deviation areas are identified, and a candidate map of persimmon defects is generated. Extracting local color, texture and shape feature parameters from the dried persimmon defect candidate image, and combining the standard features in the dried persimmon appearance feature index set to construct a defect feature descriptor; Using a support vector machine classifier to classify the defect feature descriptors, the surface defects of dried persimmons are divided into mildew, insect damage, mechanical damage and rot and deterioration categories, and a distribution map of dried persimmon defect types is formed; According to the dried persimmon defect type distribution map, the area proportion, severity and location distribution of each type of defect are calculated, and a defect scoring matrix is ​​established in combination with the aesthetic parameters in the dried persimmon appearance feature index set; Based on the internal quality data in the persimmon comprehensive quality feature library, the sugar content, moisture content and tissue characteristics of the persimmon are evaluated and scored, and the defect scoring matrix is ​​integrated to calculate the comprehensive quality score of the persimmon; According to the comprehensive persimmon quality score and the industry standard grading threshold, the persimmon samples are divided into five grades: special grade, first grade, second grade, qualified and unqualified, and a persimmon quality grading result table is generated.

6. The dried persimmon quality detection method based on machine vision according to claim 1, characterized in that: According to the persimmon quality grading result table and the persimmon appearance characteristic index set, time series analysis and trend mining are performed on the persimmon quality parameters, a quality early warning mechanism is established, and a persimmon quality intelligent analysis report and early warning plan are formed, including: Establishing a time series storage structure for persimmon quality data, organizing and storing the persimmon quality grading result table by time, batch and origin, and constructing a persimmon quality history database; Tracking and analyzing the changes in quality parameters in the dried persimmon quality history database by a time series analysis method, identifying quality fluctuation patterns and abnormal change points, and forming a dried persimmon quality trend graph; Perform statistical distribution calculation on the quality data of dried persimmons from different batches and different origins, combine the dried persimmon appearance characteristic index set and the key parameters in the dried persimmon comprehensive quality characteristic library, find the quality influencing factors, and establish a dried persimmon quality correlation factor table; Based on the statistical analysis results of the dried persimmon quality grading result table, the proportion of each grade, the unqualified rate and the quality consistency index are calculated, and combined with the dried persimmon quality trend chart, a batch quality assessment report is generated; Integrate environmental monitoring data with the persimmon quality correlation factor table, explore the mapping relationship between environmental factors and persimmon quality through multi-source data fusion analysis method, and build a persimmon quality change prediction model; An automatic warning rule for quality anomalies based on threshold triggering is designed. When abnormal fluctuations or downward trends in persimmon quality parameters are detected, warning signals and cause analysis are automatically generated to form an intelligent analysis report and warning plan for persimmon quality.

7. The dried persimmon quality detection method based on machine vision according to claim 1, characterized in that: Based on the persimmon quality intelligent analysis report and early warning scheme, the persimmon production process parameters and quality characteristics are correlated and optimized, a quality traceability system is constructed, and a persimmon process parameter optimization scheme and quality traceability file are generated, including: Constructing a correlation data model of persimmon production process parameters and quality characteristics, mapping and associating the drying temperature, humidity, time and flipping frequency with the persimmon appearance characteristic index set, the persimmon comprehensive quality characteristic library and the persimmon quality grading result table to form a process-quality correlation data table; The process-quality correlation data table is processed by multivariate regression analysis to identify the key process parameter combinations that significantly affect the final quality of dried persimmons, and to establish a process parameter influence weight table; Based on the high-quality persimmon sample data in the persimmon quality intelligent analysis report, the corresponding process parameter configuration is extracted, and the process parameter optimization space is constructed in combination with the process parameter influence weight table; A genetic algorithm is used to perform parameter optimization calculation on the process parameter optimization space, search for a process parameter combination that maximizes the persimmon quality score, and generate a persimmon production process parameter optimization plan; Establish a digital traceability structure for the entire persimmon production process, assign a unique identification code to each batch of persimmons, associate the raw material source, processing technology, the persimmon quality grading result table, and the persimmon quality intelligent analysis report and early warning plan data, and build a persimmon quality chain diagram; Develop a QR code scanning interface to encode the quality inspection results, production date and origin information in the persimmon quality chain diagram into the product logo to form a persimmon quality traceability file.

8. A persimmon quality detection system based on machine vision, used to implement the persimmon quality detection method based on machine vision as described in any one of claims 1 to 7, characterized in that: The persimmon quality detection system based on machine vision includes: The acquisition module is used to perform multi-angle and multi-spectral imaging acquisition and preprocessing of persimmon samples through an industrial camera array system to form a standardized persimmon image data set; A quantification module is used to extract and quantify the color, icing, texture and shape features of the persimmons according to the standardized persimmon image data set, and to construct a persimmon appearance feature index set; A detection module, used to perform spectral analysis and non-destructive detection on the internal quality parameters of persimmons by using the standardized persimmon image data set and the persimmon appearance feature index set, so as to form a persimmon comprehensive quality feature library; A classification module, for identifying and classifying persimmon defects based on the persimmon appearance feature index set and the persimmon comprehensive quality feature library, calculating the persimmon quality comprehensive score, and generating a persimmon quality grading result table; A mining module, for performing time series analysis and trend mining on persimmon quality parameters according to the persimmon quality grading result table and the persimmon appearance characteristic index set, establishing a quality early warning mechanism, and forming a persimmon quality intelligent analysis report and early warning plan; The analysis module is used to perform correlation analysis and optimization on the persimmon production process parameters and quality characteristics based on the persimmon quality intelligent analysis report and early warning plan, build a quality traceability system, and generate a persimmon process parameter optimization plan and quality traceability file.

9. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and is characterized in that when the processor executes the computer program, the persimmon quality detection method based on machine vision described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the processor is enabled to execute the dried persimmon quality detection method based on machine vision as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Food safety intelligent management method and system based on big data

    CN111879772A

  • Seed variety quality detection method and system based on hyperspectrum

    CN114882249A

  • Shaving board quality detection method and system based on image recognition

    CN117152161A

  • Rapid nondestructive detection method and system for apple quality based on Raman spectrum technology

    CN118150547A

  • Nondestructive testing method and system for comprehensive quality of harvested bananas

    CN119595556A

Cited By

  • Color ring element appearance detection device and detection system based on machine vision

    CN120177368A

  • Time-sharing measuring device and measuring method for carbon content in flue fly ash

    CN120177385A

  • Method, system and equipment for detecting transparency of acrylic plate and medium

    CN120374599A

  • Iron stick yam intelligent system and method based on image recognition

    CN120388226A

  • An image recognition-based intelligent system and method for iron stick yam

    CN120388226B