# Developing a Robust Training Dataset for AI-Driven Architectural Spatial Layout Generation
## 3 Methodology
### Experiment
#### 4.2.2 Data Training and Testing  
The datasets for training and testing comprised 5524 and 1380 samples, respectively, which were split in an 8:2 ratio. The parameters designated for training encompassed a batch size of 64, a subdivision of 16, dimensions of 416 \(\times\) 416 for height and width, and 78 filters. Test accuracy was ascertained using a confusion matrix [28; 29]. This matrix consists of two rows and two columns delineating the true positives, false positives, false negatives, and true negatives [29]. When the actual true matches the predicted true, it becomes a true positive (\(TP\)). When the actual false is matched with the predicted true, it becomes a false positive (\(FP\)). When the actual true is matched with the predicted false, it becomes a false negative (\(FN\)). When an actual false result matches a predicted false result, it becomes a true negative (\(TN\)). The unique truth count (UTC) from the 1380 test data points was 52,253. Precision is calculated in Equation (1) as the ratio of how many positive predictions were correct (positive predictive value), as follows:  
\[Precision=\frac{true\ positives}{predicted\ positives}=\frac{TP}{TP+FP} \tag{1}\]  
The evaluation metrics for the space classes are listed in Table 7. The \(TP\) and \(FP\) values were 19,528 and 2359, respectively, with an average precision of 0.873. The kitchen had the highest precision at 0.971, followed by the bedroom (0.962), stairs room (0.954), and living room (0.949). By contrast, spaces such as laundry rooms (0.723), utility rooms (0.728), and pantry rooms (0.747), which are intrinsic to households but lack distinguishing features, registered lower precision scores. The kitchen had high precision because the detected classes were small and the number of incorrect answers was small. Table 8 presents the evaluation metrics for the central class. Here, the \(TP\) and \(FP\) were 27,107 and 2573, respectively, with an average precision of 0.89. Single doors had precision scores of 0.958, followed by double doors (0.921) and windows (0.901). These central classes demonstrated high precision owing to their distinct features and the prevalence of their detection. Sliding doors were occasionally misclassified as windows. The lower precision  
Figure 7: Creating training data using an annotation tool. of the opening classes can be explained by the lack of distinct features. Of the 52,253 UTCs, 686 were not detected. Recall is the percentage of correct predictions of actual positives (true positive rate), calculated using Equation (2). The _TP_ was 46,635, the _FN_ was 5618, and the recall was 0.89. \[Recall(Sensitivity)=\frac{true\ positives}{all\ positives}=\frac{TP}{TP+FN} \tag{2}\]  
The bounding box detection rate is given by Equation (3): the _TP_ was 46,635, the _FP_ was 4932, and the UTC was 52,253, respectively, resulting in a detection rate of 0.99. This signifies that even when classes were not precisely matched within the bounding box, 99% of the detections were feasible. \[Detection\ rate=\frac{actual\ detected\ value}{unique\ truth\ count}=\frac{TP+FP}{UTC} \tag{3}\]  
The performance of the algorithm for object detection was evaluated using the mAP, as shown in Equation (4). Following the establishment of an IoU threshold of 0.5, the test yielded an mAP of 0.85. This score surpasses those documented in prior studies [11; 18; 30]. The results of the algorithm's performance for data testing are shown in Figure 8.  
\[mAP=\frac{1}{N}{\sum_{i=1}^{N}AP_{i}} \tag{4}\]