A persimmon quality detection method and system based on machine vision
Through the persimmon cake quality detection method based on machine vision, multi-angle, multi-spectral imaging and feature extraction technology are adopted, combined with non-destructive detection and process optimization, the multi-dimensional feature comprehensive analysis problem of existing persimmon cake quality detection is solved, the stability and traceability of persimmon cake quality is achieved, and the detection efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202510293073.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-03-13
AI Technical Summary
The existing persimmon cake quality detection technology has strong subjectivity and low efficiency in manual testing, traditional mechanical detection single parameters, computer vision technology lacks multi-dimensional feature comprehensive analysis and non-destructive testing capabilities, and cannot form a closed-loop management of the entire quality process, resulting in difficult to control quality fluctuations in the production process, poor product consistency, and lack of data support for process parameter optimization.
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. The Retinex algorithm and edge-keeping filtering technology are combined to eliminate the influence of light. The HSV color space transformation and adaptive threshold segmentation algorithm are used for feature extraction, and the non-destructive detection is combined with near-infrared spectral analysis is used for defect identification, and the defect is identified by the support vector machine classifier is used for classification. The process parameters are optimized by time series analysis and multivariate regression analysis to build a quality warning and traceability system.
A comprehensive non-destructive testing of the appearance and internal quality of persimmon cakes is achieved, the detection efficiency and accuracy are improved, and a closed-loop system with quality warning and process optimization is formed, the quality stability and traceability of persimmon cake production is improved, and the failure rate and false alarm rate are reduced.
Smart Images

