Brown School, Washington University in St. Louis, St. Louis, MO 63130, USA.
School of Medicine, Washington University in St. Louis, St. Louis, MO 63130, USA.
Nutrients. 2024 Apr 26;16(9):1294. doi: 10.3390/nu16091294.
Nuts are nutrient-dense foods and can be incorporated into a healthy diet. Artificial intelligence-powered diet-tracking apps may promote nut consumption by providing real-time, accurate nutrition information but depend on data and model availability. Our team developed a dataset comprising 1380 photographs, each in RGB color format and with a resolution of 4032 × 3024 pixels. These images feature 11 types of nuts that are commonly consumed. Each photo includes three nut types; each type consists of 2-4 nuts, so 6-9 nuts are in each image. Rectangular bounding boxes were drawn using a visual geometry group (VGG) image annotator to facilitate the identification of each nut, delineating their locations within the images. This approach renders the dataset an excellent resource for training models capable of multi-label classification and object detection, as it was meticulously divided into training, validation, and test subsets. Utilizing transfer learning in Python with the IceVision framework, deep neural network models were adeptly trained to recognize and pinpoint the nuts depicted in the photographs. The ultimate model exhibited a mean average precision of 0.7596 in identifying various nut types within the validation subset and demonstrated a 97.9% accuracy rate in determining the number and kinds of nuts present in the test subset. By integrating specific nutritional data for each type of nut, the model can precisely (with error margins ranging from 0.8 to 2.6%) calculate the combined nutritional content-encompassing total energy, proteins, carbohydrates, fats (total and saturated), fiber, vitamin E, and essential minerals like magnesium, phosphorus, copper, manganese, and selenium-of the nuts shown in a photograph. Both the dataset and the model have been made publicly available to foster data exchange and the spread of knowledge. Our research underscores the potential of leveraging photographs for automated nut calorie and nutritional content estimation, paving the way for the creation of dietary tracking applications that offer real-time, precise nutritional insights to encourage nut consumption.
坚果是营养密集型食物,可以纳入健康饮食中。人工智能驱动的饮食追踪应用程序可以通过提供实时、准确的营养信息来促进坚果的消费,但这依赖于数据和模型的可用性。我们的团队开发了一个数据集,包含 1380 张照片,每张照片都为 RGB 彩色格式,分辨率为 4032×3024 像素。这些图像包含 11 种常见食用坚果。每张照片包含三种坚果类型;每种类型由 2-4 个坚果组成,因此每张图像包含 6-9 个坚果。使用视觉几何组 (VGG) 图像标注器绘制矩形边界框,以方便识别每个坚果,并在图像内标记其位置。这种方法使数据集成为训练能够进行多标签分类和目标检测的模型的极好资源,因为它被精心划分为训练、验证和测试子集。我们在 Python 中使用 IceVision 框架进行迁移学习,成功训练了深度神经网络模型来识别和定位照片中的坚果。最终模型在验证子集中识别各种坚果类型的平均准确率为 0.7596,并在测试子集中确定坚果数量和种类的准确率达到 97.9%。通过为每种坚果类型集成特定的营养数据,该模型可以精确(误差范围在 0.8 到 2.6%之间)计算照片中显示的坚果的综合营养含量——总能量、蛋白质、碳水化合物、脂肪(总脂肪和饱和脂肪)、纤维、维生素 E 以及镁、磷、铜、锰和硒等必需矿物质。我们还将数据集和模型都公开,以促进数据交换和知识传播。我们的研究强调了利用照片自动估算坚果卡路里和营养成分的潜力,为创建提供实时、精确营养洞察的饮食追踪应用程序铺平了道路,以鼓励坚果消费。