Date fruits are the most common fruit in the Middle East and North Africa. There are a wide variety of dates with different types, colors, shapes, tastes, and nutritional values. Classifying, identifying, and recognizing dates would play a crucial role in the agriculture, commercial, food, and health sectors. Nevertheless, there is no or limited work to collect a reliable dataset for many classes. In this paper, we collected the dataset of date fruits by picturing dates from primary environments: farms and shops (e.g., online or local markets). The combined dataset is unique due to the multiplicity of items. To our knowledge, no dataset contains the same number of classes from natural environments. The collected dataset has 27 classes with 3228 images. The experimental results presented are based on five stages. The first stage applied traditional machine learning algorithms for measuring the accuracy of features based on pixel intensity and color distribution. The second stage applied a deep transfer learning (TL) model to select the best model accuracy of date classification. In the third stage, the feature extraction part of the model was fine-tuned by applying different retrained points to select the best retraining point. In the fourth stage, the fully connected layer of the model was fine-tuned to achieve the best classification configurations of the model. In the fifth stage, regularization was applied to the classification layer of the best-selected model from the fourth stage, where the validation accuracy reached 97.21% and the best test accuracy was 95.21%.
Breast cancer significantly affects people’s health globally, making early and accurate diagnosis vital. While ultrasound imaging is safe and non-invasive, its manual interpretation is subjective. This study explores machine learning (ML) techniques to improve breast ultrasound image segmentation, comparing models trained on combined versus separate classes of benign and malignant tumors. The YOLOv8 object detection algorithm is applied to the image segmentation task, aiming to capitalize on its robust feature detection capabilities. We utilized a dataset of 780 ultrasound images categorized into benign and malignant classes to train several deep learning (DL) models: UNet, UNet with DenseNet-121, VGG16, VGG19, and an adapted YOLOv8. These models were evaluated in two experimental setups—training on a combined dataset and training on separate datasets for benign and malignant classes. Performance metrics such as Dice Coefficient, Intersection over Union (IoU), and mean Average Precision (mAP) were used to assess model effectiveness. The study demonstrated substantial improvements in model performance when trained on separate classes, with the UNet model’s F1-score increasing from 77.80 to 84.09% and Dice Coefficient from 75.58 to 81.17%, and the adapted YOLOv8 model achieving an F1-score improvement from 93.44 to 95.29% and Dice Coefficient from 82.10 to 84.40%. These results highlight the advantage of specialized model training and the potential of using advanced object detection algorithms for segmentation tasks. This research underscores the significant potential of using specialized training strategies and innovative model adaptations in medical imaging segmentation, ultimately contributing to better patient outcomes.