Unity-based ship detection data set construction method

By creating complex ocean scenes and performing various annotations in the Unity virtual simulation environment, the problems of small size and insufficient scene coverage of existing ship detection datasets are solved, generating diverse ship detection datasets and improving the detection capabilities of the model.

CN121767772APending Publication Date: 2026-03-31XIAN UNIV OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing ship detection datasets are small in size, incomplete in perspective, insufficient in scene coverage, and difficult to annotate, resulting in insufficient detection capabilities of deep learning models in complex marine scenes.

Method used

Using the Unity virtual simulation environment, various complex ocean scenes were created. Ship video images were generated through screen recording and screenshots. Multiple annotation methods were used to enrich the dataset, including adjusting ocean color, lighting conditions and ship models, and using different annotation tools to annotate ship and aircraft carrier runway sections.

Benefits of technology

A ship detection dataset covering a wide range of real-world marine environments was generated, which makes up for the shortcomings of existing datasets in terms of quantity and limited scenarios, and improves the detection capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121767772A_ABST
    Figure CN121767772A_ABST
Patent Text Reader

Abstract

The invention discloses a ship detection data set construction method based on unity, and the method is specifically implemented according to the following steps: step 1, creating a unity High Definition 3D project, and generating a unity WaterSurface water system in the project; 2, a ship model obtained through autonomous modeling or obtained from a network is imported into the unity WaterSurface water system in the step 1, and the ship model is adjusted to be located at a reasonable position; and step 3, a ship video picture is obtained in a screen recording or screenshot mode, a ship data set is enriched in a mode of adjusting ocean colors and illumination conditions and replacing a ship model, and a plurality of labels are adopted to meet detection requirements of special ships. The problems that in the prior art, a traditional real data set in a ship data set is difficult to collect, angles are incomplete, scene coverage is insufficient, and marking is difficult are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and data processing technology, specifically relating to a method for constructing a ship detection dataset based on Unity. Background Technology

[0002] With the rapid development of computer technology, significant progress has been made in the field of computer vision, with deep learning technology becoming a core driving force for the development of object detection tasks. In practical applications, deep learning models play a crucial role in numerous fields such as security monitoring, autonomous driving, and aerospace.

[0003] However, the performance of deep learning models is highly dependent on large-scale, high-quality training datasets. The quantity and quality of training data directly affect the model's accuracy, generalization ability, and robustness. In target detection tasks, datasets need to contain a rich variety of target objects, covering different poses, scales, lighting conditions, and background environmental factors. This is necessary for the model to learn comprehensive and effective feature representations, thereby accurately detecting targets in various situations in practical applications. However, currently available ship detection datasets have several limitations. First, the size of the datasets is often small, failing to meet the needs of deep learning models for large amounts of training data. The limited number of samples restricts the model's learning ability, resulting in insufficient generalization ability when facing complex and ever-changing real-world maritime scenarios, making it difficult to accurately detect ships of various types and states. Second, given the military sensitivity of real-world ship data, existing open-source ship data is difficult to obtain, has low public availability, and the obtained open-source datasets generally lack multi-view coverage, mostly focusing on common observation angles (top-down view > 80%, eye-level and oblique tactical view missing rates > 60%), and lacking complete required angles. Finally, existing datasets suffer from poor diversity, primarily due to their limited scene diversity (failing to comprehensively cover the diverse characteristics of ships under different geographical environments, weather conditions, and military strategic contexts. For example, the usage and appearance of ships vary in different sea areas and climates; existing open-source data only includes clear daytime scenes, while key information for nighttime low-light environment identification data is almost impossible to obtain through public channels), limited ship types, and insufficient variation in attitude and scale. Given Unity's powerful capabilities, its application to ship detection dataset construction holds immense potential. Utilizing Unity's virtual simulation environment, various complex marine scenes can be easily created, including different weather conditions (such as sunny and cloudy days), diverse sea surface states (calm sea, waves, and rough seas), and scenes at different times of day (daytime, nighttime, dawn, and dusk). By precisely controlling these scene parameters, massive amounts of highly diverse virtual image data can be generated, effectively compensating for the shortcomings of existing datasets in terms of scene diversity. Summary of the Invention

[0004] The purpose of this invention is to provide a method for constructing ship detection datasets based on Unity, which solves the problems of difficulty in collecting traditional real-world data, incomplete perspectives, insufficient scene coverage, and difficulty in annotation in existing ship data sets.

