A detector apparatus for a sensor, comprising: a data compressor, wherein the data compressor is adapted to implement an algorithm for converting a set of data x into a compressed set of data x̂, wherein x̂ = Φx, where Φ represents a M x N random-projection matrix used for the compression; a machine learning module coupled to the data compressor, wherein the machine learning module is adapted to: directly transform via a matrix transformation Ĥ the compressed set of data into a projected compressed domain feature vector ŷ of a feature vector y, wherein the matrix transformation Ĥ is derived from a constrained optimization problem that is solved via an auxiliary matrix Θ wherein ŷ is a K-dimensional projection Θy of y according to the following equation: Θ y = y ^ ⇒ Θ Hx = H ^ Φ x ⇒ Θ H = H ^ Φ wherein Θ = K × N , H = N × N , H ^ = K × M , and Φ = M × N ; and filter the compressed domain feature vector ŷ; a data encryptor coupled to the machine learning module, wherein the data encryptor is adapted to encrypt the filtered vector; and an integrity protection module coupled to the machine learning module, wherein the integrity protection module is adapted to protect integrity of the filtered vector using a cryptographic hash algorithm. a data compressor, wherein the data compressor is adapted to implement an algorithm for converting a set of data x into a compressed set of data x̂, wherein x̂ = Φx, where Φ represents a M x N random-projection matrix used for the compression; a machine learning module coupled to the data compressor, wherein the machine learning module is adapted to: directly transform via a matrix transformation Ĥ the compressed set of data into a projected compressed domain feature vector ŷ of a feature vector y, wherein the matrix transformation Ĥ is derived from a constrained optimization problem that is solved via an auxiliary matrix Θ wherein ŷ is a K-dimensional projection Θy of y according to the following equation: Θ y = y ^ ⇒ Θ Hx = H ^ Φ x ⇒ Θ H = H ^ Φ wherein Θ = K × N , H = N × N , H ^ = K × M , and Φ = M × N ; and filter the compressed domain feature vector ŷ; a data encryptor coupled to the machine learning module, wherein the data encryptor is adapted to encrypt the filtered vector; and an integrity protection module coupled to the machine learning module, wherein the integrity protection module is adapted to protect integrity of the filtered vector using a cryptographic hash algorithm. directly transform via a matrix transformation Ĥ the compressed set of data into a projected compressed domain feature vector ŷ of a feature vector y, wherein the matrix transformation Ĥ is derived from a constrained optimization problem that is solved via an auxiliary matrix Θ wherein ŷ is a K-dimensional projection Θy of y according to the following equation: Θ y = y ^ ⇒ Θ Hx = H ^ Φ x ⇒ Θ H = H ^ Φ wherein Θ = K × N , H = N × N , H ^ = K × M , and Φ = M × N ; and filter the compressed domain feature vector ŷ; a data encryptor coupled to the machine learning module, wherein the data encryptor is adapted to encrypt the filtered vector; and an integrity protection module coupled to the machine learning module, wherein the integrity protection module is adapted to protect integrity of the filtered vector using a cryptographic hash algorithm. <EOS>