{'fraction_non_alphanumeric': 0.04088712426557581, 'fraction_numerical': 0.014337564418777196, 'mean_word_length': 4.255559068394984, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 54, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Generalized Local Optimality for Video Steganalysis in Motion Vector Domain

The local optimality of motion vectors (MVs) is an intrinsic property in video coding, and any modifications to the MVs will inevitably destroy this optimality, making it a sensitive indicator of steganography in the MV domain. Thus the local optimality is commonly used to design steganalytic features, and the estimation for local optimality has become a top priority in video steganalysis. However, the local optimality in existing works is often estimated inaccurately or using an unreasonable assumption, limiting its capability in steganalysis. In this paper, we propose to estimate the local optimality in a more reasonable and comprehensive fashion, and generalize the concept of local optimality in two aspects. First, the local optimality measured in a rate-distortion sense is jointly determined by MV and predicted motion vector (PMV), and the variability of PMV will affect the estimation for local optimality. Hence we generalize the local optimality from a static estimation to a dynamic one. Second, the PMV is a special case of MV, and can also reflect the embedding traces in MVs. So we generalize the local optimality from the MV domain to the PMV domain. Based on the two generalizations of local optimality, we construct new types of steganalytic features and also propose feature symmetrization rules to reduce feature dimension. Extensive experiments performed on three databases demonstrate the effectiveness of the proposed features, which achieve state-of-the-art in both accuracy and robustness in various conditions, including cover source mismatch, video prediction methods, video codecs, and video resolutions.


I. INTRODUCTION
S TEGANOGRAPHY and steganalysis are a pair of antagonistic technologies engaged in a cat-and-mouse game fashion, where the steganography aims to covertly transmit secret messages by embedding them into inconspicuous carriers, and the steganalysis tries to expose the presence of hidden messages in suspicious carriers. What connects the above two opposite parties is message carrier, on which the embedding mechanisms of steganography and the discriminative features of steganalysis rely heavily in practice. Commonly used carriers for steganography and steganalysis are digital media including image, video and audio, among which the digital video has gained more attention recently for following reasons.
First, digital videos are easily accessible carriers in today's digital media era. Digital video has become ubiquitous and pervasive due to the high popularity of video devices and the wide variety of online video applications, making video stream the main traffic flow in the IP network. According to Cisco Visual Networking Index [1], the global IP video traffic will account for 82% of all IP traffic by 2022, up from 75% in 2017. Second, digital video has sufficient spatialtemporal information, which provides more embedding space than other types of carriers [2]. Third, video sharing and broadcast through social networking is conductive to conceal the steganography behavior. It is reported that 400 hours of videos are uploaded to YouTube every minute worldwide [3], acting as a natural camouflage for transmitting videos with hidden messages. These merits of video carrier promote the prosperity of video steganography, and large numbers of video steganographic methods or tools have emerged continuously [4], posing a severe challenge to video steganalysis.
The MV based steganography embeds messages into MVs by modifying the values of one and/or two components of MVs. This embedding is performed in the inter coding of video compression, in accompanying with prediction error (PE) adjustment to avoid video quality degradation. The development of MV based steganography can be divided into three stages. The MV based steganography in the first stage is quality-preserved methods, which modify the candidate MVs while maintaining the video quality, such as selecting large MV magnitudes [12], appropriate MV phase angles [13] and small PEs [14]. The second-stage MV based steganography is statistics-preserved methods, whose aim is to modify the MVs with minimal impact on video statistics. Typical methods include perturbing motion estimation with suboptimal MVs [15] and altering MVs with slight changes on MV distributions and PEs [16]. To achieve little statistical deviation, some coding schemes, like wet paper codes [27] and syndrometrellis codes [28], are also integrated into the embedding. In the third stage, the MV based steganography can be characterized as local optimality-preserved methods from the coding point of view. These methods first assess the preservation of MV optimality when suffering MV modifications, based on which the embedding cost for each MV is designed and assigned, and finally embed the messages by using syndrome-trellis codes. Popular methods in this type measure the MV optimality using coding costs of MVs, including the sum of absolute difference (SAD) [17] and Lagrangian cost [18]. Recently, the combination of video statistics and local optimality is also arXiv:2112.11729v1 [cs.CV] 22 Dec 2021 employed for MV based steganography [19].
The MV based steganography has gone through a process which moves the focus from the coding-independent video entities to the intrinsic properties of video coding. Similarly, the video steganalysis in the MV domain also has such a developmental trend. Steganalytic features play a crucial role in steganalysis. Early video steganalytic features are designed drawing on the ideas of image steganalysis, such as characteristic function moments of MV residue distributions [29], [30], first-order or high order co-occurrence matrices using MV residues [31], [32], and calibration based features [33]- [35]. These steganalytic features performs well against the first-stage MV based steganography, but are often incompetent for the later ones which consider more about steganographic security. Besides, they also have some constraints in feature extraction, such as continuous and non-subdivided inter macroblocks, as discussed in [36], [37]. To better reveal the embedding traces in MVs, the coding optimality associated with MVs are explored to construct steganalytic features. The representative method is AoSO [38], which assumes that the original MV is locally optimal, and uses SAD as a criterion to identify whether or not a MV has been changed. A similar methodology was also present in [39], where the SAD based local optimality together with recompression calibration is used to extract features. However, these local optimality based features become ineffective when this ideology is adopt by an adversary [17]- [19]. As a fightback against the local optimality-preserved methods, subsequent video steganalysis [40] suggests using more accurate coding criterion to check the local optimality of MVs. In [40], the rate-distortion cost instead of SAD is utilized to form steganalytic features, achieving significant detection performance.
The local optimality based features have become a prevailing approach for video steganalysis in MV domain, owing to the fact that any locally optimal MVs undergoing changes will be shift to locally non-optimal ones in a high probability, regardless of embedding mechanism. Therefore, the local optimality based features rely heavily on the estimation of local optimality for MVs. However, the accuracy of estimation for local optimality in existing works is still far from the requirements. The SAD based local optimality [38], [39] only focuses on the distortion cost, but neglects the bit-rate cost associated with MVs 1 . Although the rate-distortion based optimality [40] considers both the above costs simultaneously, the bit-rate cost is estimated on an unreasonable assumption. For example, when calculating the motion vector difference between the MV and its predicted motion vector (PMV), the [40] assumes that the PMV is unchanged. If a changed PMV is used to estimate the bit-rate cost, inaccurate estimation result may occurs (see the detail examples in Section III-B).
In this paper, we propose to construct steganalytic features for video steganalysis by using generalized local optimality. We adopt the rate-distortion cost to measure the local optimality. To identify the steganographic changes of MVs more accurately and stably, we generalize the normal local 1 Distortion cost refers to the pixel difference. Bit-rate cost is the bit length required to encode the motion vector difference. See Section II for details. optimality in two aspects. First, The bit-rate cost (also the ratedistortion cost) is determined jointly by MV and PMV. The PMV may be changed or remain unchanged after embedding, and the uncertainty of PMV will affect the estimation of local optimality for the corresponding MV. Therefore, we suggest checking the local optimality of MVs under the conditions of various possible changes of PMVs, and generalize the local optimality from a static estimation to a dynamic one. This generalization aims to reduce the interference of the PMV changes on rate-distortion costs. Second, the PMV is a special case of MV, whose changes are also reflected in the PMV, so the change of PMV can also be served as an indicator of steganographic embedding. As a result, we suggest checking the local optimality not only for the MVs but also for the PMVs, and generalize the local optimality from MV domain to PMV domain. This generalization aims to increase the diversity of steganalytic features. Finally, we design two types of steganalytic features based on the two generalizations of local optimality, and also propose symmetrization rules to reduce feature dimension. We perform extensive experiments to evaluate the detection accuracy, robustness and complexity of our method, and all the results prove its advantages over existing steganalytic methods.
The contributions of this paper are summarized as follows: 1) We discover the underlying issue in normal local optimality, and generalize the concept of local optimality in two aspects, including estimating the local optimality of MVs from the fixed PMVs to the dynamic PMVs, and extending the local optimality from the MV domain to the PMV domain. 2) We construct two types of steganalytic features, including the generalized local optimality features in MV domain and those in PMV domain, both of which eliminate the interactions among neighboring MVs, and thus improve the detection accuracy. To our best knowledge, this is the first study to explore the PMVs for video steganalysis. 3) We propose feature symmetrization rules based on the distributions of generalized local optimality, and the symmetrization rules significantly reduce the feature dimensions without sacrificing detection accuracy. 4) The proposed generalized local optimality increases the diversity of steganalytic features while does not obviously affect the computational complexity, indicating its efficiency for practical applications. The organization of this paper is as follows. Section II briefly introduces the video inter coding related to our method. Section III elaborates on the two types of generalized local optimality. The subsequent Section IV describes the details of feature construction. In Section V, we present and discuss the experimental results. Finally, Section VI concludes the paper.