[0005] The technical solution adopted in this invention is a method for constructing a ship detection dataset based on Unity, which is implemented according to the following steps: Step 1: Create a Unity High Definition 3D project and generate the UnityWaterSurface water system within the project; Step 2: Import the ship model obtained through self-modeling or acquired from the network into the unityWaterSurface water system of Step 1, and adjust the ship model to a reasonable position. Step 3: Obtain ship video images by screen recording or screenshots, and enrich the ship dataset by adjusting ocean color, lighting conditions, and changing ship models. Use multiple annotations to meet the detection needs of special ships.

[0006] The invention is further characterized in that, Step 1 is implemented in the following steps: Step 1.1: First, create a new High Definition Render Pipeline (HDRP). Select Project Editor version 2022.3.0f1c1, and then select the High Definition 3D core template. Step 1.2: Click the following option to embed the editable configuration package, thus enabling the editing of water resources: Select Edit -> Project Settings -> Quality -> High Definition Render Pipeline (HDRP) -> Render -> Water, then check Enable and Script Interaction; Step 1.3: Click the following option to apply water rendering resources and create a water / ocean environment in Unity: Right-click on the water surface in the Hierarchy window -> Ocean, Sea, or Lake, select Sky and Fog, and click Add Override to add the Water Rendering component; Step 1.4: Click to open all effects, change the State to Enable, so that the applied water / ocean environment can be directly displayed. This completes the project creation and water system generation.

[0007] Step 2 is implemented in the following steps: Step 2.1: Directly import the FBX file of the ship model obtained through self-modeling or from the internet into the ocean environment created in Step 1. Step 2.2: During import, first scale the model size to avoid excessive changes in the main viewpoint of the ship model with each zoom-in when recording videos of the ship model using external software. Second, use Unity's built-in vertical movement operation to move the ship model appropriately so that the lower half of the model is in the ocean and the upper half is above it. Finally, rotate the ship model and the main viewpoint of the Unity interface to meet the different ship perspectives required for creating the dataset through subsequent screen recording. In Step 3, select a screen recording software, adjust the viewpoint, and start the screen recording function. Adjust Unity's near and far perspectives and vertical perspectives to achieve shooting effects from a distant viewpoint to a close-up focus, and from a high-altitude viewpoint to a level view close to the sea surface, thus completely capturing the perspective from far to near and from top to bottom. In step 3, the ship videos obtained through screen recording are processed by frame-by-frame conversion into images. A large number of captured images are then manually screened. During recording and frame-by-frame processing, some imperfections may occur, such as parts of the image being obscured by other objects, or blurring due to rapid changes in perspective. These flawed images will affect the quality of the dataset and subsequent analysis results. All the screened images are used as the dataset images. Step 3, following the above operations, can obtain ship dataset videos and images for a single environment. Multi-environment datasets can be created using the following method: 1. Adjusting the built-in Sun project in Unity to change the direction and size of the sun's illumination. Rotating the sun to the top of the sea level in the created ocean environment simulates midday sunlight, while rotating it to the left or right of the sea level simulates sunset sunlight, thus achieving environmental changes. Secondly, adjusting the Water Surface configuration, by modifying color and wave, changes the ocean's color depth to achieve near-shore or offshore environments, and the wave size to achieve different wind speeds. Thirdly, due to the limitations of Unity's built-in weather system, different algorithms can be used to generate infrared images and rain / fog images based on selected normal images. In step 3, the ship detection dataset is labeled as the ship itself, while the aircraft carrier dataset includes two parts: the aircraft carrier hull and the aircraft carrier runway.

[0008] In step 3, because the aircraft carrier runway has a trapezoidal shape from a perspective perspective, while the ship's hull shape is relatively regular, the dataset employs a two-stage annotation strategy: the rolabelimg tool is used to annotate the ship's hull with a rectangle, completely selecting its actual outline; the labelme tool's polygon function is used to annotate the irregularly shaped runway using a five-point annotation method, thus obtaining the aircraft carrier detection annotation data. Different annotation methods can be used depending on different detection requirements in practice.

