A method for constructing a blueberry fresh-keeping quality prediction model and a prediction method

By combining narrowband blue light and a multi-scale bi-branch hybrid network model, the problems of unstable light preservation effect and single detection target in blueberry preservation technology are solved. This achieves stability of blueberry preservation effect and interpretability of prediction model, and improves the practicality and reliability of model.

CN121278323BActive Publication Date: 2026-04-17JILIN AGRICULTURAL UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511863173.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-04-17
Estimated Expiration
2045-12-11

AI Technical Summary

Technical Problem

Existing blueberry preservation technologies suffer from unstable light-based preservation effects, limited predictive models with single detection targets, and insufficient practicality and reliability. Furthermore, the lack of deep integration between physical technologies and digital models results in poor interpretability of the predictive models.

Method used

Using narrowband blue light as the light source, and combining a multi-scale dual-branch hybrid network model and an adaptive multi-task loss function, a blueberry preservation quality prediction model is constructed. Blueberry sample data is obtained through narrowband blue light illumination, and feature extraction and prediction are performed using a multi-scale convolution module, a temporal module, a dual-branch collaborative module, and a fusion module to achieve simultaneous image reconstruction and physical property evaluation.

Benefits of technology

The model achieves stability of blueberry preservation effect and interpretability of prediction model. It predicts the weight, firmness and future freshness changes of blueberries non-destructively through images, ensuring effective mutual verification between output results and actual physiological changes, thus improving the practicality and reliability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121278323B_ABST
    Figure CN121278323B_ABST
Patent Text Reader

Abstract

The application discloses a blueberry fresh-keeping quality prediction model construction method and a prediction method, relates to the field of agricultural product preservation and detection, and alleviates the problems of unstable light fresh-keeping effect, single detection target, and insufficient practicability and reliability of an existing blueberry fresh-keeping technology. Blueberry samples are obtained, the blueberry samples are pretreated through narrow-band blue light irradiation to obtain pretreated blueberry samples; data collection is performed on the pretreated blueberry samples to obtain a blueberry training set; the blueberry training set comprises a blueberry image, a blueberry weight and a blueberry hardness; based on the blueberry image training set, a multi-scale double-branch hybrid network model is trained by using an adaptive multi-task loss function to obtain a trained multi-scale double-branch hybrid network model as a blueberry fresh-keeping quality prediction model. The application is suitable for the field of postharvest preservation and nondestructive detection of agricultural products, and is especially suitable for green fresh-keeping and quality prediction of blueberries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural product preservation and testing, specifically to the field of blueberry preservation quality prediction. Background Technology

[0002] Blueberries, as a high-value berry highly sensitive to post-harvest quality, present a core challenge throughout the entire supply chain in terms of preservation. Blueberries undergo vigorous respiration after harvest, have a soft texture, and their natural waxy skin is easily damaged, making them highly susceptible to shrinkage, softening, mold, and flavor deterioration due to moisture loss, microbial infection, and mechanical damage, resulting in significant economic losses. Therefore, using light-based preservation technology is an efficient solution for preserving blueberries.

[0003] Currently, research on light-based preservation of blueberries mainly focuses on ordinary light sources or ultraviolet light. However, these light sources generally suffer from problems such as broad spectrum, low energy efficiency, weak penetration, and difficulty in precise dosage control, resulting in unstable preservation effects and failing to fully realize the potential of lasers as a controllable and efficient physical method.

[0004] At the digital technology level, with the development of the Internet of Things and big data technologies, research on quality prediction models has become a frontier in smart agriculture and intelligent supply chains. Examples include using models such as CNNs and GANs for disease identification, growth prediction, or phenotypic extraction. However, most existing AI-based image analysis models focus on a single task, such as disease identification or phenotypic extraction. They struggle to comprehensively reflect the overall decline in fruit quality.

[0005] A deeper problem lies in the disconnect between the development of the aforementioned physical technologies and digital models. There is a lack of deep integration between the two, failing to construct a data modeling framework driven primarily by physical preservation mechanisms. This results in poor interpretability of the predictive models, making it difficult to effectively corroborate their output with the actual physiological changes in the predicted fruit (such as the response after laser treatment), thus limiting the models' practicality and reliability.

[0006] In summary, existing blueberry preservation technologies suffer from problems such as unstable light-based preservation effects, limited predictive model detection targets, and insufficient practicality and reliability. Summary of the Invention

[0007] This invention alleviates the problems of unstable light-based preservation effects, limited target detection in predictive models, and insufficient practicality and reliability in existing blueberry preservation technologies. This invention provides the following solution:

[0008] Option 1: A method for constructing a blueberry preservation quality prediction model, comprising the following steps:

[0009] Step S01: Obtain a blueberry sample and preprocess the blueberry sample by irradiating it with narrowband blue light to obtain a preprocessed blueberry sample.

[0010] Step S02: Data collection is performed on the preprocessed blueberry samples to obtain a blueberry training set; the blueberry training set includes blueberry images, blueberry weight, and blueberry firmness.

[0011] Step S03: Based on the blueberry image training set, the multi-scale dual-branch hybrid network model is trained using an adaptive multi-task loss function to obtain the trained multi-scale dual-branch hybrid network model as a blueberry preservation quality prediction model.

[0012] Furthermore, in one embodiment of the present invention, the narrowband blue light irradiation in step S01 specifically refers to:

[0013] The narrowband blue light has a wavelength of 468 to 472 nm and an illuminance of 480 to 520 nm. The irradiation window time is 38 to 42 seconds.