II. PRELIMINARIES
Our video steganalytic method can be applied to any video coding standards that adopt rate-distortion optimization for inter coding. In this section, we use H.264/AVC [41] as an example to introduce the preliminary knowledge of video inter coding related to our feature design. We choose H.264/AVC because it is still the most commonly accepted video coding standard, which holds an 82% market share of video codecs in 2019 [42], making it widely applicable for video steganography [2], [4].
The H.264/AVC employs a block-based hybrid video coding framework. For a current block in the inter frame, the motion estimation (ME) searches for a predicted block in the previously coded frame (i.e., reference frame) such that the predicted block is most similar to the current block. The similarity of the two blocks is usually measured by the sum of absolute difference (SAD) or the sum of absolute transformed difference (SATD), which represents the visual distortion introduced by video coding.
The spatial offset between the current block and the predicted block is called motion vector (MV). The MV indicates the position of the predicted block. To reduce bit-rate, the motion vector difference (MVD), which is the difference between the MV and the predicted motion vector (PMV), is encoded into video bit-stream. For the PMV, it is the starting MV for ME, and is usually defined as the median value of the MVs of three neighboring blocks adjacent to the current block, including left, top, and top-right blocks [41] (see the left figure in Fig. 1).
Visual distortion and bit-rate are the two most crucial criteria for video coding. These two criteria are mutually conflicting, and the process of finding a good trade-off between them is known as rate-distortion optimization (RDO), which is achieved by minimizing the following Lagrangian function where J is the rate-distortion cost, V and P stand for the MV and the PMV, E denotes the current block, E V denotes the predicted block indicated by V , D (·, ·) represents the distortion cost measured by SAD or SATD, R (·) represents the bit-rate cost, and λ is the Lagrangian multiplier defined as λ = √ 0.85 × 2 (Q−12)/3 , in which Q denotes the quantization parameter (QP) [43].
For efficient video coding, practical video codecs often use fast block matching algorithms [44] for ME, so the final J has a minimum value in a local search area. This is so-called the local optimality of MVs. Apparently, a changed MV may lose its local optimality after steganographic embedding, which is the foundation of local optimality based features for video steganalysis.