[0009] The beneficial effect of this invention is that the Unity-based method for constructing ship detection datasets effectively overcomes the shortcomings of existing ship datasets, such as limited quantity and limited scene variety. Through Unity's virtual simulation technology, various complex marine scenes can be created, including different weather conditions (such as sunny, cloudy, overcast), diverse sea surface states (calm sea, waves, and rough seas), and scenes at different times of day (daytime, nighttime, dawn, and dusk). This allows the generated dataset to cover a wide range of real-world marine environmental conditions. Attached Figure Description

[0010] Figure 1 This is a flowchart of a method for constructing a ship detection dataset based on Unity according to the present invention; Figure 2 This is a detection result diagram built based on a Unity-based ship dataset. Detailed Implementation

[0011] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0012] The present invention provides a method for constructing a ship detection dataset based on Unity, the flowchart of which is shown below. Figure 1 As shown, please follow these steps: Step 1: Create a Unity High Definition 3D project and generate the UnityWaterSurface water system within the project; Step 1 is implemented in the following steps: Step 1.1: First, create a new High Definition Render Pipeline (HDRP). Select Project Editor version 2022.3.0f1c1, and then select the High Definition 3D core template. Step 1.2: Click the following option to embed the editable configuration package, thus enabling the editing of water resources: Select Edit -> Project Settings -> Quality -> High Definition Render Pipeline (HDRP) -> Render -> Water, then check Enable and Script Interaction; Step 1.3: Click the following option to apply water rendering resources and create a water / ocean environment in Unity: Right-click on the water surface in the Hierarchy window -> Ocean, Sea, or Lake, select Sky and Fog, and click Add Override to add the Water Rendering component; Step 1.4: Click to open all effects, change the State to Enable, so that the applied water / ocean environment can be directly displayed. This completes the project creation and water system generation.

[0013] Step 2: Import the ship model obtained through self-modeling or acquired from the network into the unityWaterSurface water system of Step 1, and adjust the ship model to a reasonable position. Step 2 is implemented in the following steps: Step 2.1: Directly import the FBX files of the ship models obtained through self-modeling or from online resources (such as CG Model Network, Unity Resource Store, Aigo.com) into the ocean environment created in Step 1. Step 2.2: During import, first scale the model size to avoid excessive changes in the main viewpoint of the ship model with each zoom-in when recording videos of the ship model using external software (i.e., simulating zooming in from a distance to a closer view). Second, use Unity's built-in vertical movement operation to move the ship model vertically so that the lower half of the model is in the ocean and the upper half is above it. Finally, rotate the ship model and the main viewpoint of the Unity interface to accommodate different ship perspectives required for subsequent screen recording and dataset creation.

[0014] Step 3: Based on the reasonable position of the ship in the ocean obtained in Step 2, obtain video images of the ship by screen recording or screenshot. Enrich the ship dataset by adjusting the ocean color, lighting conditions, and changing the ship model. Use multiple annotations to meet the detection needs of special ships.

[0015] In step 3, a screen recording software is selected, the viewing angle is adjusted to enable the screen recording function, and the near and far and vertical viewing angles in Unity are adjusted to achieve the shooting effect from a distant view to a close-up focus, as well as the change in perspective from a high-altitude view to a close-up view of the sea surface, thus completely capturing the perspective from far to near and from top to bottom. In step 3, the ship videos obtained through screen recording are processed by frame-by-frame conversion and a large number of images are manually screened. Due to the possibility of some imperfections during recording and frame-by-frame processing, such as parts of the image being obscured by other objects, or blurring due to rapid changes in perspective, these flawed images will affect the quality of the dataset and subsequent analysis results. All the screened images are used as the images for the dataset. In step 3, following the above operations, a single-environment ship dataset video and images can be obtained. The creation of multi-environment datasets can be obtained by the following method: 1. Adjusting (rotating vertically) the (sun) item in Unity to change the direction and size of the sun's illumination. Rotating the sun to the top of the sea level in the created ocean environment simulates midday sunlight, while rotating it to the left or right of the sea level simulates sunset sunlight, thus achieving environmental changes. Secondly, adjusting the Water Surface configuration, by modifying the color and wave settings, changes the ocean's color depth to achieve near-shore or offshore environments, and the wave size to achieve different wind speeds. Thirdly, due to the limitations of Unity's built-in weather system, different algorithms can be used to generate infrared images and rain / fog images based on selected normal images. In step 3, the ship detection dataset is labeled as the ship itself, while the aircraft carrier dataset labeling includes two parts: the aircraft carrier hull and the aircraft carrier runway. Therefore, the labeling process of the ship model is introduced using the aircraft carrier dataset labeling as an example.

