Reiver Operating Characteristic

class ReceiverOperatingCharacteristic(radar, radar_channel, num_thresholds=101)[source]

Bases: RadarEvaluator, Serializable

Evaluate the receiver operating characteristics for a radar operator.

The receiver operating characteristics (ROC) curve is a graphical plot that illustrates the performance of a detector by visualizing the probability of false alarm versus the probability of detection for a given parameterization.

A minimal example within the context of a Simulation evaluating the probability of detection for a single radar target illuminated by an FMCW radar would be:

 1from hermespy.radar import Radar, FMCW, ReceiverOperatingCharacteristic
 2from hermespy.simulation import Simulation
 3from hermespy.channel import SingleTargetRadarChannel
 4
 5# Create a new simulated scenario featuring a single device
 6simulation = Simulation()
 7device = simulation.new_device(carrier_frequency=60e9)
 8
 9# Configure the device to transmit and reveive radar waveforms
10radar = Radar(device=device)
11radar.waveform = FMCW()
12
13# Create a new radar channel with a single illuminated target
14target = SingleTargetRadarChannel(1, 1., attenuate=True)
15simulation.scenario.set_channel(device, device, target)
16
17# Create a new detection probability evaluator
18simulation.add_evaluator(ReceiverOperatingCharacteristic(radar, target))
19
20# Run the simulation
21result = simulation.run()
Parameters:
  • radar (Radar) – Radar under test.

  • radar_channel (RadarChannelBase) – Radar channel containing a desired target.

  • num_thresholds (int, optional) – Number of different thresholds to be considered in ROC curve

classmethod From_HDF(file, h0_campaign='h0_measurements', h1_campaign='h1_measurements')[source]

Compute an ROC evaluation result from a savefile.

Parameters:
  • file (Union[str, File]) – Savefile containing the measurements. Either as file system location or h5py File handle.

  • h0_campaign (str, optional) – Campaign identifier of the h0 hypothesis measurements. By default, h0_measurements is assumed.

  • h1_campaign (str, optional) – Campaign identifier of the h1 hypothesis measurements. By default, h1_measurements is assumed.

Return type:

RocEvaluationResult

Returns: The ROC evaluation result.

classmethod From_Scenarios(h0_scenario, h1_scenario, h0_operator=None, h1_operator=None)[source]

Compute an ROC evaluation result from two scenarios.

Parameters:
  • h0_scenario (Scenario) – Scenario of the null hypothesis.

  • h1_scenario (Scenario) – Scenario of the alternative hypothesis.

  • h0_operator (Radar, optional) – Radar operator of the null hypothesis. If not provided, the first radar operator of the null hypothesis scenario will be used.

  • h1_operator (Radar, optional) – Radar operator of the alternative hypothesis. If not provided, the first radar operator of the alternative hypothesis scenario will be used.

Return type:

RocEvaluationResult

Returns: The ROC evaluation result.

evaluate()[source]

Evaluate the state of an investigated object.

Implements the process of extracting an arbitrary performance indicator, represented by the returned Artifact \(X_m\).

Returns: Artifact \(X_m\) resulting from the evaluation.

Return type:

RocEvaluation

from_scenarios(h0_scenario, h1_scenario, h0_operator=None, h1_operator=None)[source]

Compute an ROC evaluation result from two scenarios.

Parameters:
  • h0_scenario (Scenario) – Scenario of the null hypothesis.

  • h1_scenario (Scenario) – Scenario of the alternative hypothesis.

  • h0_operator (Radar, optional) – Radar operator of the null hypothesis. If not provided, the first radar operator of the null hypothesis scenario will be used.

  • h1_operator (Radar, optional) – Radar operator of the alternative hypothesis. If not provided, the first radar operator of the alternative hypothesis scenario will be used.

Return type:

RocEvaluationResult

Returns: The ROC evaluation result.

generate_result(grid, artifacts)[source]

Generate a new receiver operating characteristics evaluation result.

Parameters:
  • grid (Sequence[GridDimension]) – Grid dimensions of the evaluation result.

  • artifacts (numpy.ndarray) – Artifacts of the evaluation result.

Return type:

RocEvaluationResult

Returns: The generated result.

property abbreviation: str

Short string representation of this evaluator.

Used as a label for console output and plot axes annotations.

property title: str

Long string representation of this evaluator.

Used as plot title.

class RocEvaluation(cube_h0, cube_h1)[source]

Bases: Evaluation[PlotVisualization]

Evaluation of receiver operating characteristics (ROC)

Parameters:
  • cube_h0 (RadarCube) – H0 hypothesis radar cube.

  • cube_h1 (RadarCube) – H1 hypothesis radar cube.

artifact()[source]

Generate an artifact from this evaluation.

Returns: The evaluation artifact.

Return type:

RocArtifact

property cube_h0: RadarCube

H0 hypothesis radar cube.

property cube_h1: RadarCube

H1 hypothesis radar cube.

class RocArtifact(h0_value, h1_value)[source]

Bases: Artifact

Artifact of receiver operating characteristics (ROC) evaluation

Parameters:
  • h0_value (float) – Measured value for null-hypothesis (H0), i.e., noise only

  • h1_value (float) – Measured value for alternative hypothesis (H1)

to_scalar()[source]

Scalar representation of this artifact’s content.

Used to evaluate premature stopping criteria for the underlying evaluation.

Return type:

None

Returns:

Scalar floating-point representation. None if a conversion to scalar is impossible.

property h0_value: float
property h1_value: float
class RocEvaluationResult(grid, evaluator, detection_probabilities, false_alarm_probabilities)[source]

Bases: EvaluationResult

Final result of an receive operating characteristcs evaluation.

Parameters:
  • grid (Sequence[GridDimension]) – Grid dimensions of the evaluation result.

  • evaluator (ReceiverOperatingCharacteristic) – Evaluator that generated the evaluation result.

  • detection_probabilities (np.ndarray) – Detection probabilities for each grid point.

  • false_alarm_probabilities (np.ndarray) – False alarm probabilities for each grid point.

to_array()[source]

Convert the evaluation result raw data to an array representation.

Used to store the results in arbitrary binary file formats after simulation execution.

Return type:

ndarray

Returns:

The array result representation.