III. GENERALIZED LOCAL OPTIMALITY
This section first describes the embedding effect on PMV and bit-rate, and then analyzes the four cases of rate-distortion cost, followed by the definition of generalized local optimality  for MV and PMV, and the discussion of the changes of generalized local optimality caused by steganography.

A. Embedding Effect on PMV and Bit-rate
The RDO is adopted in nearly all video coding standards, so we use rate-distortion cost to measure the local optimality of MVs, as did in [40]. Although the rate-distortion cost can capture the changes of MVs more accurately than SAD [38], [39], it is affected by more factors.
According to (1), the rate-distortion cost is the weighted sum of distortion and bit-rate, in which the distortion is only controlled by MV, while the bit-rate is jointly determined by MV and PMV. Therefore, when using the rate-distortion cost to check the local optimality of MVs, not only the MVs but also the PMVs need to be considered.
The PMV is a special case of MV, and is formed by the median prediction of three neighboring MVs [41]. So the changes of neighboring MVs may also lead to the change of the corresponding PMV. To avoid the decoding error, every PMV after steganographic embedding should be updated by the neighboring MVs to calculate the new MVD, which will be encoded into the bit-stream of the stego video.
To describe the relationship between embedding and PMV more intuitively, we use Fig. 1 to illustrate the above process. The left figure in Fig. 1 shows the locations of current block E and its three neighboring blocks A, B and C, whose MVs are denoted by V E , V A , V B and V C , respectively. The right figure in Fig. 1 shows the values of four MVs and the calculation results of PMV P and MVD D E corresponding to V E . The P is the median of V A , V B and V C , and if the embedding change "+1" is only made to the horizontal component of V A or V B (−27 is modified as −26), the PMV will be changed from P = (−27, −3) to P = (−26, −3), and the MVD will be changed from D E = (+1, −1) to D E = (0, −1). For other examples, such as changing the horizontal components and/or vertical components with different combinations of MV numbers and change types, the PMV and the MVD may also change correspondingly.
Meanwhile, the bit-rate may also change with the PMV. The change rates of PMVs and bit-rate under different change rates of MVs are shown in Fig. 2 Fig. 8 in Supplementary), so its change rate is lower than that of PMVs.

B. Four cases of Estimation for Local optimality
The local optimality of MVs is disturbed during steganographic embedding at the video encoder side, but has to be estimated for steganalysis at the video decoder side, so the estimation of local optimality is affected by the quantization distortion [38]. We verify that apart from the quantization distortion, the change of PMV will also affect the estimation of local optimality.
Since the rate-distortion cost is jointly determined by PMV and MV, the local optimality of a MV can be estimated in following four cases: • Case 1: both the PMV and the MV are not changed. • Case 2: the PMV is not changed, but the MV is changed. • Case 3: the PMV is changed, but the MV is not changed. • Case 4: both the PMV and the MV are changed. In the first two cases, the PMVs are not changed during the embedding, which is considered by previous method [40]. While in the last two cases, the PMVs are changed due to the changes of other MVs. The empirical probabilities of occurrences of four cases in stego videos are listed in Table I.
As shown in Table I, for a given change rate of MVs, the empirical probabilities of each case are very close under different QPs, indicating that the proportions of four cases are not influenced by the compression degree. When the change rate increases, the proportion of Case 1 decreases gradually, while the proportions of the other three cases all increase. In particular, the empirical probability of Case 4 increases more significantly, because the interaction among neighboring MVs is more prominent at high change rates. To investigate the embedding effect on the local optimality for different cases, we report in Table II the empirical probabilities of occurrences of local optimality for four cases in stego videos. This experiment is simulated at the video encoder side, from which we can check the values of PMVs and MVs before and after embedding, and the rate-distortion costs are calculated using the updated PMVs after embedding, which matches the situation at the video decoder side.
By comparing Case 1 and Case 2 in Table II, we observe a large probability gap between them. This is because the Case 1 corresponds to the situation in a cover video where both the PMVs and the MVs remain unchanged, and naturally has high probabilities of local optimality. The Case 2 is an ideal situation where only the MVs are changed and the ratedistortion costs can be obtained free from the influence of PMVs, so it has low probabilities of local optimality.
For the Case 3, although the MVs are not changed, the local optimality can still be destroyed by the changes of PMVs. Because the changed PMV may alter the rate-distortion cost, deviating the MV from locally optimal to locally non-optimal. This process is illustrated by the example in Fig. 3, showing the changes of SAD, bit-rate and rate-distortion cost when only the PMV is modified. The results in Fig. 3 are obtained from a coding block (frame No. 12, block No. 44) in video sequence "bus" in DB1. The P denotes the PMV, the V 5 is the original MV located in the center of the 3 × 3 neighborhood (see the 3×3 structure in Fig. 4(b)), V 4 is the modified MV by making embedding change "−1" on the horizontal component of V 5 , and J 4 and J 5 are the rate-distortion costs corresponding to V 4 and V 5 . The video sequence is H.264/AVC compressed with QP 15, so the Lagrangian multiplier is λ = 1.3 (see the definition of λ in (1)).
As can be seen from Fig. 3, before changing the PMV P , the V 5 has a local optimality, i.e., J 5 = min J k , k = 1, · · · , 9. After changing the PMV from P = (−32, −5) to P = (−33, −5), the SADs remain unchanged, but the MVDs together with bit-rates and rate-distortion costs in the 3 × 3 neighborhood are all changed. Taking V 4 and V 5 as an example, since V 5 and P have the same modification directions (both −1 on the horizontal components), the V 4 changed from V 5 tends to have a smaller magnitude of MVD, and thus the V 4 has a lower bit-rate and a lower rate-distortion cost than V 5 . Finally, when rechecking local optimality in the 3 × 3 neighborhood, the V 5 is no longer locally optimal.    As for the Case 4, it is the combination of Case 2 and Case 3. The superposition of changing both the PMV and the MV may shift the MV from locally optimal to locally non-optimal, or even shift the MV from locally non-optimal (caused by quantization distortion) to locally optimal. These two types of changes for local optimality occur almost equally by our experimental observation, so the overall empirical probabilities of Case 2 and Case 4 are very close. For brevity and simplicity, we do not provide detail examples like Fig. 3.
From the explanations of Case 3 and Case 4, we observe that the changes of the PMVs may deviate the estimation of local optimality for tested MVs. This deviation is sometimes beneficial to video steganalysis (e.g., the changed PMV make the unchanged MV become locally non-optimal), but sometimes it is unfavorable to steganalysis (the changed PMV and the changed MV may counteract with each other, obtaining a locally optimal MV and thus reducing the embedding traces). Therefore, we draw following two conclusions: 1) To increase the accuracy of estimation for local optimality, we suggest checking the local optimality by considering the dynamics of PMVs. 2) To improve the diversity of local optimality based features, we suggest checking the local optimality from the view of both MVs and PMVs. In the following two subsections, we will generalize the local optimality based on the two conclusions and demonstrate their effectiveness.