[0014] Furthermore, in one embodiment of the present invention, the data acquisition described in step S02 specifically includes:

[0015] The pretreated blueberries were placed in a standard light box for data collection at 24±0.5 hours, 48±0.5 hours, 72±0.5 hours or 96±0.5 hours after the blueberry samples were stored.

[0016] The standard light box uses blue light with an intensity of 600 to 800 Lux.

[0017] Furthermore, in one embodiment of the present invention, the key parameters for training in step S03 include the learning rate and the batch size; the learning rate is 5e -5 up to 5e -4 The batch size is 8, 16, or 32.

[0018] Furthermore, in one embodiment of the present invention, the multi-scale dual-branch hybrid network model is composed of a multi-scale convolution module, a temporal module, a dual-branch collaborative module, a fusion module, a blueberry image prediction module, and a blueberry physical property prediction module;

[0019] The multi-scale convolution module is used to receive blueberry images; it is also used to extract multi-dimensional spatial features from the blueberry images to obtain multi-dimensional spatial features; and it is also used to send the multi-dimensional spatial features to the temporal module and the dual-branch collaborative module.

[0020] The time-series module is used to extract time features from the obtained multi-dimensional spatial features to obtain time features; it is also used to send the time features to the dual-branch collaboration module.

[0021] The dual-branch collaborative module is used to fuse the obtained multi-dimensional spatial features and temporal features to obtain fused features; it is also used to process the fused features into visual branches and physical branches respectively to obtain visual features and physical features respectively; and it is also used to send the visual features and physical features to the fusion module.

[0022] The fusion module is used to adaptively gatedly fuse the obtained visual features and physical features to obtain adaptive gated fusion features, and is also used to obtain channel weights based on the adaptive gated fusion features using a channel attention mechanism, and to obtain spatiotemporal features based on the adaptive gated fusion features and the channel weights; and is also used to send the spatiotemporal features to the blueberry image prediction module and the blueberry physical attribute prediction module.

[0023] The blueberry image prediction module is used to obtain the predicted blueberry image by decoding the obtained spatiotemporal features through image reconstruction.

[0024] The blueberry physical property prediction module is used to obtain the predicted physical properties of blueberries by using a physical property regression head on the obtained spatiotemporal features; the blueberry physical properties include blueberry weight and blueberry firmness.

[0025] Furthermore, in one embodiment of the present invention, the adaptive multi-task loss function described in step S03 is...

[0026]

[0027] in, Image loss weights, Weighting for quality loss. As a weight for hardness loss, For image loss, For quality loss, For hardness loss

[0028] Furthermore, in one embodiment of the present invention, image loss pass

[0029]

[0030] Obtain, among which, for Loss weights; The mean squared error loss weight is used; The weights for cosine similarity loss are used. Number of images; It is a real image; For predicting images; for Norm; for Norm; This is the vector after the image has been flattened.

[0031] Furthermore, in one embodiment of the invention, mass loss pass

[0032]

[0033] Obtain, among which, For batch size, Indicates the number of time steps; Let b be the true hardness value of the b-th sample at time step t; Let be the predicted hardness value of the b-th sample at time step t.

[0034] Furthermore, in one embodiment of the present invention, hardness loss pass

[0035]

[0036] Obtain, among which, Let b be the true hardness value of the b-th sample at time step t; Let be the predicted hardness value of the b-th sample at time step t.

[0037] Option 2: A method for predicting the preservation quality of blueberries, step B01: obtain a blueberry sample to be predicted, and pre-process the blueberry sample by irradiating it with narrowband blue light to obtain a pre-processed blueberry sample.

[0038] Step B02: Acquire images of the preprocessed blueberry samples to obtain blueberry images;

[0039] Step B03: Input the blueberry image into the blueberry preservation quality prediction model for prediction and obtain the prediction results. The prediction results include the blueberry image, blueberry weight and blueberry firmness of the blueberry sample to be predicted four days later.

[0040] The blueberry preservation quality prediction model is the blueberry preservation quality prediction model obtained by the method described in Scheme 1.

[0041] The present invention provides a method for constructing and predicting a blueberry preservation quality prediction model, which effectively alleviates the problems of unstable light-based preservation effects, limited detection targets in prediction models, and insufficient practicality and reliability in existing blueberry preservation technologies. Specific beneficial effects include:

[0042] 1. This invention uses blue laser as the light source. Existing light-based preservation technologies all use ordinary light sources or ultraviolet light. In existing light-based preservation technologies, ultraviolet light mainly preserves food by destroying microbial DNA and directly killing spoilage bacteria; while ordinary visible light of a specific wavelength indirectly preserves food by regulating the respiration and stress resistance physiology of fruits and vegetables, thus delaying their aging. This has led to few researchers choosing other light sources. This invention uses narrowband blue light as the light source, with a wavelength of 468 to 472 nm and a light intensity of 480 to 520 nm. The irradiation window of 38 to 42 seconds preserves blueberries, setting a precedent for applying blue lasers to light-based preservation technology. This is a green and efficient preservation method that fully leverages the potential of lasers as a controllable and efficient physical means.

[0043] 2. The multi-scale bi-branch hybrid network model described in this invention, through the proposed adaptive multi-task loss function for blueberry decay prediction, enables the model to coordinate and optimize image reconstruction and quality prediction tasks during training, ensuring that the prediction results are consistent with the physiological changes and physical mechanisms induced by laser treatment. Simultaneously, it completes image-level decay process reconstruction, which involves joint and coordinated prediction of three key quality indicators: image prediction, weight prediction, and firmness prediction. This comprehensively reflects the overall decay of fruit quality and achieves joint and synchronous evaluation of multi-dimensional quality indicators.