[0016] In step 3, because the aircraft carrier runway has a trapezoidal perspective and the ship's hull shape is relatively regular, the dataset employs a two-stage annotation strategy: The `rolabelimg` tool is used to annotate the ship's hull with a rectangle, completely selecting its actual outline (this annotation tool is sufficient for obtaining the required annotation data for general ship detection); the `labelme` tool's polygon function is used to annotate the irregularly shaped runway using a five-point annotation method (the last point coincides with the first point to form a closed polygon), thus obtaining the aircraft carrier detection annotation data. Different annotation methods can be used depending on the specific detection requirements.

[0017] Example 1 The present invention provides a method for constructing a ship detection dataset based on Unity, the flowchart of which is shown below. Figure 1 As shown, please follow these steps: Step 1: Create a Unity High Definition 3D project and generate the UnityWaterSurface water system within the project; Step 2: Import the ship model obtained through self-modeling or acquired from the network into the unityWaterSurface water system of Step 1, and adjust the ship model to a reasonable position. Step 3: Based on the reasonable position of the ship in the ocean obtained in Step 2, obtain video images of the ship by screen recording or screenshot. Enrich the ship dataset by adjusting the ocean color, lighting conditions, and changing the ship model. Use multiple annotations to meet the detection needs of special ships.

[0018] Example 2 The present invention provides a method for constructing a ship detection dataset based on Unity, the flowchart of which is shown below. Figure 1 As shown, please follow these steps: Step 1: Create a Unity High Definition 3D project and generate the UnityWaterSurface water system within the project; Step 1 is implemented in the following steps: Step 1.1: First, create a new High Definition Render Pipeline (HDRP). Select Project Editor version 2022.3.0f1c1, and then select the High Definition 3D core template. Step 1.2: Click the following option to embed the editable configuration package, thus enabling the editing of water resources: Select Edit -> Project Settings -> Quality -> High Definition Render Pipeline (HDRP) -> Render -> Water, then check Enable and Script Interaction; Step 1.3: Click the following option to apply water rendering resources and create a water / ocean environment in Unity: Right-click on the water surface in the Hierarchy window -> Ocean, Sea, or Lake, select Sky and Fog, and click Add Override to add the Water Rendering component; Step 1.4: Click to open all effects, change the State to Enable, so that the applied water / ocean environment can be directly displayed. This completes the project creation and water system generation.

[0019] Step 2: Import the ship model obtained through self-modeling or acquired from the network into the unityWaterSurface water system of Step 1, and adjust the ship model to a reasonable position. Step 3: Based on the reasonable position of the ship in the ocean obtained in Step 2, obtain video images of the ship by screen recording or screenshot. Enrich the ship dataset by adjusting the ocean color, lighting conditions, and changing the ship model. Use multiple annotations to meet the detection needs of special ships.

[0020] Example 3 The present invention provides a method for constructing a ship detection dataset based on Unity, the flowchart of which is shown below. Figure 1 As shown, please follow these steps: Step 1: Create a Unity High Definition 3D project and generate the UnityWaterSurface water system within the project; Step 1 is implemented in the following steps: Step 1.1: First, create a new High Definition Render Pipeline (HDRP). Select Project Editor version 2022.3.0f1c1, and then select the High Definition 3D core template. Step 1.2: Click the following option to embed the editable configuration package, thus enabling the editing of water resources: Select Edit -> Project Settings -> Quality -> High Definition Render Pipeline (HDRP) -> Render -> Water, then check Enable and Script Interaction; Step 1.3: Click the following option to apply water rendering resources and create a water / ocean environment in Unity: Right-click on the water surface in the Hierarchy window -> Ocean, Sea, or Lake, select Sky and Fog, and click Add Override to add the Water Rendering component; Step 1.4: Click to open all effects, change the State to Enable, so that the applied water / ocean environment can be directly displayed. This completes the project creation and water system generation.