C. Generalized Local Optimality of MVs
According to the first conclusion, the dynamics of PMVs should be considered to estimate the local optimality of MVs. However, the steganalyst at the video decoder side does not know whether or not the PMVs have been changed or the way they were changed. So it is impossible to estimate the local optimality of MVs by predetermining the status of PMVs.
Inspired by the local optimality estimation that considers the MVs with all potential modifications, we estimate the local optimality of MVs under the conditions of all potential modifications of PMVs. We define the generalized local optimality of a MV as the optimality that the corresponding MV has the lowest ratedistortion cost under various possible modifications of the PMV. Since larger modification magnitudes of MVs lead to greater impact on video compression efficiency and steganographic security, practical MV based steganography often limits the embedding changes to ±1 [12], [14]- [17], [19]. Following the practice in [38]- [40], we also consider the ±1 embedding on MVs. Let the l-th MV in a frame be denoted by where V h l and V v l are the horizontal and vertical components of V l . A set of candidate MVs which are potentially modified MVs is defined as Let the PMV of the l-th MV be denoted by P l = (P h l , P v l ), where P h l and P v l are the horizontal and vertical components of P l . Similar to (2), a set of candidate PMVs which are potentially modified PMVs is defined as The relative spatial positions of Ω(P l ) and Ω(V l ) are 3 × 3 neighborhoods as shown in Fig. 4(a) and (b). Let J(P i l , V j l ) denotes the rate-distortion cost determined by P i l and V j l . Given a PMV P i l ∈ Ω(P l ), the relative spatial positions of J(P i l , V j l ) j = 1, · · · , 9 is shown in Fig. 4(c), and the empirical probability that the V j l ∈ Ω(V l ) has a local optimality is denoted by Pr(J(P i l , V j l ) = J min (P i l , Ω(V l ))), where J min (P i l , Ω(V l )) = min J(P i l , V j l ) j = 1, · · · , 9 . The comparison of Pr(J(P i l , V j l ) = J min (P i l , Ω(V l ))) for cover and stego videos are shown in Fig. 5. The cover and stego videos are the same as those mentioned in Section  III-A. The videos are compressed with QP 15, and the local optimality is measured by the SAD based rate-distortion cost.
To highlight the graphical comparison results, a large change rate of 0.5 for MVs is used. As seen from Fig. 5, in stego videos, the Pr(J(P i l , V 5 l ) = J min (P i l , Ω(V l ))) is decreased and the Pr(J(P i l , V j l ) = J min (P i l , Ω(V l ))), j = 5 are all increased, verifying that the steganographic embedding destroys the local optimality of MVs. The above phenomenon is observed for all P i l ∈ Ω(P l ), this demonstrates that the dynamics of PMVs should indeed be used to estimate the local optimality of MVs (the previous work [40] regards all P i l ∈ Ω(P l ) as P 5 l .

D. Generalized local optimality of PMVs
The MV based steganography directly modifies the MVs, so the local optimality in existing methods [38]- [40] is naturally analyzed from the view of MVs. Since the rate-distortion cost is jointly determined by the MV and the PMV, the local optimality can also be explained from the view of the PMV, as illustrated by the example of Case 3 in Fig. 3. Specifically, for a block whose MV is not changed, the corresponding ratedistortion cost will depend on the PMV. If the PMV is also unchanged, we could say that the PMV has a local optimality. We could also say that the PMV is locally non-optimal when its rate-distortion cost is not minimal due to the change of the PMV. For the varied MV, the local optimality can also be checked in terms of the PMV, as did in Section III-C.
Similarly, we define the generalized local optimality of a PMV as the optimality that the corresponding PMV has the lowest rate-distortion cost under various possible modifications of the MV. Given a MV V j l ∈ Ω(V l ), the relative spatial positions of J(P i l , V j l ) i = 1, · · · , 9 is shown in Fig. 4(d), and the empirical probability that the P i l ∈ Ω(P l ) has a local optimality is denoted by Pr(J(P i l , V j l ) = J min (Ω(P l ), V j l )), where J min (Ω(P l ), V j l ) = min J(P i l , V j l ) i = 1, · · · , 9 . The comparison of Pr(J(P i l , V j l ) = J min (Ω(P l ), V j l )) for cover and stego videos are shown in Fig. 6, and the experimental settings are the same as those for Fig. 5.
We can see from Fig. 6 that the highest empirical probabilities in the 3 × 3 neighborhoods are all tilted to the direction of embedding changes. Taking Pr(J(P i l , V 4 l ) = J min (Ω(P l ), V 4 l )) as an example, the V 4 l is obtained by making embedding change "−1" on the horizontal component of V l (i.e., V 5 l ), and the P 4 l that has the same modification direction as V 4 l is prone to have a smaller magnitude of MVD (i.e., lower bit-rate), so Pr(J(P 4 l , V 4 l ) = J min (Ω(P l ), V 4 l )) has the maximum value. When comparing the cover videos and the stego videos, we also see that the steganographic embedding on MVs disturbs the local optimality of PMVs. For example, the Pr(J(P i l , V j l ) = J min (Ω(P l ), V j l )), i = j in cover videos is larger than that in stego videos, while the Pr(J(P i l , V j l ) = J min (Ω(P l ), V j l )), i = j in cover videos is lower than that in stego videos (see the ranges of color bars in Fig. 6). This is clear evidence that the generalized local optimality of PMVs also has a strong statistical discriminability, which can be used to design steganalytic features.

IV. THE PROPOSED FEATURES A. Feature Construction
For each MV V l = (V h l , V v l ) and its PMV P l = (P h l , P v l ), the following steps of preparation are needed for feature construction. 1) Obtain the MV set Ω(V l ) and the PMV set Ω(P l ) based on (2) and (3). 2) For each combination of P i l ∈ Ω(P l ) and V j l ∈ Ω(V l ), calculate its rate-distortion cost J D (P i l , V j l ), where D ∈ {SAD, SATD} denotes the rate-distortion cost based on SAD or SATD. 3) For each fixed P i l ∈ Ω(P l ), check the rate-distortion costs in J D (P i l , V j l ) j = 1, · · · , 9 , and determine the minimum one as J D min (P i l , Ω(V l )). 4) For each fixed V j l ∈ Ω(V l ), check the rate-distortion costs in J D (P i l , V j l ) i = 1, · · · , 9 , and determine the minimum one as J D min (Ω(P l ), V j l ). The steganalytic features based on the generalized local optimality of MVs have two types. The first type corresponds to the probability that J D (P i l , V j l ) equals J D min (P i l , Ω(V l )) with a given P i l , V j l and D, and is defined by (i, j = 1, · · · , 9, k = 9 · (i − 1) + j, where L is the number of MVs (PMVs) in a video frame, and δ (x, y) = 1 if x = y and 0 otherwise.
The second type is the exponentially magnified relative difference between J D (P i l , V j l ) and J D min (P i l , Ω(V l )): The steganalytic features based on the generalized local optimality of PMVs also have two types, and the first type corresponds to the probability that J D (P i l , V j l ) equals J D min (Ω(P l ), V j l ) with a given V j l , P i l and D: The second type is also the exponentially magnified relative difference between J D (P i l , V j l ) and J D min (Ω(P l ), V j l ): For the generalized local optimality of MVs, the features have two types, and each of them has two types of ratedistortion costs (SAD based or SATD based), nine P i l and nine V j l , so the feature dimension is 2 × 2 × (9 × 9) = 324. For the generalized local optimality of PMVs, the visual distortion is only controlled by the MV, and is irrelevant to the PMV (i.e., f SAD 3,k = f SATD 3,k ), so only the SAD based ratedistortion cost is used for the first type of features. As for the J D (P i l , V j l ) and J D min (Ω(P l ), V j l ) in the second type of features, although their exponentially relative difference is related to the SAD and SATD, their values are very close especially for high QPs. Besides, we also demonstrate in Section V-B that the steganalysis performance of f SAD 4,k , f SATD

4,k
and their combination is almost the same. So only the SAD based ratedistortion cost is used for the second type of features. As a result, the feature dimension is 2 × (9 × 9) = 162.
The proposed features are referred to as generalized local optimality (GLO) features, and the sub-features based on the generalized local optimality of MVs and PMVs are referred to as GLO-MV and GLO-PMV, respectively.

B. Feature Symmetrization
The proposed features have a much higher dimensionality than the previous local optimality based features [38]- [40]. To explore whether there is redundancy in the proposed features, this subsection studies feature symmetrization to reduce feature dimension.
As observed from Fig. 5 and Fig. 6, the empirical probability distributions exhibit specific symmetrical patterns, such as the cross symmetry for the generalized local optimality of MVs, and the directional symmetry along embedding changes for the generalized local optimality of PMVs.
According to the modification type and the empirical probability distributions in Fig. 5, the feature symmetrization process for the GLO-MV is performed as follows: 1) Divide the PMV set Ω(P l ) into three subsets P 1 l = P 1 l , P 3 l , P 7 l , P 9 l , P 2 l = P 2 l , P 4 l , P 6 l , P 8 l and P 3 l = P 5 l , and all PMVs in each subset are regarded as the same PMV.
2) Divide the MV set Ω(V l ) into three subsets V 1 l , and all MVs in each subset are regarded as the same MV.
3) Combine each PMV subset and each MV subset, and extract the features based on (4) and (5). Finally, the total dimension of symmetrized GLO-MV features is 2 × 2 × (3 × 3) = 36 (the symmetrized GLO-MV is also shown in Table XIII and Fig. 9 in Supplementary).
By analogy, the feature symmetrization process for the GLO-PMV is performed as follows: 1) Divide the MV set Ω(V l ) into three subsets V 1 l , and all MVs in each subset are regarded as the same MV. 2) For each MV in V 1 l , divide the PMV set Ω(P l ) into six subsets. Taking V 1 l in V 1 l as an example, the Ω(P l ) is divided into P 1,1 l = P 1 l , P 1,2 l = P 2 l , P 4 l , P 1,3 l = P 5 l , P 1,4 l = P 3 l , P 7 l , P 1,5 l = P 6 l , P 8 l and P 1,6 l = P 9 l . The set division of Ω(P l ) for V 3 l , V 7 l and V 9 l is also similar, and the resulted subsets are denoted by P p,1 l , · · · , P p,6 l , where p = 3, 7, 9. Merge the subsets P 1,1 l , P 3,1 l , P 7,1 l and P 9,1 l , and obtain P 1 l = ∪ p=1,3,7,9 P p,1 l , where ∪ denotes set union. The P 2 l , · · · , P 6 l are also obtained in a similar way. The PMVs in each merged subset are regarded as the same PMV. Combine MV subset V 1 l and each PMV subset in P 1 l , · · · , P 6 l , and extract the features based on (6) and (7).
3) For each MV in V 2 l , divide the PMV set Ω(P l ) into five subsets. Taking V 2 l in V 2 l as an example, the Ω(P l ) is divided into P 2,1 l = P 2 l , P 2,2 l = P 1 l , P 3 l , P 5 l , P 2,3 l = P 4 l , P 6 l , P 2,4 l = P 8 l and P 2,5 l = P 7 l , P 9 l . The set division of Ω(P l ) for V 4 l , V 6 l and V 8 l is also similar, and the resulted subsets are denoted by P p,1 l , · · · , P p,5 l , where p = 4, 6, 8. Merge the subsets P 2,1 l , P 4,1 l , P 6,1 l and P 8,1 l , and obtain P 1 l = ∪ p=2,4,6,8 P p,1 l . The P 2 l , · · · , P 5 l are also obtained in a similar way. The PMVs in each merged subset are regarded as the same PMV. Combine MV subset V 2 l and each PMV subset in P 1 l , · · · , P 5 l , and extract the features based on (6) and (7). 4) For the MV V 5 l in V 3 l , divide the PMV set Ω(P l ) into three subsets P 1 l = P 1 l , P 3 l , P 7 l , P 9 l , P 2 l = P 2 l , P 4 l , P 6 l , P 8 l and P 3 l = P 5 l , and the PMVs in each subset are regarded as the same PMV. Combine MV subset V 3 l and each PMV subset in P 1 l , P 2 l and P 3 l and extract the features based on (6) and (7). 5) Concatenate the features extracted in setp 2) -4) into a feature vector. Finally, the total dimension of symmetrized GLO-PMV features is 2 × (6+5+3) = 28 (the symmetrized GLO-MV is also shown in Table XIV and Fig. 9 in Supplementary).