[0044] 3. The blueberry preservation quality prediction model construction method described in this invention is a physical mechanism-driven intelligent prediction framework. It achieves deep integration of blue laser preservation with a deep learning model by embedding the biophysical mechanism of laser-blueberry tissue interaction as a constraint into the neural network structure design. This ensures stable blueberry preservation effects and allows for non-destructive prediction of blueberry weight, firmness, and future freshness changes through images. The model is highly interpretable, and its output can be effectively corroborated by the actual physiological changes of the predicted fruit (such as the response after laser treatment), fully leveraging the model's practicality and reliability.

[0045] The blue laser used in this invention interacts with fruit through mechanisms fundamentally different from those of ultraviolet or ordinary visible light (such as exciting endogenous photosensitive substances to generate reactive oxygen species for sterilization and regulating specific photoreceptor signaling pathways). Therefore, the physicochemical characteristics and variation patterns of image data obtained through blue laser processing are also specific. Subsequent data processing, especially the structural design and training constraints of the deep learning model, must be specifically constructed based on the unique biophysical mechanisms of blue lasers, rather than directly applying existing models designed for other light sources (such as ultraviolet or infrared light). This indicates that the core contribution of this invention lies not in simply replacing the light source with blue light, but in creating a complete and inseparable intelligent prediction system deeply coupled with the blue light preservation mechanism.

[0046] The method described in this invention is applicable to the field of post-harvest preservation and non-destructive testing of agricultural products, and is especially suitable for the green preservation and quality prediction of blueberries. Attached Figure Description

[0047] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0048] Figure 1 This is a structural diagram of the multi-scale bi-branch hybrid network model described in Implementation Method 5.

[0049] Figure 2 This is a flowchart of the adaptive multi-task loss function described in Implementation Method Six.

[0050] Figure 3 The image comparison shows the blueberry preservation effect prediction obtained by using the technology of Embodiment 10 and existing technologies respectively under the 24-hour period described in Embodiment 10.

[0051] Figure 4 To and Figure 3 The corresponding blueberry performance comparison chart.

[0052] Figure 5 This is a comparison chart of the predicted blueberry image effects of Embodiment 10 and the prior art under 48 hours.

[0053] Figure 6 This is a performance comparison chart of Embodiment 10 and the prior art under 48 hours as described in Embodiment 10.

[0054] Figure 7 This is a comparison chart of the predicted blueberry image effects of Embodiment 10 and the prior art under 72 hours.

[0055] Figure 8 This is a performance comparison chart of Embodiment 10 and the prior art under 72 hours as described in Embodiment 10.

[0056] Figure 9 This is a comparison chart of the predicted blueberry image effects of Embodiment 10 and the prior art under 96 hours.

[0057] Figure 10 This is a performance comparison chart of Embodiment 10 and the prior art under 96 hours. Detailed Implementation

[0058] Various embodiments of the present invention will now be clearly and completely described with reference to the accompanying drawings. The embodiments described with reference to the drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0059] Implementation Method 1: The method for constructing a blueberry preservation quality prediction model according to this implementation method includes the following steps:

[0060] Step S01: Obtain a blueberry sample and preprocess the blueberry sample by irradiating it with narrowband blue light to obtain a preprocessed blueberry sample.

[0061] Step S02: Data collection is performed on the preprocessed blueberry samples to obtain a blueberry training set; the blueberry training set includes blueberry images, blueberry weight, and blueberry firmness.

[0062] Step S03: Based on the blueberry image training set, the multi-scale bi-branch hybrid network model is trained using an adaptive multi-task loss function to obtain the trained multi-scale bi-branch hybrid network model as a blueberry preservation quality prediction model; the multi-scale bi-branch hybrid network model takes blueberry images as input and outputs blueberry images, blueberry weight, and blueberry firmness for the next four days.

[0063] In this embodiment, the blueberry images in the blueberry training set are preferably uniformly scaled to a fixed resolution of 224 to 512 pixels.

[0064] The method for constructing the blueberry preservation quality prediction model described in this embodiment is a physical mechanism-driven intelligent prediction framework. By deeply integrating blue laser preservation with a deep learning model, it ensures stable blueberry preservation effects. It predicts the weight, firmness, and future freshness changes of blueberries non-destructively through images, making the blueberry preservation quality prediction model highly interpretable. Its output results can be effectively corroborated with the actual physiological changes of the fruit (such as the response after laser treatment), giving full play to the model's practicality and reliability.

[0065] Implementation Method Two: This implementation method further defines the method for constructing the blueberry preservation quality prediction model described in Implementation Method One. In this implementation method, the narrow-band blue light irradiation in step S01 specifically refers to:

[0066] The narrowband blue light has a wavelength of 468 to 472 nm and an illuminance of 480 to 520 nm. The irradiation window time is 38 to 42 seconds.

[0067] In this embodiment, the wavelength of the narrowband blue light is preferably between 468 and 472 nm, and the illuminance is 500 nm. Irradiate with narrowband blue light for 40 seconds.

[0068] This embodiment further defines step S01 and provides an example of narrowband blue light irradiation. The core control parameter of this method is the physical characteristics of the laser: by limiting the wavelength, specific physiological effects for blueberry preservation are ensured; by limiting the light intensity, effective stimulation for blueberry preservation is provided while avoiding damage; and through the synergistic effect of limiting the wavelength, light intensity, and irradiation time, the preservation mechanism of blueberries is activated from the source, laying a physical foundation for subsequent quality prediction.

