Semantic algorithm for land segmentation and building recognition to protect the Egyptian cultıvated
* Author to whom correspondence should be addressed.
Sigma Journal of Engineering and Natural Sciences 2026, Vol. 44, Issue 1, pp. 360-374; doi.org/10.14744/sigma.2026.1987
Abstract
Keywords: AI; Building Recognition; Deep Learning; Image Segmentation; Land Classification; Multi Passes Networks; Neural Networks; Semantic Segmentation; U-Net
Introduction
Monitoring the rapid growth of illegal buildings is critical for protecting Egypt’s agricultural lands. By 2020, approximately 2.8 million unauthorized buildings had been documented, along with 396,087 illegal floors and 1.7 million unauthorized units [1,2]. Across all governorates, illegal structures are estimated at nearly 20 million, with significant concentrations in Cairo and Giza. Daily monitoring of land use modifications using aerial imagery can help to distinguish between ‘legitimate’ and ‘illegal’ buildings, assist authorities to pinpoint new construction and assist in the planning of land use. But the conventional field practices that focus on site examination and laboratory analysis are too costly, inconvenient, and time-consuming [3]. These drawbacks render standard methodologies impracticable for the application to large-scale monitoring when focusing on densely populated urban and agriculture intensive areas. Unmanned aerial vehicles (UAVs) offer a cost-effective and practical alternative to land monitoring [4,5]. UAVs have been developed that provide a high resolution for remote sensing and wide range data collection, which is extremely useful for the accurate assessment of data types including building types, crop coverage and terrain composition [6–8], making them flexible to use. Egypt can be used for both estimating the effect of illegal construction on agriculture grounds through UAV-based survey and for a clear indication in identifying sites that are allocated for legally developed developments. Nevertheless, existing survey methods have become quite costly and may lack objective features [9,10]; the use of advanced technology such as artificial intelligence (AI) and deep learning in large scale image classification and building footprint analysis is now a necessity. Recent development in AI such as convolutional neural network (CNN) has shown improvement in accuracy for land classification and for segmentation tasks [11–13]. For example, Wei et al. Integrating hyperspectral imagery and conditional random field-based fusion for crop classification resulted in an accuracy of 95.29% [14]. Similarly, Yamamoto et al. [15] applied CNNs for segmentation of sugar beet plants with outstanding performance. Integrating UAV data with AI-based systems, we can obtain high-resolution segmentation and classification for monitoring urbanization expansion and its effect on agricultural lands. These technologies empower automatic systems that are scalable, accurate, replicable and suitable in a variety of local and environmental conditions. Informed by these enhancements, this work introduces a machine based system utilizing U-Net for segmentation and CNN for classification. Thus the approach that is proposed uses UAV-acquired images to differentiate the legal and illegal buildings and also tackles the challenges with data imbalance, image resolution varying with these objects and complexity of urban scenarios in general. From the implementation of the system into eight Egyptian governorates – including Alexandria in northern Egypt and to
the agriculturally advanced Delta region in northern Egypt, it becomes clear that the system has the potential to serve as an effective tool to protect Egypt’s cultivated lands and enrich its urban infrastructure.
Literature Review
With respect to computer system development, AI refers to the ability of a computer system to perform tasks that usually require human intelligence [16]. Deep learning, therefore, is an approach of machine learning that employs artificial neural networks with multiple hidden layers sandwiched between the input and output layers [17]. Inspired by the brain’s multi-layered neural circuits, these AI neural networks are computational models capable of processing complex information [18]. With increasing availability of high-performance CPUs and GPUs, access to the internet for large-scale training data, and the design of regularization algorithms, deep learning has been at the forefront of research since the 1990s [19]. Recently, deep learning has also been used in domains, e.g., speech recognition or image recognition, where convolutional neural networks (CNNs) have shown high performance [20]. CNNs are deep learning algorithms widely used in image processing tasks, including the classification of objects such as people, vehicles, and animals. Specifically, CNNs have been applied to identify, categorize, and map particular anomalies within target areas using satellite and UAV photography [21]. With the introduction of LeNet-5, CNNs gained prominence in the field of image identification and significantly contributed to automating tasks such as reading handwritten checks in American banks [22]. Further advancements were achieved with the creation of databases like ImageNet, which collected and organized 1,000 images for each of 20,000 categories, enabling challenges such as the ImageNet Large-Scale Visual Recognition Challenge (ILSVRC) [23,24]. Prior to 2011, classification relied on manually created features. In 2012, AlexNet, a CNN model, achieved a much lower error rate than the previous techniques and spurred the development of architectures like VGG Net, Google Net, and ResNet [25,26]. For instance, ResNet in 2015 achieved an error rate of 3.5%, becoming an important milestone for the development of CNN [27]. Since then, the performance of classification models has started to plateau, and optimization of segmentation and detection algorithms has come into focus (e.g., U-Net). In numerous remote sensing and computer vision systems, automatic building detection and reconstruction work are highly important. Deep learning models were deployed to solve this problem, with the researchers investigating CNN architectures to tackle multiple building classification problems. Hyo-Chan Lee et al. [28] proposed a CNN based building recognition approach robust to image noise. Alidoost and Arefi proposed models to classify roof types for buildings from aerial imagery and LiDAR data resulting in a high classification accuracy [29,30]. Hierarchical networks for the classification
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
of urban buildings were proposed by Salma Taoufiq et al. [31] with improved prediction using coarse-to-fine learning. Karuppusamy also created a CNN model to improve building detection by using the histogram of oriented gradients (HOG) and local binary patterns (LBP) as an analytic model [32]. CNNs have been applied in agriculture too, e.g. Yamamoto et al. [33] utilized these models in classifying plant diseases with more than 90% accuracy. Ji et al. [34] applied CNNs to classify crop types with over 93.8% accuracy at the field level. Kwak et al. [35] classified highland cabbage and other crops using UAV-based time-series photos, achieving an accuracy of 98.72%. In another study, Wei et al. used hyperspectral imagery with a conditional random field-based fusion method, achieving a classification accuracy of 95.29% for nine crop types and 98.02% for eighteen classes [36-39]. Dyrmann et al. [40] classified 22 crop species using supervised learning in a CNN-based approach, with an accuracy of 86.2%. Kussul et al. [41] utilized LANDSAT-8 and SENTINEL-1A satellite images to classify eleven crop types and land covers, achieving an accuracy of 94.6% using a 2D CNN-based ensemble. Böhler et al. [42] classified crops using RGB and multispectral UAV images and obtained 86.3% field-level accuracy and 67% pixel-level accuracy. CNNs could be promising to overcome data complexity and resolution variability obstacles in Egyptian agriculture. Yet there is little applied CNN for agricultural land monitoring on a large scale and urban expansion analysis for Egypt. U-Net and CNN architectures are especially well-suited to such applications as U-Net’s symmetric design allows accurate segmentation and CNNs are good for detecting and classifying complex patterns [37, 38]. Based on the model work done between U-Net for monitoring illegal construction of agricultural lands in Egypt, this study proposes to solve this challenge in a scalable and high-performance system by combining the traditional U-Net and CNN models. Using innovations in AI, this system bridges the existing accuracy and scalability gaps and offers a robust tool for policymakers to address urban sprawl and safeguard valuable agricultural production.
Differences detected initiate a stepwise segmentation to isolate diverse fractions. A U-Net segmentation model is deployed to identify and outline building footprints and the changes over time are inferred by segment comparison. These segments are subsequently labelled using CNN as ‘Building’ and ‘Not Building,’ which allows the identification of emergent constructions in the latest images. For improved accuracy this image is split into 25 patches with an equal size according to the V7 workflows, and each patch is numbered and compared with corresponding patches in subsequent image folders to check for similarity. A patch found outside the permissible building domain identifies any new building as illegal. In contrast, patches within permissible domains will be flagged for human inspection to ascertain construction legality. RGB coloring improves understanding across the area, and it aids in urban planning, land management, and agricultural protection.
Materials And Methods
Genetic Algorithms Parameter Justification The parameter selection for the genetic algorithm (GA) was done by sensitivity analysis to optimize model performance. A mutation rate of 0.05 was selected based on a number of different rates between 0.01 and 0.1, whereby lower mutation rates could not achieve enough variability and higher mutation rates disrupted convergence. We set the number of epochs to 200 in accordance with convergence trends found during optimization to allow the GA to reach stable solutions without overfitting. A population size of 50 was chosen to guarantee that the solution diversity and amount of computation was balanced. This parameter configuration gave an optimum match between accuracy and processing time, as shown through
The Model Figure 1 illustrates the workflow for using UAVs and deep learning techniques to track changes in land-use. The system analyzes building structures and manages unauthorized constructions. UAVs take sequential aerial pictures of the same area, which are saved into a structured folder system with subfolders representing the week each image was taken. Process images of diverse resolutions through small parts or sections which can be analyzed on a sceneby-scene basis and ensure a flexible model. Each image is compared with its subsequent one using the Structural Similarity Index Measure (SSIM).
Geographic Analysis Integration The system adopts GA to obtain precision for segmentation and offers context to land-use changes. GA methods provide the system capability to integrate geospatial data with aerial images to classify land types and detect unauthorized constructions within predefined boundaries. The incorporation of GA comprises: • Drawing spatial coordinates for each segment of images, in relation to cadastral maps and administrative registers. • Using GA to overlay land-use zoning boundaries so that permissible and non-permissible building zones are distinguished. • Dynamic updates on permissible boundaries reflecting changes with new legislations or urban planning adjustments. The proposed system is a powerful application for unauthorized constructions with a robust approach, which adapts well to policies or environmental variables by integrating GA with U-Net and CNN architectures. With this integration, the system can detect illegal constructions while also providing a precise location for actionable insights.
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
experiments using validation datasets. The incorporation of GA improved model robustness and efficiency for better segmentation/classification results in terms of more reliable classification and segmentation results. Data Acquisition Phase This study uses a custom dataset known as the Egypt delta satellite images (EDSI), derived from historical Google Maps data. EDSI was specifically developed for the experiments conducted in this work. The dataset comprises low-resolution historical images, which help determine new buildings at the boundaries of villages and cities. Despite the finite number of historical images, the system effectively identifies changes in each area, including their location and type. Data on 8 governorates (in Egypt) in the Delta is summarized in Figure 2 and details are presented in Table 1. These governorates are characterized by widely heterogeneous population distributions. (Gharbia and Qalyubia have little urban spread and are mainly agricultural, while Beheira is much wider.) Data Processing Phase All aerial images were captured at specified heights to ensure visual differentiation between buildings and other land types. For the Egypt Delta, Figure 3, the images were divided equally and each 500x500 meter image cropped into
25 smaller 100x100 meter images. By doing this, the systems are able to identify any new building in the size of 400 square meters or even less in order to understand whether this is in fact a building. 5,450 high resolution aerial images were obtained over the region of two km around the neighborhood and housing areas. Then each image was split into 25 smaller ones, to obtain a total of 1,635,000 images. These images were then analyzed for features for segmentation and classification. Training Phase For training, validation, and testing purposes, we selected 60,000 block images for all eight governorates, which are summarized in Table 2. This selection enabled a proportional representation, by mirroring the size of each governorate, while also ensuring that the last two subsequent images in every region were provided to monitor temporal changes. The dataset was split as follows: • Training Data: 70% • Validation Data: 15% • Testing Data: 15% U-Net, CNN and Classification were the algorithms used in the system. U-Net was originally designed for biomedical image segmentation and is now being applied on land-use analysis and building identification. It is composed of two paths in the architecture:
Figure 1. Enhanced workflow diagram: UAV-based land monitoring.
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
Figure 2. The boundaries and location of the eight governorates of Egypt Delta.
Table 1. Some information of Delta and Alexandria governorates Governorate
2. Expanding Path: Maps contextual information back to
the original resolution by up-convolutions and concatenation to form an expanded path. The symmetrical form ensures accurate segmentation as shown in Fig. 4. Then the U-Net segments were processed by the CNN to classify regions using “Building” or “Not Building” as them to characterize them. The CNN architecture
illustrated in Figure 5 used a weighted cross-entropy loss function to correct class imbalances. The structured training pipeline ensured that the system was fine-tuned to the peculiarities of each governorate while also producing similar performance metrics. Table 2 highlights the number of images, blocks and split samples per governorate for the balanced and all encompassing dataset. The performance of the system was quantified using five main metrics: overall accuracy, precision, recall, F1 score, and Intersection over
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
Figure 3. Data preprocessing phase. Cropping each image 500x 500 m to 25 images (100x100 m for each).
Table 2. Number of images, blocks and number of split sample images in each governorate Governorate
Figure 4. U-Net Architecture. The arrows represent the layers and the boxes represents the out put of each layer. The arrows colors denote a layer of the same type.
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
Union (IoU). These metrics are characterized by Equations (1)–(5), wherein TP = true positives, FP = false positives, TN = true negatives, and FN = false negatives:
4. F1 Score: A balance between precision and recall that
gives a holistic performance metric. 5. IoU: It describes the average overlap between the predicted and actual segmentation masks. (1)
regard to the other segment, and if these overlaps were found between all the segments, it was analyzed using Table 3. At the second stage, the CNN based on features of the U-Net categorized the segments into “Building” or “Not Building”. In addition, the performance measures of precision, recall, F1 score, and accuracy for each governorate were calculated that allowed us to determine the reliability and robustness of the building classification system. Differences can be observed among the governorates as found in the results, where Alexandria had slightly worse results owing to its compact urban space and irregular building layout, while Menofia also performed better on accuracy and precision. Between them, these stages offered a comprehensive evaluation of how well the system achieves segmentation and classification tasks.
Results And Discussion
(5) The system was evaluated in two stages, including 2 phases of U-Net based segmentation accuracy, and then building prediction based on CNN. In the first step, we compared the accuracy of the U-Net model to manual segmented benchmarks by applying the U-Net model over 500x500 meter images to segment the images into 100x100 meter regions. Correctful segment of the dataset was presented if the similarity of each segment exceeded 95% with
The proposed system was evaluated in two phases: segmentation accuracy using the U-Net model and building recognition using CNN. This section presents the results of the evaluation, providing a detailed analysis of the system’s performance and its implications. Model Performance and Evaluation For U-Net Network In the performance of segmenting 500x500 meter aerial imagery into 100x100 meter sub-regions, U-Net model achieved high precision as per standards developed via manual segmentation. The evaluation statistics are presented in Table 3: the average F1 score in the eight Egyptian governorates was 96.88%, whereas the recall and accuracy figures were 96.57% and 93.72%, respectively. Performance varied by governorate and reflected regional geographical and urban characteristics. Alexandria had the lowest F1 score at 92.50% and accuracy of 86.71%, with its dense urban layout and irregular building arrangements, while
Figure 5. CNN Neural Network to classify the original of the segmented parts by U-Net neural network.
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
Figure 6. Example of the resulting segments using the developed semantic segmentation model for segmentation
Table 3. The test results of the splits detection using U-Net Governorate
Menofia achieved the highest F1 of 98.94% and 95.42% accuracy. Example segmentation results are illustrated in Figure 6 showing a spatialization scenario where aerial images can be classified into urban, cultivated, and barren land types. Each land type is color-coded nicely for clarity, indicating U-Net’s ability to identify complex patterns. Although it performed reasonably well overall, there were overlaps between segments, leading to a higher overall processing time. In future iterations, improving on this would increase efficiency without sacrificing accuracy. Model Performance and Evaluation for CNN Network Following segmentation, the CNN model classified the sub-regions as either “Building” or “Not Building.” Overall, the classification metrics, presented in Table 4, provide an F1 score of 94.94%, precision, and recall of 94.71% and 95.20%, respectively. Due to the robustness of the CNN against the fluctuation due to the lighting, shadow and imaging resolutions, it was able to successfully operate in almost all the regions consistently. Still, Alexandria was presented with image complexity, which added more difficulty, earning it an F1 score of 89.50% and accuracy of 82.71%, similar to segmentation. Figure 7 presents results
from building recognition with high accuracy for CNN to be able to classify building structures in a segmented region. The confusion matrix presented in Table 5 shows the tradeoff between true positives, false positives, true negatives, and false negatives, confirming the robustness of the model in identifying illegal constructions. Image resolution impact on segmentation and classification performance was shown as well. If segmentation details were improved in higher-resolution images, it was a minor impact on accuracy. This result further substantiates the system’s flexibility to both types of data sources like small or low-res images, making it usable for larger scale deployment. The accuracy curves, Figure8, indicate that the model performs well in most regions, with training accuracy steadily increasing across epochs. In regions like Kafr el-Sheikh, Menofia, Gharbia, and Qalyubia, both training and validation accuracies converge smoothly, indicating good generalization and model stability. But, areas such as Alexandria and Beheira have a variable validation accuracy, indicating overfitting or data-related problems. In these applications, the training accuracy is high; however, validation accuracy is not always consistent, suggesting that the model has difficulty in generalising to new data. The performance shows moderate results in Dakahlia and Sharqia,
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
Figure 7. Examples of the prediction results using the developed semantic segmentation model for building detection.
with a relatively stable trend and some gap between training accuracy and validation accuracy. Figure 9 is the loss curves; it generally indicates all the regions, as we can see that it is learning effectively, and the model is minimizing errors over epochs. Over regions Kafr el-Sheikh, Menofia, Gharbia, and Qalyubia smooth and converging loss curves emerge for both training as well as validation, suggesting stable training and generalization. In contrast, Alexandria and Beheira share more variances in validation loss that correspond to the variability in validation accuracy observed. These spikes could be the result of high data variance or insufficient regularization. In Dakahlia and Sharqia the loss decreases consistently but leaves room for further optimization to provide better stability. The model achieves impressive results in regions with stable and clean data, such as Kafr el-Sheikh, Menofia, Gharbia, and Qalyubia, where both accuracy and loss measures show effective learning and good generalization. Conversely, Alexandria and Beheira need enhancement to tackle the challenge of overfitting to stabilize validation performance via regularization, better data preprocessing, or augmenting the dataset. Dakahlia and Sharqia perform moderately well, but more fine-tuning in the model or data augmentation can boost the performance. In general, the prediction of the model looks good but there are a few
things that can be done in order to keep it stable across all regions. Comparison with Existing Models The proposed system was benchmarked against established models, such as random forest (RF) and support vector machines (SVM). Key performance metrics, such as accuracy, F1 score, and processing time, are summarized in Table 6. The U-Net model attained matching or better accuracy and recall rates of the other models when segmenting. The same holds true for prediction precision and recall for the CNN, with the majority more sensitive labels than for RF and SVM in less complex scenarios such as Menofia and Sharqia, respectively. With the U-Net model having slightly increased processing time attributed to the split overlap, the greater precision of the segmentation was worth the trade-off. The CNN worked better than the other algorithms for building pattern recognition, particularly for discovering high level complex building forms in an urban context e.g., Alexandria. Figure 8 shows the percentage accuracy and decrease of our training and validation for U-Net model indicating its convergence. The loss values from CNN model are also depicted in Figure 9, with separate line styles in the training and validation step. Both diagrams reinforce the stability of the models.
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
Figure 8b Figure 8. Accuracy results for training and validation phase for each individual governorate
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
Figure 9b Figure 9. Loss results for Training and Validation phase for each individual governorate.
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
Table 4. The test results of the building classification model using CNN Governorate
Table 5. TP, TN, FP and FN for the building recognition test phase Governorate
Comparative segmentation results vs. the other models are shown in Figure 10 and superior performance in the building recognition tasks with CNN is shown in Figure 11. Such visualizations serve to highlight the versatility of the
system proposed with different data conditions and settings. It is not without limitations despite strong performance. Firstly, the accuracy is greatly influenced by the quality of the uploaded images. Environmental conditions; it might lower
Figure 10. Comparison between the proposed U-Net model and 4 known methods.
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
Figure 11. Comparison between the proposed CNN model and 3 known methods for building recognition.
Table 6. Average time for segmentation and building recognition for the proposed model and selected known methods
Method
Average time for building recognition Phase for 10000 images
the performance of segmentation and classification, especially for more densely urbanized cities, e.g., Alexandria with its shadows and cloud cover and different light environment. Moreover, the overlapping segmentation scheme exacerbates the computational burden on large data. In the future, we could also optimize the U-Net architecture to prevent overlap and try on other platform such as satellite imagery and UAV data to increase scaling. The system’s dependency on legal borders of classification leads to difficulty in dynamically changing those borders to account for policy or urban expansion. The GIS combined with the modern updates, it is believed, offers more flexibility and adaptability which would also make the land monitoring system more effective. The system proved to be able to detect land-use modifications and abnormal buildings for Egypt and monitor the construction of illegal houses for agricultural area. Integration of U-Net for segmentation and CNN for classification makes this system flexible and efficient, scalable platform to tackle the problem posed by urban sprawl as well as protecting valuable agricultural land with a scalable high-quality model. Knowledge gained from this study will be used as a basis for further development to improve
the efficacy of the system, the adaptability with regards to system application in a larger geographic area.
Conclusion
In this research, classification algorithms have been formulated that can handle both major upland and random buildings in Egypt through a bespoke model that utilizes U-Net and CNN neural networks. The U-Net model, with its semantic segmentation algorithm, efficiently generated well-defined segments which served as feed line for the CNN to determine newly generated buildings with the same historic image pair which was taken at different times. This imbalance in training data resulted in inferior accuracy for some governorates, however class under-sampling has resulted in a significant improvement in image classification performance. Notably, while it was perceived from early stages that image resolution could heavily impact the model’s performance, the results from experiments revealed that resolution had little influence on performance, indicating the model’s robustness across different dimensions and data formats. In Menofia governorate at this time U-Net obtained the best evaluation measures of 99.97% (IoU), 98.94% (F1-score), 99.54% (Precision), 99.71%
Sigma J Eng Nat Sci, Vol. 44, No. 1, pp. 360−374, February, 2026
(Recall), and 97.78% (Accuracy) whereas CNN reached the score of 95.97%, 97.94%, 97.61%, 98.71%, and 96.42% respectively. In particular, for some regions the lowest performance was observed, where U-Net achieved 82.99% (IoU), 92.50% (F1-score), 93.07% (Precision), 91.93% (Recall), and 86.71% (Accuracy), respectively; while in another region (80.99%, 89.50%, 89.07%, 89.93%, and 82.71%), CNN produced very limited performances. These variations were due to overfitting and data variability in various regions such as Alexandria and Beheira. Overall performance in all governorates was very satisfactory indicating the models capacity to generalise well to different contexts. Also, comparative evaluation revealed that our proposed system outperformed other models in segmentation and recognition tasks, compared to other different architectures, it has 33% heavier computational burden due to overlapping segments. The average time required for processing was also acceptable, but not great. The proposed problem solving in future work will further address these challenges, focusing on things like lower computation time and mitigate against the potential of overlapping segments. Furthermore, this system could be generalized to encompass such advanced work as the classification of building types, and the prediction of its number of floors and detection and checking for changes to the top floors of structures. These enhancements, in turn, will improve the practicality and usability of the model.
Acknowledgements
The researcher would like to acknowledge the Deanship of Graduate Studies and Scientific Research, Taif University for funding this work.
Share and Cite
ROKAYA, M.; ALWATEER, M. Semantic algorithm for land segmentation and building recognition to protect the Egyptian cultıvated. Sigma Journal of Engineering and Natural Sciences 2026, Vol. 44, pp. 360-374. https://doi.org/10.14744/sigma.2026.1987

