## 2 Materials and Methods  
### Image Acquisition and Processing  
In this study, a unique database containing 2260 tomato images was developed. Of these, 700 images were taken in greenhouses in Niigata (Niigata Prefecture, Japan). The remaining 1560 images were carefully selected from various publicly available sources, including Kaggle and Github [29; 30; 31], to ensure the greatest representativeness and diversity. During the selection, special attention was paid to aspects such as tomato ripeness, lighting conditions, shooting angles, and background features, as demonstrated in Figure 1. As a result, the database covers images of tomatoes grown under a variety of conditions, including greenhouse conditions. This approach to database compilation was deliberately chosen to increase the reliability and universality of the analysis results. The data-labeling process involved both automatic and manual methods, with initial labeling performed by a pre-trained CNN model and subsequent manual validation by agricultural experts. We established clear inclusion criteria, focusing on healthy, mature tomatoes under different light conditions, and excluded any images that were blurred or contained multiple overlapping fruits. This approach ensures the relevance and applicability of our dataset to real-world agricultural scenarios, addressing the limitations of existing datasets in representing the diverse conditions encountered in tomato harvesting. The images were standardized and underwent a number of preprocessing steps to ensure the uniformity of resolution and brightness. To preserve quality, each image was resized to 224 \(\times\) 224 pixels using modern interpolation techniques. The pixel intensities  
Figure 1: Examples of dataset images. were normalized to a maximum value of 255. These processes were implemented in Python using OpenCV and scikit-image libraries. The methodology developed in this study was based on a CNN, which was chosen for its effectiveness in pattern recognition tasks. The CNN consisted of several convolutional layers with rectified linear unit (ReLU) feature activation, max-pooling layers and fully connected layers for feature extraction, dimensionality reduction, and classification, respectively. The dataset was divided into training (80%), validation (10%), and test (10%) subsets. Training was performed in batches and after each epoch, performance on the validation set was evaluated to fine-tune the model and prevent overfitting. A personal computer (Intel i7, 3.60 GHz, 32 GB DDR4, GeForce RTX 2080) running the Windows 11 operating system was used as the computing machine. The Python programming language was used to build the system. The reproductive structure of a tomato is illustrated in Figure 2. It consists of several biologically distinct components that link the main stem to the fruit. These components include the peduncle, abscission region, and sepal. The branch emanating from the main stem bears one or more pedicles, from each of which a separate fruit develops [32]. Anatomically, the pedicel is divided into distal and proximal parts relative to the abscission zone. This zone is where the physiological detachment of the mature fruit occurs through the abscission process [33]. In the context of developing robotic harvesting systems, determining the center of gravity of an object is a key task. This information is critical for ensuring the balance and stability of the robot, particularly when manipulators or rakes are used to lift and move the crop. Accurate information about the location of the center of gravity allows control and manipulation to be optimized, which minimizes the risk of crop damage and improves harvesting accuracy. Additionally, this information contributes to energy efficiency by allowing the robot to move more economically without wasting unnecessary energy on maintaining balance or adjusting its position. Determining the center of gravity is also important for adapting robotic systems to various types of crops, which can vary significantly in size, shape, and weight.