[0069] Implementation Method 3: This implementation method further defines the construction method of the blueberry preservation quality prediction model described in Implementation Method 1. In this implementation method, the data collection mentioned in step S02 specifically includes:

[0070] The pretreated blueberries were placed in a standard light box for data collection at 24±0.5 hours, 48±0.5 hours, 72±0.5 hours or 96±0.5 hours after the blueberry samples were stored.

[0071] The standard light box uses blue light with an intensity of 600 to 800 Lux.

[0072] In this embodiment, the weight is measured using a balance with an accuracy of not less than ±0.01 grams; the hardness is measured using a texture analyzer at a uniform testing speed.

[0073] In this embodiment, the uniform test speed is preferably 1.0 to 2.0 mm / s.

[0074] This embodiment further defines step S02 and provides an example of data acquisition. This method ensures standardized acquisition conditions, performing multimodal data acquisition on blueberry samples at preset fixed time points throughout the storage period. By determining the light intensity during acquisition to eliminate ambient light interference and by limiting the accuracy of the acquisition instrument to accurately measure physical characteristics, a high-precision, consistent spatiotemporal dataset is constructed.

[0075] Implementation Method Four: This implementation method further defines the construction method of the blueberry preservation quality prediction model described in Implementation Method One. In this implementation method, the key training parameters in step S03 include the learning rate and batch size; the learning rate is 5e...-5 up to 5e -4 The batch size is 8, 16, or 32.

[0076] This embodiment further defines step S03, providing an example to illustrate it. The selection of key parameters in this method fully considers the physiological characteristics of the blueberry sample and its specific response during blue light preservation. The multi-scale convolutional head (containing 1×1, 3×3, and 5×5 convolutional kernels) used in the model is specifically designed for the multi-scale characteristics of blueberry spoilage: the 1×1 convolutional kernel captures microscopic changes in bloom distribution and skin color, the 3×3 convolutional kernel identifies local features such as stem wrinkling, and the 5×5 convolutional kernel perceives macroscopic morphological changes in overall fruit shrinkage. The CBAM attention mechanism embedded in the residual block enhances the extraction of blue light-sensitive skin pigment features through channel attention and focuses on perishable areas such as the stem through spatial attention, enabling the model to simulate the initial diffusion path of blueberry spoilage. The 1:0.1 weight ratio of image loss to physical attribute loss in the multi-task loss function has been experimentally verified to effectively balance the quality of appearance generation and the accuracy of intrinsic quality prediction. This ratio ensures that the model establishes a physiological correlation between image features (such as the degree of surface wrinkling) and physical parameters (such as the decrease in hardness) during the learning process. Ultimately, the PSNR value of the predicted image for the next four days exceeds 32dB, and the prediction errors for weight and hardness are less than 0.15g and 0.2g, respectively.

[0077] Implementation Method Five: This implementation method further defines the method for constructing the blueberry preservation quality prediction model described in Implementation Method One. In this implementation method, as... Figure 1 As shown, the multi-scale dual-branch hybrid network model consists of a multi-scale convolution module, a temporal module, a dual-branch collaborative module, a fusion module, a blueberry image prediction module, and a blueberry physical property prediction module.

[0078] The multi-scale convolution module is used to receive blueberry images; it is also used to extract multi-dimensional spatial features from the blueberry images to obtain multi-dimensional spatial features; and it is also used to send the multi-dimensional spatial features to the temporal module and the dual-branch collaborative module.

[0079] The time-series module is used to extract time features from the obtained multi-dimensional spatial features to obtain time features; it is also used to send the time features to the dual-branch collaboration module.

[0080] The dual-branch collaborative module is used to fuse the obtained multi-dimensional spatial features and temporal features to obtain fused features; it is also used to process the fused features into visual branches and physical branches respectively to obtain visual features and physical features respectively; and it is also used to send the visual features and physical features to the fusion module.

[0081] The fusion module is used to adaptively gatedly fuse the obtained visual features and physical features to obtain adaptive gated fusion features, and is also used to obtain channel weights based on the adaptive gated fusion features using a channel attention mechanism, and to obtain spatiotemporal features based on the adaptive gated fusion features and the channel weights; and is also used to send the spatiotemporal features to the blueberry image prediction module and the blueberry physical attribute prediction module.

[0082] The blueberry image prediction module is used to obtain the predicted blueberry image by decoding the obtained spatiotemporal features through image reconstruction.

[0083] The blueberry physical property prediction module is used to obtain the predicted physical properties of blueberries by using a physical property regression head on the obtained spatiotemporal features; the blueberry physical properties include blueberry weight and blueberry firmness.

[0084] In this embodiment, the mapping of the multi-scale dual-branch hybrid network model is as follows:

[0085]

[0086] in, The input is a blueberry image from the first day. Image of blueberries on day t. Let be the weight of the blueberries on day t. Let t be the hardness of the blueberries on day t.

[0087] In this embodiment, the multi-scale convolution module uses...

[0088]

[0089] Obtain the spatial features at the s-th scale , ,in, Let be the convolution, normalization, and nonlinear transformation at the s-th scale.

[0090] In this embodiment, the timing module includes the following steps:

[0091] Step A1, through

[0092]

