Method, system, device and storage medium for establishing ship face feature database
By collecting and storing ship image feature information under different conditions in inland waters, a ship face feature database is established, which solves the problem of insufficient ship image samples in inland waters and improves the accuracy of ship re-identification and supervision efficiency.
Patent Information
- Application Number
- CN202111248755.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-26
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-10-26
AI Technical Summary
There are few ship image samples in inland waters, which makes it difficult to implement ship re-identification technology under small sample conditions, which affects the effective supervision of inland navigation ships.
Collect ship images under different preset conditions in different preset areas, extract preset dimensional feature information, and obtain identity recognition tags based on AIS information matching, which are stored in the ship face feature database for subsequent use for retrieval and matching.
Through a rich database of ship face features, the problem of insufficient samples during ship re-identification is solved, and the identification accuracy and supervision efficiency of ships in inland waters are improved.
Smart Images

Figure CN113987251B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of ship identification, and in particular to a method, system, device and storage medium for establishing a ship face feature database. Background Art
[0002] Maritime supervision of inland waterway shipping is an important guarantee for the safe navigation of inland river ships, and is also an important means to implement the fishing ban on the Yangtze River and detect illegal ship behaviors. At present, the main means of inland waterway supervision is to locate and track ships through ship AIS information. However, some ships sailing on the Yangtze River are not equipped with AIS equipment, or turn off the AIS equipment when committing illegal acts, resulting in the inability of maritime regulatory authorities to effectively supervise inland river ships. With the development of computer vision and the improvement of recognition performance brought by various neural networks, ship re-identification technology can realize cross-mirror identification and tracking of ships. Even if the illegal ship turns off the ship's AIS information, the ship can still be identified through visual images and the ship re-identification network.
[0003] However, due to the small number of ship images in inland waters, re-identification based on small samples makes it difficult to implement re-identification technology, which has become one of the main reasons restricting the development of ship re-identification. Therefore, in order to better apply ship re-identification technology to inland waters, it is urgent to establish a ship face feature database with rich images in inland waters. Summary of the invention
[0004] In view of this, the present application provides a method, system, device and storage medium for establishing a ship face feature database to solve the technical problem of the small number of ship image samples in inland waters.
[0005] In order to solve the above problems, in a first aspect, the present application provides a method for establishing a ship face feature database, the method comprising:
[0006] Collect ship images under different preset conditions in different preset areas;
[0007] Extracting preset dimensional feature information corresponding to the ship images under different preset conditions;
[0008] Acquire the AIS information of the ship, match the acquired AIS information with the collected ship image, and obtain the identity identification tag corresponding to the ship image;
[0009] The ship images under different preset conditions, preset dimensional feature information and identity recognition tags are correspondingly stored in a database to generate a ship face feature database, so that the ship face feature database can be used for retrieval and matching when re-identifying ships in inland waters.
[0010] Optionally, the preset area includes inland bridge area waters, inland bend waters and / or coastal port entry and exit channel areas; the preset conditions include different scales of the ship from the camera, different lighting environments, different angles and / or different time periods.
[0011] Optionally, collecting ship images under different preset conditions in different preset areas includes:
[0012] When collecting ship images in the waters of the inland bridge area, the camera array pre-installed on the bridge foundation and the shore foundation is used to collect ship images within the waters of the inland bridge area, wherein the camera array consists of a visible light camera and an infrared camera, and the camera array is installed on the bridge foundation at preset intervals, and several of the camera arrays are integrated and installed on the shore foundation to form a multi-angle camera array.
[0013] Optionally, extracting preset dimensional feature information corresponding to the ship image under different preset conditions includes:
[0014] Extracting the foreground image of the ship image based on a preset target detection algorithm;
[0015] The foreground image is identified by using a pre-trained bow and stern recognition model, and the bow image and stern image in the foreground image are extracted, and the bow image and stern image are used as preset dimensional feature information corresponding to the ship image; wherein the bow and stern recognition model is a neural network model obtained by pre-labeling and training a preset number of bow sample images and stern sample images.
[0016] Optionally, extracting preset dimensional feature information corresponding to the ship image under different preset conditions includes:
[0017] Using a fully convolutional neural network to identify the foreground image to generate a text feature map, using a segmentation frame to extract a text area map in the foreground image according to the shape of the text feature map, and using the text area map as preset dimensional feature information corresponding to the ship image; and / or,
[0018] The aspect ratio information of the ship in the foreground image is obtained, and the aspect ratio information of the aspect ratio information is used as the preset dimensional feature information corresponding to the ship image.
[0019] Optionally, extracting preset dimensional feature information corresponding to the ship image under different preset conditions includes:
[0020] Calculating a similarity parameter between the ship image and a similar ship image, and if the calculated similarity parameter is greater than a preset threshold, determining the similar ship image as a negative sample label image of the ship image, and the negative sample label image serves as preset dimensional feature information corresponding to the ship image;
[0021] The calculating the similarity parameter between the ship image and similar ship images comprises:
[0022] The ship image X1 and the similar ship image X2 are transformed using the constructed network mapping function Gw(X) to obtain feature vectors Gw(X1) and Gw(X2), and the loss function EW(X1, X2) is obtained using the following formula:
[0023] E W (X1, X2) = || G W (X1)-G W (X2)||
[0024] The Siamese network is trained using the loss function EW(X1, X2) to output similarity parameters between the ship image X1 and the similar ship image X2.
[0025] Optionally, the acquiring of AIS information of the ship, matching the acquired AIS information with the collected ship image, and obtaining an identity identification tag corresponding to the ship image includes:
[0026] The camera that collects ship images is set to camera stereo calibration; the AIS information of the ship in the image collection area of the camera is obtained, and in the process of the ship entering and leaving the image collection area of the camera, the ship's navigation trajectory is linearly interpolated according to the ship's heading and speed in the ship's AIS information, and each ship image collected by the camera is matched with the corresponding ship AIS information, and used as the identity recognition tag corresponding to each ship image.
[0027] In a second aspect, the present application provides a system for establishing a ship face feature database, the system comprising:
[0028] An acquisition module, used for acquiring ship images under different preset conditions in different preset areas;
[0029] An extraction module, used to extract preset dimensional feature information corresponding to the ship image under different preset conditions;
[0030] A matching module is used to obtain the AIS information of the ship, match the obtained AIS information with the collected ship image, and obtain the identity identification tag corresponding to the ship image;
[0031] The storage module is used to store the ship images under different preset conditions, preset dimensional feature information and identity recognition tags in a database, and generate a ship face feature database so that the ship face feature database can be used for retrieval and matching when re-identifying ships in inland waters.
[0032] In a third aspect, the present application provides a computer device, which adopts the following technical solution:
[0033] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for establishing a ship face feature database are implemented.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:
[0035] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for establishing a ship face feature database are implemented.
[0036] The beneficial effect of adopting the above embodiment is: by collecting ship images under different preset conditions in different preset areas and extracting corresponding preset dimensional feature information, after obtaining the corresponding identity recognition tag according to AIS information matching, the ship images under different preset conditions, the preset dimensional feature information and the identity recognition tag are stored correspondingly to generate a ship face feature database. Since the database contains not only ship images under different preset conditions, but also different dimensional feature information, it provides information-rich ship image samples, and can use the information-rich ship image samples in the database to perform identification when re-identifying inland waters in the future, solving the problem of insufficient samples during re-identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A method flow chart of an embodiment of a method for establishing a ship face feature database provided by the present application;
[0038] Figure 2 A schematic diagram of collecting ship images in the waters of an inland bridge area in an embodiment of a method for establishing a ship face feature database provided by the present application;
[0039] Figure 3 A schematic diagram of collecting ship images in an inland river bend water area in an embodiment of a method for establishing a ship face feature database provided by the present application;
[0040] Figure 4 A schematic diagram of collecting ship images in the inlet and outlet channel area of a coastal port in an embodiment of a method for establishing a ship face feature database provided by the present application;
[0041] Figure 5 A schematic diagram of collecting ship images at different angles in an embodiment of a method for establishing a ship face feature database provided by the present application;
[0042] FIG. 6( a ) and FIG. 6( b ) are schematic diagrams of collecting ship images of different scales in an embodiment of a method for establishing a ship face feature database provided by the present application;
[0043] Figure 7 A method flow chart of step S102 of an embodiment of a method for establishing a ship face feature database provided by the present application;
[0044] Figure 8 A schematic diagram of identifying the bow and stern of a ship in an embodiment of a method for establishing a ship face feature database provided by the present application;
[0045] Fig. 9 A schematic diagram of extracting the text area on the hull in an embodiment of a method for establishing a ship face feature database provided in the present application;
[0046] Fig.10 A schematic diagram of calculating ship similarity in an embodiment of a method for establishing a ship face feature database provided by the present application;
[0047] Fig.11 A schematic diagram of constructing a ship face database in an embodiment of a method for establishing a ship face feature database provided by the present application;
[0048] Fig.12 A schematic diagram of a ship face recognition database in an embodiment of a method for establishing a ship face feature database provided by the present application;
[0049] Fig.13 A principle block diagram of an embodiment of a system for establishing a ship face feature database provided by the present application;
[0050] Fig.14 This is a functional block diagram of an embodiment of a computer device provided in this application. DETAILED DESCRIPTION
[0051] The preferred embodiments of the present application are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of the present application and are used together with the embodiments of the present application to illustrate the principles of the present application, and are not used to limit the scope of the present application.
[0052] In the description of the present application, “plurality” means two or more than two, unless otherwise clearly and specifically defined.
[0053] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0054] The present application provides a method, system, device and storage medium for establishing a ship face feature database, which are described in detail below.
[0055] Reference Figure 1 A method flow chart of an embodiment of a method for establishing a ship face feature database provided by the present application, wherein the method for establishing a ship face feature database comprises the following steps:
[0056] S101, collecting ship images under different preset conditions in different preset areas;
[0057] S102, extracting preset dimensional feature information corresponding to the ship image under different preset conditions;
[0058] S103, obtaining the AIS information of the ship, matching the obtained AIS information with the collected ship image, and obtaining an identity identification tag corresponding to the ship image;
[0059] S104, storing the ship images under different preset conditions, preset dimensional feature information and identity recognition tags in a database, generating a ship face feature database, so that the ship face feature database can be used for retrieval and matching when re-identifying ships in inland waters.
[0060] This embodiment collects ship images under different preset conditions in different preset areas, extracts corresponding preset dimensional feature information, and after obtaining corresponding identity identification tags according to AIS information matching, stores the ship images under different preset conditions, preset dimensional feature information and identity identification tags accordingly to generate a ship face feature database. Since the database contains not only ship images under different preset conditions, but also different dimensional feature information, it provides information-rich ship image samples, which can be used to identify ships in inland waters in the subsequent re-identification, solving the problem of insufficient samples during re-identification.
[0061] Furthermore, in one embodiment, the preset area includes inland bridge area waters, inland river bend waters and / or coastal port entry and exit channel areas; the preset conditions include different scales of the ship from the camera, different lighting environments, different angles and / or different time periods. Step S101 includes:
[0062] When collecting ship images in the waters of the inland bridge area, the camera array pre-installed on the bridge foundation and the shore foundation is used to collect ship images within the waters of the inland bridge area, wherein the camera array consists of a visible light camera and an infrared camera, and the camera array is installed on the bridge foundation at preset intervals, and several of the camera arrays are integrated and installed on the shore foundation to form a multi-angle camera array.
[0063] In this embodiment, since the application scope of ship re-identification is relatively wide, cameras can be deployed in bridge areas, ports, and waterways to perform cross-mirror detection, identification, and tracking of ships. In consideration of the recognition accuracy, the data collection area is as wide as possible, so it is considered to collect ship images in different areas.
[0064] For inland bridge areas, refer to Figure 2 As shown, Figure 2 A schematic diagram of collecting ship images in the waters of an inland bridge area in one embodiment of the method for establishing a ship face feature database provided by the present application. The waters of an inland bridge area are generally wide, and the scale richness of the observed ships is high. For the image collection of the bridge foundation, a top view of the ship and a top view of the ship with a large change angle can be collected. Since the layout of the inland maritime monitoring network is likely to be based on the bridge foundation, the construction of the ship re-identification dataset also requires the collection of bridge foundation ship images.
[0065] Based on the bridge and shore-based fixed facilities, multiple cameras can be arranged in the bridge area to obtain ship images from multiple angles. At the same time, visible light and infrared cameras are combined into a camera array, so that the device layout can be simplified and infrared images of ships can be obtained at night or in foggy weather. For the arrangement of shore-based cameras, in order to better take ship images, a shore-based multi-angle image-AIS information acquisition system can be designed, which can obtain images of ships sailing in inland waters from three angles all day long. For the arrangement of camera arrays in the bridge area, camera arrays are arranged at certain intervals on the bridge according to the length of the bridge. The specific distance between camera arrays should refer to the length of the bridge and the width of the waterway. In order to obtain ship images from more angles, the camera arrays should be as large as possible. This data set installs a camera array every 300 meters on the bridge. The camera viewing angle in the middle of the bridge should be 90° with the bridge. The camera viewing angles from the middle of the bridge to the sides of the bridge gradually reduce the angle with the bridge.
[0066] The main purpose of bridge foundation image acquisition is to collect smaller-scale images of the front and top view of the ship. It is mainly composed of visible light cameras and infrared cameras. The visible light camera can be equipped with a lens that adapts to the focal length of the scene, or a zoom lens can be installed to facilitate the acquisition of ship images with larger ship foregrounds. When visibility is poor or at night, the infrared camera works and the acquired ship is streamed into the ship infrared image database through the network. The power supply and network of the camera are provided by the POE switch through the network optical fiber.
[0067] The main purpose of shore-based image acquisition is to collect side-view images of ships from different angles. In order to achieve the purpose of observing multiple ships at one location, multiple visible light-infrared camera arrays are integrated together. The camera array can acquire ship images at different time points when the ship is sailing in the waters of the bridge area, thereby obtaining images of ships from different angles. The infrared camera and the visible light camera in the array are in the same direction, forming a shore-based inland river ship image acquisition system for different time intervals.
[0068] In order to collect the tag information of the ship, the AIS receiver is integrated with the shore-based image acquisition system on the shore to collect the AIS information of passing ships. This information is later used as a label for the ship image, so as to accurately determine the real ID information of the ship after re-identification.
[0069] For inland river bends, refer to Figure 3 As shown, Figure 3 A schematic diagram of collecting ship images in an inland river bend water area in one embodiment of the method for establishing a ship face feature database provided by the present application. Most ships sailing in the inland river bend water area can be observed, and the shore-based camera installation angle can be adjusted according to the bend angle. The camera can also observe the front image of the ship, and there are many observation angles, which can better collect multi-angle ship pictures. Arranging cameras in relatively narrow waters can obtain larger-scale ship images and obtain more detailed ship information, such as local text symbols and texture information of the ship.
[0070] Unlike bridge foundations, the main purpose of inland river bend shore-based image acquisition is to collect large-scale images of the front and side views of ships. The shore-based multi-angle image-AIS information acquisition system used is the same as the device of the inland river bridge foundation. The device is arranged on both banks before the bend and on the bank facing the river after the bend, and the camera is facing the middle of the inland river. As shown in the figure.
[0071] For coastal port entry and exit waterway areas, refer to Figure 4 As shown, Figure 4 A schematic diagram of collecting ship images in the coastal port entry and exit channel area in one embodiment of the method for establishing a ship face feature database provided by the present application. The coastal port entry and exit channel area has ocean-going and offshore ships entering and exiting all year round, so it is also necessary to arrange a ship re-identification system in this area, and arrange ship image collection to realize re-identification in the identification and monitoring of offshore and offshore ships. The layout of the coastal port image collection system is affected by the shape of the port, so it is adapted to local conditions and cameras are arranged in appropriate protruding areas and on both sides of the channel to collect multi-angle ship face images of ships.
[0072] In addition, in this embodiment, if the characteristics of a ship are only photographed from one angle, the obtained ship characteristics are limited, and when performing ship re-identification, the ship shooting angles of the index images are generally different. Therefore, in order to better extract the ship face features and measure the ship re-identification feature distance, the image of a certain ID ship should be taken from as many angles as possible, and the ship images that are familiar with the shooting angle of the later index images should be given a larger weight to constitute the ship face data of the specific ID ship. Therefore, in this embodiment, ship images from different angles are collected. Figure 5 , Figure 5 A schematic diagram of collecting ship images at different angles in an embodiment of a method for establishing a ship face feature database provided in the present application.
[0073] In this embodiment, it is considered that the number of pixels contained in the ship changes as the distance between the ship and the fixed viewpoint changes. In large-scale scenes, the obtained ship image is small, and its overall features are more obvious (such as overall contour information, overall structural information), but its local detail information is less. In small-scale scenes, the ship occupies a large part of the image, and the local detail information of the ship is relatively rich (such as local structural information, RGB information of each part of the ship, texture features and other multi-dimensional information). Moreover, when the retrieval image of the ship re-identification is measured from the database image, multiple scales can be better matched to the retrieval image of the constantly changing ship image scale. Therefore, in this embodiment, ship images of different scales are collected. Referring to Figures 6(a) and 6(b), it is a schematic diagram of collecting ship images of different scales in the first embodiment of the method for establishing the ship face feature database provided by the present application.
[0074] In this embodiment, it is considered that the images of ships have different characteristics when photographed under different backgrounds and different lighting angles. For example, when photographed with backlight and against light, a clearer image of the ship can be obtained when photographed with backlight, while if photographed against light, the image of the ship is darker and the local information is less. However, the purpose of photographing against light is that the later retrieval images may also be photographed against light, so the photographs photographed against light at different angles are the necessary information for similarity measurement with the photographs retrieved against light. Therefore, in this embodiment, images of ships in different lighting environments such as dusk, twilight, glare, etc. are collected. In addition, the images of ships at different time periods such as morning, noon, and evening will be different, and in this embodiment, images of ships at different time periods are also collected.
[0075] Further, refer to Figure 7 As shown, in one embodiment, step S102 includes:
[0076] S701, extracting a foreground image of the ship image based on a preset target detection algorithm;
[0077] S702. Use a pre-trained bow and stern recognition model to recognize the foreground image, extract the bow image and the stern image in the foreground image, and use the bow image and the stern image as preset dimensional feature information corresponding to the ship image; wherein the bow and stern recognition model is a neural network model obtained by pre-labeling and training a preset number of bow sample images and stern sample images.
[0078] Using a fully convolutional neural network to identify the foreground image to generate a text feature map, using a segmentation frame to extract a text area map in the foreground image according to the shape of the text feature map, and using the text area map as preset dimensional feature information corresponding to the ship image; and / or,
[0079] The aspect ratio information of the ship in the foreground image is obtained, and the aspect ratio information of the aspect ratio information is used as the preset dimensional feature information corresponding to the ship image.
[0080] A similarity parameter between the ship image and a similar ship image is calculated. If the calculated similarity parameter is greater than a preset threshold, the similar ship image is determined as a negative sample label image of the ship image, and the negative sample label image serves as preset dimensional feature information corresponding to the ship image.
[0081] Specifically, since the bridge foundation and the shore base collect images of ships in inland river scenes, and ship re-identification requires foreground images of ships, it is necessary to extract the foreground of ships based on the acquired images in order to avoid the background image from affecting the feature extraction of ships in re-identification. Considering the complexity of inland river scenes and the accuracy of ship extraction, Faster-RCNN and Mask-RCNN based on detectron2 can meet the needs. After identifying inland river ships based on different neural networks, Faster-RCNN has a high accuracy rate in identifying ships and is more accurate in locating ships. At the same time, Mask-RCNN can completely segment the foreground image of the ship, and there is less background information.
[0082] Since the cargo loaded in the cargo hold or deck of a ship may vary in quantity and loading position on different voyages, the image of the middle part of the ship may vary on different voyages. Therefore, in order to solve the problem of matching the feature distances between the images of the same ship on different voyages, the bow and stern of the ship can be identified through a neural network, and the ship can be divided into three parts. The bow and stern are given a larger feature weight, and the middle cargo hold of the ship is given a smaller feature weight, thereby improving the accuracy of subsequent ship re-identification and reducing the re-identification error caused by loading cargo for ships with the same ID. Specifically, in order to realize the recognition and segmentation of the bow and stern, a supervised learning method can be used to use a neural network to learn the labeled bow and stern data sets, optimize the weights of the neural network, and train a bow and stern extractor that can detect, identify and segment the bow and stern areas. Use Faster-RCNN for training, first train based on the ship data set, then transfer the recognition weights of the ship data set to the bow and stern data set, use the bow and stern data set to fine-tune the weights, and finally obtain a neural network that can accurately identify the bow and stern. Reference Figure 8 , Figure 8 A schematic diagram of identifying the bow and stern of a ship in an embodiment of a method for establishing a ship face feature database provided in the present application.
[0083] The image of the ship name or the text content area on the hull is an important mark to distinguish different ships. Since the structure and color of the same type of ships are similar, the hull architecture is also similar, and the distribution area and image features of the ship name and hull text content area on different types of ships and different ID ships are different. Therefore, the neural network based on ship re-identification can extract this feature and use it as important information to calculate the similarity between the index image and the area of the image.
[0084] Before the ship re-identification, ship name recognition is a method of identifying the ship based on the image and the ship ID. However, ship name recognition is limited by the image quality, especially when the ship occupies fewer pixels in the image, the accuracy of text recognition based on natural scenes is low, but the CNN-based ship feature extraction can extract high-dimensional features of characters, not just simple semantic features. Therefore, in this embodiment, considering that the ship text area has Gestalt features, such as the proximity of characters in height and projection, EAST is used to detect the hull text area in the natural scene based on these features, and the text area is directly generated through the fully convolutional network (FCN), and the segmentation box can be an angled rectangle or a quadrilateral according to the shape of the text area, which can more accurately extract the hull text area. Refer to Fig. 9 , Fig. 9 A schematic diagram of extracting the text area on the hull in an embodiment of a method for establishing a ship face feature database provided in the present application.
[0085] In addition to the image dimension information of the ship, the geometric dimension information of the ship is also very important for improving the accuracy of ship re-identification. The aspect ratio of the ship image with the same ID in the same scene is fixed, so this information can provide a basis for the initial screening of ships in the early stage of re-identification. Therefore, in this embodiment, the vertical and horizontal pixels and aspect ratio information of the ship in the foreground image are also obtained, and the vertical and horizontal pixels and aspect ratio information are used as the preset dimensional feature information corresponding to the ship image, thereby improving the working efficiency of the re-identification network and being able to complete the re-identification of the ship in a shorter time.
[0086] Furthermore, since one of the difficulties in re-identifying inland vessels is that some ships have a high degree of similarity, this greatly reduces the accuracy of ship re-identification. In order to solve this problem, in this embodiment, negative samples with similar ships can be added in the process of establishing the database, and the network can be provided with data with negative labels that are difficult to identify based on these negative samples.
[0087] Specifically, the Siamese network algorithm is mainly used to calculate the similarity between two ships. The principle of the algorithm is to use a neural network to extract description operators, obtain feature vectors, and then use the feature vectors of the two pictures to judge the similarity. It is similar to sift, but uses CNN to extract features, and uses feature vectors to construct loss functions and perform network training. Fig.10 , Fig.10 A schematic diagram of calculating ship similarity in an embodiment of a method for establishing a ship face feature database provided in the present application.
[0088] The process of using the Siamese network to find the similarity of ship images includes: there are two branches that input images X1 and X2 respectively (note: these two branches are actually the same, the same CNN model, the same parameters), including convolution, pooling and other related operations. The Siamese network is divided into the front half and the back half. The front half is used for feature extraction. Two ship images can be input into the front half of the network respectively, and then an output feature vector Gw(X1) and Gw(X2) are obtained respectively. Then two feature vector distance metrics are constructed as the similarity calculation function of the two images. For example,
[0089] To calculate whether the ship images X1 and X2 are similar, we can construct a network mapping function Gw(X), and then take X1 and X2 as parameter independent variables, and we can get Gw(X1) and Gw(X2), that is, we get the feature vectors used to evaluate whether X1 and X2 are similar. Then we get the loss function:
[0090] E W (X1, X2) = || G W (X1)-G W (X2)||
[0091] By using this loss function to train the network, the similarity between the two ships can be determined. In the above process, the two branches of the network use the same function, that is, the weights and network structure are the same. Gw(X) can be regarded as a feature extractor. Therefore, the Siamese network is actually a process of extracting the feature operator of the image. Then, in the last layer of the network, it is a loss function used to define the similarity between feature vectors. The similarity of each image can be accurately calculated through the feature extraction operator and the feature distance calculation operator. Then, the easily confused ship image, that is, the similar ship image corresponding to the collected ship image, is obtained, and the similar ship image is determined as the negative sample label image of the ship image, and the negative sample label image is used as the preset dimensional feature information corresponding to the ship image.
[0092] In this embodiment, by adding negative samples to the ship face feature database, compared with the ship re-identification based only on positive labels, the re-identification neural network with positive and negative samples in this embodiment can learn more ship features, improve the recognition ability of the network, increase the recognition accuracy of similar ships, and reduce the recognition error rate.
[0093] Further, in one embodiment, step S103 includes:
[0094] The camera that collects ship images is set to camera stereo calibration; the AIS information of the ship in the image collection area of the camera is obtained, and in the process of the ship entering and leaving the image collection area of the camera, the ship's navigation trajectory is linearly interpolated according to the ship's heading and speed in the ship's AIS information, and each ship image collected by the camera is matched with the corresponding ship AIS information, and used as the identity recognition tag corresponding to each ship image.
[0095] In this embodiment, in terms of maritime supervision, supervision of ships is often achieved by monitoring the AIS information of the ships to obtain the location information of the ships, and ship re-identification is to supervise the ships based on the image information of the maritime supervision system, so it is necessary to give the ships in the picture their real labels (ship names / call signs), that is, identity identification labels, and therefore it is necessary to match the AIS information of the ships with the ship images.
[0096] The ship automatic identification system AIS (automatic identification system) can transmit and receive dynamic and static information of ships. Among them: dynamic information includes the time when the ship sends information, the longitude and latitude values of the ship at that time, the ship's heading, etc. Since the AIS information transmission of passing ships is intermittent, the ship's navigation trajectory is linearly interpolated based on the intermittent ship AIS position information and the ship's heading and speed information. When a ship appears in the picture, the interpolated ship trajectory is used to predict the position of the ship in the image. However, it is necessary to establish the correspondence between the image acquisition image and the real scene before that, which can be done through the stereo calibration of the camera.
[0097] For camera stereo calibration, the camera remains fixed in the water area monitored by the camera. The purpose is to obtain the camera's intrinsic matrix parameters and the camera's extrinsic rotation matrix parameters. Using Zhang Zhengyou's calibration method, a two-dimensional calibration object is used to continuously obtain the object image in the scene, obtain the object corner point, and then calculate the relationship between the corner point image coordinates and the actual coordinates of the corner point in the real coordinate system. This process can be completed through the camera calibration of the MATLAB toolbox.
[0098] For ship trajectory interpolation, first obtain the ship AIS information in the image acquisition area, perform linear interpolation on the time of the ship information with the same call sign, and decompose the ship motion into changes in longitude and latitude. That is, the original longitude and latitude changes are regarded as a combination of two one-dimensional motions (time-longitude), and the motion in both directions is regarded as a short-term uniformly accelerated linear motion. Assume that the interpolation point is p i (Lon i , Lat i , v i ,θ i , t i ), where: Lon represents longitude; Lat represents latitude; v represents ship speed; θ represents heading; t represents sending time. The coordinates of the two points before and after are q1 (Lon1, Lat1, v1, θ1, t1) and q2 (Lon2, Lat2, v2, θ2, t2). The interpolation is changed from longitude and latitude to time interpolation. The interpolation time series T is used to obtain the interpolation time t i The coordinates of the point (Lon i , Lat i ), and then use the linear interpolation method to interpolate the two motion states respectively, and finally combine the longitude and latitude of the same time obtained by interpolation to get the final interpolation result.
[0099] For the matching of ship AIS information and camera images, after camera stereo calibration, a one-to-one correspondence between the camera image area and the actual monitoring area is established. When a ship sends out AIS information before the camera imaging area, then enters the camera imaging area, updates the AIS information in the area, or updates the AIS information after leaving the area, the continuous track coordinate information of the ship in the real world can be obtained through the interpolation of the ship trajectory. Finally, the coordinate information is converted into the camera image coordinate system coordinates. According to the converted coordinates and the coordinates of the ship image captured by the camera passing through the area, the ship in the real coordinate system can be matched with the ship in the image coordinate system. Therefore, the ship's AIS information can be matched one-to-one with the ship in the image.
[0100] In summary, see Fig.11 , Fig.11 A schematic diagram of constructing a ship face database in an embodiment of the method for establishing a ship face feature database provided by the present application. In this embodiment, after the above steps, information of ships at different angles, different scales, different regions, different dimensions, etc. can be obtained. This information is integrated, and the pictures of each ship are put into the same directory. Then, the directory collection of different ships constitutes a ship face feature database, i.e., a ship face recognition database. See Fig.12 , Fig.12 A schematic diagram of a ship face recognition database in an embodiment of a method for establishing a ship face feature database provided in the present application.
[0101] In an optional embodiment, the database includes the following ship information:
[0102] Ship face information at different scales. According to the specific scene scale, the ship can be divided into one scale when it is 300m away from the camera. Similarly, the ship image when it is 500m, 800m, 1000m, and 1500m away from the camera can be divided into ship pictures at different scales, ship text areas, bow pictures, stern pictures, negative label images, ship vertical and horizontal pixels and aspect ratio information. In the future, the division of ship scales can be further refined according to the requirements of the re-identification network to obtain more ship information.
[0103] Ship face information under different lighting conditions. When the camera shoots the ship toward the light, it is divided into ship images facing the light, ship text area, bow images, stern images, negative label images, ship vertical and horizontal pixels, and aspect ratio information. Similarly, when the camera shoots against the light, it is divided into ship images facing the light, ship text area, bow images, stern images, negative label images, ship vertical and horizontal pixels, and aspect ratio information.
[0104] Ship face information at different angles. According to the pictures taken by cameras at different angles in the same scene and at the same time interval of the same ship, the images of the ship acquired by different cameras are divided into 6 categories, namely: ship pictures at 45° shore, 45° bridge, 90° shore, 90° bridge, 135° shore, 135° bridge, ship text area, bow picture, stern picture, negative label image, ship vertical and horizontal pixels and aspect ratio information.
[0105] Ship face information at different time periods. According to the different weather, lighting and other environments in the ship navigation area at different time periods, the collected information can be divided into ship images of different seasons from March to June, from June to September, from September to November, and from November to March of the following year. Alternatively, considering the changes in lighting during the day, the ship data of each day can be divided into images of the ship at 6-8, images of the ship at 8-10, images of the ship at 10-14, images of the ship at 14-17, images of the ship at 17-19, images of the ship at 19-6 o'clock the next day, ship text areas, bow images, stern images, negative label images, and information on the ship's vertical and horizontal pixels and aspect ratios.
[0106] The ship face feature database generated in this embodiment includes specific ID ship images in different time periods and different environments, integrates ship image information of various dimensions, enriches the ship features of ship re-identification input data, and by establishing a hierarchical recognition database under different conditions, it is convenient for the re-identification neural network to calculate the feature distance between the index ship image and the image of the ship face feature database under the conditions for the ship pictures under different conditions, which can meet the application needs of ship re-identification in various situations.
[0107] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0108] This embodiment also provides a system for establishing a ship face feature database, which corresponds one-to-one to the method for establishing a ship face feature database in the above embodiment. Fig.13 As shown, the system for establishing the ship face feature database includes a collection module 501, an extraction module 502, a matching module 503, and a storage module 504. The detailed description of each functional module is as follows:
[0109] The acquisition module 501 is used to acquire ship images under different preset conditions in different preset areas;
[0110] An extraction module 502 is used to extract preset dimensional feature information corresponding to the ship image under different preset conditions;
[0111] The matching module 503 is used to obtain the AIS information of the ship, match the obtained AIS information with the collected ship image, and obtain the identity identification tag corresponding to the ship image;
[0112] The storage module 504 is used to store the ship images under different preset conditions, preset dimensional feature information and identity recognition tags in a database, and generate a ship face feature database so that the ship face feature database can be used for retrieval and matching when re-identifying ships in inland waters.
[0113] The specific definition of each module of the ship face feature database establishment system can refer to the definition of the ship face feature database establishment method in the above text, and will not be repeated here. Each module in the above ship face feature database establishment system can be implemented in whole or in part by software, hardware and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0114] Reference Fig.14 This embodiment also provides a computer device, which may be a computing device such as a mobile terminal, a desktop computer, a notebook, a palmtop computer, and a server. The computer device includes a processor 10, a memory 20, and a display 30. FIG6 shows only some components of the computer device, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0115] In some embodiments, the memory 20 may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory 20 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Further, the memory 20 may include both an internal storage unit of the computer device and an external storage device. The memory 20 is used to store application software and various data installed in the computer device, such as program codes installed in the computer device. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a computer program 40 for establishing a ship face feature database.
[0116] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code stored in the memory 20 or process data, such as executing a method for establishing a ship face feature database.
[0117] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the computer device and to display a visual user interface. The components 10-30 of the computer device communicate with each other through a system bus.
[0118] In one embodiment, when the processor 10 executes the computer program 40 for establishing the ship face feature database in the memory 20, the following steps are implemented:
[0119] Collect ship images under different preset conditions in different preset areas;
[0120] Extracting preset dimensional feature information corresponding to the ship images under different preset conditions;
[0121] Acquire the AIS information of the ship, match the acquired AIS information with the collected ship image, and obtain the identity identification tag corresponding to the ship image;
[0122] The ship images under different preset conditions, preset dimensional feature information and identity recognition tags are correspondingly stored in a database to generate a ship face feature database, so that the ship face feature database can be used for retrieval and matching when re-identifying ships in inland waters.
[0123] This embodiment also provides a computer-readable storage medium, on which a computer program for establishing a ship face feature database is stored. When the computer program is executed by a processor, the following steps are implemented:
[0124] Collect ship images under different preset conditions in different preset areas;
[0125] Extracting preset dimensional feature information corresponding to the ship images under different preset conditions;
[0126] Acquire the AIS information of the ship, match the acquired AIS information with the collected ship image, and obtain the identity identification tag corresponding to the ship image;
[0127] The ship images under different preset conditions, preset dimensional feature information and identity recognition tags are correspondingly stored in a database to generate a ship face feature database, so that the ship face feature database can be used for retrieval and matching when re-identifying ships in inland waters.
[0128] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0129] Any reference to memory, storage, database or other medium used in the embodiments provided in the present application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0130] The above is only a preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed in the present application should be covered within the protection scope of the present application.
Claims
1. A method for establishing a ship face feature database, characterized in that: The method comprises: Collect ship images under different preset conditions in different preset areas; Extracting preset dimensional feature information corresponding to the ship images under different preset conditions; Acquire the AIS information of the ship, match the acquired AIS information with the collected ship image, and obtain the identity identification tag corresponding to the ship image; The ship images under different preset conditions, the preset dimensional feature information and the identity recognition tags are stored in a database to generate a ship face feature database, so that the ship face feature database can be used for retrieval and matching when re-identifying the inland waters ship; The collecting of ship images under different preset conditions in different preset areas includes: When collecting images of ships in the waters of the inland bridge area, the images of ships in the waters of the inland bridge area are collected by using a camera array pre-installed on the bridge foundation and the shore foundation, wherein the camera array is composed of a visible light camera and an infrared camera, and the camera array is installed at preset intervals on the bridge foundation, and a plurality of the camera arrays are integrated and installed on the shore foundation to form a multi-angle camera array; The extracting of preset dimensional feature information corresponding to the ship image under different preset conditions includes: Extracting the foreground image of the ship image based on a preset target detection algorithm; The foreground image is recognized by using a pre-trained bow and stern recognition model, and the bow image and the stern image in the foreground image are extracted, and the bow image and the stern image are used as preset dimensional feature information corresponding to the ship image; wherein the bow and stern recognition model is a neural network model obtained by pre-labeling and training a preset number of bow sample images and stern sample images; The extracting of preset dimensional feature information corresponding to the ship image under different preset conditions includes: Using a fully convolutional neural network to identify the foreground image to generate a text feature map, using a segmentation frame to extract a text area map in the foreground image according to the shape of the text feature map, and using the text area map as preset dimensional feature information corresponding to the ship image; and / or, Acquire the aspect ratio information of the ship in the foreground image, and use the aspect ratio information of the foreground image as the preset dimensional feature information corresponding to the ship image; The extracting of preset dimensional feature information corresponding to the ship image under different preset conditions includes: Calculating a similarity parameter between the ship image and a similar ship image, and if the calculated similarity parameter is greater than a preset threshold, determining the similar ship image as a negative sample label image of the ship image, and the negative sample label image serves as preset dimensional feature information corresponding to the ship image; The calculating the similarity parameter between the ship image and similar ship images comprises: The ship image X1 and the similar ship image X2 are transformed using the constructed network mapping function Gw(X) to obtain feature vectors Gw(X1) and Gw(X2), and the loss function EW(X1, X2) is obtained using the following formula: The Siamese network is trained using the loss function EW(X1, X2) to output similarity parameters between the ship image X1 and the similar ship image X2.
2. The method for establishing a ship face feature database according to claim 1, characterized in that: The preset area includes inland bridge area waters, inland river bend waters and / or coastal port entry and exit channel areas; the preset conditions include different scales of the ship from the camera, different lighting environments, different angles and / or different time periods.
3. The method for establishing a ship face feature database according to claim 1 or 2, characterized in that: The obtaining of the AIS information of the ship, matching the obtained AIS information with the collected ship image, and obtaining an identity identification tag corresponding to the ship image includes: The camera that collects ship images is set to camera stereo calibration; the AIS information of the ship in the image collection area of the camera is obtained, and in the process of the ship entering and leaving the image collection area of the camera, the ship's navigation trajectory is linearly interpolated according to the ship's heading and speed in the ship's AIS information, and each ship image collected by the camera is matched with the corresponding ship AIS information, and used as the identity recognition tag corresponding to each ship image.
4. A system for establishing a ship face feature database, used to execute the method for establishing a ship face feature database as claimed in any one of claims 1 to 3, characterized in that: The system comprises: An acquisition module, used for acquiring ship images under different preset conditions in different preset areas; An extraction module, used to extract preset dimensional feature information corresponding to the ship image under different preset conditions; A matching module is used to obtain the AIS information of the ship, match the obtained AIS information with the collected ship image, and obtain the identity identification tag corresponding to the ship image; The storage module is used to store the ship images under different preset conditions, preset dimensional feature information and identity recognition tags in a database, and generate a ship face feature database so that the ship face feature database can be used for retrieval and matching when re-identifying ships in inland waters.
5. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for establishing a ship face feature database as claimed in any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for establishing a ship face feature database as claimed in any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Ship feature re-identification method, application method and system based on deep learning
CN109977897A
Ship identity recognition system based on camera calibration and deep learning algorithm
CN111523465A
Ship identity recognition method based on fusion of AIS data and video data
US20210073573A1