[0021] Step 2: Import the ship model obtained through self-modeling or acquired from the network into the unityWaterSurface water system of Step 1, and adjust the ship model to a reasonable position. Step 2 is implemented in the following steps: Step 2.1: Directly import the FBX files of the ship models obtained through self-modeling or from online resources (such as CG Model Network, Unity Resource Store, Aigo.com) into the ocean environment created in Step 1. Step 2.2: During import, first scale the model size to avoid excessive changes in the main viewpoint of the ship model with each zoom-in when recording videos of the ship model using external software (i.e., simulating zooming in from a distance to a closer view). Second, use Unity's built-in vertical movement operation to move the ship model vertically so that the lower half of the model is in the ocean and the upper half is above it. Finally, rotate the ship model and the main viewpoint of the Unity interface to accommodate different ship perspectives required for subsequent screen recording and dataset creation.

[0022] Step 3: Based on the reasonable position of the ship in the ocean obtained in Step 2, obtain video images of the ship by screen recording or screenshot. Enrich the ship dataset by adjusting the ocean color, lighting conditions, and changing the ship model. Use multiple annotations to meet the detection needs of special ships.

[0023] Example 4 The present invention provides a method for constructing a ship detection dataset based on Unity, the flowchart of which is shown below. Figure 1 As shown, please follow these steps: Step 1: Create a Unity High Definition 3D project and generate the UnityWaterSurface water system within the project; Step 1 is implemented in the following steps: Step 1.1: First, create a new High Definition Render Pipeline (HDRP). Select Project Editor version 2022.3.0f1c1, and then select the High Definition 3D core template. Step 1.2: Click the following option to embed the editable configuration package, thus enabling the editing of water resources: Select Edit -> Project Settings -> Quality -> High Definition Render Pipeline (HDRP) -> Render -> Water, then check Enable and Script Interaction; Step 1.3: Click the following option to apply water rendering resources and create a water / ocean environment in Unity: Right-click on the water surface in the Hierarchy window -> Ocean, Sea, or Lake, select Sky and Fog, and click Add Override to add the Water Rendering component; Step 1.4: Click to open all effects, change the State to Enable, so that the applied water / ocean environment can be directly displayed. This completes the project creation and water system generation.

[0024] Step 2: Import the ship model obtained through self-modeling or acquired from the network into the unityWaterSurface water system of Step 1, and adjust the ship model to a reasonable position. Step 2 is implemented in the following steps: Step 2.1: Directly import the FBX files of the ship models obtained through self-modeling or from online resources (such as CG Model Network, Unity Resource Store, Aigo.com) into the ocean environment created in Step 1. Step 2.2: During import, first scale the model size to avoid excessive changes in the main viewpoint of the ship model with each zoom-in when recording videos of the ship model using external software (i.e., simulating zooming in from a distance to a closer view). Second, use Unity's built-in vertical movement operation to move the ship model vertically so that the lower half of the model is in the ocean and the upper half is above it. Finally, rotate the ship model and the main viewpoint of the Unity interface to accommodate different ship perspectives required for subsequent screen recording and dataset creation.

[0025] Step 3: Based on the reasonable position of the ship in the ocean obtained in Step 2, obtain video images of the ship by screen recording or screenshot. Enrich the ship dataset by adjusting the ocean color, lighting conditions, and changing the ship model. Use multiple annotations to meet the detection needs of special ships.

[0026] In step 3, a screen recording software is selected, and the screen recording function is activated by adjusting the viewing angle. The near and far, vertical and horizontal viewing angles in Unity are adjusted to achieve a shooting effect from a distant viewpoint to a close-up focus, and from a high-altitude viewpoint to a level view close to the sea surface, thus completely capturing the perspective from far to near and from top to bottom. In step 3, the ship video obtained through screen recording is processed by frame-by-frame conversion into images, and a large number of images are manually screened. Due to potential imperfections during recording and frame-by-frame processing, such as parts of the image being obscured by other objects or blurring due to rapid changes in perspective, these flawed images will affect the quality of the dataset and subsequent analysis results. All the screened images are used as the dataset images.