[0093] Obtain the hidden state in discrete time T ,in, , For learnable matrices, The multi-dimensional spatial features or the time-step features obtained from the output of the previous layer;

[0094] Step A2, through

[0095]

[0096] Obtain the time feature y in discrete time T t ,in It is a learnable matrix.

[0097] In this embodiment, the fusion module includes the following steps.

[0098] Step B01 involves adaptively gating and fusing the obtained visual and physical features, specifically including the following steps:

[0099] Step B011, the obtained visual and physical features are processed through...

[0100]

[0101] Obtain fusion weights ,in, For vector concatenation, Activated for sigmoid. and Here, GAP(x) is a learnable parameter, representing global average pooling. As a visual feature, Physical characteristics;

[0102] Step B012, through

[0103]

[0104] Obtain adaptive gating fusion features , To map visual feature outputs to linear or convolutional mappings of a uniform dimension, To map physical feature outputs to linear or convolutional mappings of a uniform dimension; This is an element-wise product.

[0105] Step B02 involves using a channel attention mechanism to obtain channel weights from the acquired adaptive gating fusion features. Specifically, this is achieved through...

[0106]

[0107] Obtain channel weights ,in, for , for , .

[0108] In this embodiment, the blueberry image prediction module gradually restores the original resolution through multi-level upsampling via image reconstruction decoding, thereby obtaining pixel-level prediction.

[0109]

[0110] Get the blueberry image on day t. ,in, Spatiotemporal characteristics, Dec () is the image reconstruction decoding function.

[0111] In this embodiment, the blueberry physical property prediction module obtains the blueberry physical properties through a physical property regression head. These physical properties include blueberry weight and blueberry firmness.

[0112]

[0113] Get the weight of blueberries on day t. ,in, For weight, a learnable parameter. For average pooling, b m This is the bias term for the weight regression head;

[0114] pass

[0115]

[0116] Obtain the blueberry hardness on day t. ,in, b is a learnable parameter for hardness. h This is the bias term for the hardness regression head.

[0117] This embodiment further defines the multi-scale bi-branch hybrid network model and provides an example of the multi-scale bi-branch hybrid network model. This method extracts multi-dimensional spatial features that characterize surface texture and shape through multi-scale convolution modules.

[0118] By using a time-series module based on a state-space model, the decay dynamic process is simulated by the evolution of hidden states, and the time evolution of decay is characterized. Spatial features are extended to the time domain and introduced into the state space to obtain time features. This linear state-space form not only retains the expressive power of long-range dependencies, but also avoids the gradient degradation problem common in traditional recurrent networks, thus achieving stable time series modeling.

[0119] The dual-branch collaborative module is specifically divided into visual and physical branches. The former focuses on image detail reconstruction, while the latter learns attribute association features. This dual-channel parallel processing is used to achieve cross-modal collaboration.

[0120] The fusion module interacts and weights visual and physical features through adaptive gating fusion, and then enhances key information through a channel attention mechanism to form unified spatiotemporal features, ensuring computational efficiency and modeling ability, and enhancing discriminativeness and channel selectivity.

[0121] The blueberry image prediction module decodes spatiotemporal features into high-resolution predicted images of future time points.

[0122] The blueberry physical property prediction module uses a regressor to output weight and hardness values ​​based on spatiotemporal characteristics.

[0123] Implementation Method Six: This implementation method further defines the method for constructing the blueberry preservation quality prediction model described in Implementation Method One. In this implementation method, as... Figure 2 As shown, the adaptive multi-task loss function described in step S03 is...

[0124]

[0125] in, Image loss weights, Weighting for quality loss. As a weight for hardness loss, For image loss, For quality loss, This represents a loss of hardness.

[0126] In this embodiment, in practical applications, the quality loss weight... Based on the relative difficulty of quality prediction The obtained quality prediction is relatively difficult. for:

[0127]

[0128] The relative difficulty of quality prediction This parameter represents the relative difficulty of quality prediction compared to image prediction, and the quality loss weights can be determined based on this parameter. The numerical value, in general, indicates that the quality prediction is relatively difficult. The larger the value, the greater the mass loss weight. The larger.

[0129] In this embodiment, in practical applications, the hardness loss weight Based on the relative difficulty of hardness prediction The obtained hardness prediction relative difficulty for:

[0130]

[0131] The relative difficulty of hardness prediction This parameter represents the relative difficulty of hardness prediction compared to image prediction; the hardness loss weight can be determined based on this parameter. The value of hardness, in general, makes predicting hardness relatively difficult. The larger the value, the greater the hardness loss weight. The larger.

[0132] In this embodiment, the tiny constant To prevent the value from being zero, ensure the numerical stability of the weight calculation.

[0133] This implementation further defines step S03 and provides an example of the adaptive multi-task loss function. This method is a dynamic collaborative optimization process that supervises the multi-scale bi-branch hybrid network model and begins with the simultaneous independent calculation of the losses for the three tasks of image prediction, quality prediction, and hardness prediction.

[0134] Then, based on image loss, the relative difficulty of the remaining tasks is evaluated in real time through the core dynamic weight mechanism. The contribution of each task can be automatically adjusted according to the training process, so that image reconstruction, quality prediction and hardness prediction can be coordinated and optimized, thereby improving the overall performance and prediction stability of the model.

[0135] If the loss of a certain task increases sharply, the system will automatically increase its weight, forcing the model to pay more attention to it in subsequent training. Finally, the weighted multi-task loss will be summarized and backpropagated to update the model.

