Method and system for controlling internal temperature of refrigerated cabinet
By acquiring the product images and environmental data inside the refrigerator in real time, extracting feature vectors and setting the optimal storage temperature, it solves the problem of insufficient accuracy of the traditional refrigerator temperature control method, achieves precise control of the internal temperature of the refrigerator, and improves product quality. preservation effect.
Patent Information
- Application Number
- CN202411222391.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-10-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional refrigerated cabinet temperature control method relies on a single temperature sensor and manual settings, which is difficult to achieve precise control and cannot comprehensively consider changes in the external environment and the storage requirements of different commodities. This results in limited temperature control effects and affects the freshness quality of the commodities.
Through real-time acquisition of product images inside the refrigerated cabinet collected by cameras and environmental data collected by multiple sensors, product feature vectors are extracted, product types are determined, and the optimal storage temperature is set based on relevant environmental data to achieve precise control of the internal temperature of the refrigerated cabinet.
It achieves precise control of the internal temperature of the refrigerator, ensuring that products are stored under the most appropriate storage conditions, improving the preservation effect and product quality.
Smart Images

Figure CN118816477A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of refrigerators, and in particular to a method and system for controlling the internal temperature of a refrigerator. Background Art
[0002] Refrigerator cabinets play a vital role in the modern food storage and preservation process, and are widely used in households, supermarkets, and the catering industry. Therefore, in modern cold chain logistics and refrigerated storage systems, how to effectively control the temperature inside the refrigerator to ensure the preservation quality of various commodities is an important technical problem. Traditional refrigerator temperature control methods usually rely on a single temperature sensor and manual temperature setting, but these methods still have obvious shortcomings. Manual temperature setting depends on the user's experience and operation, and it is difficult to achieve precise control. Existing automation systems are mostly based on single sensor data, and it is difficult to comprehensively consider changes in the external environment and the storage requirements of different commodities, resulting in limited temperature control effects, which leads to unsatisfactory storage environments for some commodities, which in turn affects the preservation effect and quality of the commodities.
[0003] Therefore, how to achieve accurate control of the temperature inside the refrigerator has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a method and system for controlling the internal temperature of a refrigerator, which can achieve precise control of the internal temperature of the refrigerator.
[0005] In a first aspect, the present application provides a method for controlling the internal temperature of a refrigerator, the method comprising: acquiring in real time a first product image corresponding to all products inside the refrigerator collected by each camera; and acquiring initial environmental data collected by multiple sensors outside the refrigerator; based on the first product image, extracting a product feature vector corresponding to each of the products; based on each of the product feature vectors, determining a product type corresponding to each of the products; based on each of the product types, determining relevant environmental data corresponding to each of the product types from multiple initial environmental data; and based on each of the relevant environmental data, setting the storage temperature inside the refrigerator.
[0006] By adopting the above technical solution, by acquiring the first product image corresponding to all the products inside the refrigerator collected by each camera in real time, the specific distribution and quantity information of the products inside the refrigerator can be accurately obtained. By acquiring the initial environmental data collected by multiple sensors outside the refrigerator, the environmental conditions outside the refrigerator can be fully grasped. Based on the first product image, the product feature vector corresponding to each product can be extracted, so that the features of different products in the refrigerator can be accurately identified, providing basic data for subsequent classification. Based on each product feature vector, the product type corresponding to each product is determined, so that the products in the refrigerator can be effectively classified; based on each product type, the relevant environmental data corresponding to each product type is determined from multiple initial environmental data, so that the optimal storage conditions for each product can be accurately matched; based on each relevant environmental data, the storage temperature inside the refrigerator is set, so that the temperature inside the refrigerator can be accurately controlled according to the actual conditions of the products inside the refrigerator.
[0007] Optionally, extracting a product feature vector corresponding to each of the products based on the first product image specifically includes: performing image preprocessing on the first product image to obtain a preprocessed first product image; separating each of the products from the preprocessed first product image to obtain a segmented product area corresponding to each of the products; extracting shape features, color features and texture features corresponding to each of the products from each of the segmented product areas; aggregating the shape features, color features and texture features corresponding to each of the products to obtain a comprehensive feature vector corresponding to each of the products; and normalizing each of the comprehensive feature vectors to obtain the product feature vector corresponding to each of the products.
[0008] By adopting the above technical solution, by performing image preprocessing on the first product image, noise and interference in the image can be removed, image quality can be improved, and the foundation for subsequent processing can be laid. By separating each product from the preprocessed first product image, the segmented product area corresponding to each product is obtained, so that the boundary and position of the product can be clarified, which is helpful for the accuracy of subsequent feature extraction. By extracting the shape features, color features and texture features corresponding to each product from each segmented product area, the appearance features of the product can be described in multiple dimensions, providing more comprehensive product information. By aggregating the shape features, color features and texture features corresponding to each product, a comprehensive feature vector corresponding to each product is obtained, so that a complete product feature description can be formed. By normalizing each comprehensive feature vector, a product feature vector corresponding to each product is obtained, so that the dimensional differences between different features can be eliminated, and the effect and stability of the feature vector in the classification and matching process can be improved.
[0009] Optionally, the product type includes an actual product type and an uncertain product type; determining the product type corresponding to each product based on each product feature vector specifically includes: inputting each product feature vector into a pre-trained product classification model, and outputting a pre-identified product type corresponding to each product; performing confidence evaluation on each pre-identified product type to obtain a classification confidence corresponding to each product; when the classification confidence corresponding to the product is greater than the confidence threshold, using the pre-identified product type corresponding to the product as the actual product type corresponding to the product; when the classification confidence is not greater than the confidence threshold, marking the product as the uncertain product type.
[0010] By adopting the above technical solution, by inputting each commodity feature vector into the pre-trained commodity classification model, the commodities can be preliminarily classified quickly and efficiently, thereby improving the classification efficiency and accuracy. By outputting the pre-identified commodity type corresponding to each commodity, the preliminary classification result of each commodity can be obtained in time, providing a basis for subsequent processing. By performing confidence assessment on each pre-identified commodity type, the classification confidence corresponding to each commodity is obtained, so that the reliability of the classification result can be judged and the credibility of the classification result can be ensured. When the classification confidence corresponding to the commodity is greater than the confidence threshold, the pre-identified commodity type corresponding to the commodity is used as the actual commodity type corresponding to the commodity, so that the commodity type can be directly confirmed under high confidence conditions, thereby improving the accuracy and efficiency of classification decisions. When the classification confidence is not greater than the confidence threshold, the commodity is marked as an uncertain commodity type, so that misclassification can be avoided under low confidence conditions.
[0011] Optionally, before inputting each of the commodity feature vectors into the pre-trained commodity classification model and outputting the pre-identified commodity type corresponding to each of the commodities, the method further includes: obtaining a plurality of second commodity images corresponding to the commodities to be trained; obtaining a feature vector to be trained corresponding to each of the commodities to be trained based on each of the second commodity images; marking the type of each of the commodities to be trained to obtain a commodity type to be trained corresponding to each of the commodities to be trained; corresponding each of the feature vectors to be trained to each of the commodity types to be trained to construct a commodity classification data set; the commodity classification data set includes a plurality of feature vectors to be trained and a plurality of commodity types to be trained, wherein one feature vector to be trained corresponds to one commodity type to be trained; dividing the commodity classification data set to obtain a model training set, model verification set and model test set; determine the initial model, initial model parameters and hyperparameters; train the initial model through a preset number of training cycles to obtain a model to be verified; in each training cycle, input the model training set into the initial model for training, output the predicted commodity type, and calculate the training loss value based on the predicted commodity type and the commodity type to be trained, and update the initial model parameters through the back propagation algorithm to minimize the training loss value; use the model verification set to verify the model to be verified, evaluate the model performance of the model to be verified and adjust the hyperparameters to obtain a trained model; use the model test set to test the trained model to obtain a test result; based on the test result, determine the pre-trained commodity classification model.
[0012] Optionally, based on each of the commodity types, determining relevant environmental data corresponding to each of the commodity types from the multiple initial environmental data specifically includes: determining the storage requirements corresponding to each of the commodity types; based on each of the storage requirements, determining relevant environmental data corresponding to each of the commodity types from the multiple initial environmental data.
[0013] By adopting the above technical solution, by determining the storage requirements corresponding to each commodity type, the optimal storage conditions for each commodity, such as temperature, humidity, etc., can be clarified, providing a basis for refined management. By determining the relevant environmental data corresponding to each commodity type from multiple initial environmental data based on each storage requirement, the actual storage environment of different commodities can be accurately matched, ensuring that each commodity is stored under the most suitable conditions, and realizing accurate control of the internal temperature of the refrigerator.
[0014] Optionally, the storage temperature inside the refrigerator is set based on each of the relevant environmental data, specifically including: determining multiple environmental risk factors corresponding to each of the commodity types; determining initial environmental risk data corresponding to each environmental risk factor from the multiple relevant environmental data, and determining the importance weight corresponding to each of the environmental risk factors; normalizing the multiple initial environmental risk data to obtain multiple normalized environmental risk data; multiplying the normalized environmental risk data corresponding to each of the environmental risk factors by the importance weight to obtain a single risk score corresponding to each of the environmental risk factors; adding the multiple single risk scores to obtain a first environmental risk score corresponding to each of the commodity types; and determining the storage temperature based on each of the first environmental risk scores.
[0015] By adopting the above technical solution, by determining multiple environmental risk factors corresponding to each commodity type, the key factors affecting the storage safety of commodities can be fully identified, laying the foundation for subsequent risk assessment. By determining the initial environmental risk data corresponding to each environmental risk factor from multiple relevant environmental data, and determining the importance weight corresponding to each environmental risk factor, the degree of influence of each risk factor can be accurately quantified to ensure the accuracy of risk assessment. By normalizing multiple initial environmental risk data, multiple normalized environmental risk data are obtained, thereby eliminating the dimensional differences between different risk factors and ensuring the consistency and comparability of data processing. By multiplying the normalized environmental risk data corresponding to each environmental risk factor with the importance weight, a single risk score corresponding to each environmental risk factor is obtained, so that the influence weight of each risk factor can be comprehensively considered to quantify the degree of risk. By adding multiple single risk scores, the first environmental risk score corresponding to each commodity type is obtained, so that a comprehensive environmental risk assessment result can be formed to provide a basis for subsequent decision-making. By determining the storage temperature based on each first environmental risk score, the storage temperature can be dynamically adjusted according to the comprehensive risk assessment result, thereby realizing the precise control of the internal temperature of the refrigerator.
[0016] Optionally, determining the storage temperature based on each of the first environmental risk scores specifically includes: determining a mapping relationship between different environmental risk score intervals and different storage temperatures, wherein one environmental risk score interval corresponds to one storage temperature; determining a second environmental risk score from each of the first environmental risk scores, wherein the second environmental risk score is greater than the remaining first environmental risk scores; and determining the storage temperature based on the environmental risk score interval in which the second environmental risk score is located and the mapping relationship.
[0017] By adopting the above technical solution, by determining the mapping relationship between different environmental risk score intervals and different storage temperatures, a clear correspondence between environmental risk and storage temperature can be established, and by determining the second environmental risk score from each first environmental risk score, wherein the second environmental risk score is greater than the remaining first environmental risk scores, the environmental conditions with the highest risk can be identified, providing a basis for key control. By determining the storage temperature based on the environmental risk score interval and mapping relationship in which the second environmental risk score is located, the storage temperature can be accurately adjusted for the highest risk situation, thereby achieving precise control of the internal temperature of the refrigerator.
[0018] In a second aspect of the present application, a temperature control system for an internal refrigerator is provided, the system comprising: an acquisition module, a processing module and a temperature setting module; the acquisition module is used to acquire in real time a first product image corresponding to all the products inside the refrigerator acquired by each camera; and acquire initial environmental data acquired by multiple sensors outside the refrigerator; the processing module is used to extract a product feature vector corresponding to each of the products based on the first product image; the processing module is also used to determine the product type corresponding to each of the products based on each of the product feature vectors; the processing module is also used to determine, based on each of the product types, relevant environmental data corresponding to each of the product types from multiple initial environmental data; the temperature setting module is used to set the storage temperature inside the refrigerator based on each of the relevant environmental data.
[0019] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any method as described in the first aspect of the present application.
[0020] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program that can be loaded by a processor and execute the method as described in any one of the first aspects of the present application.
[0021] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: By acquiring the first product image corresponding to all the products inside the refrigerator collected by each camera in real time, the specific distribution and quantity information of the products inside the refrigerator can be accurately obtained. By acquiring the initial environmental data collected by multiple sensors outside the refrigerator, the environmental conditions outside the refrigerator can be fully understood. Based on the first product image, the product feature vector corresponding to each product is extracted, so that the features of different products in the refrigerator can be accurately identified, providing basic data for subsequent classification. Based on each product feature vector, the product type corresponding to each product is determined, so that the products in the refrigerator can be effectively classified; based on each product type, the relevant environmental data corresponding to each product type is determined from multiple initial environmental data, so that the optimal storage conditions for each product can be accurately matched; based on each relevant environmental data, the storage temperature inside the refrigerator is set, so that the temperature inside the refrigerator can be accurately controlled according to the actual conditions of the products inside the refrigerator. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is one of the flow charts of a method for controlling the internal temperature of a refrigerator provided in an embodiment of the present application; Figure 2 This is a second flow chart of a method for controlling the internal temperature of a refrigerator provided in an embodiment of the present application; Figure 3 This is a third flow chart of a method for controlling the internal temperature of a refrigerator provided in an embodiment of the present application; Figure 4 It is a structural schematic diagram of a refrigerator internal temperature control system provided in an embodiment of the present application; Figure 5 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0023] Explanation of the reference numerals: 1. Acquisition module; 2. Processing module; 3. Temperature setting module; 500. Electronic device; 501. Processor; 502. Communication bus; 503. User interface; 504. Network interface; 505. Memory. DETAILED DESCRIPTION
[0024] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0025] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0026] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0027] The present application provides a method for controlling the internal temperature of a refrigerator. Figure 1 , which shows one of the flow charts of a method for controlling the internal temperature of a refrigerator provided in an embodiment of the present application. The method includes steps S1-S5, which are as follows: Step S1: acquiring in real time first commodity images corresponding to all commodities inside the refrigerator collected by various cameras; and acquiring initial environmental data outside the refrigerator collected by multiple sensors.
[0028] Specifically, in this embodiment, the purpose of step S1 is to obtain comprehensive image data of the goods inside the refrigerator and external environment data, so as to provide basic data for subsequent product feature extraction and environmental control. By obtaining the first product image corresponding to all the goods inside the refrigerator collected by each camera in real time, and obtaining the initial environmental data collected by multiple sensors outside the refrigerator, real-time monitoring of the environment inside and outside the refrigerator can be achieved to ensure the timeliness and comprehensiveness of the data.
[0029] Specifically, multiple cameras are installed inside the refrigerator. The location and number of cameras are reasonably configured according to the size and internal structure of the refrigerator to ensure that all product areas in the refrigerator are covered and blind spots are avoided. The camera collects image data of all products inside the refrigerator in real time to form a first product image. The camera needs to have high resolution and good imaging capabilities under low light conditions to ensure image clarity and detail integrity.
[0030] At the same time, multiple sensors are installed on the outside of the refrigerator to monitor the initial environmental data such as temperature and humidity of the external environment in real time. Sensors should be placed in key locations around the refrigerator to fully capture changes in the external environment. Sensor data is transmitted to the control system in real time through wireless or wired transmission, and synchronized with the image data collected by the camera.
[0031] The data collection frequency of the camera and sensor needs to be set according to the actual application scenario, usually set to once per minute or higher to ensure the real-time and continuity of the data. The collected first product image and initial environmental data are processed by the data preprocessing module 2 to remove noise and outliers to ensure data quality.
[0032] Step S2: extracting a product feature vector corresponding to each product based on the first product image.
[0033] In a possible implementation, step S2 specifically includes the following steps: Perform image preprocessing on the first product image to obtain a preprocessed first product image.
[0034] Each commodity is separated from the preprocessed first commodity image to obtain a segmented commodity area corresponding to each commodity.
[0035] The shape features, color features and texture features corresponding to each product are extracted from each segmented product area.
[0036] The shape features, color features, and texture features corresponding to each product are aggregated to obtain a comprehensive feature vector corresponding to each product.
[0037] Each comprehensive feature vector is normalized to obtain a product feature vector corresponding to each product.
[0038] In this embodiment, the purpose of step S2 is to extract the commodity feature vector corresponding to each commodity from the first commodity image acquired in real time. These feature vectors will be used for subsequent commodity type recognition and environmental data matching. By extracting the commodity feature vector, the shape, color, texture and other features of the commodity can be accurately described, thereby providing a reliable data basis for the classification model and realizing accurate commodity recognition and classification.
[0039] Specifically, the first product image is first preprocessed to improve the image quality and the accuracy of feature extraction. In the image preprocessing stage, a denoising technique, such as Gaussian filtering or median filtering, is first applied to remove noise in the image and enhance the clarity of the image. Next, grayscale processing is performed to convert the color image into a grayscale image to simplify subsequent processing steps, and histogram equalization is used to enhance the image contrast, thereby obtaining the preprocessed first product image.
[0040] After obtaining the preprocessed first product image, separate each product from the image. To this end, apply image segmentation techniques such as threshold segmentation, edge detection, and contour detection. First, separate the product area in the image from the background through threshold segmentation. Then, use an edge detection algorithm (such as Canny edge detection) to detect the edges of the product. Next, use contour detection technology (such as findContours function in OpenCV) to obtain the contour of each product, and finally obtain the segmented product area corresponding to each product.
[0041] The shape features, color features and texture features of the products are extracted from the segmented product areas. Shape features include the perimeter, area and compactness of the outline (i.e. the ratio of the square of the perimeter to the area), as well as shape moments (such as Hu moments) and bounding box features (such as the minimum enclosing rectangle). Color features include color histogram, average color and color moments (such as first-order moments, second-order moments and third-order moments), which are used to describe the color distribution and characteristics of the products. Texture features calculate the texture characteristics of the product area such as contrast, homogeneity, energy and entropy through the gray level co-occurrence matrix (GLCM), and the local binary pattern (LBP) describes the texture pattern of the product area.
[0042] The extracted shape features, color features, and texture features are aggregated to form a comprehensive feature vector corresponding to each product. The comprehensive feature vector combines multiple types of feature information, comprehensively describes the characteristics of the product, and enhances the recognition ability of the subsequent classification model. In order to eliminate the scale differences between different features, the comprehensive feature vector is normalized so that its value range is unified within a range, usually normalized to [0, 1] or [-1, 1], so as to obtain the product feature vector corresponding to each product.
[0043] Through the above steps, the product feature vector corresponding to each product is extracted based on the first product image, providing a high-quality data foundation for subsequent product type recognition and environmental data matching. This systematic feature extraction method not only improves the accuracy and comprehensiveness of feature description, but also enhances the reliability and generalization ability of the classification model.
[0044] In summary, step S2 obtains the product feature vector corresponding to each product through image preprocessing, product segmentation, feature extraction and feature aggregation. This implementation process ensures the accuracy and comprehensiveness of the feature data, provides reliable basic data for subsequent product classification and environmental control, and thus improves the accuracy of temperature control inside the refrigerator and the product storage effect.
[0045] Step S3: Based on the feature vectors of each commodity, determine the commodity type corresponding to each commodity.
[0046] In this embodiment, the purpose of step S3 is to accurately determine the commodity type corresponding to each commodity based on the commodity feature vector, so as to provide accurate basic data for subsequent environmental data matching and temperature control. By classifying the commodity feature vectors through the commodity classification model, automatic commodity identification can be achieved, manual intervention can be reduced, and classification accuracy and efficiency can be improved.
[0047] In one possible implementation, refer to Figure 2 , which shows a second flow chart of a method for controlling the internal temperature of a refrigerator provided in an embodiment of the present application. Step S3 specifically includes steps S31-S34: Step S31: input each commodity feature vector into a pre-trained commodity classification model, and output the pre-identified commodity type corresponding to each commodity.
[0048] Specifically, in step S31, first, the feature vectors of each product are input into the pre-trained product classification model. The feature vectors are extracted from the previous image processing step and contain comprehensive features such as the shape, color and texture of the product. These feature vectors are used as input data of the model and are processed by the pre-trained product classification model.
[0049] The model uses a forward propagation algorithm to map the input feature vector to the corresponding product type through calculations in the input layer, hidden layer, and output layer. The pre-trained product classification model may be a convolutional neural network (CNN) with multiple convolutional layers and fully connected layers, which can automatically extract and learn the complex relationships between features for classification. In each layer, the model performs nonlinear transformations through activation functions (such as ReLU) to extract high-order features, and performs dimensionality reduction through pooling layers (such as maximum pooling), and finally obtains the probability distribution of each product type in the output layer.
[0050] The output of the model is a vector containing multiple category probabilities, each probability value corresponds to a product type. These probability values represent the model's confidence in each product type. By selecting the category with the largest probability value, the model outputs the pre-identified product type of the product. This step realizes automated product classification, reduces manual intervention, and improves classification efficiency and accuracy.
[0051] Step S32: performing confidence evaluation on each pre-identified commodity type to obtain the classification confidence corresponding to each commodity.
[0052] Specifically, in step S32, the pre-identified commodity types and their corresponding probability values output by the pre-trained commodity classification model are used as input for confidence evaluation. Each pre-identified commodity type has a corresponding probability value, which represents the confidence of the model in the classification result. In order to obtain the classification confidence, these probability values need to be processed and evaluated.
[0053] Step S33: When the classification confidence corresponding to the commodity is greater than the confidence threshold, the pre-identified commodity type corresponding to the commodity is used as the actual commodity type corresponding to the commodity.
[0054] Specifically, in step S33, by setting a confidence threshold, it is possible to determine whether the classification result is reliable. If the probability value of a pre-identified commodity type is higher than the confidence threshold, the classification result is considered to have a high confidence level; if it is lower than the confidence threshold, the classification result is considered to have a low confidence level and needs further processing.
[0055] In actual operation, a reasonable confidence threshold can be set, such as 0.75, which means that only when the probability value of a certain product type is higher than 0.75, the classification result is considered to have sufficient confidence. For each pre-identified product type, according to its corresponding probability value, calculate and judge whether its classification confidence exceeds the threshold. And when the classification confidence corresponding to the product is greater than the confidence threshold, the pre-identified product type corresponding to the product is used as the actual product type corresponding to the product.
[0056] Step S34: When the classification confidence is not greater than the confidence threshold, the product is marked as an uncertain product type.
[0057] Specifically, in step S33, the purpose of marking uncertain commodity types is to perform special processing on these results. Commodities marked as uncertain commodity types will enter a queue for processing. These commodities may need to be manually reviewed to confirm their types, or reclassified by obtaining more data (such as new images or environmental data). In this way, it can be ensured that the final classification results of all commodities are strictly confirmed, thereby improving the overall classification accuracy and reliability of the system.
[0058] In summary, step S3 accurately determines the actual type of the product by inputting the product feature vector into the pre-trained classification model, classifying confidence evaluation and classifying result processing, providing accurate basic data for subsequent environmental control. This process ensures the high accuracy and reliability of the classification results, and improves the overall effect of refrigerator temperature control and product storage.
[0059] In a possible implementation, before step S31, the method further includes the following steps: Obtain second product images corresponding to multiple products to be trained.
[0060] Based on each second product image, a feature vector to be trained corresponding to each product to be trained is obtained.
[0061] Each to-be-trained commodity is marked with a type to obtain a to-be-trained commodity type corresponding to each to-be-trained commodity.
[0062] Each feature vector to be trained is matched with each commodity type to be trained to construct a commodity classification data set; the commodity classification data set includes multiple feature vectors to be trained and multiple commodity types to be trained, wherein one feature vector to be trained corresponds to one commodity type to be trained.
[0063] The commodity classification data set is divided into model training set, model verification set and model test set.
[0064] Determine the initial model, initial model parameters, and hyperparameters.
[0065] The initial model is trained for a preset number of training cycles to obtain a model to be verified. In each training cycle, the model training set is input into the initial model for training, and the predicted product type is output. Based on the predicted product type and the product type to be trained, the training loss value is calculated, and the initial model parameters are updated through the back propagation algorithm to minimize the training loss value.
[0066] Use the model validation set to validate the model to be validated, evaluate the model performance of the model to be validated and adjust the hyperparameters to obtain the trained model.
[0067] Use the model test set to test the trained model and obtain the test results.
[0068] Based on the test results, determine the pre-trained product classification model.
[0069] In this embodiment, it is first necessary to collect a large number of product images to be trained, and ensure that these images cover as many product types as possible to improve the generalization ability and accuracy of the model. The acquisition of images can be achieved by actual shooting, using public data sets, and web crawling. In actual shooting, you can use a camera to shoot product images at different angles and under different lighting conditions in a supermarket, warehouse, or refrigerator. Use existing public product image data sets, which usually contain a large number of annotated product images and are suitable for model training. At the same time, crawl public product images from the Internet, automatically collect product images through crawler technology, and clean and screen them.
[0070] After obtaining multiple second product images corresponding to the products to be trained, these second product images need to be sorted and labeled. First, the second product images are preprocessed, including denoising, graying and image enhancement, to improve the image quality and the accuracy of feature extraction. Then, the image processing and feature extraction methods are used to extract the feature vectors to be trained corresponding to the products to be trained from each second product image. The feature extraction process includes the extraction and aggregation of the shape features, color features and texture features of the products. The method for obtaining the feature vectors to be trained corresponding to each product to be trained based on each second product image is consistent with the method for extracting the product feature vectors corresponding to each product based on the first product image in the aforementioned embodiment, so it will not be elaborated here.
[0071] In order to ensure the effectiveness and accuracy of model training, each product to be trained needs to be labeled and the corresponding product type to be trained is obtained. This step is crucial because the classification model needs to learn the characteristics of different product types through these labeled data in order to accurately classify them. Labeling can be done manually, or with the help of existing labeling tools and technologies, combined with manual review, to ensure the accuracy of labeling.
[0072] After feature extraction and type labeling, the feature vector to be trained is matched with the product type to be trained. Specifically, for each product to be trained, its feature vector and type label constitute a sample. All samples are aggregated to form a product classification data set containing multiple feature vectors to be trained and product types to be trained. The construction of this data set needs to ensure that the data format of each sample is consistent and can accurately reflect the characteristics and category information of the product.
[0073] The purpose of building a product classification dataset is to ensure that the model can learn the characteristics of different product types through a large number of training samples, thereby improving the classification accuracy of the model. In this way, the model can continuously optimize parameters during the training process, learn more accurate feature representations, and ultimately achieve efficient and accurate product classification in practical applications.
[0074] Next, the product classification data set is divided into model training set, model validation set and model test set. The ratio of model training set, model validation set and model test set is usually 8:1:1.
[0075] Next, we lay the foundation for model training by reasonably selecting the initial model, initial model parameters, and hyperparameters. Reasonable model architecture and parameter settings can effectively improve the model's training effect and classification performance.
[0076] First, determine the architecture of the initial model based on the requirements of the commodity classification task and the characteristics of the data set. For commodity classification problems, commonly used model architectures include deep learning models such as convolutional neural networks (CNNs). Convolutional neural networks have significant advantages in processing image data and can automatically extract hierarchical features of images, making them suitable for commodity classification. When determining the initial model, it is necessary to consider parameters such as the depth of the model, the number of neurons in each layer, and the size and number of convolution kernels.
[0077] After determining the initial model, the next step is to set the initial model parameters and hyperparameters. The initial model parameters include the weights and biases of each layer in the model, which are usually randomly initialized at the beginning of training. Common initialization methods include Xavier initialization and He initialization, which can ensure that the parameters have a good distribution in the initial state, which is conducive to the subsequent gradient descent process.
[0078] Hyperparameters refer to parameters that need to be set in advance during the training process and will not be automatically adjusted during the training process. Common hyperparameters include learning rate, batch size, number of training cycles (epochs), regularization parameters, etc. The learning rate determines the step size of each parameter update, the batch size determines the number of samples used in each iteration, the number of training cycles determines the number of times the entire dataset is trained, and the regularization parameter is used to prevent the model from overfitting.
[0079] When setting the learning rate, you need to consider that a too high learning rate may lead to unstable training, while a too low learning rate may slow down the training speed. Generally speaking, you can optimize the training effect by dynamically adjusting the learning rate during the training process, such as using learning rate decay or adaptive learning rate optimization algorithms (such as Adam optimizer). The batch size should be as large as possible within the scope of computing resources to improve training efficiency.
[0080] After setting the initial model, initial model parameters, and hyperparameters, you can start the model training process. Through the above settings, you can ensure that the model starts training from a reasonable initial state, and gradually optimize the parameters under the appropriate training configuration, and finally obtain a product classification model with excellent performance.
[0081] Determine the preset number of training cycles (epochs) to ensure that the model can iterate multiple times on enough training data to fully learn the characteristics of the data. The number of training cycles should be determined based on the size of the dataset and the complexity of the model, and is usually set to dozens to hundreds of times.
[0082] In each training cycle, the model training set is input into the initial model for training. Each sample in the training set, including the feature vector to be trained and the corresponding product type label to be trained, is input into the model through the forward propagation process. The model calculates based on the input feature vector and outputs the predicted product type. The predicted result is compared with the true label to calculate the training loss value. The commonly used loss function is the cross entropy loss, which can measure the difference between the predicted category and the true category.
[0083] In order to optimize the model parameters, the back propagation algorithm is used to minimize the loss value. Back propagation calculates the gradient of the loss value to the model parameters and updates the weights and biases in the model layer by layer to reduce the prediction error. The model parameters are adjusted using an appropriate optimization algorithm, such as stochastic gradient descent (SGD) or Adam optimizer. After each iteration, the model parameters gradually converge to an optimal state that minimizes the training loss value.
[0084] After multiple rounds of training, a model to be verified is finally obtained. This model performs well on both the training set and the verification set, with high classification accuracy. Through this training process, the model can fully learn the mapping relationship between product features and product types, improving the classification effect.
[0085] After each training cycle, the model validation set is input into the model to be validated to evaluate the model performance. The validation set is a data set that has never been involved in training and is used to test the performance of the model on new data. Through the forward propagation process, the model to be validated predicts each sample in the validation set and outputs the predicted product type. The prediction result is compared with the true label, and the validation loss value and evaluation indicators such as accuracy, precision, recall and F1 score are calculated.
[0086] The performance of the model can be judged by analyzing the validation loss value and the evaluation index. If the validation loss value is low and the evaluation index is high, it means that the model performs well on the validation data and has good generalization ability. If the validation loss value is high or the evaluation index is low, there may be overfitting or underfitting problems, and hyperparameters need to be adjusted for optimization. Common hyperparameter adjustment methods include changing the learning rate, increasing or decreasing the number of model layers, adjusting regularization parameters, etc. Through multiple validations and adjustments, a trained model with the best performance on the validation set is finally obtained.
[0087] The model test set is then input into the trained model for the final evaluation of the model performance. The test set is a data set that is completely independent of the training set and validation set and is used to test the performance of the model on new data. Through the forward propagation process, the trained model predicts each sample in the test set and outputs the predicted product type. The prediction result is compared with the true label, and the test loss value and evaluation indicators such as accuracy, precision, recall and F1 score are calculated.
[0088] By analyzing the test loss value and evaluation index, we can judge the performance of the model in practical applications. If the test loss value is low and the evaluation index is high, it means that the model performs well on new data and has good generalization ability and practical application value. The test results will serve as the basis for evaluating the final performance of the model to ensure the reliability and effectiveness of the model in practical applications.
[0089] Finally, based on the test results of the previous steps, analyze the performance of the trained model on the test set. If the model has a low loss value on the test set and a high evaluation index, it means that the model has good performance and generalization ability in practical applications. By comprehensively considering the test loss value and various evaluation indicators, determine an optimal pre-trained product classification model.
[0090] Step S4: Based on each commodity type, determine relevant environmental data corresponding to each commodity type from a plurality of initial environmental data.
[0091] In this embodiment, the purpose of step S4 is to determine the relevant environmental data corresponding to each commodity type from the multiple initial environmental data based on each commodity type. Through this process, the most suitable storage environment data can be provided for different types of commodities, thereby optimizing the temperature control inside the refrigerator and achieving accurate control of the temperature inside the refrigerator.
[0092] In a possible implementation, step S4 specifically includes the following steps: Determine storage requirements corresponding to each commodity type; and determine relevant environmental data corresponding to each commodity type from a plurality of initial environmental data based on each storage requirement.
[0093] First, determine the storage requirements for each commodity type. This step requires establishing a mapping relationship between commodity types and their optimal storage environment. Generally, different types of commodities have different requirements for storage environments. For example, fruits and vegetables may require higher humidity and lower temperature, while dairy products and meat may require relatively low humidity and temperature. By consulting relevant literature, industry standards and expert opinions, a database of commodity types and storage requirements is established, which lists in detail the temperature, humidity and other parameters of each commodity type under optimal storage conditions.
[0094] After establishing the mapping relationship between commodity types and storage requirements, the next step is to determine the relevant environmental data corresponding to each commodity type from multiple initial environmental data. The initial environmental data is collected in real time by multiple sensors, including environmental parameters such as temperature and humidity outside and inside the refrigerator. By analyzing these initial environmental data, the storage status of each commodity type under the current environmental conditions can be identified.
[0095] Specifically, based on the storage requirements of each product type, the relevant environmental parameters are extracted from the initial environmental data. For example, if a certain product type needs to be stored in a low-temperature and high-humidity environment, the system will extract the current temperature and humidity data inside the refrigerator from the initial environmental data, compare these data with the optimal storage conditions, and determine whether environmental adjustments are needed.
[0096] In this way, the environmental conditions inside the refrigerator can be monitored and adjusted in real time to ensure that each product is in its optimal storage environment. The system screens and matches the initial environmental data according to the different types of goods, extracts the environmental data related to each type of goods, and forms a comprehensive set of environmental parameters.
[0097] Through the above implementation steps, it is successfully realized to determine the relevant environmental data from multiple initial environmental data based on the product type. This process establishes a mapping relationship between product type and storage requirements, extracts relevant parameters from the initial environmental data, and provides the most suitable storage environment data for different types of products, thereby optimizing the temperature control of the refrigerator.
[0098] Step S5: Based on various relevant environmental data, the storage temperature inside the refrigerator is set.
[0099] In this embodiment, the purpose of step S5 is to set the storage temperature inside the refrigerator based on various relevant environmental data. Through this process, it can be ensured that the temperature inside the refrigerator is adapted to the optimal storage requirements of different types of goods, thereby achieving accurate control of the temperature inside the refrigerator.
[0100] In one possible implementation, refer to Figure 3 , which shows a third flow chart of a method for controlling the internal temperature of a refrigerator provided in an embodiment of the present application. Step S5 specifically includes steps S51-S56: Step S51: Determine multiple environmental risk factors corresponding to each commodity type.
[0101] Specifically, in step S51, first, it is necessary to analyze the specific requirements of different commodity types for the storage environment. Each commodity type has different sensitivities to environmental factors such as temperature, humidity, and light when stored in a refrigerated environment. For example, fruits and vegetables generally require a higher humidity and a moderately low temperature environment, while dairy products and meat require a relatively low temperature and lower humidity. By consulting relevant literature, industry standards, and expert opinions, the environmental parameters required for different commodity types under optimal storage conditions can be determined.
[0102] Next, based on the above analysis, the environmental risk factors corresponding to each product type are determined. These risk factors include but are not limited to temperature, humidity, and light intensity. Specifically, temperature is one of the most critical risk factors because it directly affects the freshness and shelf life of the product; humidity is equally important, especially for products that are prone to water loss, such as vegetables and fruits; light intensity may also be an important risk factor for some products, such as dairy products, because light may cause deterioration or loss of nutrients.
[0103] Step S52: determining the initial environmental risk data corresponding to each environmental risk factor from a plurality of relevant environmental data, and determining the importance weight corresponding to each environmental risk factor.
[0104] Specifically, in step S52, for each commodity type, initial environmental risk data related to its environmental risk factors are extracted. For example, if the main environmental risk factors of a commodity type are temperature and humidity, then the temperature and humidity data inside the current refrigerator are extracted from the sensor data as the initial environmental risk data for the commodity type.
[0105] Then, according to the analysis results in step S51, the importance weights of various environmental risk factors are determined. These weights reflect the importance of different environmental risk factors to the commodity storage environment. Through expert evaluation, literature review and historical data analysis, a weight value can be assigned to each environmental risk factor. For example, for some commodity types, the weight of temperature may be 0.6, while the weight of humidity may be 0.4. These weights will be used in subsequent environmental risk assessments to ensure that the impact of different risk factors on the comprehensive environmental risk is reasonably considered.
[0106] Step S53: normalize the multiple initial environmental risk data to obtain multiple normalized environmental risk data.
[0107] Specifically, the goal of normalization is to convert all initial environmental risk data into the same range, usually [0, 1] or [-1, 1]. Common normalization methods include Min-Max Normalization and Z-score normalization. In this embodiment, the Min-Max Normalization method is used, and its formula is as follows: x′=(x−x min ) / (x max −x min ), where x represents a measurement value in the initial environmental risk data, x′ represents the normalized data, and x min and x max They represent the minimum and maximum values of the data among all the measured values.
[0108] In actual operation, for each environmental risk factor, the minimum and maximum values of all measured values are calculated. Then, each initial environmental risk data is normalized according to the above formula to obtain normalized environmental risk data. This process ensures that all environmental risk data are converted to the same scale range, which is convenient for subsequent comprehensive analysis and risk assessment.
[0109] Step S54: multiply the normalized environmental risk data corresponding to each environmental risk factor by the importance weight to obtain a single risk score corresponding to each environmental risk factor.
[0110] Specifically, for each environmental risk factor, the formula for calculating its single risk score is as follows: Ri=Wi×Ni, where Ri represents the single risk score of the i-th environmental risk factor, Wi represents the importance weight of the i-th environmental risk factor, and Ni represents the normalized environmental risk data of the i-th environmental risk factor.
[0111] Step S55: Add multiple single risk scores to obtain a first environmental risk score corresponding to each commodity type.
[0112] Specifically, in actual operation, for each commodity type, the single risk scores of all its environmental risk factors are obtained in turn, and these scores are accumulated to obtain a total risk score, namely the first environmental risk score. This score combines the impact of all environmental risk factors and reflects the overall risk level of the current storage environment for this commodity type.
[0113] By calculating the first environmental risk score, the comprehensive risk of each commodity type under the current environmental conditions can be clarified. These risk scores will be used for subsequent storage temperature settings to ensure that the temperature control inside the refrigerator can best adapt to the optimal storage requirements of different commodity types.
[0114] Step S56: Determine the storage temperature based on each first environmental risk score.
[0115] In a possible implementation, step S56 specifically includes the following steps: Determine the mapping relationship between different environmental risk score intervals and different storage temperatures, where one environmental risk score interval corresponds to one storage temperature.
[0116] A second environmental risk score is determined from each of the first environmental risk scores, wherein the second environmental risk score is greater than the remaining first environmental risk scores.
[0117] Based on the environmental risk score interval in which the second environmental risk score is located and the mapping relationship, the storage temperature is determined.
[0118] In this embodiment, the purpose of step S56 is to determine the storage temperature inside the refrigerator based on each first environmental risk score. Through this process, it can be ensured that the temperature setting inside the refrigerator can meet the optimal storage requirements of different types of goods, thereby achieving accurate control of the temperature inside the refrigerator.
[0119] First, it is necessary to determine the mapping relationship between different environmental risk score ranges and different storage temperatures. To do this, it is necessary to analyze the performance of various commodity types under different environmental conditions, and determine the optimal storage temperature range under different environmental risk levels through experiments and industry standards. Establish a mapping table between environmental risk score ranges and storage temperatures so that each risk score range corresponds to a specific storage temperature range. For example, an environmental risk score between 0.0 and 0.2 may correspond to 4 degrees Celsius, between 0.2 and 0.4 may correspond to 5 degrees Celsius, and so on.
[0120] Next, based on the first environmental risk scores of each commodity type calculated in step S55, a comprehensive environmental risk score is determined. Specifically, the maximum value of the first environmental risk scores of each commodity type needs to be selected as the comprehensive environmental risk score, so as to ensure that the storage temperature can meet the most stringent requirements of all commodity types.
[0121] Based on the determined comprehensive environmental risk score, the storage temperature inside the refrigerator is determined by referring to the previously established mapping table of environmental risk score intervals and storage temperatures. The specific operation is to find the interval where the comprehensive environmental risk score is located, and find the corresponding storage temperature according to the mapping table. For example, if the comprehensive environmental risk score is 0.35, then according to the mapping table, the storage temperature of the refrigerator is determined to be 5 degrees Celsius.
[0122] Finally, the determined storage temperature is set as the target temperature inside the refrigerator, and the temperature control system of the refrigerator is adjusted to ensure that the temperature reaches and stabilizes at the set value. Through this process, all types of goods can be stored in the refrigerator in the best conditions, thereby achieving precise control of the temperature inside the refrigerator.
[0123] Reference Figure 4 , which shows a structural schematic diagram of a refrigerator internal temperature control system provided by an embodiment of the present application, the system includes an acquisition module 1, a processing module 2 and a temperature setting module 3; the acquisition module 1 is used to acquire in real time a first commodity image corresponding to all commodities inside the refrigerator collected by each camera; and to acquire initial environmental data collected by multiple sensors outside the refrigerator; the processing module 2 is used to extract a commodity feature vector corresponding to each commodity based on the first commodity image; the processing module 2 is also used to determine the commodity type corresponding to each commodity based on each commodity feature vector; the processing module 2 is also used to determine, based on each commodity type, relevant environmental data corresponding to each commodity type from multiple initial environmental data; the temperature setting module 3 is used to set the storage temperature inside the refrigerator based on each relevant environmental data.
[0124] In a possible implementation, the processing module 2 is further used to perform image preprocessing on the first product image to obtain a preprocessed first product image; the processing module 2 is further used to separate each product from the preprocessed first product image to obtain a segmented product area corresponding to each product; the processing module 2 is further used to extract the shape features, color features and texture features corresponding to each product from each segmented product area; the processing module 2 is further used to aggregate the shape features, color features and texture features corresponding to each product to obtain a comprehensive feature vector corresponding to each product; the processing module 2 is further used to normalize each comprehensive feature vector to obtain a product feature vector corresponding to each product.
[0125] In a possible implementation, the processing module 2 is further used to input each commodity feature vector into a pre-trained commodity classification model, and output a pre-identified commodity type corresponding to each commodity; the processing module 2 is further used to perform confidence assessment on each pre-identified commodity type to obtain a classification confidence corresponding to each commodity; the processing module 2 is further used to use the pre-identified commodity type corresponding to the commodity as the actual commodity type corresponding to the commodity when the classification confidence corresponding to the commodity is greater than a confidence threshold; the processing module 2 is further used to mark the commodity as an uncertain commodity type when the classification confidence is not greater than the confidence threshold.
[0126] In a possible implementation, the acquisition module 1 is further used to acquire a plurality of second product images corresponding to the products to be trained; the processing module 2 is further used to obtain a feature vector to be trained corresponding to each product to be trained based on each second product image; the processing module 2 is further used to type-mark each product to be trained to obtain a product type to be trained corresponding to each product to be trained; the processing module 2 is further used to correspond each feature vector to be trained to each product type to be trained to construct a product classification data set; the product classification data set includes a plurality of feature vectors to be trained and a plurality of product types to be trained, wherein one feature vector to be trained corresponds to one product type to be trained; the processing module 2 is further used to divide the product classification data set to obtain a model training set, a model verification set, and a model test set; the processing module 2, is also used to determine the initial model, initial model parameters and hyperparameters; processing module 2, is also used to train the initial model through a preset number of training cycles to obtain a model to be verified; in each training cycle, the model training set is input into the initial model for training, the predicted commodity type is output, and the training loss value is calculated based on the predicted commodity type and the commodity type to be trained, and the initial model parameters are updated through the back propagation algorithm to minimize the training loss value; processing module 2, is also used to use the model verification set to verify the model to be verified, evaluate the model performance of the model to be verified and adjust the hyperparameters to obtain a trained model; processing module 2, is also used to use the model test set to test the trained model to obtain a test result; processing module 2, is also used to determine the pre-trained commodity classification model based on the test result.
[0127] In a possible implementation, the processing module 2 is further used to determine the storage requirements corresponding to each commodity type; the processing module 2 is further used to determine the relevant environmental data corresponding to each commodity type from multiple initial environmental data based on each storage requirement.
[0128] In a possible implementation, the temperature setting module 3 is also used to determine multiple environmental risk factors corresponding to each commodity type; the temperature setting module 3 is also used to determine the initial environmental risk data corresponding to each environmental risk factor from multiple related environmental data, and determine the importance weight corresponding to each environmental risk factor; the temperature setting module 3 is also used to normalize the multiple initial environmental risk data to obtain multiple normalized environmental risk data; the temperature setting module 3 is also used to multiply the normalized environmental risk data corresponding to each environmental risk factor by the importance weight to obtain a single risk score corresponding to each environmental risk factor; the temperature setting module 3 is also used to add multiple single risk scores to obtain a first environmental risk score corresponding to each commodity type; based on each first environmental risk score, the storage temperature is determined.
[0129] In a possible implementation, the temperature setting module 3 is also used to determine the mapping relationship between different environmental risk score intervals and different storage temperatures, wherein one environmental risk score interval corresponds to one storage temperature; the temperature setting module 3 is also used to determine the second environmental risk score from each first environmental risk score, wherein the second environmental risk score is greater than the remaining first environmental risk scores; the temperature setting module 3 is also used to determine the storage temperature based on the environmental risk score interval in which the second environmental risk score is located and the mapping relationship.
[0130] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0131] The present application also discloses an electronic device. Figure 5 , Figure 5 The electronic device 500 may include: at least one processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .
[0132] The communication bus 502 is used to realize the connection and communication between these components.
[0133] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.
[0134] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0135] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 501 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 501, and it can be implemented separately through a chip.
[0136] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 505 may optionally be at least one storage device located away from the aforementioned processor 501. Refer to Figure 5 , the memory 505 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module and an application program.
[0137] exist Figure 5In the electronic device 500 shown, the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 501 can be used to call an application stored in the memory 505, and when executed by one or more processors 501, the electronic device 500 executes one or more methods in the above-mentioned embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0138] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0139] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0140] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0141] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0143] The above are only exemplary embodiments of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.
[0144] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for controlling the internal temperature of a refrigerator, characterized in that: The method comprises: Acquire in real time first commodity images corresponding to all commodities in the refrigerator collected by each camera; and acquire initial environmental data collected by multiple sensors outside the refrigerator; Extracting a product feature vector corresponding to each of the products based on the first product image; Determining the commodity type corresponding to each of the commodities based on the commodity feature vectors; Based on each of the commodity types, determining relevant environmental data corresponding to each of the commodity types from the plurality of initial environmental data; Based on each of the relevant environmental data, the storage temperature inside the refrigerator is set.
2. The method according to claim 1, characterized in that The extracting, based on the first product image, a product feature vector corresponding to each of the products specifically includes: performing image preprocessing on the first product image to obtain a preprocessed first product image; Separating each of the commodities from the preprocessed first commodity image to obtain a segmented commodity area corresponding to each of the commodities; Extracting shape features, color features, and texture features corresponding to each of the products from each of the segmented product areas; Aggregating the shape features, the color features, and the texture features corresponding to each of the commodities to obtain a comprehensive feature vector corresponding to each of the commodities; Each of the comprehensive feature vectors is normalized to obtain the product feature vector corresponding to each of the products.
3. The method according to claim 1, characterized in that: The commodity types include actual commodity types and uncertain commodity types; and determining the commodity types corresponding to the commodities based on the commodity feature vectors specifically includes: Inputting each of the commodity feature vectors into a pre-trained commodity classification model, and outputting a pre-identified commodity type corresponding to each of the commodities; Performing confidence evaluation on each of the pre-identified commodity types to obtain a classification confidence corresponding to each of the commodities; When the classification confidence corresponding to the commodity is greater than the confidence threshold, taking the pre-identified commodity type corresponding to the commodity as the actual commodity type corresponding to the commodity; When the classification confidence is not greater than the confidence threshold, the commodity is marked as the uncertain commodity type.
4. The method according to claim 3, characterized in that Before inputting each of the commodity feature vectors into a pre-trained commodity classification model and outputting a pre-identified commodity type corresponding to each of the commodities, the method further includes: Obtaining second product images corresponding to a plurality of products to be trained; Based on each of the second product images, obtaining a feature vector to be trained corresponding to each of the products to be trained; Marking each of the to-be-trained commodities by type to obtain the to-be-trained commodity type corresponding to each of the to-be-trained commodities; Corresponding each of the feature vectors to be trained to each of the commodity types to be trained to construct a commodity classification data set; the commodity classification data set includes a plurality of the feature vectors to be trained and a plurality of the commodity types to be trained, wherein one feature vector to be trained corresponds to one commodity type to be trained; Dividing the commodity classification data set into a model training set, a model verification set, and a model test set; Determine the initial model, initial model parameters, and hyperparameters; The initial model is trained for a preset number of training cycles to obtain a model to be verified; in each training cycle, the model training set is input into the initial model for training, the predicted commodity type is output, and based on the predicted commodity type and the commodity type to be trained, a training loss value is calculated, and the initial model parameters are updated through a back propagation algorithm to minimize the training loss value; Using the model validation set to validate the model to be validated, evaluating the model performance of the model to be validated and adjusting the hyperparameters to obtain a trained model; Using the model test set to test the trained model to obtain a test result; Based on the test result, the pre-trained product classification model is determined.
5. The method according to claim 1, characterized in that The determining, based on each of the commodity types, relevant environmental data corresponding to each of the commodity types from the plurality of initial environmental data specifically includes: Determine storage requirements corresponding to each of the commodity types; Based on each of the storage requirements, relevant environmental data corresponding to each of the commodity types is determined from a plurality of the initial environmental data.
6. The method according to claim 1, characterized in that The step of setting the storage temperature inside the refrigerator based on each of the relevant environmental data specifically includes: Determining a plurality of environmental risk factors corresponding to each of the commodity types; Determining initial environmental risk data corresponding to each environmental risk factor from the plurality of related environmental data, and determining the importance weight corresponding to each environmental risk factor; Normalizing the plurality of initial environmental risk data to obtain a plurality of normalized environmental risk data; Multiplying the normalized environmental risk data corresponding to each of the environmental risk factors by the importance weight to obtain a single risk score corresponding to each of the environmental risk factors; Adding a plurality of the single risk scores to obtain a first environmental risk score corresponding to each of the commodity types; Based on the respective first environmental risk scores, the storage temperature is determined.
7. The method according to claim 6, characterized in that The determining the storage temperature based on each of the first environmental risk scores specifically includes: Determine a mapping relationship between different environmental risk score intervals and different storage temperatures, wherein one environmental risk score interval corresponds to one storage temperature; Determine a second environmental risk score from each of the first environmental risk scores, wherein the second environmental risk score is greater than the remaining first environmental risk scores; The storage temperature is determined based on the environmental risk score interval in which the second environmental risk score is located and the mapping relationship.
8. A temperature control system inside a refrigerator, characterized in that: The system comprises: an acquisition module, a processing module and a temperature setting module; The acquisition module is used to acquire in real time the first commodity images corresponding to all commodities inside the refrigerator collected by each camera; and to acquire the initial environmental data outside the refrigerator collected by multiple sensors; The processing module is used to extract a commodity feature vector corresponding to each of the commodities based on the first commodity image; The processing module is further used to determine the commodity type corresponding to each of the commodities based on each of the commodity feature vectors; The processing module is further used to determine, based on each commodity type, relevant environmental data corresponding to each commodity type from the plurality of initial environmental data; The temperature setting module is used to set the storage temperature inside the refrigerator based on each of the relevant environmental data.
9. An electronic device, characterized in that: The electronic device (500) comprises a processor (501), a memory (505), a user interface (503) and a network interface (504), wherein the memory (505) is used to store instructions, the user interface (503) and the network interface (504) are used to communicate with other devices, and the processor (501) is used to execute the instructions stored in the memory (505) so that the electronic device (500) executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.