[0027] Example 5 The present invention provides a method for constructing a ship detection dataset based on Unity, the flowchart of which is shown below. Figure 1 As shown, please follow these steps: Step 1: Create a Unity High Definition 3D project and generate the UnityWaterSurface water system within the project; Step 1 is implemented in the following steps: Step 1.1: First, create a new High Definition Render Pipeline (HDRP). Select Project Editor version 2022.3.0f1c1, and then select the High Definition 3D core template. Step 1.2: Click the following option to embed the editable configuration package, thus enabling the editing of water resources: Select Edit -> Project Settings -> Quality -> High Definition Render Pipeline (HDRP) -> Render -> Water, then check Enable and Script Interaction; Step 1.3: Click the following option to apply water rendering resources and create a water / ocean environment in Unity: Right-click on the water surface in the Hierarchy window -> Ocean, Sea, or Lake, select Sky and Fog, and click Add Override to add the Water Rendering component; Step 1.4: Click to open all effects, change the State to Enable, so that the applied water / ocean environment can be directly displayed. This completes the project creation and water system generation.

[0028] Step 2: Import the ship model obtained through self-modeling or acquired from the network into the unityWaterSurface water system of Step 1, and adjust the ship model to a reasonable position. Step 2 is implemented in the following steps: Step 2.1: Directly import the FBX files of the ship models obtained through self-modeling or from online resources (such as CG Model Network, Unity Resource Store, Aigo.com) into the ocean environment created in Step 1. Step 2.2: During import, first scale the model size to avoid excessive changes in the main viewpoint of the ship model with each zoom-in when recording videos of the ship model using external software (i.e., simulating zooming in from a distance to a closer view). Second, use Unity's built-in vertical movement operation to move the ship model vertically so that the lower half of the model is in the ocean and the upper half is above it. Finally, rotate the ship model and the main viewpoint of the Unity interface to accommodate different ship perspectives required for subsequent screen recording and dataset creation.

[0029] Step 3: Based on the reasonable position of the ship in the ocean obtained in Step 2, obtain video images of the ship by screen recording or screenshot. Enrich the ship dataset by adjusting the ocean color, lighting conditions, and changing the ship model. Use multiple annotations to meet the detection needs of special ships.

[0030] In step 3, a screen recording software is selected, the viewing angle is adjusted to enable the screen recording function, and the near and far and vertical viewing angles in Unity are adjusted to achieve the shooting effect from a distant view to a close-up focus, as well as the change in perspective from a high-altitude view to a close-up view of the sea surface, thus completely capturing the perspective from far to near and from top to bottom. In step 3, the ship videos obtained through screen recording are processed by frame-by-frame conversion and a large number of images are manually screened. Due to the possibility of some imperfections during recording and frame-by-frame processing, such as parts of the image being obscured by other objects, or blurring due to rapid changes in perspective, these flawed images will affect the quality of the dataset and subsequent analysis results. All the screened images are used as the images for the dataset. In step 3, following the above operations, a single-environment ship dataset video and images can be obtained. The creation of multi-environment datasets can be obtained by the following method: 1. Adjusting (rotating vertically) the (sun) item in Unity to change the direction and size of the sun's illumination. Rotating the sun to the top of the sea level in the created ocean environment can simulate midday sunlight, while rotating it to the left or right of the sea level can simulate sunset sunlight, thus achieving environmental changes; Second, adjusting the Water Surface configuration, by modifying the color and wave, can change the color depth of the ocean to achieve near-shore or offshore environments, and the wave size can achieve environments with different wind speeds; Third, due to the limitations of Unity's built-in weather system, different algorithms can be used to generate infrared images and rain / fog images based on the selected normal images.

[0031] Example 6 The present invention provides a method for constructing a ship detection dataset based on Unity, the flowchart of which is shown below. Figure 1 As shown, please follow these steps: Step 1: Create a Unity High Definition 3D project and generate the UnityWaterSurface water system within the project; Step 1 is implemented in the following steps: Step 1.1: First, create a new High Definition Render Pipeline (HDRP). Select Project Editor version 2022.3.0f1c1, and then select the High Definition 3D core template. Step 1.2: Click the following option to embed the editable configuration package, thus enabling the editing of water resources: Select Edit -> Project Settings -> Quality -> High Definition Render Pipeline (HDRP) -> Render -> Water, then check Enable and Script Interaction; Step 1.3: Click the following option to apply water rendering resources and create a water / ocean environment in Unity: Right-click on the water surface in the Hierarchy window -> Ocean, Sea, or Lake, select Sky and Fog, and click Add Override to add the Water Rendering component; Step 1.4: Click to open all effects, change the State to Enable, so that the applied water / ocean environment can be directly displayed. This completes the project creation and water system generation.