V. EXPERIMENTS
In this section, we perform extensive experiments to evaluate the effectiveness of the proposed features. We first introduce the experimental settings, and then analyze the feature subsets and validate the feature symmetrization rules. Next, we compare our features with the state-of-the-art methods, and also evaluate the feature robustness under different conditions. Finally, we discuss the computational complexity of features.
A. Experimental Setup 1) Video Database: We use three video databases for experiments, and the databases are introduced as follows.
DB1: this database contains 70 standard test video sequences collected from the internet, as did in [38], [40], and each of them has 240 frames with a CIF resolution (352×288).
DB2: this database contains 1200 video sequences captured by our digital cameras. The resolution of all the video sequences is resized to 352×288, and the frame length is 36.
DB3: this database is similar to the DB2, but with a resolution of 1920×1080.
The video sequences in three databases are all stored in raw YUV 4:2:0 format with a frame rate of 30 fps.
2) Steganographic Methods: We use four steganographic methods to evaluate the detection performance of our features, including Cao et al.'s method [15] (statistics-preserved, denoted as Tar1), Cao et al.'s method [17] (local optimalitypreserved, denoted as Tar2), Zhang et al.'s method [18] (local optimality-preserved, denoted as Tar3) and Zhu et al.'s method [19] (combination of statistics and local optimality, denoted as Tar4). The embedding rate is measured by bpnsmv (bits per non-skip motion vector), which is the ratio of the number of embedded bits to the total number of non-skip MVs. Unless stated otherwise, all the steganographic methods are implemented in a H.264/AVC encoder x264 [45] with constant quantization parameter (CQP), and the block matching method is Hexagon Search algorithm (HEX).
3) Steganalytic Methods: We compare our method with two state-of-the-art steganalytic methods based on local optimality i.e., AoSO [38] and NPE [40]. We also use the universal steganalytic method [37] and recent HEVC-specified steganalytic    [46] for comparison, but we provide their resuts in Supplementary due to limited space.