[0136] This implementation simultaneously constrains three tasks: image reconstruction, quality measurement, and hardness prediction. It achieves joint optimization of the model in both visual and physical properties, capturing both spatiotemporal image features and numerical attribute changes. By dynamically adjusting the loss weights of each task, it ensures synergistic optimization of the three tasks—image prediction, quality prediction, and hardness assessment—thus achieving accurate end-to-end quality prediction. Quality prediction is relatively difficult. The relative difficulty of hardness prediction Its function is to automatically measure the relative difficulty of non-primary tasks (quality prediction and hardness prediction) relative to the primary task (image prediction). When the loss of a certain task is large, its corresponding weight will be dynamically increased; conversely, when the task loss decreases, its weight will be automatically reduced. Unlike traditional static loss weights, this mechanism does not artificially preset fixed proportions for different tasks. Instead, it uses image reconstruction loss as a benchmark and captures the relative changes in task learning difficulty through logarithmic differencing, thereby achieving real-time self-balancing of the loss term during training.

[0137] Implementation Method Seven: This implementation method further defines the construction method of the blueberry preservation quality prediction model described in Implementation Method Six. In this implementation method, image loss... pass

[0138]

[0139] Obtain, among which, for Loss weights; The mean squared error loss weight is used; The weights for cosine similarity loss are used. Number of images; It is a real image; For predicting images; for Norm; for Norm; This is the vector after the image has been flattened.

[0140] In this embodiment, the L1 weight The initial value is preferably 0.5, MSE weight The preferred value is 0.3, with a cosine similarity weight. The preferred value is 0.2.

[0141] This implementation method addresses image loss. Further restrictions on image loss An example is provided to illustrate that this method combines L1, mean squared error, and cosine similarity in its image loss mechanism. This implementation addresses the technical challenges in blueberry decay prediction, such as insufficient image detail recovery, difficulty in capturing structural changes, and unstable physical quantity prediction. It designs a multi-task joint loss function that integrates pixel differences, global intensity, and structural consistency to achieve simultaneous optimization of image reconstruction and physical quantity regression tasks. L1 loss, by constraining pixel-level differences, enhances the fidelity of key details such as peel wrinkles and minor rot spots, solving the blurring problem common in traditional methods. MSE loss, by measuring global luminance differences, maintains the overall consistency of image brightness and reflectance features, providing a stable base distribution for the regression of physical properties such as hardness and weight. Cosine distance loss, by constraining the directional similarity between image feature vectors, maintains the consistency of texture structure and geometry, effectively modeling the structural change trend of blueberry decay over time. During training, the contributions of local detail recovery, overall brightness fitting, and structural preservation are adaptively balanced, ensuring that the predicted image maintains both sharpness and physical structural consistency. Through the above design, this implementation method achieves deep synergy between image prediction and physical quantity prediction, improves the robustness and interpretability of the model, and significantly enhances the prediction accuracy of key indicators such as decay degree, hardness and weight. It effectively solves the problems of gradient conflict and training instability in the multi-task optimization process, and finally constructs a spatiotemporal prediction model that is more consistent with the real mechanism of fruit and vegetable decay.

[0142] Implementation Method Eight: This implementation method further defines the construction method of the blueberry preservation quality prediction model described in Implementation Method Six. In this implementation method, quality loss... pass

[0143]

[0144] Obtain, among which, For batch size, Indicates the number of time steps; Let b be the true hardness value of the b-th sample at time step t; Let be the predicted hardness value of the b-th sample at time step t.

[0145] Implementation Method Nine: This implementation method further defines the method for constructing the blueberry preservation quality prediction model described in Implementation Method Six. In this implementation method, hardness loss... pass

[0146]

[0147] Obtain, among which, Let b be the true hardness value of the b-th sample at time step t; Let be the predicted hardness value of the b-th sample at time step t.

[0148] Implementation Method 10: The blueberry preservation quality prediction method described in this implementation method includes the following steps:

[0149] Step B01: Obtain the blueberry sample to be predicted, and preprocess the blueberry sample by irradiating it with narrowband blue light to obtain the preprocessed blueberry sample.

[0150] Step B02: Acquire images of the preprocessed blueberry samples to obtain blueberry images;

[0151] Step B03: Input the blueberry image into the blueberry preservation quality prediction model for prediction and obtain the prediction result. The prediction result includes the blueberry image, blueberry weight and blueberry firmness of the blueberry sample to be predicted four days later as described in step B01.

[0152] The blueberry preservation quality prediction model is the blueberry preservation quality prediction model obtained by any one of the methods described in Embodiments 1 to 9.

[0153] This embodiment provides one example.

[0154] Figure 3 This demonstrates the image prediction performance of different algorithms in predicting blueberry decay over 24 hours. Figure 4 The corresponding quantitative performance indicators are then listed.

[0155] From the image results as follows Figure 3As shown, traditional temporal models exhibit significant blurring and texture loss in long-term predictions, resulting in blurred edges on the fruit peel's gloss and decay spots, leading to a large deviation between the predicted image and the true distribution, and a poor sense of realism. While ST-ResNet and PredRNN achieve a relatively balanced texture, overall brightness deviation and local distortion remain noticeable. In contrast, the algorithm proposed in this implementation significantly improves image clarity and structural consistency in 24-hour prediction tasks.