[0032] Step 2: Import the ship model obtained through self-modeling or acquired from the network into the unityWaterSurface water system of Step 1, and adjust the ship model to a reasonable position. Step 2 is implemented in the following steps: Step 2.1: Directly import the FBX files of the ship models obtained through self-modeling or from online resources (such as CG Model Network, Unity Resource Store, Aigo.com) into the ocean environment created in Step 1. Step 2.2: During import, first scale the model size to avoid excessive changes in the main viewpoint of the ship model with each zoom-in when recording videos of the ship model using external software (i.e., simulating zooming in from a distance to a closer view). Second, use Unity's built-in vertical movement operation to move the ship model vertically so that the lower half of the model is in the ocean and the upper half is above it. Finally, rotate the ship model and the main viewpoint of the Unity interface to accommodate different ship perspectives required for subsequent screen recording and dataset creation.

[0033] Step 3: Based on the reasonable position of the ship in the ocean obtained in Step 2, obtain video images of the ship by screen recording or screenshot. Enrich the ship dataset by adjusting the ocean color, lighting conditions, and changing the ship model. Use multiple annotations to meet the detection needs of special ships.

[0034] In step 3, a screen recording software is selected, the viewing angle is adjusted to enable the screen recording function, and the near and far and vertical viewing angles in Unity are adjusted to achieve the shooting effect from a distant view to a close-up focus, as well as the change in perspective from a high-altitude view to a close-up view of the sea surface, thus completely capturing the perspective from far to near and from top to bottom. In step 3, the ship videos obtained through screen recording are processed by frame-by-frame conversion and a large number of images are manually screened. Due to the possibility of some imperfections during recording and frame-by-frame processing, such as parts of the image being obscured by other objects, or blurring due to rapid changes in perspective, these flawed images will affect the quality of the dataset and subsequent analysis results. All the screened images are used as the images for the dataset. In step 3, following the above operations, a single-environment ship dataset video and images can be obtained. The creation of multi-environment datasets can be obtained by the following method: 1. Adjusting (rotating vertically) the (sun) item in Unity to change the direction and size of the sun's illumination. Rotating the sun to the top of the sea level in the created ocean environment simulates midday sunlight, while rotating it to the left or right of the sea level simulates sunset sunlight, thus achieving environmental changes. Secondly, adjusting the Water Surface configuration, by modifying the color and wave settings, changes the ocean's color depth to achieve near-shore or offshore environments, and the wave size to achieve different wind speeds. Thirdly, due to the limitations of Unity's built-in weather system, different algorithms can be used to generate infrared images and rain / fog images based on selected normal images. In step 3, the ship detection dataset is labeled as the ship itself, while the aircraft carrier dataset labeling includes two parts: the aircraft carrier hull and the aircraft carrier runway. Therefore, the labeling process of the ship model is introduced using the aircraft carrier dataset labeling as an example.

[0035] In step 3, because the aircraft carrier runway has a trapezoidal perspective and the ship's hull shape is relatively regular, the dataset employs a two-stage annotation strategy: The `rolabelimg` tool is used to annotate the ship's hull with a rectangle, completely selecting its actual outline (this annotation tool is sufficient for obtaining the required annotation data for general ship detection); the `labelme` tool's polygon function is used to annotate the irregularly shaped runway using a five-point annotation method (the last point coincides with the first point to form a closed polygon), thus obtaining the aircraft carrier detection annotation data. Different annotation methods can be used depending on the specific detection requirements.

[0036] Figure 1The dataset creation process begins with creating a marine environment using the Unity HDRP water system. This involves creating a new Unity HDRP project, configuring relevant parameters, and adding water rendering components to construct a marine environment that simulates different ocean regions and seasonal characteristics, allowing for adjustment of water color and wave size. In the dataset creation phase, external screen recording and frame capture are used to obtain ship video data from various directions, angles, and heights by adjusting the ship's direction, distance, and vertical perspective. Then, by adjusting ocean color, wave size, and changing ship models, and after manual selection, the ship dataset is completed. Figure 2 This is a selected image from the completed dataset that has undergone detection. The image to be detected is on the left, and the detection result is on the right. Based on the above dataset creation process, a ship detection dataset covering different perspectives, angles, and environments can be constructed.

Claims