4) Training and Testing:
We implement steganalyzers using a Gaussian-kernel SVM (support vector machine) [47], whose hyper-parameters (C, γ) are optimized by a grid search on (C, γ) | C = 2 −5 , 2 −4 , · · · , 2 15 , γ = 2 −15 , 2 −14 , · · · , 2 3 . The cover and stego pairs of the video sequences in each database are randomly split into two equal-sized halves as a training set and a testing set. The detection performance is measured by accuracy rate, which is the mean value of true positive rate and true negative rate, and the final accuracy rate is averaged over 20 random splits of the database.

B. Feature Subset Analysis
We adopt two types of rate-distortion costs to measure the generalized local optimality. To evaluate the effect of SAD and SATD based rate-distortion costs on the detection performance of the proposed features, we report the accuracy rates of GLO-MV and GLO-PMV with different rate-distortion costs in Table III and Table IV, where the best result is marked in bold for each group of comparison. The suffixes "SAD" and "SATD" in the steganalytic method names mean SAD and SATD based rate-distortion costs, and the number suffixes indicate feature dimensions. The experiments are conducted on DB1 with QP 15 and 25, and the steganographic methods are Tar1-4 with 0.1 and 0.4 bpnsmv.
It can be seen from Table III that the SATD based ratedistortion cost contributes more to the GLO-MV in most cases, while the SAD based rate-distortion cost becomes more important at high payloads and low QP values. This indicates that the SAD and SATD based rate-distortion costs play different roles in different conditions. Besides, combining the two types of rate-distortion costs always has better detection performance than using one of them alone, demonstrating that the SAD and SATD based rate-distortion costs should be both considered for the GLO-MV.
As seen from Table IV, the accuracy rates of GLO-PMV-SAD-162 and GLO-PMV-SATD-162 are basically the same, even combining them does not necessarily improve the detec- tion performance. Because the GLO-PMV depends mainly on the changes of PMVs, and the prediction error (i.e., distortion) remains unchanged when estimating the generalized local optimality of PMVs. As a result, both SAD and SATD have roughly the same impact on the GLO-PMV, and that is why we only use SAD based rate-distortion cost in (6) and (7).