[0156] Quantitative results such as Figure 4 As shown, this implementation achieves the best results in four key metrics: Peak Signal-to-Noise Ratio (PSNR), Mean Square Error (MAE), Root Mean Square Error (RMSE), and Structural Similarity Index (SSIM). The PSNR reaches 37.917, an improvement of approximately 11.22 compared to ConvLSTM and nearly 13.8 compared to Transformer. The MAE and RMSE are 0.010 and 0.0253, respectively, both significantly lower than the comparison algorithms, indicating minimal prediction error. The SSIM value is as high as 0.928, an improvement of approximately 12% and 33% compared to ConvLSTM (0.827) and PredRNN (0.699), respectively, demonstrating stronger structure preservation and texture similarity. These results indicate that the algorithm possesses higher robustness and generalization performance in complex spatiotemporal sequence prediction. Based on the comprehensive analysis of image quality and numerical indicators, this implementation method performs best in the 24-hour blueberry decay prediction task. It can effectively capture subtle changes in the decay process on the fruit surface and is significantly better than the comparison methods such as ConvLSTM, 3D-CNN, Transformer, ST-ResNet and PredRNN.

[0157] Figure 5 This demonstrates the image prediction performance of different algorithms in predicting blueberry decay over 48 hours. Figure 6 The corresponding quantitative performance indicators are then listed.

[0158] from Figure 5 Traditional temporal networks such as ConvLSTM and 3D-CNN exhibit significant blurring and texture loss in long-term predictions, with blurred boundaries and large brightness deviations in fruit rot spots, making it difficult to accurately reflect the details of fruit decay. In contrast, the algorithm proposed in this implementation demonstrates higher visual fidelity and structural consistency in the 48-hour prediction task, with clear boundaries of rot spots on the fruit surface, natural peel texture, and an overall image that most closely resembles the true distribution.

[0159] like Figure 6As shown, this implementation achieves optimal results in four key metrics: PSNR, MAE, RMSE, and SSIM. PSNR reaches 38.277, an improvement of approximately 11.534 compared to ConvLSTM and approximately 13.162 compared to Transformer. MAE and RMSE are 0.009 and 0.0245 respectively, significantly lower than the comparison algorithms, indicating minimal prediction error. SSIM reaches 0.944, an improvement of approximately 11% and 26% compared to ConvLSTM (0.849) and PredRNN (0.746), respectively, demonstrating stronger structure preservation and texture consistency. This indicates that the algorithm has higher accuracy and robustness in capturing the complex spatiotemporal dynamics of blueberry decay. Based on the combined analysis of image visual effects and numerical metrics, the algorithm in this study achieves optimal performance in the 48-hour blueberry decay prediction task.

[0160] Figure 7 This demonstrates the image prediction performance of different algorithms in predicting blueberry decay over 72 hours. Figure 8 The corresponding quantitative performance indicators are then listed.

[0161] As the prediction time increases, the ability of various algorithms to reproduce the texture of fruit surface decay varies significantly. Traditional ConvLSTM and 3D-CNN models exhibit obvious blurring and structural drift in long-term predictions, with unclear edges of decayed areas and excessive smoothing of fine decay spots, resulting in a large difference between the overall image and the real sample. The Transformer model has certain advantages in global feature capture, but its ability to preserve local structure and details is limited, leading to insufficient image texture hierarchy. ST-ResNet's prediction results are relatively stable in terms of texture details, but the overall brightness deviation is still significant, and the predicted image is slightly lagging in reproducing the decay process. The PredRNN model shows significant error accumulation in 72-hour predictions, with reduced contrast and severe structural distortion in its output image.

[0162] like Figure 8 As shown, this implementation performs best in all four metrics: PSNR, MAE, and SSIM. PSNR reaches 37.920, an improvement of approximately 10.515 compared to ConvLSTM and 13.461 compared to Transformer. MAE and RMSE are 0.010 and 0.026 respectively, both significantly lower than other models, indicating the smallest prediction error and the highest fitting accuracy. SSIM reaches 0.935, an improvement of approximately 8% and 27% compared to ConvLSTM (0.866) and PredRNN (0.735) respectively, demonstrating excellent structure preservation and texture consistency. These results show that even under long-term (72-hour) prediction conditions, this algorithm still possesses excellent stability and generalization performance, effectively capturing the dynamic evolution characteristics of blueberry decay.

[0163] Figure 9 This demonstrates the image prediction performance of different algorithms in predicting blueberry decay over 96 hours. Figure 10 The corresponding quantitative performance indicators are then listed.

[0164] Traditional ConvLSTM, 3D-CNN, and Transformer models exhibit significant problems such as blurring, texture collapse, and diffusion of decay boundaries in long-term sequence predictions, especially in dark areas of the fruit surface and bright decay spots where prediction distortion is severe. While ST-ResNet and PredRNN show slight improvements in structure preservation, their overall detail fidelity remains insufficient, exhibiting blurred edges and degraded spatial texture.

[0165] In comparison, the model proposed in this embodiment significantly outperforms the contrasting model in terms of image clarity, rot boundary fitting, and texture restoration, and can more accurately reproduce the true distribution pattern of fruit peel rot. Figure 10 As shown, the comprehensive performance metrics of the 96-hour prediction further validate the superiority of the model. This implementation significantly outperforms other comparative models in PSNR = 36.582, MAE = 0.013, RMSE = 0.029, and SSIM = 0.880. Specifically, PSNR is improved by approximately 36.1% compared to ConvLSTM and approximately 50.3% compared to 3D-CNN; simultaneously, SSIM is improved to 0.880, an improvement of over 30% compared to PredRNN's 0.672, indicating that the model maintains extremely high structural similarity and reconstruction quality even under long-term prediction.

