Freshness detection method based on machine vision and refrigerator
By adopting machine vision technology in smart refrigerators, collecting and analyzing food images and establishing a freshness detection model, the shortcomings of existing smart refrigerators in detecting food freshness are solved, real-time and accurate detection of food freshness is achieved, and food waste and food safety risks are reduced.
Patent Information
- Application Number
- CN202510364574.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-06-27
AI Technical Summary
The existing smart refrigerators have a single freshness perception dimension in detecting the freshness of food, and cannot obtain changes in the actual quality of food in real time, resulting in waste of ingredients and food safety risks.
Using a freshness detection method based on machine vision, food ingredient images are collected through visual sensing modules, image preprocessing, color component difference calculation and shape and texture feature extraction, and mapping relationship model is established to realize automatic detection of food freshness.
Real-time and objective detection of the freshness of ingredients is achieved, the accuracy of the detection is improved, the waste of ingredients is reduced, and users are promptly reminded to eat and manage the ingredients in the refrigerator.
Smart Images

Figure CN120213827A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of household appliances, and more specifically to a freshness detection method and a refrigerator based on machine vision. Background Art
[0002] With the development of technology and the improvement of people's living standards, smart home devices have gradually entered people's daily lives. Among them, as an important device for storing food ingredients, the intelligence level of refrigerators is also getting higher and higher. Traditional refrigerators can only store food ingredients, while modern smart refrigerators can manage food ingredients, including reminding users to replenish food ingredients and recommending recipes. However, there are still some problems with these smart refrigerators in detecting the freshness of food ingredients.
[0003] The current smart refrigerators mainly adopt a food ingredient management system of "barcode recognition + RFID (Radio Frequency Identification)". Users enter the food ingredient information into the refrigerator system by scanning the product barcode or pasting the RFID tag. The system analyzes the food ingredient type, shelf life, and storage suggestions according to the pre-stored database.
[0004] However, this method results in high user interaction costs. Barcode scanning relies on manual operation, and RFID tags need to be pasted one by one, with insufficient user compliance. Secondly, the freshness perception dimension is single, and it can only linearly estimate through the production date, unable to obtain the actual quality changes of food ingredients in real time, lacking dynamic monitoring of complex deterioration processes such as meat spoilage and fruit and vegetable dehydration. Therefore, it will still cause food ingredient waste and may also lead to food safety risks due to lack of timely warning. Summary of the Invention
[0005] To solve the problem of single freshness perception dimension in the above method, which can only linearly estimate through the production date and lacks dynamic monitoring, the present application provides a freshness detection method based on machine vision in the first aspect, including the following steps:
[0006] Collect images of food ingredients in the refrigerator, where the images include: images in the initial fresh state and images at different storage times;
[0007] Preprocess the images, where the preprocessing includes denoising, segmentation to separate the food ingredients from the background, and enhancement;
[0008] Extract the R, G, B color component values of the food ingredients in the preprocessed images, and calculate the color component differences at different storage times;
[0009] Extract the shape and texture appearance features of the food ingredients in the images based on computer vision;
[0010] Establish a mapping relationship model according to the color component differences and the appearance features;
[0011] Obtain an image input of the ingredients inside the new refrigerator and determine the freshness level of the ingredients through the mapping relationship model.
[0012] In a feasible implementation manner, the denoising process uses a Gaussian filtering algorithm, the segmentation process uses a threshold segmentation or edge detection algorithm, and the enhancement process uses a histogram equalization method.
[0013] In a feasible implementation manner, the calculation of the color component difference includes:
[0014] Obtain the average values of the R, G, and B components of fruit and vegetable ingredients at different storage times, calculate the time series difference of the component average values, and compare the time series difference with a preset freshness threshold range.
[0015] In a feasible implementation manner, the step of extracting the shape and texture appearance features of the ingredients in the image based on computer vision includes:
[0016] Use a vision transformer neural network model to perform edge detection on the ingredient contour to obtain the shape features, and analyze the texture features through a gray-level co-occurrence matrix.
[0017] In a feasible implementation manner, the step of establishing the mapping relationship model includes:
[0018] Input the color component difference and the shape and texture features into the classifier of the mapping relationship model, and train the mapping relationship model through supervised learning to output the freshness level, and the levels include: fresh, average, and deteriorated.
[0019] The second aspect of this application provides a refrigerator, including:
[0020] A refrigerator door body, a lighting module, a vision sensing module, a detection module, a display panel, and a controller;
[0021] The lighting module is installed at the top inside the refrigerator to provide a stable light source;
[0022] The vision sensing module is installed inside the refrigerator cabinet to collect ingredient images;
[0023] The detection module is electrically connected to the vision sensing module and is used for the freshness detection method described in any one of the above;
[0024] The display panel is installed on the outside of the refrigerator door body to display the ingredient name and the corresponding freshness level icon;
[0025] The controller is electrically connected to the lighting module, the vision sensing module, the detection module, and the display panel respectively, and is used to control the operation of the lighting module, the vision sensing module, the detection module, and the display panel.
[0026] In a feasible implementation, the visual sensing module includes a wide-angle camera. The installation position of the wide-angle camera faces the refrigerator storage compartment directly, and forms an angle of 30° - 60° with the light source axis of the lighting module.
[0027] In a feasible implementation, the detection module is integrated in the controller. The detection module includes an image processing unit and a data analysis unit;
[0028] The image processing unit is used to perform image preprocessing and feature extraction;
[0029] The data analysis unit is used to run a mapping relationship model to judge the freshness level of food ingredients.
[0030] In a feasible implementation, the refrigerator further includes a communication module. The communication module is electrically connected to the controller, and the communication module supports Wi-Fi or Bluetooth protocols;
[0031] The communication module is configured to: send the food ingredient freshness detection result to the user terminal.
[0032] In a feasible implementation, the freshness level icon of the display panel is represented by a color gradient bar, where green corresponds to "fresh", yellow corresponds to "average", and red corresponds to "spoiled". A note is set beside the icon, and the note is used to mark the food ingredient name and the recommended consumption period corresponding to the food ingredient.
[0033] As can be seen from the above, the present application provides a freshness detection method and a refrigerator based on machine vision, which integrate a visual sensing module, a detection module, a display panel and a communication module in the refrigerator, realizing the functions of automatic detection, result display and remote notification of the freshness of food ingredients. The present application can automate the detection process, without the need for users to manually scan or label, improving the detection efficiency, and can be widely applied to the freshness detection of various types of food ingredients, with a large coverage of food ingredient types. At the same time, by means of computer machine vision and image preprocessing technology, the changes in the RGB color components and appearance features of food ingredients are analyzed, improving the accuracy of freshness determination. Timely reminding users to consume and manage the food ingredients in the refrigerator further improves the utilization rate of food ingredients. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings here are incorporated into the specification and form a part of this specification, showing the embodiments that comply with the implementation of the present invention, and are used together with the specification to explain the principles of the embodiments of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0035] Figure 1 It is a schematic flowchart of the freshness detection method based on machine vision shown in the embodiments of the present application. Detailed implementation manners
[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present invention.
[0037] Existing smart refrigerators usually use barcode scanning or RFID tags to identify and record the types and shelf lives of food ingredients. However, this method requires users to manually scan or label, which is cumbersome to operate and cannot detect the freshness of food ingredients in real time. In addition, there are many types of edible food ingredients, and the spoilage determination criteria for different food ingredients may be completely different, greatly increasing the difficulty of freshness determination.
[0038] To solve the above problems, a first aspect of the embodiments of the present application provides a freshness detection method based on machine vision. Referring to Figure 1 as shown, it includes the following steps:
[0039] S100: Collect images of food ingredients in the refrigerator, where the images include: images in the initial fresh state and images at different storage times.
[0040] In this step, the initial state of the food ingredients and the image sequence during storage are automatically obtained through the built-in camera of the refrigerator to establish a dynamic visual archive. The initial image records the characteristics of the non-spoiled food ingredients, and subsequent images are collected at regular intervals (such as every 12 or 24 hours) to capture the changes in appearance over time, providing basic data for subsequent analysis.
[0041] S200: Preprocess the images, where the preprocessing includes denoising, segmentation to separate the food ingredients from the background, and enhancement.
[0042] It can be understood that the reliability of the analysis is improved by optimizing the quality of the original images. The denoising process eliminates the interference of the internal light of the refrigerator and the influence of condensation water stains; the background segmentation separates the food ingredients from the interfering elements such as the refrigerator partition / lighting; the contrast enhancement highlights the surface details of the food ingredients (such as mold spots, wilting textures), ensuring the accuracy of subsequent feature extraction.
[0043] S300: Extract the R, G, and B color component values of the ingredients in the pre - processed image, and calculate the color component differences at different storage times.
[0044] This step quantifies the color change law of the ingredients to evaluate freshness. By calculating the RGB component differences (ΔR / ΔG / ΔB) at different storage time points, key color change patterns are identified - such as the redness attenuation caused by the oxidation of myoglobin in meat and the yellowness increase caused by the decomposition of chlorophyll in green leafy vegetables, and the correlation between color and the spoilage process is established.
[0045] S400: Extract the shape and texture appearance features of the ingredients in the image based on computer vision.
[0046] This step further complements the color information blind area and extracts shape and texture features to enhance the robustness of the determination. Shape features (such as contour dilation) reflect the structural integrity of the ingredients, and texture features (such as surface roughness) capture early spoilage signals (such as shrinkage of fruit skin and degradation of vegetable fibers), solving the problem of insufficient coverage of complex spoilage patterns by a single color feature.
[0047] S500: Establish a mapping relationship model based on the color component differences and appearance features.
[0048] Construct a freshness prediction engine that fuses multiple parameters. Use machine learning algorithms to perform non - linear mapping of color change amounts, shape factors, texture parameters, and experimentally determined freshness levels, and form an adaptive discrimination model through training to solve the determination problem caused by differences in spoilage characteristics of different ingredients.
[0049] S600: Obtain the image input of the ingredients in the new refrigerator and judge the freshness level of the ingredients through the mapping relationship model.
[0050] Realize dynamic monitoring and early warning. Automatically trigger the detection process for the newly deposited ingredients by the user, input the real - time image into the trained model, output the three - level freshness status, and push suggestions through the refrigerator display screen or mobile APP to form a closed - loop management.
[0051] This application uses a visual sensing module to collect images of the ingredients in the refrigerator. Through image pre - processing and feature extraction, it analyzes the changes in the color components and appearance features of the ingredients to judge their freshness. This method realizes real - time and objective detection of the freshness of the ingredients. At the same time, by combining color components and appearance features (shape, texture) for comprehensive judgment, the accuracy of freshness detection is improved. Color components reflect the color change of the ingredients, while appearance features reflect the physical state change of the ingredients. The two complement each other and can more comprehensively reflect the freshness of the ingredients.
[0052] In some embodiments of the present application, Gaussian filtering algorithm is used for denoising processing, threshold segmentation or edge detection algorithm is used for segmentation processing, and histogram equalization method is used for enhancement processing.
[0053] Specifically, the Gaussian filtering algorithm is used to denoise the acquired image. The Gaussian filtering algorithm replaces the value of each pixel in the image with the weighted average of its surrounding pixel values through weighted averaging, thereby eliminating the noise interference in the image and improving the image quality.
[0054] The denoised image is segmented using threshold segmentation or edge detection algorithm. The threshold segmentation algorithm divides the image into the ingredient area and the background area by setting a gray threshold; the edge detection algorithm separates the ingredient from the background by detecting the edge points with obvious brightness changes in the image. Both of these algorithms can effectively separate the ingredient from the complex background, facilitating subsequent feature extraction and analysis.
[0055] The enhancement processing uses the histogram equalization method to enhance the segmented ingredient image. The histogram equalization method adjusts the gray histogram of the image to make the gray distribution of the image more uniform, thereby improving the contrast and clarity of the image and facilitating subsequent color component and appearance feature extraction.
[0056] In some embodiments of the present application, the calculation of the color component difference includes:
[0057] S310: Obtain the average values of the R, G, and B components of the fruit and vegetable ingredients at different storage times, calculate the time series difference of the average component values, and compare the time series difference with a preset freshness threshold range.
[0058] Specifically, the color space of the preprocessed image is converted, and the image is converted from the RGB color space to other color spaces (such as the HSV color space) to more accurately extract the color components of the ingredient. Or the RGB color component values can also be directly extracted.
[0059] Extract the R, G, and B color component values of the ingredient area in the image, and calculate their average values as the color features of the ingredient.
[0060] The calculation of the color component difference is specifically: obtain the average values of the R, G, and B components of the fruit and vegetable ingredients at different storage times, and calculate the time series difference of these average component values. For example, for a certain kind of fruit and vegetable, the average values of the R, G, and B components in the initial fresh state are R1, G1, and B1 respectively, and the average values of the R, G, and B components after storage for a period of time are R2, G2, and B2 respectively. Then the color component difference is ΔR = R2 - R1, ΔG = G2 - G1, ΔB = B2 - B1.
[0061] Compare the time series difference with a preset freshness threshold range. The preset freshness threshold range can be determined based on a large amount of experimental data or industry standards. For example, different threshold ranges are set for ΔR, ΔG, and ΔB respectively. When the color component difference exceeds the corresponding threshold range, it is considered that the freshness of the food ingredient has changed.
[0062] In this embodiment, by obtaining the R, G, B image sequences of fruit and vegetable ingredients during the storage period, performing pixel-level segmentation on the ingredient areas in each image, the average values of the R, G, B three channels can be calculated as color feature values to form time series data. The sliding window method is used to calculate the component differences between adjacent sampling points, and a color change curve is generated to dynamically match the channel differences with the preset freshness threshold range interval. This solves the problem of large manual observation errors. By using the exclusive freshness threshold range for different fruit and vegetable categories, the problem of a large variety of food ingredients is solved. When the color change is not yet visible to the naked eye, problems can be discovered in advance to avoid food spoilage.
[0063] In some embodiments of the present application, the steps of extracting the shape and texture appearance features of the food ingredient in the image based on computer vision include:
[0064] S410: Use a vision transformer neural network model to perform edge detection on the food ingredient contour to obtain shape features, and analyze texture features through a gray-level co-occurrence matrix.
[0065] Specifically, a vision transformer neural network model can be used to perform edge detection on the food ingredient contour. The vision transformer neural network model is a deep learning-based model that can automatically learn the features in the image, perform accurate edge detection on the food ingredient contour, and thus obtain the shape features of the food ingredient.
[0066] Quantify the extracted shape features, such as calculating parameters such as the perimeter, area, and aspect ratio of the food ingredient, as a description of the shape features.
[0067] The texture features of the food ingredient can also be analyzed through a gray-level co-occurrence matrix. The gray-level co-occurrence matrix is a matrix that describes the spatial dependence relationship of gray levels in an image and can reflect characteristics such as the roughness and directionality of the texture in the image.
[0068] Extract texture feature parameters from the gray-level co-occurrence matrix, such as contrast, entropy, energy, etc., as a description of the texture features of the food ingredient.
[0069] Through the extraction and analysis of shape and texture features, the appearance state of the food ingredient can be comprehensively reflected, improving the accuracy of freshness judgment.
[0070] In this embodiment, the color component difference is used as one of the input features, and combined with the subsequently extracted shape and texture features, it is input into the classifier (such as support vector machine, neural network, etc.) of the mapping relationship model for training. The model is trained through supervised learning to establish the mapping relationship between the color component difference, shape features, texture features and freshness levels (fresh, average, spoiled). During the training process, a large number of labeled sample data are required, that is, the food ingredient images with known freshness levels and their corresponding color component differences, shape features and texture features.
[0071] In some embodiments of the present application, the steps of establishing the mapping relationship model include:
[0072] S510: Input the color component difference and shape and texture features into the classifier of the mapping relationship model, and train the mapping relationship model through supervised learning to output the freshness level, and the levels include: fresh, average and spoiled.
[0073] Specifically, the color component difference is used as one of the input features, and combined with the subsequently extracted shape and texture features, it is input into the classifier (such as support vector machine, neural network, etc.) of the mapping relationship model for training.
[0074] Then, the model is trained through supervised learning to establish the mapping relationship between the color component difference, shape features, texture features and freshness levels (fresh, average, spoiled). During the training process, a large number of labeled sample data are required, that is, the food ingredient images with known freshness levels and their corresponding color component differences, shape features and texture features.
[0075] Through the analysis of the color component difference and the establishment of the mapping model in this embodiment, the color change of food ingredients can be quantified, providing an objective basis for freshness judgment. It breaks through the limitations of single color features, and can identify the early signals of spoilage through shape and texture information. For example, when the surface of an apple shrinks but the color does not change significantly, it can be detected and identified through shape and texture information. At the same time, by continuously inputting new samples for incremental learning, the model can adapt to the spoilage laws of different varieties of fruits and vegetables.
[0076] On the other hand, an embodiment of the present application provides a refrigerator, including: a refrigerator door body, a lighting module, a visual sensing module, a detection module, a display panel, a controller and a communication module.
[0077] Among them, the lighting module is installed at the top inside the refrigerator for providing a stable light source. The visual sensing module is installed inside the refrigerator body for collecting food ingredient images. The visual sensing module is located inside the refrigerator body, facing the refrigerator storage compartment. This layout can ensure that the visual sensing module can clearly collect food ingredient images and avoid the reflection problem caused by direct light source irradiation.
[0078] The detection module is electrically connected to the vision sensing module and is used to execute the freshness detection method based on machine vision in the above embodiments. The detection module is integrated in the controller, and the display panel is installed on the outer side of the refrigerator door body and is used to display the ingredient name and the corresponding freshness level icon.
[0079] The controller is electrically connected to the lighting module, the vision sensing module, the detection module, the display panel and the communication module respectively and is used to control the operation of these modules. The controller can be implemented by an embedded control system such as a microcontroller or a single-chip microcomputer. The specific functions of the controller are: controlling the lighting module to turn on to provide lighting conditions for the vision sensing module to collect images. The vision sensing module automatically collects images of the ingredients in the refrigerator at preset time intervals (such as every 12 hours), including the initial freshness state and the images at different storage times.
[0080] Through the integrated module design in this embodiment, the functions of automatic detection of ingredient freshness, result display and remote notification are realized, improving the intelligence of the refrigerator and the user experience.
[0081] In some embodiments of the present application, the vision sensing module includes a wide-angle camera. The installation position of the wide-angle camera faces the refrigerator storage compartment and forms an angle of 30°-60° with the light source axis of the lighting module. This installation position can ensure that the vision sensing module can clearly collect the ingredient images and avoid the reflection problem caused by direct light source irradiation.
[0082] By optimizing the installation position of the vision sensing module in this embodiment, the quality of image collection is improved, providing an accurate basis for subsequent freshness detection.
[0083] In some embodiments of the present application, the detection module is integrated in the controller and includes an image processing unit and a data analysis unit. The image processing unit is used to execute image preprocessing and feature extraction, and the data analysis unit is used to run the mapping relationship model to judge the ingredient freshness level.
[0084] In this embodiment, the detection module is integrated in the controller. This integrated design can simplify the internal structure of the refrigerator, reduce production costs and improve the stability of the system.
[0085] In some embodiments of the present application, the refrigerator further includes a communication module. The communication module is electrically connected to the controller and supports Wi-Fi or Bluetooth protocols.
[0086] Through the communication module, the remote notification function is further realized in this embodiment. Specifically, when it is detected that the freshness level of the food ingredient changes (such as changing from "fresh" to "average" or "spoiled"), the controller controls the communication module to send the freshness detection result to the user terminal. The user terminal can be a mobile phone, a tablet computer, etc. An appropriate APP can also be installed on the user terminal to receive and display the freshness detection result, which is not specifically limited in this application.
[0087] Through the remote notification function, even when the user is not at home, they can timely understand the freshness of the food ingredients in the refrigerator, which is convenient for reasonably arranging the use and procurement plans of the food ingredients.
[0088] In some embodiments of this application, the display panel is installed on the outer side of the refrigerator door body for displaying the food ingredient name and the corresponding freshness level icon. The freshness level icon is represented by a color gradient bar, where green corresponds to "fresh", yellow corresponds to "average", and red corresponds to "spoiled". A note is set beside the icon for marking the food ingredient name and the recommended consumption period corresponding to the food ingredient.
[0089] Through the intuitive display panel design, it is convenient for users to quickly understand the freshness and recommended consumption period of the food ingredients, improving the utilization rate of the food ingredients.
[0090] According to the content of the above embodiments, this application is based on machine vision technology. The images of the food ingredients in the refrigerator are obtained through the vision sensing module. The image quality is improved by using image preprocessing technology, and then the color and appearance features in the image are extracted. Through the mapping relationship model between the color component difference and the freshness, combined with the analysis of the appearance features, the freshness level of the food ingredient is judged. Finally, the freshness detection result is displayed to the user in real time through the display panel and the communication module. The vision sensing module, the detection module, the display panel and the communication module are integrated in the refrigerator, realizing the functions of automatic detection of the freshness of food ingredients, result display and remote notification. This application can automate the detection process, without the need for users to manually scan or label, improving the detection efficiency, and can be widely applied to the freshness detection of various types of food ingredients, covering a large range of food ingredient types. At the same time, by analyzing the changes in the RGB color components and appearance features of the food ingredients with the help of computer machine vision and image preprocessing technology, the accuracy of freshness determination is improved. Timely reminding users to consume and manage the food ingredients in the refrigerator further improves the utilization rate of the food ingredients.
[0091] As can be seen from the above, it should be noted that in the embodiments of the present application, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a structure, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such structure, article or device. Without further limitation, an element defined by the statement "including..." does not exclude the existence of additional identical elements in the structure, article or device including the element.
[0092] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the disclosure herein. The present application is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and examples are only illustrative, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0093] It should be understood that the present disclosure is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A freshness detection method based on machine vision, characterized in that: The following steps are involved: Collecting images of food in the refrigerator, the images including: images in an initial fresh state and images at different storage times; Preprocessing the image, the preprocessing including denoising, segmentation to separate food and background, and enhancement; Extracting R, G, and B color component values of the food in the preprocessed image, and calculating the color component differences at different storage times; Extracting shape and texture appearance features of the food in the image based on computer vision; Establishing a mapping relationship model according to the color component difference and the appearance feature; A new image input of food in a refrigerator is obtained and the freshness level of the food is determined by using the mapping relationship model.
2. The freshness detection method based on machine vision according to claim 1, characterized in that: The denoising process adopts a Gaussian filtering algorithm, the segmentation process adopts a threshold segmentation or edge detection algorithm, and the enhancement process adopts a histogram equalization method.
3. The freshness detection method based on machine vision according to claim 1, characterized in that: The calculation of the color component difference includes: The mean values of the R, G, and B components of the fruit and vegetable ingredients at different storage times are obtained, the time series difference of the component mean values is calculated, and the time series difference is compared with a preset freshness threshold range.
4. The freshness detection method based on machine vision according to claim 1, characterized in that: The step of extracting shape and texture appearance features of the food in the image based on computer vision comprises: The visual converter neural network model is used to perform edge detection on the food contour to obtain the shape features, and the texture features are analyzed through the gray level co-occurrence matrix.
5. The freshness detection method based on machine vision according to claim 1, characterized in that: The step of establishing the mapping relationship model comprises: The color component difference and the shape and texture features are input into the classifier of the mapping relationship model, and the mapping relationship model is trained through supervised learning to output freshness levels, wherein the levels include: fresh, general and spoiled.
6. A refrigerator, characterized in that: include: Refrigerator door, lighting module, visual sensor module, detection module, display panel and controller; The lighting module is installed on the top of the inner side of the refrigerator to provide a stable light source; The visual sensor module is installed in the refrigerator body and is used to collect food images; The detection module is electrically connected to the visual sensing module, and is used to perform the freshness detection method based on machine vision according to any one of claims 1 to 5; The display panel is installed on the outside of the refrigerator door and is used to display the food name and the corresponding freshness level icon; The controller is electrically connected to the lighting module, the visual sensing module, the detection module and the display panel respectively, and is used to control the operation of the lighting module, the visual sensing module, the detection module and the display panel.
7. The refrigerator according to claim 6, characterized in that: The visual sensing module includes a wide-angle camera, which is installed opposite to the refrigerator storage compartment and forms an angle of 30°-60° with the axis of the light source of the lighting module.
8. The refrigerator according to claim 6, characterized in that: The detection module is integrated in the controller, and the detection module includes an image processing unit and a data analysis unit; The image processing unit is used to perform image preprocessing and feature extraction; The data analysis unit is used to run the mapping relationship model to determine the freshness level of the food.
9. The refrigerator according to claim 6, characterized in that: The refrigerator further comprises a communication module, the communication module is electrically connected to the controller, and the communication module supports Wi-Fi or Bluetooth protocol; The communication module is configured to send the food freshness detection result to the user terminal.
10. The refrigerator according to claim 6, characterized in that: The freshness level icon of the display panel is represented by a color gradient bar, where green corresponds to "fresh", yellow corresponds to "normal", and red corresponds to "spoiled". Notes are provided next to the icons, and the notes are used to mark the name of the ingredient and the recommended shelf life corresponding to the ingredient.