1. A method for building a unity-based ship detection dataset, characterized in that, Specifically, the following steps are implemented: Step 1, create unity High Definition 3D project, and generate unity WaterSurface water system in the project; Step 2, import the ship model obtained by autonomous modeling or obtained from the network into the unityWaterSurface water system in step 1, and adjust the ship model to a reasonable position; Step 3, obtain ship video pictures by screen recording or screen capture, and enrich the ship dataset by adjusting the ocean color, lighting conditions, and replacing the ship model, and use multiple annotations to meet the detection needs of special ships.

2. The unity-based ship detection dataset construction method of claim 1, wherein, The step 1 is implemented according to the following steps: Step 1.1, first, create a new high-definition rendering pipeline HDRP, and select the project editor version as 2022.3.0f1c1, and then select the High Definition 3D core template; Step 1.2, click the following option to embed the configuration editable package, so that the water resource can be edited: select Edit->Project Settings->Quality->High Definition Rendering Pipeline HDRP->Rendering->Water, and check Enable and script interaction; Step 1.3, click the following option to apply water body rendering resources to create a water body marine environment in the unity software: right-click Water in the Hierarchy window->Ocean, Sea or Lake, select Sky, Fog, and click Add Override to add WaterRendering component; Step 1.4, click to open all effects, change the State to active Enable state, so that the applied water body marine environment can be directly displayed, thus completing the creation of the project and the generation of the water system.

3. The unity-based ship detection dataset construction method of claim 2, wherein, The step 2 is implemented according to the following steps: Step 2.1, import the fbx file of the resource ship model obtained by autonomous modeling or obtained from the network into the marine environment created in step 1; Step 2.2, when importing, first, scale the size of the model to avoid the change of the main perspective of the ship model caused by the indentation of the perspective every time when recording the video of the ship model through external software; secondly, use the up and down operation of unity to move the ship model up and down to the position where the lower half of the model is just in the ocean and the upper half is above the ocean; finally, you can rotate the ship model and the main vision of the unity interface to meet the different perspectives of the ship required by the subsequent screen recording to create the dataset.

4. The unity-based ship detection dataset construction method of claim 3, wherein, In step 3, select a screen recording software, adjust the perspective to start the screen recording function, adjust the near and far perspective and the up and down perspective of Unity to realize the shooting effect from far to close and from high to low, so as to completely capture the perspective from far to close and from high to low.

5. The unity-based ship detection dataset construction method of claim 4, wherein, In step 3, the ship video obtained by screen recording is converted into pictures by frame capturing, and a large number of pictures are manually screened. During the recording and frame capturing process, some defects may occur, such as partial screen being blocked by other objects or screen being blurred due to rapid change of viewing angle. These defective pictures will affect the quality of the data set and the subsequent analysis results. All the screened pictures are used as the pictures of the data set.

6. The unity-based ship detection dataset construction method of claim 5, wherein, In step 3, the ship data set video and pictures of a single environment can be obtained according to the above operation. The multi-environment data set can be obtained by the following methods:

1. Adjust the sun project in unity to change the direction and size of the sun's light, and rotate the sun to the head of the sea level in the created ocean environment to simulate the light of noon, and rotate it to the left and right of the sea level to simulate the light of sunset, thereby realizing the change of environment; 2. Adjust the Water Surface configuration, change the color and wave to change the color and depth of the ocean, realize the near sea or far sea environment, and realize the different wind speed environment by changing the wave size of the ocean; 3. Due to the limitation of the unity built-in weather system, different algorithms can be used to generate infrared images, rain and fog images based on the selected normal images.

7. The unity-based ship detection dataset construction method of claim 6, wherein, In step 3, the ship detection data set is labeled as the ship itself, and the aircraft carrier data set is labeled as two parts: the aircraft carrier body and the aircraft carrier runway.

8. The unity-based ship detection dataset construction method of claim 7, wherein, In step 3, the aircraft carrier runway is trapezoidal due to perspective, and the ship body shape is regular, so the data set adopts a twice labeling strategy: using the rolabelimg tool to label the ship body with a rectangular frame, and completely framing its actual contour; using the polygon function of the labelme tool to label the irregular runway with a five-point labeling method, thereby obtaining the aircraft carrier detection labeling data.

Citation Information

Cited By

  • Unity-based cultured fish target tracking model training data generation method

    CN122049571A