Claims

1. A method for constructing a blueberry fresh-keeping quality prediction model, characterized in that, Includes the following steps: Step S01: Obtain a blueberry sample and preprocess the blueberry sample by irradiating it with narrowband blue light to obtain a preprocessed blueberry sample. Step S02: Data collection is performed on the preprocessed blueberry samples to obtain a blueberry training set; the blueberry training set includes blueberry images, blueberry weight, and blueberry firmness. Step S03: Based on the blueberry image training set, the multi-scale dual-branch hybrid network model is trained using an adaptive multi-task loss function to obtain the trained multi-scale dual-branch hybrid network model as a blueberry freshness quality prediction model. The multi-scale dual-branch hybrid network model consists of a multi-scale convolution module, a temporal module, a dual-branch collaborative module, a fusion module, a blueberry image prediction module, and a blueberry physical property prediction module. The multi-scale convolution module is used to receive blueberry images; it is also used to extract multi-dimensional spatial features from the blueberry images to obtain multi-dimensional spatial features; and it is also used to send the multi-dimensional spatial features to the temporal module and the dual-branch collaborative module. The time-series module is used to extract time features from the obtained multi-dimensional spatial features to obtain time features; it is also used to send the time features to the dual-branch collaboration module. The dual-branch collaborative module is used to fuse the obtained multi-dimensional spatial features and temporal features to obtain fused features; it is also used to process the fused features into visual branches and physical branches respectively to obtain visual features and physical features respectively; It is also used to send the visual features and physical features to the fusion module; The fusion module is used to adaptively gatedly fuse the obtained visual features and physical features to obtain adaptive gated fusion features, and is also used to obtain channel weights based on the adaptive gated fusion features using a channel attention mechanism, and to obtain spatiotemporal features based on the adaptive gated fusion features and the channel weights; and is also used to send the spatiotemporal features to the blueberry image prediction module and the blueberry physical attribute prediction module. The blueberry image prediction module is used to obtain the predicted blueberry image by decoding the obtained spatiotemporal features through image reconstruction. The blueberry physical property prediction module is used to obtain the predicted physical properties of blueberries by using a physical property regression head on the obtained spatiotemporal features; the blueberry physical properties include blueberry weight and blueberry firmness.

2. The method of claim 1, wherein the blueberry fresh-keeping quality prediction model is constructed by using the blueberry fresh-keeping quality prediction model construction program. The narrowband blue light irradiation mentioned in step S01 specifically refers to: The narrow-band blue light has a wavelength of 468 to 472 nm, an irradiation intensity of 480 to 520 , and an irradiation window time of 38 to 42 seconds.

3. The method for constructing the blueberry preservation quality prediction model according to claim 1, characterized in that, The data acquisition described in step S02 specifically includes: The pretreated blueberries were placed in a standard light box for data collection at 24±0.5 hours, 48±0.5 hours, 72±0.5 hours or 96±0.5 hours after the blueberry samples were stored. The standard light box uses blue light with an intensity of 600 to 800 Lux.

4. The method of claim 1, wherein the blueberry freshness quality prediction model is constructed by using the blueberry freshness quality prediction model construction program. The key parameters of the training in step S03 include a learning rate and a batch size; the learning rate is 5e -5 - 5e -4 ; and the batch size is 8, 16, or 32.

5. The method of claim 1, wherein the blueberry freshness quality prediction model is constructed by using the blueberry freshness quality prediction model construction program. The adaptive multi-task loss function mentioned in step S03 is... wherein, is an image loss weight, is a weight loss weight, is a hardness loss weight, is an image loss, is a weight loss, is a hardness loss.

6. The method for constructing the blueberry preservation quality prediction model according to claim 5, characterized in that, Image loss By Obtain, among which, for Loss weights; Weights for mean squared error loss; The weights for cosine similarity loss are used. Number of images; It is a real image; For predicting images; for Norm; for Norm; This is the vector after the image has been flattened.

7. The method of claim 5, wherein the blueberry freshness quality prediction model is constructed by using the blueberry freshness quality prediction model of claim 1. Weight loss By obtained, wherein, is a batch size, denotes a time step; is a weight true value of the bth sample at the tth time step; is a weight predicted value of the bth sample at the tth time step.

8. The method of claim 7, wherein the blueberry fresh-keeping quality prediction model is constructed by using the blueberry fresh-keeping quality prediction model construction program of claim 1. hardness loss by obtained, wherein is the hardness ground truth value for the b-th sample at the t-th time step; is the hardness predicted value for the b-th sample at the t-th time step.

9. A method for predicting the fresh-keeping quality of blueberries, characterized by, Includes the following steps: Step B01: Obtain the blueberry sample to be predicted, and preprocess the blueberry sample by irradiating it with narrowband blue light to obtain the preprocessed blueberry sample. Step B02: Acquire images of the preprocessed blueberry samples to obtain blueberry images; Step B03: Input the blueberry image into the blueberry preservation quality prediction model for prediction and obtain the prediction results. The prediction results include the blueberry image, blueberry weight and blueberry firmness of the blueberry sample to be predicted four days later. The blueberry preservation quality prediction model is the blueberry preservation quality prediction model obtained by any one of the methods described in claims 1 to 8.

Citation Information

Patent Citations

  • Litchi fruit quality detection method and device, computer equipment and storage medium

    CN119649364A

  • Cold fresh mutton freshness nondestructive testing method based on double-branch hierarchical spectral feature sensing network

    CN119992541A