Figure CN119810100B_ABST
Abstract
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 of dried persimmons has long relied primarily on manual judgment, including visual inspection of appearance characteristics, measurement of softness and hardness by touch, and tasting to evaluate sweetness and mouthfeel. With the development of the food industry, some rudimentary mechanized testing methods have begun to be applied, such as using a colorimeter to measure surface color, a texture analyzer to determine hardness, and a saccharimeter to measure soluble solids content. In addition, laboratory analytical methods such as high-performance liquid chromatography and infrared spectroscopy have also been used to study the compositional characteristics of dried persimmons. In recent years, computer vision technology has made certain progress in the field of agricultural product quality testing. Simple image processing techniques have been used to grade the appearance of dried persimmons, but most are limited to detecting a single parameter or feature.
[0003] However, existing persimmon cake quality inspection technologies have many shortcomings. First, manual inspection is highly subjective, inefficient, and has inconsistent standards, making it difficult to meet the needs of large-scale production. Traditional mechanical inspection methods, while objective, are mostly single-parameter inspections and cannot comprehensively evaluate persimmon cake quality. Laboratory analysis methods, while accurate, are highly destructive, time-consuming, and costly, making them unsuitable for online inspection on production lines. Existing computer vision technology is simple to apply and mostly targets single features such as color or shape. It lacks the ability to comprehensively analyze multidimensional features and conduct non-destructive testing of internal quality. At the same time, existing technologies generally lack the analytical mining of historical quality data and feedback mechanisms for process optimization, making it impossible to form a closed-loop management and traceability system for the entire quality process. This results in difficulty in controlling quality fluctuations during production, 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, thereby improving the quality stability and traceability of persimmon cake production.
[0005] In the first aspect, the present application provides a persimmon quality detection method based on machine vision, which comprises: performing multi-angle and multi-spectral imaging acquisition and preprocessing of persimmon samples through an industrial camera array system to form a standardized persimmon image dataset; extracting and quantitatively analyzing the color, icing, texture, and shape features of the persimmons based on the standardized persimmon image dataset to construct a persimmon appearance feature index set; using the standardized persimmon image dataset and the persimmon appearance feature index set, performing spectral analysis and non-destructive testing on the internal quality parameters of the persimmons to form a persimmon comprehensive quality feature library. ; Based on the persimmon cake appearance characteristic index set and the persimmon cake comprehensive quality characteristic library, persimmon cake defects are identified and classified, the persimmon cake quality comprehensive score is calculated, and a persimmon cake quality grading result table is generated; based on the persimmon cake quality grading result table and the persimmon cake appearance characteristic index set, the persimmon cake quality parameters are subjected to time series analysis and trend mining, a quality early warning mechanism is established, and a persimmon cake quality intelligent analysis report and early warning plan are formed; based on the persimmon cake quality intelligent analysis report and early warning plan, the persimmon cake production process parameters and quality characteristics are correlated and analyzed and optimized, a quality traceability system is constructed, and a persimmon cake 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, the persimmon quality detection system based on machine vision comprising:
[0007] The acquisition module is used to perform multi-angle and multi-spectral imaging acquisition and preprocessing of dried persimmon samples through an industrial camera array system to form a standardized dried persimmon image dataset;
[0008] a quantification module for extracting and quantitatively analyzing the color, icing, texture, and shape features of the persimmons based on the standardized persimmon image dataset, and constructing a persimmon appearance feature index set;
[0009] A detection module is used to perform spectral analysis and non-destructive testing on the internal quality parameters of persimmons using the standardized persimmon image dataset and the persimmon appearance feature index set to form a persimmon comprehensive quality feature library;
[0010] A classification module is used to identify and classify persimmon defects based on the persimmon appearance feature index set and the persimmon comprehensive quality feature library, calculate the persimmon quality comprehensive score, and generate a persimmon quality grading result table;
[0011] A mining module is used to perform time series analysis and trend mining on persimmon quality parameters based on the persimmon quality grading result table and the persimmon appearance characteristic index set, establish a quality early warning mechanism, and form a persimmon quality intelligent analysis report and early warning plan;
[0012] 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.
[0013] 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.
[0014] A fourth aspect of the present invention provides a computer-readable storage medium, which stores instructions that, when executed on a computer, enable the computer to execute the above-mentioned persimmon quality detection method based on machine vision.
[0015] In the technical solution provided by this application, in the process of constructing the standardized persimmon image dataset, the improved Retinex algorithm and edge-preserving filtering technology are integrated to effectively eliminate the influence of uneven illumination, enhance the texture contrast of the feature area, and provide a high-quality data basis for subsequent feature extraction; HSV color space transformation combined with adaptive threshold segmentation algorithm realizes the accurate identification of the frosting area on the surface of 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; near-infrared spectral analysis technology is used to quantitatively evaluate the internal quality parameters of persimmon, 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 avoids sample loss associated with traditional destructive testing methods. It integrates edge detection with region growing algorithms to perform fine segmentation of the persimmon surface, and combines it with a support vector machine classifier to classify defect feature descriptors, significantly improving the accuracy of defect identification, especially for defects that are visually similar but of different types. It processes quality data using a time series analysis method, and achieves early identification of quality fluctuations through the moving average method and anomaly detection algorithm, enabling quality problems to be discovered before they cause large-scale losses. Multivariate regression analysis is combined with a genetic algorithm to optimize process parameters, finding the optimal combination of process parameters under complex parameter interaction conditions, improving the quality consistency of persimmon production and reducing the rejection rate. During data processing, special attention is paid to the contribution of algorithm features to the solution. For example, the improved local binary pattern algorithm takes into account the radial texture distribution characteristics when extracting persimmon texture features, improving the distinguishing ability of feature vectors. The application of multispectral data fusion technology in internal quality testing solves the problem of insufficient single-band information and improves the robustness of the prediction model. The threshold-triggered quality warning mechanism screens out true anomalies through statistical significance tests, effectively reducing the false alarm rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 Schematic diagram of an embodiment of a persimmon quality detection method based on machine vision in an embodiment of the present application;
[0018] Figure 2 Schematic diagram of an embodiment of a persimmon quality inspection system based on machine vision in an embodiment of the present application;
[0019] Figure 3 It is a schematic block diagram of the structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The embodiments of the present application provide 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 this 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 herein can be implemented in an order other than that illustrated or described herein. 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 that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or that are inherent to these processes, methods, products or devices.
[0021] 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 persimmon quality detection method based on machine vision includes:
[0022] Step S101: performing multi-angle and multi-spectral imaging acquisition and preprocessing on dried persimmon samples using an industrial camera array system to form a standardized dried persimmon image dataset;
[0023] Step S102: extracting and quantitatively analyzing the color, icing, texture, and shape features of the dried persimmons based on the standardized dried persimmon image dataset to construct a dried persimmon appearance feature index set;
[0024] Step S103: Using the standardized persimmon image dataset 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;
[0025] Step S104: Based on the dried persimmon appearance characteristic index set and the dried persimmon comprehensive quality characteristic library, identify and classify dried persimmon defects, calculate the dried persimmon quality comprehensive score, and generate a dried persimmon quality grading result table;
[0026] Step S105: Based on the persimmon quality grading result table and the persimmon appearance characteristic index set, perform time series analysis and trend mining on the persimmon quality parameters, establish a quality early warning mechanism, and form a persimmon quality intelligent analysis report and early warning plan;
[0027] Step S106: Based on the persimmon quality intelligent analysis report and early warning plan, correlation analysis and optimization are performed on the persimmon production process parameters and quality characteristics, a quality traceability system is constructed, and a persimmon process parameter optimization plan and quality traceability file are generated.
[0028] It is understandable that the execution subject of this application can be a persimmon quality inspection system based on machine vision, or a terminal or a server, which is not limited here. The embodiment of this application is described by taking the server as the execution subject as an example.
[0029] Specifically, an industrial camera array system was used to perform multi-angle, multispectral imaging and preprocessing of persimmon samples to generate a standardized persimmon image dataset. The industrial camera array system, consisting of a top main camera and four surrounding side cameras, simultaneously captured the surface and side features of the persimmons from different angles, generating a set of raw persimmon images. Furthermore, three illumination modes, diffuse white light, side oblique light, and narrow-spectrum light, were used to capture persimmon images under different lighting conditions, constructing a multispectral image sequence. These raw images were then geometrically corrected to eliminate distortion caused by the lens and viewing angle, enabling precise stitching of the multi-angle images to generate a panoramic persimmon image. Next, an adaptive threshold segmentation algorithm was used to extract the foreground from the panoramic persimmon image. This algorithm dynamically adjusted the threshold based on the grayscale value distribution of the local region, accurately separating the persimmon target from the background, and generating a persimmon target region map. The persimmon target region map was then processed using an improved Retinex algorithm for color standardization and image enhancement. This algorithm decomposes the image into illumination and reflectance components, adjusting the illumination component to enhance dark area detail and texture contrast, thereby creating an enhanced persimmon image. 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, forming a standardized persimmon image dataset.
[0030] Based on a standardized persimmon image dataset, the color, icing, texture, and shape features of the persimmons were extracted and quantitatively analyzed to construct a set of persimmon appearance feature indices. Specifically, the standardized persimmon images were transformed using the HSV color space. The HSV color space divides color into three dimensions: hue, saturation, and value, which is more consistent with human perception. The hue, saturation, and value distribution parameters of the persimmon surface were calculated to form a persimmon color feature vector. An adaptive threshold segmentation algorithm was then used to identify icing regions in the standardized persimmon images. This algorithm automatically determines the optimal segmentation threshold based on local region characteristics. The icing coverage, distribution uniformity, and crystallization pattern were calculated to construct a persimmon icing feature descriptor. Texture analysis of the standardized persimmon images was then performed using the local binary pattern (LBP) and gray-level co-occurrence matrix (GLCM). LBP generates a binary code by calculating the relationship between the central pixel and surrounding pixels, while GLCM describes texture features by statistically analyzing the grayscale relationship between pixel pairs. Texture uniformity, directionality, and roughness values were extracted to generate a persimmon texture feature set. In addition, contour extraction and morphological analysis methods were used to analyze the shape of standardized persimmon images. Roundness, symmetry, and perimeter-to-area ratio were calculated, and a persimmon shape descriptor was established. Wrinkle features were analyzed using an edge detection algorithm. This algorithm detects regions of significant grayscale value variation within the grayscale image and measures wrinkle density, depth, and directional distribution parameters to generate a surface structural feature map. A weighted fusion of the persimmon color feature vector, the persimmon icing feature descriptor, the persimmon texture feature set, the persimmon shape descriptor, and the persimmon surface structural feature map was performed to construct a set of persimmon appearance feature indices.
[0031] Using a standardized persimmon image dataset and a set of persimmon appearance characteristic indices, spectral analysis and non-destructive testing were performed on the internal quality parameters of persimmons to form a comprehensive quality characteristic library for persimmons. Specifically, spectral separation and extraction were performed on the near-infrared (780-2500nm), ultraviolet (200-400nm), and visible light (400-780nm) band images in the standardized persimmon image dataset. The reflectance and transmittance values of the persimmons at different wavelengths were calculated to construct a multispectral characteristic curve for the persimmons. By analyzing the absorption characteristics of the near-infrared band in the persimmon multispectral characteristic curve, especially the relationship between the absorption peaks near wavelengths of 1450nm and 1930nm and the sugar content, the sugar content of the persimmons was quantitatively evaluated, and a persimmon sweetness distribution map was generated. Based on the grayscale distribution characteristics of images in the moisture characteristic absorption bands (such as 1450nm and 1940nm), combined with the texture parameters in the persimmon appearance characteristic indices, the moisture content of the persimmons was calculated to form a persimmon moisture content distribution map. Ultraviolet fluorescence imaging was used to enhance the specific wavelength response in a standardized persimmon image dataset to detect potential moldy areas within the persimmons and establish a mold risk assessment index. Based on the differences in the multispectral transmission characteristics of the standardized persimmon image dataset, a hierarchical analysis of the persimmon's internal structure was conducted to assess its uniformity and density, and to construct a persimmon internal structure model. The persimmon sweetness and moisture content distribution maps, mold risk assessment indexes, and internal structure model were integrated and correlated with a set of persimmon appearance characteristic indicators to form a comprehensive persimmon quality feature library.
[0032] Based on a set of persimmon appearance feature indices and a comprehensive persimmon quality feature library, persimmon defects were identified and classified, a comprehensive persimmon quality score was calculated, and a persimmon quality grading result table was generated. In the specific implementation, the persimmon surface was finely segmented by fusing edge detection and region growing algorithms. The edge detection algorithm identified areas with significant grayscale value changes in the image, while the region growing algorithm gradually expanded similar pixel regions from a seed point, identifying abnormal surface structures and areas of color deviation, and generating a candidate persimmon defect map. Local color, texture, and shape feature parameters were extracted from the candidate persimmon defect map and combined with standard features from the persimmon appearance feature indices to construct a defect feature descriptor. The defect feature descriptors were classified using a support vector machine (SVM) classifier. The SVM distinguished different categories by constructing an optimal hyperplane, classifying persimmon surface defects into mold, insect damage, mechanical damage, and rot and deterioration, forming a persimmon defect type distribution map. Based on the persimmon defect type distribution map, the area percentage, severity, and location distribution of each defect were calculated. Combined with the aesthetic parameters from the persimmon appearance feature indices, a defect scoring matrix was established. Based on internal quality data from the persimmon comprehensive quality characteristic library, the sugar content, moisture content, and textural characteristics of the persimmons were evaluated and scored. A defect scoring matrix was then integrated to calculate a comprehensive persimmon quality score. Based on the comprehensive persimmon quality score and industry standard grading thresholds, the persimmon samples were classified into five grades: special, first, second, qualified, and unqualified. A persimmon quality grading results table was generated.
[0033] Based on the persimmon quality grading results table and characteristic data, time series analysis and trend mining of persimmon quality parameters were performed, a quality early warning mechanism was established, and an intelligent persimmon quality analysis report and early warning plan were generated. In specific implementation, a time series storage structure for persimmon quality data was established, and the persimmon quality grading results table was organized and stored by time, batch, and origin to construct a persimmon quality history database. Time series analysis methods were used to track and analyze changes in quality parameters in the persimmon quality history database, including statistical methods such as moving average, exponential smoothing, and autoregressive models. Quality fluctuation patterns and abnormal change points were identified to form a persimmon quality trend chart. Statistical distribution calculations were performed on persimmon quality data from different batches and origins. By combining the persimmon appearance characteristic index set and key parameters in the persimmon comprehensive quality characteristic library, quality influencing factors were identified and a persimmon quality correlation factor table was established. Based on the statistical analysis results of the persimmon quality grading results table, the proportion of each grade, the failure rate, and the quality consistency index were calculated. Combined with the persimmon quality trend chart, a batch quality assessment report was generated. By integrating environmental monitoring data with a table of persimmon quality-related factors and using multi-source data fusion analysis, we explored the relationship between environmental factors and persimmon quality and constructed a persimmon quality change prediction model. We also designed a threshold-triggered automatic warning rule for quality anomalies. When abnormal fluctuations or downward trends in persimmon quality parameters were detected, a warning signal and cause analysis were automatically generated, resulting in an intelligent persimmon quality analysis report and warning plan.
[0034] The production process parameters and quality characteristics of persimmon cakes were analyzed and optimized, a quality traceability system was established, and a persimmon cake process parameter optimization plan and quality traceability file were generated. In the specific implementation, a correlation data model of the production process parameters and quality characteristics of persimmon cakes was constructed, and the drying temperature, humidity, time and flipping frequency were mapped and associated with the persimmon cake appearance characteristic index set, the persimmon cake comprehensive quality characteristic library and the persimmon cake quality grading result table to form a process-quality correlation data table. 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 persimmon cakes, and to establish a process parameter influence weight table. Based on the high-quality persimmon cake sample data in the persimmon cake quality intelligent analysis report, the corresponding process parameter configurations were extracted, and the process parameter optimization space was constructed in combination with the process parameter influence 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 cake quality score, and generated a persimmon cake 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, and link the raw material source, processing technology, persimmon quality grading results table, persimmon quality intelligent analysis report, and early warning plan data to create 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 label, forming a persimmon quality traceability file.
[0035] For example, when an industrial camera array system captures an image of dried persimmons, it obtains an RGB raw image, with each pixel containing three channel values. During geometric correction, perspective transformation is used to map images from different angles to a unified coordinate system. During adaptive threshold segmentation, the average grayscale value of pixels in a local area is calculated and a constant is subtracted from the local average to determine a dynamic threshold value at each location. The improved Retinex algorithm decomposes the image into illumination and reflection components. A logarithmic transformation is then performed, followed by a Gaussian filter applied to the illumination component, which is then subtracted to obtain an enhanced reflection component. In HSV color space transformation, RGB values are mapped to HSV space through a nonlinear transformation to obtain the hue, saturation, and lightness values for each pixel. In local binary pattern analysis, pixels in the neighborhood of a central pixel are binarized to obtain a binary code. The encoded histogram of the entire image is then calculated as a texture feature. In gray-level co-occurrence matrix calculation, the co-occurrence frequency of grayscale values for pairs of pixels at a certain distance is counted to form a matrix from which statistics such as energy, contrast, and correlation are extracted. During near-infrared spectroscopy analysis, by comparing reflectivity differences at different wavelengths and utilizing 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 vectors are mapped to a high-dimensional feature space, and a maximum margin hyperplane is constructed to separate different types of defects. In time series analysis, a moving average window is used to smooth historical quality data, eliminating the impact of short-term fluctuations and highlighting long-term trends. When using a genetic algorithm to optimize process parameters, a population is defined, and new parameter combinations are generated through crossover and mutation operations. Excellent individuals are screened and retained based on the fitness function, and the optimal parameter combination is found after multiple generations of iteration.
[0036] In the embodiment of the present application, in the process of constructing the standardized persimmon image dataset, the improved Retinex algorithm and edge-preserving filtering technology are integrated to effectively eliminate the influence of uneven lighting, improve the texture contrast of the feature area, and provide a high-quality data foundation for subsequent feature extraction; HSV color space transformation combined with adaptive threshold segmentation algorithm realizes the accurate identification of the frosting area on the surface of 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; near-infrared spectral analysis technology is used to quantitatively evaluate the internal quality parameters of persimmon, and a regression model of sugar content and absorbance at a specific wavelength is established to realize non-destructive detection of internal quality. The sample loss of traditional destructive testing methods is avoided. The edge detection and region growing algorithms are integrated to perform fine segmentation of the persimmon surface, and the support vector machine classifier is combined to classify the defect feature descriptors, which greatly improves the accuracy of defect identification, especially for defects that are visually similar but of different types. The time series analysis method is used to process quality data, and the moving average method and anomaly detection algorithm are used to achieve early identification of quality fluctuations, so that quality problems can be discovered before they cause large-scale losses. 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 production and reduces the rejection rate. In the data processing process, special attention is paid to the contribution of algorithm features to the solution. For example, the improved local binary pattern algorithm takes into account the radial texture distribution characteristics when extracting the texture features of persimmons, which improves the distinguishing ability of feature vectors. The application of multispectral data fusion technology in internal quality inspection 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 out real anomalies through statistical significance tests, effectively reducing the false alarm rate.
[0037] In a specific embodiment, the process of executing step S101 may specifically include the following steps:
[0038] (1) The top main camera and the surrounding side cameras are used to collect all-round images of the persimmon cake, obtain the surface and side feature images of the persimmon cake, and form the original image group of the persimmon cake;
[0039] (2) Using diffuse white light, side oblique light, and narrow-spectrum light sources to illuminate persimmon cakes, multispectral images of persimmon cakes under different lighting conditions were collected, and a multispectral image sequence was constructed;
[0040] (3) The original persimmon image group is subjected to distortion elimination and perspective unification processing by geometric correction method, so as to achieve accurate stitching of multi-angle images and generate a panoramic image of persimmon;
[0041] (4) Based on the adaptive threshold segmentation algorithm, the foreground of the persimmon panorama image is extracted, the persimmon target and background are accurately separated, and the persimmon target area map is obtained;
[0042] (5) The color of the persimmon target area image was normalized and image enhancement was performed by improving the Retinex algorithm to enhance the dark area details and texture contrast, and to create an enhanced persimmon image;
[0043] (6) The enhanced persimmon image is denoised by combining Gaussian filtering and edge-preserving filtering, which retains the surface texture details of the persimmon while suppressing random noise, forming a standardized persimmon image dataset.
[0044] Specifically, the persimmons are imaged from all directions using a top main camera and surrounding side cameras, capturing surface and side feature images to form a set of raw persimmon images. The top main camera, mounted vertically downward, primarily captures surface information, including color, shape, and surface texture. The surrounding side cameras, facing the center of the persimmon at 45° or 60° angles, capture side features, such as thickness, edge contours, and icing distribution. Each camera captures high-resolution digital images, typically with a resolution of 2000 × 1500 pixels or higher, ensuring that subtle surface features are captured. The multi-angle images captured by these cameras collectively form a set of raw persimmon images.
[0045] The persimmons were then illuminated using a combination of diffuse white light, side oblique light, and narrow-spectrum light sources. Multispectral images of the persimmons under different lighting conditions were collected and a multispectral image sequence was constructed. Diffuse white light, a uniformly diffused light source provided by a large-area soft light box, is primarily used to evenly illuminate the persimmon surface, reducing shadows and highlights, and capturing the persimmon's true color and overall morphological characteristics. Side oblique light, illuminating the persimmon surface from a low angle, creates shadows that enhance the texture and microscopic bumps on the surface, aiding in the detection of surface wrinkles and defects. Narrow-spectrum light sources, such as LEDs or lasers with specific wavelengths, are used to stimulate the persimmons' reactions at specific wavelengths. For example, near-infrared light (780-2500nm) is used to detect sugar and moisture content, and ultraviolet light (200-400nm) is used to detect potential moldy areas, as some molds produce specific fluorescence under ultraviolet light. By imaging under these three different light sources, an image sequence containing different spectral information is formed, enriching the multi-dimensional perception of persimmon characteristics.
[0046] A geometric correction method is used to remove distortion and unify the perspective of the original dried persimmon image set, achieving precise stitching of multi-angle images and generating a panoramic dried persimmon image. Geometric correction primarily addresses image distortion caused by perspective effects and lens distortion. Lens distortion correction is performed to eliminate radial and tangential distortion caused by lens optical properties. Zhang Zhengyou's checkerboard calibration method is typically used to obtain camera intrinsic parameters and distortion coefficients, and then the original images are corrected through inverse transformation. Perspective unification is then performed to unify the images captured at different angles into a common coordinate system. This process involves coordinate transformation and image registration. Keypoint matching methods such as the SIFT (Scale-Invariant Feature Transform) or SURF (Speeded Up Robust Features) algorithm are used to detect and match key points in different images, establishing correspondences. The RANSAC (Random Sample Consensus) algorithm is then used to select correct matching point pairs, calculate the perspective transformation matrix, and apply image transformation to reconstruct the images from multiple angles into a unified perspective. By using 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.
[0047] An adaptive threshold segmentation algorithm is used to extract the foreground of a panoramic persimmon image, accurately separating the persimmon target from the background, and generating a persimmon target region map. Unlike global threshold segmentation, the adaptive threshold segmentation algorithm dynamically adjusts the threshold value based on the grayscale distribution characteristics of different image regions, making it more suitable for images with uneven lighting or complex backgrounds. This algorithm moves a sliding window across the image, calculating local statistical characteristics (such as the mean, median, or weighted average) for each window region to obtain a local threshold for that region. This threshold is then used 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 identified as the foreground (persimmon region); otherwise, it is identified as the background. This algorithm is highly adaptable to gradual changes in lighting and uneven backgrounds, effectively processing the transition area between the persimmon edge and background, and accurately extracting the persimmon outline. The resulting persimmon target region map is a binary image, with white areas representing the persimmon and black areas representing the background, providing a precise region of interest for subsequent image analysis.
[0048] An improved Retinex algorithm was used to perform color standardization and image enhancement on the persimmon target area image, enhancing dark area detail and texture contrast to create an enhanced persimmon image. The Retinex algorithm, based on the theory of color constancy in the human visual system, aims to eliminate the effects of illumination variations and restore the inherent reflective properties of the object. The improved Retinex algorithm decomposes the image into an illumination component and a reflective component. The illumination component represents the ambient lighting conditions, while the reflective component contains characteristic information about the object itself. The traditional Retinex algorithm uses a logarithmic domain transformation to convert multiplicative relationships into additive ones, and then estimates the illumination component through Gaussian filtering. However, this method is prone to "halo" effects. 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 visibility of dark area detail and the contrast of texture features in the persimmon image are improved. Color standardization adjusts the color distribution within the image to a standard distribution range, eliminating color deviations caused by differences in light source color temperature and ensuring comparability between persimmon images collected from different batches and under different conditions.
[0049] A Gaussian filter and an edge-preserving filter were combined to denoise the enhanced persimmon images, preserving the surface texture details while suppressing random noise, thus forming a standardized persimmon image dataset. Gaussian filtering is a linear smoothing filter that blurs the image by weightedly averaging neighboring pixel values using a Gaussian function. This effectively suppresses high-frequency noise, but also blurs image edges and texture details. Edge-preserving filtering, a type of nonlinear filtering method such as bilateral filtering, guided filtering, or non-local means filtering, considers not only the spatial distance of pixels but also the similarity of pixel values, thus smoothing the image while preserving edge and structural information. In this method, a Gaussian filter was applied to the image for initial denoising, removing most random noise. Edge-preserving filtering was then used to further process the image, repairing any edge blurring that might have been introduced by the Gaussian filter, while preserving key features such as the texture details, icing crystals, and wrinkle structure of the persimmon surface. This dual filtering strategy effectively suppresses image noise while preserving the characteristic information of the persimmon surface, resulting in a clear, low-noise, and standardized persimmon image dataset.
[0050] For example, during the actual persimmon quality inspection process, the persimmons are placed on a conveyor belt. As they pass through the inspection area, the top main camera and the surrounding side cameras are triggered simultaneously to capture multi-angle images of the persimmons. The top camera captures a 2448×2048 resolution planar image, while the four side cameras each capture a 2048×1536 resolution side image from different angles, generating a total of five original images. The system then sequentially switches between three light sources: diffuse white light, 45° side oblique light, and a near-infrared narrow-spectrum light source, repeatedly capturing images under each lighting condition to produce 15 multispectral images. After acquisition, the system geometrically corrects these images, correcting for lens distortion using pre-calibrated parameters. The SIFT algorithm is then used to extract feature points from the images, identifying approximately 200-300 pairs of matching points between adjacent images. The RANSAC algorithm is then used to select the exact matching points. The perspective transformation matrix is then calculated to transform the side images to the same perspective as the top image. Multi-resolution fusion is then used to process the overlapping areas, generating a seamless panoramic image of the persimmons. Adaptive threshold segmentation was then applied to the panoramic image, using an 11×11 pixel sliding window, calculating the local mean, and subtracting a constant of 10 as the threshold. This successfully separated the dried persimmon area from the background. An improved Retinex algorithm was then applied, decomposing the illumination components using a three-scale Gaussian kernel. The image was reconstructed after adjusting the dynamic range, significantly improving the visibility of dark areas and frosting structure. Initial noise reduction was performed using Gaussian filtering, followed by bilateral filtering to preserve edge details, resulting in a standardized dried persimmon image with extremely low noise and complete texture information.
[0051] In a specific embodiment, the process of executing step S102 may specifically include the following steps:
[0052] (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;
[0053] (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.
[0054] (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;
[0055] (4) Shape analysis of the standardized persimmon image dataset was performed using contour extraction and morphological analysis methods. The roundness, symmetry, and perimeter-to-area ratio of the persimmons were calculated, and a persimmon shape descriptor was established.
[0056] (5) The wrinkle feature analysis of the standardized persimmon image dataset was performed using an edge detection algorithm. The wrinkle density, depth, and direction distribution parameters were measured to form a surface structural feature map of the persimmon.
[0057] (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.
[0058] Specifically, performing color conversion on a standardized persimmon image dataset through HSV color space transformation, calculating the persimmon surface hue, saturation, and lightness distribution parameters, and forming a persimmon color feature vector are key steps in persimmon quality testing. The HSV color space is a color representation method that better aligns with human perception. H stands for hue, representing the basic attributes of color, such as red and blue, with a value range of 0-360 degrees; S stands for saturation, indicating the purity of the color. Higher saturation indicates a brighter color, with a value range of 0-1; and V stands for value, indicating the brightness of the color, with a value range of 0-1. The conversion from RGB color space to HSV color space involves converting each pixel in the RGB image. After the conversion, the HSV values of the entire persimmon area are statistically analyzed, and statistical characteristics such as the mean, standard deviation, skewness, and kurtosis of hue, saturation, and lightness are calculated to form a persimmon color feature vector. These characteristics can effectively describe the maturity, dryness and quality 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.
[0059] An adaptive threshold segmentation algorithm was used to identify frosting regions in a standardized persimmon image dataset. Frosting coverage, distribution uniformity, and crystallization patterns were calculated to construct a persimmon frosting feature descriptor. The adaptive threshold segmentation algorithm dynamically adjusts the threshold based on the grayscale value of a local region and is particularly suitable for processing images with uneven lighting. In persimmon images, frosting regions typically exhibit high brightness and low saturation, so segmentation conditions can be designed in HSV space based on these characteristics. Specifically, the formula for calculating frosting coverage (FC) is:
[0060] ;
[0061] 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:
[0062] ;
[0063] 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:
[0064] ;
[0065] in, represents the density of the frosting area, Indicates the average size of frosting sugar 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.
[0066] A texture analysis of a standardized persimmon image dataset was performed based on local binary patterns and gray-level co-occurrence matrices. Texture uniformity, directionality, and roughness values were extracted, generating a persimmon texture feature set. Local binary pattern (LBP) is a texture feature extraction method that compares the grayscale values of a central pixel with those of surrounding pixels, generates binary codes, and then statistically analyzes the distribution of these codes across the entire image. In the persimmon image analysis, the grayscale image is divided into small windows, such as 3×3 or 5×5, based on pixel values. For each window, the grayscale values of the central pixel are compared with those of the surrounding pixels. If the surrounding pixels are greater than or equal to the central pixel, the code is set to 1; otherwise, it is set to 0. This generates a binary string for each window. After conversion to decimal, the frequency distribution of each code value across the entire image is calculated to form an LBP histogram. The gray-level co-occurrence matrix (GLCM) statistically analyzes the spatial relationships between grayscale value pairs within an image. By calculating the co-occurrence frequency of grayscale values between two pixels with a certain distance and direction, a matrix is generated. Statistical features such as energy, contrast, homogeneity, and correlation are then extracted from this matrix. Texture uniformity can be characterized by the homogeneity feature of the 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 the GLCM. These features are combined to form a persimmon texture feature set, which can effectively describe the fineness of the persimmon surface structure and the drying quality. Contour extraction and morphological analysis methods are used to perform shape analysis on a standardized persimmon image dataset, calculate the persimmon roundness, symmetry, and perimeter-to-area ratio, and establish a persimmon shape descriptor. Contour extraction refers to the process of extracting the target boundary from a binary image. An edge tracking algorithm is usually used, starting from an edge point and sequentially searching for adjacent edge points along the edge until returning to the starting point, forming a closed contour line. Morphological analysis is performed on the extracted persimmon contours to calculate the circularity (Cir), which is the degree of closeness of the actual shape to a perfect circle:
[0067]
[0068] in, Indicates the area of dried persimmon, represents the perimeter of the dried persimmon. Symmetry (Sym) can be measured by calculating the mirror consistency of the dried persimmon shape on different axes:
[0069] ;
[0070] 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:
[0071]
[0072] These shape feature parameters collectively constitute a persimmon shape descriptor, which is used to assess the shape regularity and consistency of persimmons. Wrinkle feature analysis was performed on a standardized persimmon image dataset using an edge detection algorithm. Wrinkle density, depth, and directional distribution parameters were measured to generate a surface structural feature map. Edge detection algorithms detect regions of image grayscale values that experience sharp changes. Commonly used algorithms include the Sobel operator and the Canny operator. The Sobel operator detects edges by calculating horizontal and vertical gradients of the image, while the Canny operator is a multi-stage edge detection algorithm that includes Gaussian smoothing, gradient calculation, non-maximum suppression, and double thresholding. In persimmon wrinkle analysis, wrinkles appear as dense edge lines in the edge image generated after edge detection. Wrinkle density is measured as the number of edge pixels per unit area, wrinkle depth is indirectly represented by edge intensity (gradient amplitude), and wrinkle directional distribution is obtained by statistically analyzing the distribution histogram of edge gradient directions. These wrinkle features reflect the degree of shrinkage and uniformity during the drying process and are important for assessing persimmon maturity and processing technology.
[0073] 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. Weighted fusion refers to the process of assigning different weight coefficients to each feature based on its importance to quality assessment, and then combining the features linearly or nonlinearly. The optimal weight can be determined through 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 resulting persimmon appearance feature index set is a multidimensional feature vector that comprehensively describes the appearance quality characteristics of the persimmon, providing a data basis for subsequent quality rating and defect detection.
[0074] For example, when extracting appearance features from a batch of dried persimmon samples, standardized dried persimmon images are obtained and converted from RGB to the HSV color space. During the conversion process, assuming a pixel in a dried persimmon image has an RGB value of (210, 150, 90), the HSV conversion formula calculates the HSV value of that pixel to be approximately (30°, 0.57, 0.82), representing an orange-brown color with medium saturation and high brightness. Statistics for the entire dried persimmon area reveal characteristic parameters such as a mean hue of 25°, a standard deviation of 5°, a mean saturation of 0.62, and a mean lightness of 0.75, forming a color feature vector. Next, the frosting region is identified by setting a threshold in the HSV space: regions with high lightness (V>0.8) and low saturation (S<0.2) are identified as frosting. Using an adaptive threshold segmentation algorithm, the frosting region is identified and the frosting coverage, distribution uniformity, and crystallization pattern parameters are calculated. The LBP algorithm was then applied to a 3×3 window selected from the grayscale image. The center pixel was compared with its eight neighboring pixels, generating a binary code and statistically analyzing its distribution. A gray-level co-occurrence matrix was constructed, and statistical features such as contrast, correlation, energy, and homogeneity were calculated at four angles: 0°, 45°, 90°, and 135°. Contours were extracted from the binary dried persimmon image, and basic geometric features such as area and perimeter were calculated. Roundness, symmetry, and perimeter-to-area ratio were then determined. Wrinkle analysis was performed using the Canny edge detector, with the lower and upper thresholds set at 30% and 70% of the image's average gradient, respectively. An edge map was generated, and wrinkle features were statistically analyzed. These features were then fused by assigning weights based on their importance to quality: color features with a weight of 0.3, icing features with a weight of 0.25, texture features with a weight of 0.2, shape features with a weight of 0.15, and wrinkle features with a weight of 0.1. This resulted in a comprehensive set of dried persimmon appearance feature indices. 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.
[0075] In a specific embodiment, the process of executing step S103 may specifically include the following steps:
[0076] (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;
[0077] (2) By analyzing the absorption characteristics of the near-infrared band in the multispectral characteristic curve of persimmon cakes, the sugar content of persimmon cakes was quantitatively evaluated and a sweetness distribution map of persimmon cakes was generated;
[0078] (3) Based on the grayscale distribution characteristics of the moisture characteristic absorption band image and 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;
[0079] (4) Using ultraviolet fluorescence imaging technology to enhance the specific wavelength response in the standardized persimmon image dataset, the potential moldy areas inside the persimmon were detected and a mold risk assessment index was established;
[0080] (5) Based on the differences in multispectral transmission characteristics of the standardized persimmon image dataset, a hierarchical analysis of the internal structure of persimmon was conducted to evaluate the uniformity and density of the internal structure of persimmon, and to construct a persimmon internal structure model;
[0081] (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 analyzed with the persimmon cake appearance characteristic index set to form a comprehensive quality characteristic library of persimmon cake.
[0082] Specifically, multispectral images refer to multiple images of the same target acquired within 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 at each wavelength. The reflectance (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 formulas for calculating the reflectance and transmittance at different wavelengths are as follows:
[0083]
[0084] in, Indicates the wavelength is The reflectivity when Represents the intensity of reflected light, represents the incident light intensity, Represents the calibration coefficient, which is used to compensate for the deviation of the device response curve. The transmittance calculation uses a similar formula:
[0085]
[0086] in, Indicates the wavelength is The transmittance when represents the intensity of transmitted light, represents the transmission calibration coefficient, represents the thickness compensation factor, The reflectance and transmittance data points at different wavelengths are connected to form a spectral curve, namely the multi-spectral characteristic curve of persimmon.
[0087] By analyzing the absorption characteristics of the near-infrared band in the multispectral characteristic curve of persimmon cakes, the sugar content of persimmon cakes was quantitatively assessed, and a sweetness distribution map was generated. The near-infrared band is sensitive to the vibration and rotation of organic molecules, and different chemical bonds produce characteristic absorption peaks at specific wavelengths. Sugar compounds such as sucrose, glucose, and fructose have distinct absorption characteristics in the near-infrared region, particularly around 900nm, 1100nm, 1450nm, and 1930nm. The absorption values at these characteristic wavelengths were extracted from the multispectral characteristic curve, and a sugar content prediction model was then established using multivariate correction methods. Common multivariate correction methods include partial least squares regression (PLSR) and principal component regression (PCR). These methods can handle correlations between multivariate data, extract effective information, and establish prediction models. The established model was applied to each pixel to calculate the sugar content at the corresponding location. This was then plotted as a persimmon cake sweetness distribution map, visually displaying the distribution of sugar in different regions of the persimmon cake. This is important for assessing the maturity and taste uniformity of persimmon cakes.
[0088] 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 dried persimmon moisture content was calculated to form a dried 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 dried persimmon moisture content is as follows:
[0089] ;
[0090] in, Representing coordinates The moisture content at is the bias constant, represents the absorbance of the i-th water characteristic absorption band, which 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 grayscale 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. This formula considers the impact of spectral and textural characteristics on moisture content prediction, making moisture content estimation more accurate. The calculated results are visualized to form a persimmon moisture distribution map, which directly shows the distribution of moisture in various parts of the persimmon, providing a basis for evaluating drying uniformity and storage stability.
[0091] Ultraviolet fluorescence imaging technology was used to enhance specific wavelength responses in a standardized persimmon image dataset to detect potential moldy areas within the persimmons and establish a mold risk assessment index. Ultraviolet fluorescence imaging utilizes the principle that certain substances emit visible light fluorescence under ultraviolet light to detect samples. Mold fungi and their metabolites, such as aflatoxins, produce a specific fluorescence reaction under ultraviolet light, typically appearing as blue-green or yellow fluorescence. In specific implementation, the persimmons were illuminated with ultraviolet light at a wavelength of approximately 365 nm, and fluorescence images were captured using a camera equipped with a specific filter. The fluorescence images were then subjected to image enhancement processing, including contrast stretching, adaptive histogram equalization, and pseudocolor enhancement, to make potential moldy areas more visually distinct. Fluorescence intensity thresholds were then set to identify potential moldy areas, and mold risk indicators, such as the percentage of fluorescent area, mean fluorescence intensity, and distribution characteristics, were calculated. These indicators were combined to form a mold risk assessment index, which can be used to detect mold risk in persimmons early and prevent the spread of contamination.
[0092] Based on the differences in multispectral transmission characteristics of a standardized persimmon image dataset, a hierarchical analysis of the internal structure of persimmons was conducted to assess its uniformity and density, and to construct a model of its internal structure. Different wavelengths of light have varying penetration capabilities into persimmon tissue. Shortwave visible light primarily reveals surface information, while longwave near-infrared light penetrates deeper, providing information about the internal structure. By analyzing the differences in transmission images at different wavelengths, the layered structure of the persimmons can be inferred. The method involves selecting a series of transmission images from shortwave to longwave wavelengths and calculating difference maps between images at adjacent wavelengths. These difference maps represent information at different depths. Image segmentation and feature extraction techniques are then used to extract tissue features, such as density distribution, texture characteristics, and uniformity, from each layer's difference map. Based on these features, a three-dimensional structural model of the persimmon's interior was constructed. This model describes the structural changes from the surface to the core of the persimmon, reflecting the uniformity of water migration and tissue shrinkage during the drying process, providing a visual representation for assessing the internal quality of the persimmons.
[0093] The sweetness distribution map of persimmon cakes, the moisture content distribution map of persimmon cakes, the mold risk assessment index and the internal structure model of persimmon cakes were integrated and analyzed with the set of persimmon cake appearance characteristic indicators to form a comprehensive quality feature library of persimmon cakes. Correlation analysis is the process of exploring the relationship between different characteristics, and quantifying the strength of the association between characteristics by calculating correlation coefficients, mutual information or more complex statistical models. For example, the spatial correlation between sugar distribution and moisture distribution is analyzed, the relationship between internal tissue density and surface texture characteristics, and the dependency between mold risk and moisture content are explored. These correlation analysis results form knowledge rules, which together with the original feature data constitute a comprehensive quality feature library of persimmon cakes. This feature library contains both individual quality parameters and the association rules between parameters. It comprehensively and systematically describes the quality status of persimmon cakes and provides rich feature information for subsequent quality rating and classification.
[0094] An example illustrates the spectral analysis and nondestructive testing process for persimmon internal quality parameters: Multispectral imaging was performed on a batch of persimmon samples, capturing a series of images at wavelengths ranging from 400nm to 2500nm. A total of 30 sampling wavelengths were set, resulting in 30 images at different wavelengths. Each wavelength image was calibrated using a pre-calibrated reflectance standard to eliminate the effects of light source fluctuations and uneven camera response. The reflectance and transmittance values of the persimmon at each wavelength were calculated. For example, at a wavelength of 1100nm, a persimmon sample had a reflectance of 32% and a transmittance of 8%. The reflectance and transmittance values at all wavelengths were concatenated to form a multispectral characteristic curve for the persimmon. To assess sugar content, absorbance values at wavelengths of 900nm, 1100nm, and 1600nm were extracted from the multispectral curve. Combined with laboratory-measured reference sample data, a sugar prediction model was developed using partial least squares regression. This model was applied to the entire persimmon image to generate a sugar content distribution map. Similarly, for moisture content analysis, absorbance values at wavelengths of 1450nm and 1940nm were combined with morphological texture parameters such as texture contrast and uniformity to establish a moisture content prediction model and calculate a moisture distribution map. For mold risk assessment, persimmons were illuminated with a 365nm ultraviolet light source to capture fluorescence images. After enhancement processing, some persimmons exhibited weak, abnormal fluorescence at the edges. The area and intensity of the fluorescence regions were calculated to assess mold risk. For internal structure analysis, transmission images at wavelengths of 800nm, 1200nm, and 1600nm were compared to construct a three-layer structural model describing the changes in tissue density from the epidermis to the core. Comprehensive analysis of these data revealed a negative correlation between persimmon sweetness and moisture distribution, with high-sugar areas typically containing lower moisture. There was also a positive correlation between internal tissue density and surface wrinkle density, reflecting shrinkage during drying. Furthermore, high-moisture areas were positively correlated with mold risk.
[0095] In a specific embodiment, the process of executing step S104 may specifically include the following steps:
[0096] (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;
[0097] (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;
[0098] (3) The support vector machine classifier was used to classify the defect feature descriptors and divide the surface defects of persimmon into mildew, insect damage, mechanical damage, and rot and deterioration categories, forming a distribution map of persimmon defect types;
[0099] (4) Based on the distribution map of persimmon defect types, the area proportion, severity, and location distribution of each type of defect were calculated, and a defect scoring matrix was established by combining the aesthetic parameters in the persimmon appearance characteristic index set;
[0100] (5) Based on the internal quality data in the persimmon comprehensive quality characteristic 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;
[0101] (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.
[0102] Specifically, edge detection algorithms are primarily used to identify areas within an image where grayscale values change dramatically. These areas typically correspond to object boundaries or surface structural changes. For persimmon defect detection, the edge detection algorithms employed include the Canny algorithm. This algorithm applies a Gaussian filter to the image to reduce noise, then calculates the gradient magnitude and direction. Non-maximum suppression is then used to retain the local maximum gradient value. A dual-threshold method is then used to detect and connect edges, effectively detecting structural anomalies such as cracks and dents on the persimmon surface. The region growing algorithm, starting from a preset seed point, gradually merges surrounding pixels that meet similarity criteria into the current region until no more pixels meet the criteria. In persimmon detection, points whose color or texture features differ significantly from those of a normal persimmon surface are selected as seed points. The region is then expanded based on a color similarity threshold to identify areas of color deviation, such as browning or discoloration. When these two algorithms are combined, edge detection is used to identify potential defect boundaries. The region growing algorithm is then applied to the areas within 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 abnormality areas, laying the foundation for subsequent defect feature extraction and classification.
[0103] Local color, texture, and shape feature parameters are extracted from the dried persimmon defect candidate image and combined with standard features from the dried persimmon appearance feature index set to construct a defect feature descriptor. Local color features primarily describe the color characteristics of the defect region, including average hue, saturation, and brightness in the HSV color space, as well as the color difference from the normal region. Texture features characterize the surface structural properties of the defect region. Statistics such as texture energy, contrast, and correlation are extracted using local binary patterns and gray-level co-occurrence matrices, reflecting the texture roughness and regularity of the defect region. Shape features characterize the geometric properties of the defect region, including parameters such as defect area, perimeter, roundness, rectangularity, and eccentricity, used to distinguish different types of defect morphologies. These local features are compared with standard features from the dried persimmon appearance feature index set to calculate deviation metrics such as relative color difference, texture abnormality, and shape specificity. Combining these feature parameters with deviation quantification metrics creates a multidimensional defect feature descriptor that comprehensively characterizes the various characteristics of the defect region, providing sufficient feature information for subsequent defect classification.
[0104] The defect feature descriptors are classified using a support vector machine classifier, and the surface defects of persimmons are divided into categories such as mildew, insect pests, mechanical damage, and rot and deterioration, forming a distribution map of persimmon defect types. The 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 intervals between samples of different categories. In the classification of persimmon defects, it is necessary to construct a training data set containing feature descriptors and corresponding category labels for various known defects. During the training process, the support vector machine algorithm solves a quadratic optimization problem to find the decision boundary that can best distinguish between various types of defects. 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. Mold defects typically manifest as localized mold and mildew spots with distinctive color and texture. Insect damage includes bite marks and insect tunnels, which are irregular in shape but have sharp edges. Mechanical damage primarily manifests as deformation and cracks caused by squeezing and collision. Rot and deterioration manifest as softening, exudation, and darkening. The classification results are mapped back to the original image space, and each defective area is labeled with its category information. This creates a persimmon defect type distribution map, visually displaying the spatial distribution of each defect type.
[0105] Based on the persimmon defect type distribution map, the area percentage, severity, and location distribution of each defect were calculated. Combined with the aesthetic parameters from the persimmon appearance characteristic index set, a defect scoring matrix was constructed. The area percentage refers to the ratio of the area of each defect type to the total area of the persimmon, directly reflecting the extent of the defect. Severity is quantified by the degree to which the characteristics of the defect area deviate from the normal value, including a comprehensive assessment of the degree of color deviation, texture abnormality, and shape distortion. Location distribution examines the spatial distribution of defects on the persimmon, such as central, edge, or random distribution, as well as the degree of clustering and dispersion of defects. The aesthetic parameters, a comprehensive evaluation index from the persimmon appearance characteristic index set, reflect the overall appearance quality of the persimmon, including color uniformity, shape regularity, and surface finish. These parameters are organized into a matrix, with rows representing different defect types and columns representing various evaluation indicators. Each matrix element represents the score for the corresponding defect type on that indicator. The defect scoring matrix comprehensively reflects the severity and distribution of surface defects in the persimmon. Based on the internal quality data in the persimmon comprehensive quality feature database, the sugar content, moisture content, and textural characteristics of the persimmons were evaluated and scored. This data was then integrated into a defect scoring matrix to calculate a comprehensive quality score. Internal quality data, obtained through spectral analysis and nondestructive testing, includes information on sugar content distribution, moisture content distribution, and internal structural characteristics. During the scoring process, scoring criteria were set for each internal quality parameter, such as the appropriate range for sugar content, the ideal moisture content range, and textural uniformity requirements. Scores were then assigned based on the degree of conformity between the actual test values and the standards, resulting in sugar scores, moisture scores, and textural scores. These internal quality scores were then integrated with the defect scoring matrix, and a weighted summation method was used to calculate a comprehensive score. Weights for different quality parameters were assigned based on their impact on the overall quality of the persimmons. For example, mold defects were given a higher weight because they directly impact food safety, while sugar content was also given a higher weight because it determines the taste and flavor of the persimmons. This weighting mechanism ensures that the comprehensive score truly reflects the overall quality of the persimmons.
[0106] Based on the comprehensive quality score of persimmons and the industry standard grading thresholds, 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. The industry standard grading thresholds are evaluation criteria developed based on expert experience and market demand, and clearly stipulate the quality requirements for persimmons of different grades. During the grading process, the comprehensive quality score of the persimmons is compared with the thresholds of each grade to determine the final grade. Special grade persimmons require no obvious defects, high sugar content, moderate moisture content, 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 are allowed to have more defects, but food safety must be guaranteed; unqualified products have defects that seriously affect the 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, to facilitate production management and quality traceability.
[0107] For example, when quality-checking a batch of dried persimmons, defect detection is performed using standardized images. The defect detection stage first applies the Canny edge detection algorithm, setting the low and high thresholds at 30% and 70% of the average gradient of the dried persimmon image, respectively. This algorithm detects the edge structure of the dried persimmon surface, including natural texture and potential defect boundaries. Then, in the HSV color space, regions where the color deviates from the normal dried persimmon, such as areas that are significantly darker or lighter, are selected as seed points. A region growing algorithm is used to expand the defect regions, generating a candidate dried persimmon defect map. Feature extraction from the candidate defect regions involves calculating the HSV mean, local binary pattern histogram, and gray-level co-occurrence matrix features for each region, as well as shape parameters such as area, perimeter, and roundness, to form a defect feature descriptor. These feature descriptors are input into a pre-trained support vector machine classifier, which analyzes the feature patterns and classifies defects into four categories: moldy areas typically appear as bluish-gray spots with a rough texture; insect-infested areas appear as small holes or serpentine channels; mechanically damaged areas appear as indentations or cracks; and rotten areas appear as brown, softened areas. After classification, a defect distribution map is generated, the proportion and severity of each defect type are calculated, and a defect scoring matrix is established. Sugar and moisture data obtained from multispectral analysis are also evaluated to determine sugar content and moisture content scores, and the internal structure analysis results are converted into tissue characteristic scores. Based on preset weights, mold defects are weighted 0.35, mechanical damage is weighted 0.2, sugar content is weighted 0.2, moisture content is weighted 0.15, and tissue characteristics are weighted 0.1, to calculate a comprehensive quality score for the dried persimmons. Based on industry standard thresholds, scores above 90 are considered special grade, 80-90 are considered first grade, 70-80 are considered second grade, 60-70 are considered qualified, and scores below 60 are considered unqualified. A quality grading result table is generated. A key point in this process is the correspondence between defect characteristics and classification: mold defects typically have specific color and texture characteristics, insect damage defects have distinct shape characteristics, and mechanical damage has distinct structural characteristics. Through these correspondences, the support vector machine can accurately identify different types of defects, thereby achieving precise quality ratings.
[0108] In a specific embodiment, the process of executing step S105 may specifically include the following steps:
[0109] (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;
[0110] (2) Using time series analysis methods, we tracked and analyzed the changes in quality parameters in the persimmon quality history database, identified quality fluctuation patterns and abnormal change points, and formed a persimmon quality trend chart;
[0111] (3) Statistical distribution calculations were performed on the quality data of persimmons from different batches and origins. The quality influencing factors were discovered by combining the persimmon appearance characteristic index set and the key parameters in the persimmon comprehensive quality characteristic database, and a table of persimmon quality correlation factors was established.
[0112] (4) Based on the statistical analysis results of the persimmon quality grading result table, calculate the proportion of each grade, unqualified rate and quality consistency index, and generate a batch quality assessment report based on the persimmon quality trend chart;
[0113] (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 persimmon quality change prediction model;
[0114] (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.
[0115] Specifically, this time-series storage structure uses a multidimensional database design to organize and index the data in the persimmon quality grading result table according to the time, batch, and origin dimensions. The time dimension includes time points such as production date, inspection date, and warehousing 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; and the origin dimension includes spatial information such as the source of raw materials and processing location. This multidimensional structure allows for rapid query and analysis of data from different perspectives, such as viewing quality changes within a specific time period or comparing the quality differences of persimmons from different origins. In the actual storage process, a combination of relational and NoSQL databases 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 efficient data access and analysis capabilities are maintained even when a large amount of historical data is accumulated.
[0116] Time series analysis was used to track and analyze the changes in quality parameters in the persimmon quality history database, identifying quality fluctuation patterns and unusual change points, and generating a persimmon quality trend chart. Time series analysis is a statistical method that studies a sequence of chronologically arranged data points, aiming to extract meaningful statistical features and patterns. Common time series analysis methods used in persimmon quality analysis include moving average, exponential smoothing, and the autoregressive integrated moving average model. The moving average method calculates the average value of data within a specific window period to generate a smooth curve, reducing the impact of short-term fluctuations and highlighting long-term trends. The exponential smoothing method gives higher weight to recent data and decreasing weight to more distant data, making it suitable for data with a certain trend. The autoregressive integrated moving average model comprehensively considers the data's autocorrelation, trend, and periodicity, enabling a more accurate description of complex time series characteristics. In practical applications, time series data for key quality parameters such as the comprehensive score and defect rate were extracted from the quality history database. The aforementioned methods were then applied to analyze the data to identify trend, seasonal, and irregular components. The trend component reflects the long-term direction of change in the quality parameter, the seasonal component reveals cyclical fluctuation patterns, and the irregular component may contain unusual fluctuation points. By setting a statistical significance threshold, we detect data points in the time series that significantly deviate from expectations and mark them as abnormal change points. We visualize the analysis results to form a persimmon quality trend chart, which directly shows the changes in quality parameters over time and any abnormalities.
[0117] Statistical distribution calculations were performed on persimmon quality data from different batches and origins. By combining the persimmon appearance characteristic index set with key parameters from the comprehensive persimmon quality characteristic database, factors influencing quality were identified and a table of factors associated with persimmon quality was established. Statistical distribution calculations quantify the statistical characteristics of a dataset, including statistical quantities such as mean, median, standard deviation, and quartiles, as well as distribution patterns such as histograms and density curves. In the persimmon quality analysis, these statistical characteristics were calculated for persimmon quality data from different batches and origins, and their differences were compared. Key parameters such as color, shape, and texture were then selected from the persimmon appearance characteristic index set, and internal quality parameters such as sugar content, moisture content, and textural characteristics were selected from the comprehensive quality characteristic database. Correlation analysis was then conducted with the quality rating results. Correlation analysis methods include Pearson correlation coefficient calculation, Spearman rank correlation analysis, and partial correlation analysis. Variance analysis and regression analysis can also be used to explore the relationships between factors. These analyses determine which parameters have a strong correlation with the quality rating results, indicating which factors have a significant impact on persimmon quality. The study also explored the interactions between various influencing factors, such as the combined impact of the ratio of sugar content to moisture content on quality. The results were compiled into a table of factors associated with dried persimmon quality, listing the correlation coefficient, significance level, and direction of influence for each factor. This table provides data support for subsequent quality control and process optimization.
[0118] Based on the statistical analysis results of the persimmon quality grading results table, the percentage of each grade, the rejection rate, and the quality consistency index are calculated. Combined with the persimmon quality trend chart, a batch quality assessment report is generated. The percentage of each grade represents the percentage of persimmons in each of the five grades—special, first, second, qualified, and unqualified—to the total number of persimmons, reflecting the overall quality distribution. The rejection rate specifically focuses on the proportion of defective products and is a key indicator for quality control. Quality consistency indexes measure the stability of persimmon quality within a batch, typically expressed as the standard deviation or coefficient of variation of the quality scores. A smaller standard deviation indicates more consistent quality. These indices are calculated using descriptive statistics based on the data in the persimmon quality grading results table. Combining these statistical indicators with the quality trend chart generated earlier provides a comprehensive assessment of the quality of a batch, not only understanding the current quality distribution but also enabling comparison with historical data to identify changes in quality trends. The assessment report also includes an abnormality analysis of key quality parameters, identifying which parameters exhibit significant deviations and possible explanations, providing a basis for quality management decision-making.
[0119] By integrating environmental monitoring data with a table of persimmon quality-related factors and using multi-source data fusion analysis, the relationship between environmental factors and persimmon quality was explored, and a prediction model for persimmon quality change was constructed. Environmental monitoring data includes parameters such as temperature, humidity, light, and air quality. These factors may affect the drying process and storage conditions of persimmons, and thus their final quality. Multi-source data fusion is the process of integrating and analyzing heterogeneous data from different sources to obtain more complete and accurate information. In the persimmon quality analysis, a combination of feature-level fusion and decision-level fusion was used to analyze the environmental monitoring data in relation to the previously established table of quality-related factors. Feature-level fusion combines features from different sources to form a joint feature vector during the feature extraction phase; decision-level fusion combines the results of independent analysis of each data source at the decision-making stage. By calculating the time-lag correlation between environmental parameters and quality indicators, the time-lag effect of environmental factors on quality was determined, providing a temporal reference for the prediction model. Based on the fusion analysis results, a prediction model for persimmon quality changes was constructed. This model uses machine learning methods such as multivariate linear regression, artificial neural networks, and random forests. Environmental and process parameters are input and the output is a predicted quality score. Model training uses historical data for parameter optimization, and cross-validation is used to evaluate model performance and ensure the reliability of the prediction results.
[0120] A threshold-triggered automatic quality anomaly warning rule has been designed. When abnormal fluctuations or downward trends in persimmon cake quality parameters are detected, a warning signal and cause analysis are automatically generated, resulting in an intelligent persimmon cake quality analysis report and warning plan. A threshold trigger mechanism triggers an alert when a monitoring indicator exceeds a preset threshold. The persimmon cake quality warning system employs three types of threshold rules: fixed threshold rules, statistical threshold rules, and trend threshold rules. Fixed threshold rules establish acceptable ranges for quality parameters based on industry standards or expert experience, triggering alerts when parameter values exceed these limits. Statistical threshold rules, based on the statistical distribution of historical data, define anomalies as values that deviate from the mean by more than a specified multiple of the standard deviation, making them suitable for handling situations with significant data fluctuations. Trend threshold rules focus on parameter trends and trigger an alert when a downward or upward trend is detected for multiple consecutive cycles, helping to identify potential problems in advance. Once an alert is triggered, the system automatically analyzes the possible causes by querying a table of quality-related factors to identify factors strongly correlated with the abnormal parameters. This analysis then combines environmental monitoring data and processing parameter records to infer the possible causes. Alert information is graded according to severity. Emergency situations are immediately notified to relevant personnel via text message or phone calls, while more general situations are included in daily reports. The early warning plan includes response recommendations and provides targeted improvement measures based on the type and cause of the anomaly, such as adjusting drying parameters and improving storage conditions. The entire early warning process generates an intelligent quality analysis report that not only contains the warning information but also provides detailed data analysis and trend forecasts, providing comprehensive support for quality management.
[0121] For example, a dried persimmon manufacturer recorded quality inspection data for three consecutive months, including quality scores and key parameters for 30 randomly sampled dried persimmons inspected daily. This data was stored in a quality history database, organized by time, batch, and origin, forming a structured time-series dataset. Time-series analysis applied a seven-day moving average to the overall quality score to eliminate the impact of daily fluctuations, revealing a downward trend in the quality score starting in the middle of the second month. Further analysis revealed synchronized changes in several key parameters: sugar content remained stable, but moisture content gradually increased, with a reduction in surface wrinkling and a softening of the texture. Statistical distribution calculations of data from different batches revealed significant differences between batches from different drying rooms, confirmed by analysis of variance. Correlation analysis of these quality parameters with environmental monitoring data revealed that two weeks prior to the quality decline, the humidity control system in one drying room had fluctuated, with humidity periodically rising to the upper limit of normal values. A random forest prediction model trained on this historical data indicated that if ambient humidity remained high, the dried persimmon quality score would decline further in the following week, particularly for moisture-sensitive parameters. At this point, the quality early warning system automatically triggered a humidity anomaly warning because it detected humidity values that were 1.5 times higher than the standard value for five consecutive days. At the same time, the quality trend forecast indicated 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 cause of the increased moisture content in the dried persimmons, which in turn affected the drying effect and the formation of the tissue structure. Without timely intervention, more batches of dried persimmons would fail to meet the first-class quality standards. The early warning plan recommended: immediately inspect and repair the humidity control system, adjust drying parameters to increase 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, the company can promptly detect quality fluctuations in the production process, identify the root causes, and take targeted measures to ensure the stability of the quality of dried persimmons.
[0122] In a specific embodiment, the process of executing step S106 may specifically include the following steps:
[0123] (1) Construct a data model for associating dried persimmon production process parameters with quality characteristics, mapping and associating drying temperature, humidity, time, and turnover frequency with the dried persimmon appearance characteristic index set, the dried persimmon comprehensive quality characteristic database, and the dried persimmon quality grading result table to form a process-quality association data table;
[0124] (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 establish a process parameter influence weight table;
[0125] (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 by combining the process parameter influence weight table;
[0126] (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;
[0127] (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;
[0128] (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.
[0129] Specifically, a linked data model is a data structure used to describe the mapping relationship between different data entities. In dried persimmon production, this primarily involves the association of two major data types: process parameters and quality characteristics. Process parameters include drying temperature (the ambient temperature during the dried persimmon drying process, typically ranging from 20-40°C), humidity (the relative humidity of the drying environment, typically ranging from 40% to 70%), drying time (the duration of the drying process, typically 10-20 days), and turning frequency (the number of times the dried persimmons are turned over, which affects drying uniformity, typically 1-3 times per day). These process parameters are captured through automated equipment or manual recording during the production process, forming the process parameter dataset. Quality characteristic data, on the other hand, is derived from multiple results generated during the aforementioned machine vision inspection process, including a set of dried persimmon appearance characteristic indicators (color, icing, texture, and shape characteristics), a comprehensive dried persimmon quality characteristic library (sugar content, moisture content, mold risk assessment indicators, etc.), and a dried persimmon quality grading table (grading 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 number or timestamp to form a process-quality associated data table containing multi-dimensional process parameters and multi-dimensional quality characteristics.
[0130] Multivariate regression analysis was used to analyze the process-quality correlation data table, identify key process parameter combinations that significantly impact the final quality of dried persimmons, and establish a table of process parameter influence weights. 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). The method quantifies the degree of influence of each variable on the dependent variable by establishing a mathematical model. Multivariate regression methods used in dried persimmon quality analysis include linear regression, ridge regression, and elastic net regression. Linear regression assumes a linear relationship between the dependent and independent variables and estimates model parameters using the least squares method. Ridge regression introduces an L2 regularization term to mitigate multicollinearity and improve model stability. Elastic net regression uses both L1 and L2 regularization to address collinearity and facilitate variable selection. The specific steps of regression analysis involve selecting a comprehensive quality score or specific quality indicator as the dependent variable and each process parameter as the independent variable. The regression model is then fitted using training data, and the regression coefficients for each process parameter are calculated. These coefficients reflect the direction and intensity of each process parameter's impact on quality. The significance of the regression coefficients was then assessed using statistical methods such as the t-test, identifying key process parameters that significantly impact quality. Considering the potential for interactions between process parameters, interaction terms, such as those between temperature and humidity, and between time and turnover frequency, were also added to the regression model to assess their significance. Based on the absolute value and significance level of the regression coefficients, weights were assigned to each process parameter, and a process parameter impact weight table was established. This table clearly quantifies the degree of impact of each process parameter on dried persimmon quality, providing a scientific basis for subsequent process optimization.
[0131] Based on the high-quality persimmon sample data from the intelligent persimmon quality analysis report, the corresponding process parameter configurations were extracted and combined with the process parameter influence weight table to construct a process parameter optimization space. High-quality persimmon samples are those rated as special or first grade in the quality grading process. The process parameter configurations of these samples represent successful experience in producing high-quality persimmons. Process parameter data for these high-quality samples, including drying temperature, humidity, drying time, and turnover frequency, were extracted from the intelligent quality analysis report to form a set of high-quality process parameters. The process parameter influence weight table established earlier was then used to determine the importance of each parameter, with a focus on key parameters with higher weights. The process parameter optimization space refers to the range of allowable variation and constraints for each process parameter. This construction process involves statistical analysis of the process parameters of the high-quality samples, calculating statistical quantities such as the mean, median, and standard deviation for each parameter to determine the central tendency and fluctuation range of the parameters. Upper and lower limits for the parameters were then set based on their physical meaning and actual production conditions. For example, the temperature must not exceed the maximum allowed by the equipment, and the humidity must not fall below the minimum humidity for the local climate. Furthermore, interdependent constraints between parameters must be considered, such as the generally negative correlation between temperature and humidity, with high temperatures often requiring low humidity. The resulting process parameter optimization space is a multidimensional 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, searching for the process parameter combination that maximizes the persimmon quality score, and generating an optimized solution for the persimmon production process parameters. A 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 phase, process parameters are represented as chromosomes, with each gene representing a parameter value. In the initialization phase, multiple process parameter combinations are randomly generated within the process parameter optimization space to form an initial population. In the fitness evaluation phase, the previously established multivariate regression model is used to predict the persimmon quality score for each parameter set, which serves as the fitness value. In the selection phase, outstanding individuals are selected for the next generation based on their fitness values. Common selection methods include roulette wheel selection and tournament selection. In the crossover phase, the genes of two parent individuals are swapped to generate new offspring individuals, increasing the diversity of solutions. In the mutation phase, the values of certain genes are randomly altered with a certain probability to prevent the algorithm from falling into a local optimum. In the termination judgment phase, the algorithm stops when the maximum number of iterations is reached or when the fitness value no longer significantly improves. This process continues iteratively, with the population gradually evolving toward a more optimal solution, ultimately finding the process parameter combination that maximizes the persimmon quality score.This set of parameters constitutes the optimization scheme for the production process parameters of dried persimmons, including the optimal drying temperature, humidity, time and turning frequency, as well as their implementation details and precautions.
[0132] A digital traceability framework for the entire persimmon production process has been established. Each batch of persimmons is assigned a unique identification code, linking the raw material source, processing technology, persimmon quality grading results, and intelligent quality analysis reports and early warning plan data to create a persimmon quality chain diagram. This digital traceability framework digitally records the entire persimmon production process, from raw material procurement to final product, enabling full traceability. The unique identification code is the core of the traceability system. Each batch of persimmons is assigned a unique code, typically a combination of production date, batch number, and product serial number, to ensure global uniqueness. The digital traceability data includes: raw material source information (raw material type, origin, harvest date, supplier, etc.); processing technology information (actual implementation of the optimized process parameters, operators, equipment status, etc.); quality inspection information (quality grading results, test values of various quality parameters); and quality analysis information (content of intelligent quality analysis reports, early warning plan records, etc.). This data is stored and managed using database technology, establishing relationships between various data entities, such as linking raw material batches to persimmon batches and linking persimmon batches to 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 easier to intuitively understand and analyze quality changes and critical control points in the entire production process.
[0133] A QR code scanning interface has been developed to encode the quality inspection results, production date, and origin information from the persimmon quality chain diagram into the product label, creating a persimmon quality traceability profile. A QR code is a two-dimensional barcode that can store more information than traditional barcodes, making it suitable as a carrier for product quality traceability. The QR code scanning interface consists of two parts: an encoding interface that converts persimmon quality information into a QR code image, and a decoding interface that extracts 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 values), production information (production date, batch number), and origin information (raw material source, processing location). This information is then encoded into the QR code along with a unique identification code to ensure information security and authenticity. Digital signatures and encryption mechanisms can also be incorporated to prevent tampering. The generated QR code is printed on the product packaging or attached to the product label. Consumers can scan the QR code using a mobile phone or other device to connect to the quality traceability platform and view detailed quality information and production process records for the batch of persimmons, ensuring 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., supporting the tracing of quality problems and the determination of responsibility.
[0134] For example, a dried persimmon manufacturer collected production data from the past two years, encompassing 500 batches. For each batch, process parameters (drying temperature, humidity, drying time, and turnover frequency) were recorded, along with quality characteristics obtained through machine vision inspection. A correlation data model was established to correlate the process parameters for each batch with the corresponding quality characteristics, creating a process-quality correlation data table. A multivariate regression analysis was then conducted using the elastic net regression method, with the dried persimmon quality score as the dependent variable and the process parameters as independent variables. The regression results showed a regression coefficient of 0.65 (positive correlation) for drying temperature, -0.48 (negative correlation) for humidity, 0.32 (positive correlation) for time, and 0.25 (positive correlation) for turnover frequency. The regression coefficient for the interaction term between temperature and humidity was -0.42, indicating that high temperature combined with low humidity yielded the best results. Based on the absolute values and significance of the regression coefficients, a weighting table for the process parameters was determined: temperature weighted 0.40, humidity weighted 0.30, time weighted 0.20, and turnover frequency weighted 0.10. The data for 100 batches of premium dried persimmon samples were then selected from the intelligent quality analysis report. Their process parameter configurations were extracted. Statistical analysis revealed that these high-quality dried persimmons were produced with drying temperatures ranging from 28-35°C, humidity levels between 45-60%, drying times between 14-18 days, and turnover frequencies of two to three times daily. Combined with physical constraints, such as an upper temperature limit of 38°C for the equipment, the optimal process parameter range was determined. A genetic algorithm was used to optimize the parameters, with an initial population size of 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 on the optimal solution: drying temperature of 32°C, humidity of 52%, drying time of 16 days, and turnover frequency of twice daily. Verification experiments demonstrated that the quality scores of dried persimmon samples produced using this optimized set of parameters significantly improved, particularly in terms of sugar crystallization uniformity and tissue density. A digital traceability system for the entire persimmon production process has been established, assigning each batch of persimmons a unique identification code, such as "KC-20250227-001," where KC represents the persimmon product code, 20250227 represents the production date, and 001 represents the batch number for that day. The traceability system records data from raw material procurement to finished product testing, including information about raw material suppliers, actual process parameters, machine vision inspection results, and quality grading. A quality chain diagram visually illustrates key milestones and indicator changes throughout the production process, such as the temperature and humidity curves of raw material moisture content after entering production, as well as the quality grade distribution of the final product. Key quality information is encoded in a QR code and printed on the product packaging. Consumers can scan the code to obtain the origin, production date, quality grade, and key quality parameters of the batch of persimmons, ensuring full quality traceability from field to table.
[0135] The above describes the persimmon quality detection method based on machine vision in the embodiment of the present application. The following describes the 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:
[0136] The acquisition module is used to perform multi-angle and multi-spectral imaging acquisition and preprocessing of dried persimmon samples through an industrial camera array system to form a standardized dried persimmon image dataset;
[0137] a quantification module for extracting and quantitatively analyzing the color, icing, texture, and shape features of the persimmons based on the standardized persimmon image dataset, and constructing a persimmon appearance feature index set;
[0138] A detection module is used to perform spectral analysis and non-destructive testing on the internal quality parameters of persimmons using the standardized persimmon image dataset and the persimmon appearance feature index set to form a persimmon comprehensive quality feature library;
[0139] A classification module is used to identify and classify persimmon defects based on the persimmon appearance feature index set and the persimmon comprehensive quality feature library, calculate the persimmon quality comprehensive score, and generate a persimmon quality grading result table;
[0140] A mining module is used to perform time series analysis and trend mining on persimmon quality parameters based on the persimmon quality grading result table and the persimmon appearance characteristic index set, establish a quality early warning mechanism, and form a persimmon quality intelligent analysis report and early warning plan;
[0141] 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.
[0142] Through the collaborative cooperation 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 influence of uneven illumination, improved the texture contrast of the feature area, and provided a high-quality data foundation for subsequent feature extraction; 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 can 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 spectral analysis technology, and a regression model of sugar content and absorbance at a specific wavelength was established, realizing the non-inferior quality of the internal quality. The method uses a multivariate regression analysis method to optimize process parameters, finding the optimal combination of process parameters under complex parameter interaction conditions, improving the quality consistency of persimmon production and reducing the rejection rate. During data processing, special attention is paid to the contribution of algorithm features to the solution. For example, the improved local binary pattern algorithm takes into account the radial texture distribution characteristics when extracting persimmon texture features, improving the distinguishing ability of feature vectors. The application of multispectral data fusion technology in internal quality inspection solves the problem of insufficient single-band information and improves the robustness of the prediction model. The threshold-triggered quality warning mechanism screens out true anomalies through statistical significance tests, effectively reducing the false alarm rate.
[0143] 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, memory, display screen, input device, network interface and database connected via a system bus. The processor of the computer design 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 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 via a network connection. When the computer program is executed by the processor, the above method is implemented.
[0144] 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.
[0145] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the above-described method when executed by a processor. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0146] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware using a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media provided herein 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. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM.
[0147] Those skilled in the art will 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.
[0148] If the integrated unit is implemented as 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, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0149] 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 above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above 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: include: An 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. Collect multispectral images of dried persimmons under different lighting conditions and construct a multispectral image sequence; The standardized persimmon image dataset is color-converted to form a persimmon color feature vector; the standardized persimmon image dataset is subjected to icing region recognition, icing coverage, distribution uniformity, and crystallization pattern are calculated, and a persimmon icing feature descriptor is constructed; the standardized persimmon image dataset is subjected to texture analysis, texture uniformity, directionality, and roughness values are extracted, and a persimmon texture feature set is generated; the persimmon roundness, symmetry, and perimeter-to-area ratio are calculated, and a persimmon shape descriptor is established; the standardized persimmon image dataset is subjected to wrinkle feature analysis using an edge detection algorithm, wrinkle density, depth, and directional distribution parameters are measured, and a persimmon surface structure feature map is formed; 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; The distribution uniformity is evaluated as: , 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 is expressed as: , is the frosting area density, is the average size of the frosting sugar particles, is the regularity of the frosting distribution pattern, is the weight coefficient; Spectra of near-infrared, ultraviolet, and visible light band images in the standardized persimmon image dataset were separated and extracted, and the reflectance and transmittance values of persimmon at different wavelengths were calculated to construct the multispectral characteristic curve of persimmon. The sugar content of persimmons was quantitatively assessed using near-infrared wavelengths to generate a sweetness distribution map. The moisture content of persimmons was calculated based on the grayscale distribution of the moisture characteristic absorption band image, combined with texture parameters from a set of persimmon appearance characteristic indicators, to generate a moisture content distribution map. Ultraviolet fluorescence imaging was used to detect potential moldy areas within the persimmons and establish a mold risk assessment index. A persimmon internal structure model is constructed based on the multispectral transmission characteristic differences of the standardized persimmon image dataset; the persimmon sweetness distribution map, persimmon moisture content distribution map, mold risk assessment index, and persimmon internal structure model are integrated and correlated with the persimmon appearance characteristic index set to form a persimmon comprehensive quality feature library; The moisture content of the dried persimmon is calculated as: , Where W(x,y) is the moisture content at the coordinate (x,y), w0 is the bias constant, is the absorbance of the i-th moisture characteristic absorption band, , is the reflectance corresponding to the wavelength, wi is the absorbance weight coefficient, is the jth texture parameter in the persimmon appearance feature index set, is the corresponding weight coefficient; is the grayscale value, is the grayscale correction function, n represents the number of characteristic absorption bands used for moisture detection, and m represents the number of texture parameters used; Based on the persimmon cake appearance characteristic index set and the persimmon cake comprehensive quality characteristic library, persimmon cake defects are identified and classified, the persimmon cake quality comprehensive score is calculated, and the persimmon cake quality grading result table is generated.
2. The persimmon quality detection method based on machine vision according to claim 1, wherein 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 dataset, 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 the original image group of the persimmons; The original persimmon image group is subjected to distortion elimination and perspective unification processing by a geometric correction method, so as to achieve accurate multi-angle image stitching and generate a panoramic persimmon image; Performing foreground extraction on the persimmon panorama image based on an adaptive threshold segmentation algorithm, accurately separating the persimmon target and the background, and obtaining a persimmon target area map; The persimmon target area image is subjected to color standardization and image enhancement processing by an improved Retinex algorithm to enhance dark area details and texture contrast, thereby 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 while 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, wherein The method of identifying and classifying persimmon defects based on the persimmon appearance characteristic index set and the persimmon comprehensive quality characteristic library, calculating the persimmon quality comprehensive score, and generating a persimmon quality grading result table includes: By fusing edge detection and region growing algorithms, the persimmon surface is finely segmented, abnormal surface structures and color deviation areas are identified, and a candidate persimmon defect map is generated. Extracting local color, texture and shape feature parameters from the dried persimmon defect candidate image, and constructing a defect feature descriptor by combining the standard features in the dried persimmon appearance feature index set; Using a support vector machine classifier to classify the defect feature descriptors, the surface defects of the 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 defect are calculated, and the defect scoring matrix is established by combining the aesthetic parameters in the dried persimmon appearance characteristic index set; Based on the internal quality data in the persimmon comprehensive quality feature library, the sugar content, moisture content and textural 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.
4. The persimmon quality detection method based on machine vision according to claim 1, wherein Furthermore, based on 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 persimmon quality 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 place of origin, and constructing a persimmon quality history database; Tracking and analyzing the changes in quality parameters in the persimmon quality history database using a time series analysis method, identifying quality fluctuation patterns and abnormal change points, and forming a persimmon quality trend graph; Statistical distribution calculations are performed on persimmon quality data from different batches and origins, and quality-influencing factors are discovered by combining the persimmon appearance characteristic index set and key parameters in the persimmon comprehensive quality characteristic library to establish a 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.
5. The dried persimmon quality detection method based on machine vision according to claim 1, wherein 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 established, and a persimmon process parameter optimization plan and quality traceability file are generated, including: Constructing a correlation data model between persimmon production process parameters and quality characteristics, mapping and associating 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 key process parameter combinations that significantly affect the final quality of dried persimmons, and a process parameter influence weight table is established; 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, link the raw material source, processing technology, the persimmon quality grading result table, and the persimmon quality intelligent analysis report and early warning plan data to 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.
6. 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 5, 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 dried persimmon samples through an industrial camera array system to form a standardized dried persimmon image dataset; a quantification module for extracting and quantitatively analyzing the color, icing, texture, and shape features of the persimmons based on the standardized persimmon image dataset, and constructing a persimmon appearance feature index set; A detection module is used to perform spectral analysis and non-destructive testing on the internal quality parameters of persimmons using the standardized persimmon image dataset and the persimmon appearance feature index set to form a persimmon comprehensive quality feature library; A classification module is used to identify and classify persimmon defects based on the persimmon appearance feature index set and the persimmon comprehensive quality feature library, calculate the persimmon quality comprehensive score, and generate a persimmon quality grading result table; A mining module is used to perform time series analysis and trend mining on persimmon quality parameters based on the persimmon quality grading result table and the persimmon appearance characteristic index set, establish a quality early warning mechanism, and form 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.
7. A computer device, characterized in that: It includes a memory and a processor, 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, it implements the persimmon quality detection method based on machine vision as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the processor is caused to execute the dried persimmon quality detection method based on machine vision according to any one of claims 1 to 5.
Citation Information
Patent Citations
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
On-line fruit quality detection and classification apparatus and method based on three camera chains
CN1603013A