C. Feature Symmetrization Validation
To validate the effectiveness of feature symmetrization rules, we compare the detection performance of GLO-MV and GLO-PMV before and after feature symmetrization, and list their results in Table V and Table VI. In each comparison, the larger suffix number in the method name represents the dimension before feature symmetrization, and the smaller suffix number represents the dimension after feature symmetrization. The used video database, QPs and embedding rates are the same as those in the last subsection.
We observe from Table V that the detection performance of GLO-MV before and after feature symmetrization is roughly the same. In many cases, the accuracy rates of symmetrized features are even higher than those of original features. In Table VI, the GLO-PMV-28 performs better than GLO-PMV-162 in nearly all cases. This verifies that there exists redundancy in original features, and the feature symmetrization can reduce feature dimension without compromising detection accuracy.
The GLO-MV and the GLO-PMV reflect the embedding changes from different aspects, so it is necessary to merge these two types of features. We also report in Table VII the accurate rates of GLO (the combination of GLO-MV and the GLO-PMV) before and after feature symmetrization. We can see that the symmetrized features (GLO-64) still have better detection performance in nearly all cases, again demonstrating the importance of feature symmetrization. Therefore, we adopt the symmetrized features for subsequent experiments.

D. Comparison With Prior Art
To demonstrate the superiority of the proposed features based on generalized local optimality, we compare our method with state-of-the-art methods AoSO Table XVI in Supplementary).
For the comparisons between GLO-MV and previous features, we can see that the GLO-MV consistently outperforms the AoSO and NPE by a significant margin in all cases, indicating that the generalized local optimality of MVs is easier to reveal the embedding changes caused by MV based steganography. The feature dimensions of GLO-MV and NPE are the same, but the accuracy rate of GLO-MV is up to 12.13% higher than that of NPE (see the results of Tar2 in 0.4 bpnsmv at QP 25).
For the GLO-PMV at QP 15, its detection performance is always lower than GLO-MV. By comparison with AoSO and NPE, the GLO-PMV clearly outperforms AoSO and also surpasses NPE for high payloads, but is inferior to NPE for low payloads. The reasons are as follows. First, the ratedistortion cost at a low QP is dominated by the prediction error (PE), and the GLO-PMV pays less attention to the change of PE. Second, the change rate of PMVs is lower than that of MVs, especially in low payloads (see Fig. 2). While for the GLO-PMV at QP 25, its detection performance is significantly improved. The accuracy rate of GLO-PMV is basically higher than that of NPE (by a margin as high as 14.34% against Tar2 in 0.4 bpnsmv at QP 25), and even exceeds GLO-MV when detecting Tar1 and Tar2. This is because high QP leads to greater quantization distortion [38], which affects more on  For the GLO which combines GLO-MV and GLO-PMV, it provides the best performance across all steganographic methods, embedding rates and QPs, confirming the necessity of feature construction from different aspects of generalized local optimality.
E. Evaluation of Feature Robustness 1) Steganalysis on Mismatched Cover Sources: The mismatch between training set and testing set severely degrades the steganalysis performance. To evaluate the robustness of the proposed features to the mismatched cover sources, we train the steganalyzers on DB1 and test them on DB2. The DB1 and the DB2 differ greatly in imaging devices and video content, and can well simulate the source mismatch occurred in the real-world. For simplicity, we only use NPE for comparison, and only consider two payloads 0.1 and 0.4 bpnsmv. The accuracy rates of NPE, GLO-MV, GLO-PMV and GLO in a mismatched scenario are reported in Table VIII. As seen from Table VIII, the GLO and its sub-features can still obtain relatively stable detection performance under mismatched sources. Specifically, the accuracy rate of GLO-PMV is generally lower than NPE at a low QP, but higher than NPE at a high QP, which is consistent with that in matched sources in Fig. 7. The accuracy rates of GLO-MV and GLO are significantly higher than that of NPE in all conditions, indicating that the generalized local optimality has a good robustness in the mismatched scenario.

2) Steganalysis under Different Block Matching Algorithms:
The block matching algorithm used in motion estimation (ME) affects the prediction accuracy of blocks, and also affects the rate-distortion costs. To evaluate the effect of block matching algorithms on the steganalytic features, we compress the video sequences by different algorithms, including Diamond Search (DIA), Hexagonal Search (HEX), Uneven Multi-Hexagon Search (UMH) and Exhaustive Search (ESA). The experiments are performed on DB1 at QP 15 and 25, and only Tar2 is used for simplifying the comparisons. The accuracy rates of NPE, GLO-MV, GLO-PMV and GLO under different block matching algorithms are listed in Table IX. We observe from Table IX that all steganalytic features are insensitive to the change of block matching algorithms, and the fluctuations of their accuracy rates are all very small, indicating that the conventional local optimality and our generalized local optimality are robust to the block matching algorithms. The accuracy rates of GLO and its sub-features still generally outperform those of NPE under various QPs and payloads. For each type of features, the accuracy rate generally increases in the order of DIA, HEX, UMH, and ESA. The DIA, HEX and UMH are fast search methods, and their search accuracy increases gradually; ESA is a global search with the highest accuracy. More accurate block matching algorithm leads to more accurate rate-distortion costs, which are conducive to steganalysis.
3) Steganalysis on Videos with Different Resolutions: The videos in the real-world have various resolutions, which affect the texture complexity and thus the rate-distortion cost. To evaluate the steganalytic features on different videos resolutions, we perform steganalysis experiments on DB3 at QP 15 and 25. The videos in DB3 have a resolution of 1920×1080, which is quite different from the CIF videos used in other experiments. The accuracy rates of NPE, GLO-MV, GLO-PMV and GLO for the videos in DB3 are listed in Table X.
We observe that the all the methods obtain promising performance on DB3, and the accuracy rates are higher than those on DB1. This is because the high-resolution videos have relatively more smooth textures, which are easy for block matching in ME and thus can improve the accuracy of ratedistortion costs for steganalysis. 4) Steganalysis for Different Video Coding Standards: The (generalized) local optimality can be applied to any video coding standards that adopt rate-distortion optimization. To evaluate the steganalytic features on different video coding standards, we generate the video sequences using an open source MPEG-4 [48] encoder called XviD [49] with Advanced Simple Profle. The videos in previous experiments are compressed with constant quantization parameter (CQP). To evaluate the performance on dynamic quantization parameters, we compress the videos from DB1 with constant bit-rate (CBR), including 500 kb/s and 1000 kb/s. The accuracy rates of NPE, GLO-MV, GLO-PMV and GLO for MPEG-4 compressed videos are reported in Table XI. It can be seen from Table XI that all the methods can still achieve satisfactory results under the MPEG-4 standard. The accuracy rates for MPEG-4 are all slightly lower than those for H.264/AVC, and this is caused by the difference of video codecs, in which the ME in MPEG-4 is less accurate than that in H.264/AVC. In addition, the detection performance of GLO and its sub-features is generally better than that of NPE, indicating that the advantages of generalized local optimality can also be maintained in other video coding standards.

F. Comparison of Computational Complexity
The feature extraction using (generalized) local optimality is equivalent to performing ME at the video decoder, which is a time-consuming process. To evaluate the computational complexity of steganalytic methods, we compare the practical computational time of feature extraction for AoSO, NPE, GLO-MV, GLO-PMV and GLO on DB2, and report the results in Table XII. The experiments are run on a desktop computer with a 3.2GHz Intel Core i5 CPU and 4 GB RAM.
As shown in Table XII, the AoSO costs the lowest computational time, since it only calculates the SAD during the feature extraction. The NPE has to calculate both the SAD and SATD based rate-distortion costs, which increase the feature extraction time substantially. Compared with NPE, the computational time of GLO-MV and GLO only slightly increases, and the computational time of GLO-PMV is even less than that of NPE. In the process of calculating ratedistortion costs, the SAD or SATD occupies most of the time, and the bit-rate can be obtained by a look-up table. Although the GLO-MV needs to calculate more SAD and SATD based rate-distortion costs, the SAD and SATD can be reused, and the amount of calculations is the same as that of NPE. For the GLO-PMV, it only needs to calculate the SAD based ratedistortion cost, so its feature extraction time is less than NPE.

VI. CONCLUSION
The preservation of local optimality in video coding process and the destruction of local optimality caused by steganographic embedding are a pair of contradictions, which can be used for steganalysis to discover the embedding traces. In this paper, we generalize the convention local optimality in two aspects. Specifically, we first generalize the local optimality from the static estimation using fixed predicted motion vectors (PMVs) to the dynamic estimation using variable PMVs, and then generalize the local optimality from the motion vector (MV) domain to the PMV domain. These two generalizations improve the accuracy of estimation and increase the diversity of local optimality, based on which we design two types of steganalytic features and also propose feature symmetrization rules to reduce feature dimension.
Our proposed features have the same order of dimensions as previous works, but achieve higher detection accuracy against various MV based steganography. Besides, the proposed features are also robust to many real-world environments, such as different video sources, video prediction methods, video codecs and video resolutions. Finally, the proposed features do not improve the computational complexity of feature extraction, which can be used for practical applications.